CampaignFlow.Client.Campaigns (CampaignFlow Client v2.0.0)

View Source

Campaign resource operations for the Campaign Flow API.

This module provides functions for managing campaigns, including:

  • Listing and retrieving campaigns
  • Creating and updating campaigns
  • Managing campaign status and comments
  • Managing campaign vendors

Summary

Functions

Adds a comment to the audit log of a campaign.

Adds a vendor to a campaign.

Creates a new campaign.

Retrieves a specific campaign by ID.

Retrieves a specific vendor for a campaign.

Lists all campaigns.

Lists all vendors for a campaign.

Removes a vendor from a campaign.

Sends the approved email for a campaign.

Sets the status of a campaign.

Updates an existing campaign.

Verifies vendor contact information.

Functions

add_comment(client, id, params)

Adds a comment to the audit log of a campaign.

Examples

{:ok, response} = CampaignFlow.Client.Campaigns.add_comment(client, 123, %{
  comment: "Campaign approved by client"
})

add_vendor(client, campaign_id, params)

Adds a vendor to a campaign.

Examples

{:ok, vendor} = CampaignFlow.Client.Campaigns.add_vendor(client, 123, %{
  vendor_id: 456
})

create(client, params)

Creates a new campaign.

Examples

{:ok, campaign} = CampaignFlow.Client.Campaigns.create(client, %{
  name: "Summer Campaign",
  agency_id: 1,
  property_id: 2
})

get(client, id)

Retrieves a specific campaign by ID.

Examples

{:ok, campaign} = CampaignFlow.Client.Campaigns.get(client, 123)

get_vendor(client, campaign_id, vendor_id)

Retrieves a specific vendor for a campaign.

Examples

{:ok, vendor} = CampaignFlow.Client.Campaigns.get_vendor(client, 123, 456)

list(client, params \\ [])

Lists all campaigns.

Options

  • :page - Page number for pagination
  • :per_page - Number of items per page
  • Additional query parameters can be passed as options

Examples

{:ok, campaigns} = CampaignFlow.Client.Campaigns.list(client)
{:ok, campaigns} = CampaignFlow.Client.Campaigns.list(client, page: 2, per_page: 50)

list_vendors(client, campaign_id, params \\ [])

Lists all vendors for a campaign.

Examples

{:ok, vendors} = CampaignFlow.Client.Campaigns.list_vendors(client, 123)

remove_vendor(client, campaign_id, vendor_id)

Removes a vendor from a campaign.

Examples

{:ok, response} = CampaignFlow.Client.Campaigns.remove_vendor(client, 123, 456)

send_approved_email(client, campaign_id)

Sends the approved email for a campaign.

Examples

{:ok, response} = CampaignFlow.Client.Campaigns.send_approved_email(client, 123)

send_campaign_to_vendor(client, campaign_id, vendor_id)

@spec send_campaign_to_vendor(CampaignFlow.Client.t(), integer(), integer()) ::
  CampaignFlow.Client.Request.response()

Sends a campaign to a vendor.

Examples

{:ok, response} = CampaignFlow.Client.Campaigns.send_campaign_to_vendor(client, 123, 456)

set_status(client, id, params)

Sets the status of a campaign.

Examples

{:ok, response} = CampaignFlow.Client.Campaigns.set_status(client, 123, %{
  status: "approved"
})

update(client, id, params)

Updates an existing campaign.

Examples

{:ok, campaign} = CampaignFlow.Client.Campaigns.update(client, 123, %{
  name: "Updated Campaign Name"
})

update_vendor(client, campaign_id, vendor_id, params)

Updates a vendor for a campaign.

Examples

{:ok, vendor} = CampaignFlow.Client.Campaigns.update_vendor(client, 123, 456, %{
  status: "approved"
})

verify_vendor_contact(client, campaign_id, vendor_id)

Verifies vendor contact information.

Examples

{:ok, response} = CampaignFlow.Client.Campaigns.verify_vendor_contact(client, 123, 456)