CampaignFlow.Client.Campaigns (CampaignFlow Client v2.0.0)
View SourceCampaign 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.
Sends a campaign to a vendor.
Sets the status of a campaign.
Updates an existing campaign.
Updates a vendor for a campaign.
Verifies vendor contact information.
Functions
@spec add_comment(CampaignFlow.Client.t(), integer(), map()) :: CampaignFlow.Client.Request.response()
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"
})
@spec add_vendor(CampaignFlow.Client.t(), integer(), map()) :: CampaignFlow.Client.Request.response()
Adds a vendor to a campaign.
Examples
{:ok, vendor} = CampaignFlow.Client.Campaigns.add_vendor(client, 123, %{
vendor_id: 456
})
@spec create(CampaignFlow.Client.t(), map()) :: CampaignFlow.Client.Request.response()
Creates a new campaign.
Examples
{:ok, campaign} = CampaignFlow.Client.Campaigns.create(client, %{
name: "Summer Campaign",
agency_id: 1,
property_id: 2
})
@spec get(CampaignFlow.Client.t(), integer()) :: CampaignFlow.Client.Request.response()
Retrieves a specific campaign by ID.
Examples
{:ok, campaign} = CampaignFlow.Client.Campaigns.get(client, 123)
@spec get_vendor(CampaignFlow.Client.t(), integer(), integer()) :: CampaignFlow.Client.Request.response()
Retrieves a specific vendor for a campaign.
Examples
{:ok, vendor} = CampaignFlow.Client.Campaigns.get_vendor(client, 123, 456)
@spec list( CampaignFlow.Client.t(), keyword() ) :: CampaignFlow.Client.Request.response()
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)
@spec list_vendors(CampaignFlow.Client.t(), integer(), keyword()) :: CampaignFlow.Client.Request.response()
Lists all vendors for a campaign.
Examples
{:ok, vendors} = CampaignFlow.Client.Campaigns.list_vendors(client, 123)
@spec remove_vendor(CampaignFlow.Client.t(), integer(), integer()) :: CampaignFlow.Client.Request.response()
Removes a vendor from a campaign.
Examples
{:ok, response} = CampaignFlow.Client.Campaigns.remove_vendor(client, 123, 456)
@spec send_approved_email(CampaignFlow.Client.t(), integer()) :: CampaignFlow.Client.Request.response()
Sends the approved email for a campaign.
Examples
{:ok, response} = CampaignFlow.Client.Campaigns.send_approved_email(client, 123)
@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)
@spec set_status(CampaignFlow.Client.t(), integer(), map()) :: CampaignFlow.Client.Request.response()
Sets the status of a campaign.
Examples
{:ok, response} = CampaignFlow.Client.Campaigns.set_status(client, 123, %{
status: "approved"
})
@spec update(CampaignFlow.Client.t(), integer(), map()) :: CampaignFlow.Client.Request.response()
Updates an existing campaign.
Examples
{:ok, campaign} = CampaignFlow.Client.Campaigns.update(client, 123, %{
name: "Updated Campaign Name"
})
@spec update_vendor(CampaignFlow.Client.t(), integer(), integer(), map()) :: CampaignFlow.Client.Request.response()
Updates a vendor for a campaign.
Examples
{:ok, vendor} = CampaignFlow.Client.Campaigns.update_vendor(client, 123, 456, %{
status: "approved"
})
@spec verify_vendor_contact(CampaignFlow.Client.t(), integer(), integer()) :: CampaignFlow.Client.Request.response()
Verifies vendor contact information.
Examples
{:ok, response} = CampaignFlow.Client.Campaigns.verify_vendor_contact(client, 123, 456)