<advertiser_id_from_network> and <advertiser_campaign_id_from_network> are the network’s id for those objects, not Invoca’s.
/api/2022-08-01/<network_id>/advertisers/<advertiser_id_from_network>/advertiser_campaigns/<advertiser_campaign_id_from_network>.json
The <advertiser_campaign_id_from_network> in the URL — shown as <advertiser_campaign_id> in the endpoint paths below — is the lookup key used to find an existing advertiser campaign; it is matched against the campaign’s id_from_network. A PUT to this URL is an “upsert”: if a campaign with that id already exists for the advertiser it is updated; if it does not exist, a new campaign is created. Because a new campaign requires a name, a PUT to an id that does not yet exist must include a name. See the POST and PUT endpoint sections below for details.
We support passing back current_terms and future_terms on campaigns. The current properties of the campaign are reflected in current_terms. All changes to the campaign are staged in future_terms. Once the campaign goes live, future_terms transition over to current_terms.
You can set budgets on your campaign. There are three budget types, budget_cap_alert which is based on commissions, periodic_call_cap_alert, which is based on the number of calls in a given period, and concurrent_call_cap_alert, which is based on the number of simultaneous calls. These budget activities are only applicable for AffiliateEnabled campaigns (Known in the platform as a “Publisher Promotion” Campaign Type.)
You are not allowed to delete campaigns.
Property | Type | Value |
|---|---|---|
id | integer (read-only) | The internal Invoca id for this Advertiser Campaign. |
id_from_network | string (required) | The network object_id for this Advertiser Campaign. Unique within network. Used as the lookup key to find an existing campaign (see above). Not required when auto-generation is enabled at network level. |
name | string (required on create) | Campaign name. Required when creating a new campaign. Optional on update, where it defaults to the existing name. |
campaign_type | string | 3 Campaign Types Supported:
|
description | string | Campaign Description. |
url | string | Click URL Template. |
object_url | string (read-only) | URL for reaching the advertiser campaign in the UI. |
timezone | string | Supported Time Zones: https://api.rubyonrails.org/classes/ActiveSupport/TimeZone.html |
campaign_language | string | Supported Campaign Languages: “English”, “French”, “Spanish”. |
campaign_country | string | Supported Countries: “US”, “CA”, “UK”, “AU”, “CN”, “FI”, “FR”, “DE”, “HK”, “IT”, “JP”, “NL”, “SG”, “SE”, “CH”. |
operating_24_7 | boolean | |
affiliate_payout | ||
policies | ||
currency | string | USD, GBP, EUR. |
amount | decimal | Payout Amount. |
condition | string | Condition options depend on the following Campaign Setup items being in place: Duration (seconds/minutes) and (greater than, greater than or equal to, less than, less than or equal to, equal to), Connect Duration (seconds/minutes) and (greater than, greater than or equal to, less than, less than or equal to, equal to), Repeat, In Region (specified across multiple Regions), During Hours, Key Press, Is Mobile, Is Landline, Send SMS. All may be grouped with logic operators (AND/OR/NOT). |
type | string | One of: Base, Bonus. |
advertiser_payin | ||
policies | ||
currency | string | Supported Currencies: ‐ USD, GBP, EUR. |
amount | integer | Advertiser Payin Amount. |
condition | string | Condition options depend on the following Campaign Setup items being in place: Duration (seconds/minutes) and (greater than, greater than or equal to, less than, less than or equal to, equal to), Connect Duration (seconds/minutes) and (greater than, greater than or equal to, less than, less than or equal to, equal to), Repeat, In Region (specified across multiple Regions), During Hours, Key Press, Is Mobile, Is Landline, Send SMS. All may be grouped with logic operators (AND/OR/NOT). |
type | string | One of: Base, Bonus. |
hours | ||
[day of week]_open (e.g. friday_open) | string | Open Hours. In seconds past midnight (e.g. 0 for midnight, 32400 for 9:00 AM). |
[day of week]_close (e.g. friday_close) | string | Closed Hours. In seconds past midnight (e.g. 0 for midnight, 75600 for 9:00 PM). |
[day of week]_closed (e.g. sunday_closed) | string | true, false, or null. Whether the business is closed that day of the week. |
named_regions | ||
name | string | Region Name. |
regions | ||
region_type | string | Region Type. Can be one of: Zone, City, State, Country. |
value | string | Region Value, e.g. “Sacramento, CA”, or just “CA”. |
ivr_tree | hash | See following Advertiser Campaign IVR Section. |
budget_activities | Only applicable for AffiliateEnabled campaigns. | |
budget_cap_alert | ||
reset_period | string (required) | Budget will reset based on this entry. One of: Daily, Weekly, Monthly, Quarterly, Ongoing. |
starts_at | date (required) | Budget Start. |
budget_currency | string (required) | Budget Currency. |
time_zone | string (required) | Supported Time Zones: “Pacific Time (US & Canada)”, “Mountain Time (US & Canada)”, “Central Time (US & Canada)”, “Eastern Time (US & Canada)”, “London”, “UTC”. |
budget_amount | decimal (required) | Budget Amount. |
include_call_fees | boolean | True if you want call fees to be included in the budget. |
periodic_call_cap_alert | ||
reset_period | string (required) | Budget will reset based on this entry. One of: Daily, Weekly, Monthly, Quarterly, Ongoing. |
starts_at | date (required) | Call Cap Start. |
budget_currency | string (required) | Budget Currency. |
time_zone | string (required) | Supported Time Zones: “Pacific Time (US & Canada)”, “Mountain Time (US & Canada)”, “Central Time (US & Canada)”, “Eastern Time (US & Canada)”, “UTC”. |
budget_amount | decimal (required) | Budget Amount. |
auto_approve | string | One of: All, None, Approved_Affiliates Default: None This controls if affiliates are automatically approved when applying to the campaign. |
visibility | string | One of: All, None, Approved_Affiliates Default: All This controls the level of visibility publishers have when applying to campaigns. |
pause_date | string | date string (ex. ‘2015-01-01 15:59:00 -0700’). |
expiration_date | string | date string. Read only. Alias of “pause_date”. |
default_creative_id_from_network | integer | Default Creative ID. |
concurrent_call_cap_alert | ||
budget_amount | decimal (required) | Budget Amount. |
timeout | integer | Seconds to wait for the campaign to go live. Between 2 and 60. |
Advertiser Campaign IVRs
When creating an advertiser campaign, you need to provide some call flow logic through an IVR tree. Depending on the advertiser/campaign type (direct, bundled, etc) you may use the following node types: Node Parameters and Usage * => required parametermobile or in_region and during_hours
it is equivalent to this:
mobile or (in_region and during_hours)
Caller ID options can also be configured by optionally including a caller_id object inside ivr_tree:
Custom Data
Advertiser campaigns may have Custom Data Fields applied to them, which will be applied to calls originating through the advertiser campaign. To apply Custom Data Values to an advertiser campaign, the top level parametercustom_data should be assigned a hash with each pair’s key corresponding to a partner name. The value of the pair should be the value to be applied.
For the following example, we would apply the value “Offline newspaper” to the Custom Data Field “channel”.
custom_data must be sent as a JSON string, or null to clear the field — including values that are conceptually true/false or numeric. Quote them:
-
"is_member": "true"— not"is_member": true -
"order_count": "5"— not"order_count": 5
string (Short Text), url (Long Text), or business_object (Category) can be set via custom_data. Targeting a field of any other type — for example a Boolean or Score field — is rejected with an error of the form:
https://invoca.net/api/2022-08-01/<network_id>/advertisers/<advertiser_id_from_network>/advertiser_campaigns/<advertiser_campaign_id_from_network>.json
Get all campaigns for an Advertiser
Get all campaigns for an Advertiser
Examples
Read all campaigns for Advertiser 2 id from networkEndpoint:https://invoca.net/api/2022-08-01/<network_id>/advertisers/2/advertiser_campaigns.jsonResponse Body:An array of campaigns are returned.Get a campaign for an Advertiser
Get a campaign for an Advertiser
Examples
Read Campaign 100 for Advertiser 2Endpoint:https://invoca.net/api/2022-08-01/<network_id>/advertisers/2/advertiser_campaigns/100.jsonResponse Body:Create an Advertiser Campaign
Create an Advertiser Campaign
name (and an id_from_network, unless the network is configured to auto-generate ids).ExamplesCreate Campaign fJauFbSEGHKw8ADEGv for Advertiser cFUyYnFHyiYA42TrpMEndpoint:https://invoca.net/api/2022-08-01/<network_id>/advertisers/cFUyYnFHyiYA42TrpM/advertiser_campaigns.jsonRequest Body:Update an Advertiser Campaign
Update an Advertiser Campaign
<advertiser_campaign_id_from_network> in the URL, which is matched against the campaign’s id_from_network. If a campaign with that id exists for the advertiser, it is updated. If no campaign with that id exists, a new campaign is created (“upsert”). Because creating a campaign requires a name, a PUT against a non-existent id will fail unless name is included in the request body. To update an existing campaign, omit name (or send its current value) and the campaign’s name is left unchanged.ExamplesExample IVR Tree updates:- Verify the caller’s location, then if on the West Coast (setup previously) forward to a call center, otherwise hang up after playing a prompt.
- Present the options for multiple departments, if sales is selected check if office is open. If the office is open, forward the call, if not play a prompt and then hangup.
- Offer an sms to see current offers and then connect to a call center.
- Use a Real-Time Routing webhook to dynamically determine the call destination at runtime, with a fallback if the webhook does not respond in time.
Quick Stats
Quick Stats
Examples
Read Campaign 100 for Advertiser 2Endpoint:https://invoca.net/api/2022-08-01/<network_id>/advertisers/<advertiser_id_from_network>/advertiser_campaigns/<advertiser_campaign_id_from_network>/quick_stats.jsonResponse Body:Set Campaign State to Live
Set Campaign State to Live
Examples
Advertiser campaigns can have their state controlled through this API. When a campaign is created through the API, its “future terms” are being set, and its state is not yet live. When the go_live endpoint is hit, the “future terms” are promoted to “current terms” and the campaign becomes live. Archived campaigns must be unarchived before calling this endpoint to make them live.Use this request url format:https://invoca.net/api/2022-08-01/<network_id>/advertisers/<advertiser_id_from_network>/advertiser_campaigns/<advertiser_campaign_id_from_network>/go_live.jsonSet Campaign State to Archived
Set Campaign State to Archived
Examples
If a campaign has previously been set to live, either through the API or through the UI, it can be archived, which effectively shuts it down. An archived campaign can be returned to live at a later time. To archive a campaign use the following endpoint URL:Endpoint:https://invoca.net/api/2022-08-01/<network_id>/advertisers/<advertiser_id_from_network>/advertiser_campaigns/<advertiser_campaign_id_from_network>/archive.jsonResponse Body:Unarchive a Campaign
Unarchive a Campaign
Examples
Archived campaigns should be unarchived using this endpoint. It changes campaign status to paused. After that you can activate the campaign using a go_live request.Endpoint:https://invoca.net/api/2022-08-01/<network_id>/advertisers/<advertiser_id_from_network>/advertiser_campaigns/<advertiser_campaign_id_from_network>/unarchive.jsonResponse Body:Keypress Failover Type
Example IVR Tree utilizing keypress_failover_typeError Handling
Forbidden – 403:PUT/POST
https://invoca.net/api/2022-08-01/<network_id>/advertiser/<advertiser_id_from_network>/advertiser_campaign/<advertiser_campaign_id_from_network>/advertiser_campaigns/<advertiser_campaign_id>.json
Content Type: application/json
Response Code: 403
Request Body