Advertisers¶
The operations on Advertiser are similar to Network, in that the interface is fully idempotent, and the create and update commands both expect the full set of advertiser sites and users each time. You are not allowed to delete an advertiser if it has one or more campaigns.
Property |
Type |
Value |
---|---|---|
id |
integer (read-only) |
The internal Invoca id for this Advertiser. |
id_from_network |
string (required) |
The network id for this Advertiser. Unique within network. Not required when auto-generation is enabled at network level. |
name |
string (required) |
The name of the Advertiser. Unique within network. |
approval_status |
string (one of): Applied, Approved (default), Declined, Suspended, Archived |
Approval status for this advertiser. |
web_integration_phone_number |
string |
|
default_creative_id_from_network |
integer |
|
object_url |
string (read-only) |
URL for reaching the advertiser in the UI. |
sites |
json array of hashes |
1 or more pairs of id_from_network [and name]. |
id_from_network |
integer site_id (PID) |
The site_id (PID). At least one is required. The first becomes the default. |
name |
string |
The site name that matches site_id. |
users |
json array of hashes |
0 or more users for the organization. Each must have first 5 fields below. |
id_from_network |
string |
The network id for this User. |
email_address |
string in RFC 2822 addr-spec format |
The user’s email address. Unique for this user. |
first_name |
string (Required) |
The user’s first name. |
last_name |
string (Required) |
The user’s last name. |
contact_phone_number |
string in ITU E.164 format or 10-digit US form (no punctuation) |
The user’s phone number. |
role |
One of: Super (default), Manager, Member, Observer |
This user’s role in this organization. (A user may have different roles in different organizations) |
Endpoint:
https://invoca.net/api/2016-10-01/<network_id>/advertisers/<advertiser_id_from_network>.json
Examples
Read all advertisers for this network
Endpoint:
https://invoca.net/api/2016-10-01/<network_id>/advertisers.json
Format: application/json
Response Code: 200
Response Body:
[
{
"id": 43838,
"id_from_network": "cFUyYnFHy",
"web_integration_phone_number": "8004377950",
"approval_status": "Approved",
"object_url": "https://invoca.net/as/43838/dashboards/ui",
"sites": [
{
"id_from_network": "315",
"name": "315.blog.com"
}
],
"name": "NFL Tickets Exchange",
"users": [
{
"id_from_network": "549494858585cFUyYnFHyiYA42TrpM",
"email_address": "[email protected]",
"first_name": "Chris",
"phone_number": "888‐603‐3760",
"last_name": "Dean",
"role": "Manager",
"oauth_refresh_token": "556588585858585858585858858"
}
],
"default_creative_id_from_network": "222",
"oauth_refresh_token": "7464644784457575757494930303"
}
]
Examples
Read a single advertiser
Endpoint:
https://invoca.net/api/2016-10-01/<network_id>/advertisers/cFUyYnFHy.json
Format: application/json
Response Code: 200
Response Body:
{
"id": 43838,
"id_from_network": "cFUyYnFHy",
"web_integration_phone_number": "8004377950",
"approval_status": "Approved",
"object_url": "https://invoca.net/as/43838/dashboards/ui",
"sites": [
{
"id_from_network": "315",
"name": "315.blog.com"
},
{
"id_from_network": "996",
"name": "996.blog.com"
}
],
"name": "NFL Tickets Exchange",
"users": [
{
"id_from_network": "549494858585cFUyYnFHyiYA42TrpM",
"email_address": "[email protected]",
"first_name": "Chris",
"phone_number": "888‐603‐3760",
"last_name": "Dean",
"role": "Manager",
"oauth_refresh_token": "556588585858585858585858858"
},
{
"id_from_network": "694940505055cFUyYnFHyiYA42TrpM",
"email_address": "[email protected]",
"first_name": "Jim",
"phone_number": "888‐603‐3760",
"last_name": "Williams",
"role": "Observer",
"oauth_refresh_token": "4222424241628298228222"
}
],
"default_creative_id_from_network": "222",
"oauth_refresh_token": "7464644784457575757494930303"
}
Examples
Delete a single advertiser
Endpoint:
https://invoca.net/api/2016-10-01/<network_id>/advertisers/cFUyYnFHy.json
Format: application/json
Response Code: 200
Response Body:
{
}
Examples
Create an advertiser with users
Endpoints:
https://invoca.net/api/2016-10-01/<network_id>/advertisers.json
or…
https://invoca.net/api/2016-10-01/<network_id>/advertisers/<advertiser_id_from_network>.json
Use the /advertisers.json
endpoint if you want to specify the ID in the post body, or allow the ID to be auto generated.
Note: Your account can be configured to automatically generate IDs in a format you specify. Contact questions@invoca.com for more information.
Use the /advertisers/<advertiser_id_from_network>.json
endpoint if you want to specify the ID in the URL.
Note: If you specify the ID in the URL and the body, the body’s id will take precedence over the URL.
Format: application/json
Request Body:
{
"name": "NFL Tickets Exchange",
"id_from_network": "cFUyYnFHy",
"approval_status": "Approved",
"web_integration_phone_number": "8004377950",
"default_creative_id_from_network": "222",
"users": [
{
"id_from_network": "549494858585cFUyYnFHyiYA42TrpM",
"email_address": "[email protected]",
"first_name": "Chris",
"last_name": "Dean",
"contact_phone_number": "8055555555",
"role": "Manager"
},
{
"id_from_network": "694940505055cFUyYnFHyiYA42TrpM",
"email_address": "[email protected]",
"first_name": "Jim",
"last_name": "Williams",
"contact_phone_number": "2135555555",
"role": "Observer"
}
],
"sites": [
{
"id_from_network": "315",
"name": "315.blog.com"
},
{
"id_from_network": "996",
"name": "996.blog.com"
}
]
}
Response Body:
Same as a GET response, includes all the advertiser properties.
Examples
Update a user from advertiser
Endpoint:
https://invoca.net/api/2016-10-01/<network_id>/advertisers/cFUyYnFHy.json
Format: application/json
Request Body:
{
"name": "NFL Tickets Exchange",
"approval_status": "Approved",
"web_integration_phone_number": "8004377950",
"default_creative_id_from_network": "222",
"users": [
{
"id_from_network": "549494858585cFUyYnFHyiYA42TrpM",
"email_address": "[email protected]",
"first_name": "Chris",
"last_name": "Dean",
"contact_phone_number": "8055555555",
"role": "Manager"
}
],
"sites": [
{
"id_from_network": "315",
"name": "315.blog.com"
}
]
}
Response Body:
Same as a GET response, includes all the advertiser properties.