Introduction
An agency is the entity that manages an advertiser's ad campaign. Not all ad sales go through an agency; an agency is an optional part of the Campaign Organization for a sale.
Payment for advertising originates from the advertiser, but may be paid to the publisher through an agency managing a campaign.
This API manages agencies in your network. Version 3 of the Agency API allows you to list, view, create, and edit agencies and their related attributes in MRM.
You can use this API to:
- Return a list of agencies when you are de-duplicating, consolidating, or reconciling a list of agencies
- View a list of agencies when you want to see specific information about an agency, such as contact information or financial information
- Create an agency when you want to add a new agency
- Edit agencies when you want to make changes to an agency's information
- Configure agencies by creating and/or editing agencies
- Set Parent Agency and Brand relationships
Related Documentation
Refer to the following documentation for more information about FreeWheel products and APIs:
Before You Begin
Set up your Agency/Advertiser relationships before you create a campaign. Likewise, set up your campaign API before you define your brands for a campaign.
How to Create a New Agency
You can find instructions for creating and approving a new agency here.
Resources
URI(s)
The Agency API v3 identifies two Uniform Resource Identifiers (URIs):
Type of URI | URI |
---|---|
Production | https://api.freewheel.tv/services/v3/agencies.xml?[parameter1]=[query1]&... |
Staging | https://api.stg.freewheel.tv/services/v3/agencies.xml?[parameter1]=[query1]&... |
Instance | https://api.freewheel.tv/services/v3/agencies/[FW_ID].xml?[parameter1]=[query1]&... |
Agencies API Attributes
Attributes represent and describe data associated with an object, in this case the Agencies object. Attributes are organized in sets. The attribute set determines the fields available during data entry, and the values that appear to the client. Use Agencies API Attributes in conjunction with Agencies API methods to accomplish your ad tech objectives.
Basic Attributes
Basic attributes describe fundamental properties of an agency. These attributes identify the following for an agency:
- name
- ID
- billing term
- contacts
- user assignments
- address
- industry
- status
Function/Node | Description | Data Type(s) | Creatable? | Updateable? | Included in basic GET? | Comments |
---|---|---|---|---|---|---|
id | Resource ID | FW_ID | No | No | Yes | Assigned automatically during POST |
name | The name of the agency | String | Required | Yes | Yes | |
external_id | External ID for the agency | String | Yes | Yes | Yes | |
billing_term | Billing term for the agency in MRM | String | Yes | Yes | Yes | |
metadata | Metadata for the agency in MRM | String | Yes | Yes | No | |
contacts | Agency contacts | Contacts | Yes | Yes | No | |
assignments | Agency user assignments | Assignments | Yes | Yes | No | |
address | Agency address | Address | Yes | Yes | No | |
status | Agency status |
| No | No | Yes | These values must be provided in ALL CAPITAL letters. |
This sample code block shows you how to set up a generic POST statement using all the attribute sets to create a new agency.
Each of the individual attribute set definitions are listed below this sample code.
<agency>
<name>my agency</name>
<external_id>xxxx</external_id>
<metadata>xxxxx</metadata>
<billing_term>xxx</billing_term>
<address>
<address_1>Address Line 1</address_1>
<address_2>Address Line 2</address_2>
<country_id>165</country_id>
<state_id>2291</state_id>
<city>New York</city>
<postal_code>12345</postal_code>
</address>
<contacts>
<contact>
<contact_type>PRIMARY</contact_type>
<first_name>First</first_name>
<last_name>Last</last_name>
<title>Sales</title>
<address_1>Address Line 1</address_1>
<address_2>Address Line 2</address_2>
<country_id>165</country_id>
<state_id>2291</state_id>
<city>New York</city>
<postal_code>12345</postal_code>
<email_address_1>[email protected]</email_address_1>
<email_address_2>[email protected]</email_address_2>
<email_address_3>[email protected]</email_address_3>
<work_phone>12345678</work_phone>
<home_phone>12345678</home_phone>
<fax_phone>12345678</fax_phone>
<other_phone>12345678</other_phone>
<im_type>Skype</im_type>
<im_id>skype_id</im_id>
<url>test_url</url>
</contact>
<contact>
<contact_type>BILLING</contact_type>
<first_name>First</first_name>
<last_name>Last</last_name>
<title>Accountant</title>
<address_1>Address Line 1</address_1>
<address_2>Address Line 2</address_2>
<country_id>165</country_id>
<state_id>2291</state_id>
<city>New York</city>
<postal_code>12345</postal_code>
<email_address_1>[email protected]</email_address_1>
<email_address_2>[email protected]</email_address_2>
<email_address_3>[email protected]</email_address_3>
<work_phone>12345678</work_phone>
<home_phone>12345678</home_phone>
<fax_phone>12345678</fax_phone>
<other_phone>12345678</other_phone>
<im_type>Skype</im_type>
<im_id>skype_id</im_id>
<url>test_url</url>
</contact>
</contacts>
</agency>
Contacts Attributes
This attribute set identifies various contacts for the agency, including ID, type of contact, name, title, address, email address, phone, and website.
The following attributes are included in basic GET requests.
Function/Node | Description | Data Type(s) | Creatable? | Updateable? | Comments |
---|---|---|---|---|---|
contact_id | ID | No | No | ||
contact_type |
| Yes | Yes | Defaults to ADDITIONAL | |
first_name | String | Yes | Yes | ||
title | String | Yes | Yes | ||
address_1 | String | Yes | Yes | ||
address_2 | String | Yes | Yes | ||
city | String | Yes | Yes | ||
state_id | State ID from Geography Data | Integer | Yes | Yes | |
postal_code | String | Yes | Yes | ||
country_id | Country ID from Geography Data | Integer | Yes | Yes | |
email_address_1 | String | Yes | Yes | ||
email_address_2 | String | Yes | Yes | ||
work_phone | String | Yes | Yes | ||
home_phone | String | Yes | Yes | ||
fax_phone | String | Yes | Yes | ||
other_phone | String | Yes | Yes | ||
im_type | String | Yes | Yes | ||
url | String | Yes | Yes |
Assignments Attributes
This attribute set defines the assigned users or assigned groups for this agency in combination with the following related attribute sets:
- Assigned User
- Assigned User Group
Assigned User Attributes - Child Attributes of Assignments Attributes
This attribute set defines a user ID, name, and relates to the primary user role for an agency.
The following attributes are included in basic GET requests.
Function/Node | Description | Data Type(s) | Creatable? | Updateable? |
---|---|---|---|---|
user_id | Valid user id | Integer | Yes | Yes |
user_full_name | User full name | String | No | No |
Address Attributes
This attribute set defines the agency's address. This attribute set is unrelated to the contacts' address fields.
The following attributes are included in basic GET requests.
Function/Node | Description | Data Type(s) | Creatable? | Updateable? |
---|---|---|---|---|
address_1 | String | Yes | Yes | |
address_2 | String | Yes | Yes | |
city | String | Yes | Yes | |
state_id | State ID from Geography Data | Integer | Yes | Yes |
postal_code | String | Yes | Yes | |
country_id | Country ID from Geography Data | Integer | Yes | Yes |