The SmartFile API allows programmers to create automated interfaces that can pass files and information directly into the SendMyAd portal with out user intervention. This API is based on a REST interface that accepts commands via HTTP Post variables. To get started using the API a few things are required.
Getting Started
To get started you will first need a few items supplied by the SendMyAd staff.
- First you must have a SendMyAd API key. API keys can be received by request only to the SendMyAd staff. Click here to request a key
- You must also know the unique publisher code you wish to send
files to. Publisher codes can also be received via the SendMyAd staff.
If you are a publisher this code can be seen in your company profile
"code" area.
- Ability to make an HTTP POST with required variables. This can be done in most languages.
- It is also preferable that you have the ability to parse XML and/or JSON responses, since this is the native result of all API calls.
Without it, you may not be able to tell what your result was.
Reference
To make a successful call you will need to supply the documented required
variables. All required variables are marked with an asterisk (*) below in the documentation. All variable keys and names are case sensitive.
Sample Request
We recommend using the cURL command line application for testing because it will accurately display the responses in your terminal. Here is a sample cURL POST command to return a list of issues for a publication:
curl -v -3 https://yourpublishername.sendmyad.com/SmartFile/api.php -F apiKey=12345678 -F action=getIssueList -F className=Issue -F publisherCode=XYZ -F publicationName="Testing Publication"
Alternatively, you can simply create a GET style URL and run in a browser. However, various browsers and versions will handle the response differently. If the XML or JSON response does not display properly, try another browser or use cURL instead. Example URL that corresponds to the above cURL POST:
https://yourpublishername.sendmyad.com/SmartFile/api.php?apiKey=12345678&action=getIssueList&className=Issue&publisherCode=XYZ&publicationName=Testing%20Publication
Note: SendMyAd does not supply example code in specific programming languages.
SAMPLE HTML FORM POST
<!-- POST AN AD FILE THROUGH HTML FORM -->
<form method="post" action="https://portal.sendmyad.com/SmartFile/api.php" enctype="multipart/form-data">
<input type="file" id="upfile_0" name="upfile_0" value="">
<input type="hidden" id="action" name="action" value="uploadAd" />
<input type="hidden" id="className" name="className" value="Upload" />
Key:<input type="text" id="apiKey" class="w120" name="apiKey" value="[YOURKEY]" />
PublisherCode:<input type="text" class="w50" id="publisherCode" name="publisherCode" value="[YOURDATA]" />
PublicationCode:<input type="text" class="w50" id="publicationCode" name="publicationCode" value="[YOURDATA]" />
IssueCode:<input type="text" class="w50" id="issueCode" name="issueCode" value="[YOURDATA]" />
AdSpecCode:<input type="text" class="w50" id="adSpecCode" name="adSpecCode" value="[YOURDATA]" />
colorProfileShortLabel:<input type="text" class="w50" id="colorProfileCode" name="colorProfileCode" value="[YOURDATA]" />
<input type="submit" class="btn" name="mysubmit" value="Upload">
</form>
<!-- RESERVE AN AD SPACE -->
<form method="post" action="https://portal.sendmyad.com/SmartFile/api.php" enctype="multipart/form-data">
<input type="hidden" id="action" name="action" value="reserveAdSpace" />
<input type="hidden" id="className" name="className" value="Reservation" />
<input type="hidden" id="responseFormat" name="responseFormat" value="JSON" />
Publisher Code:<input type="text" class="w50" id="publisherCode" name="publisherCode" value="[YOURDATA]" />
API Key: <input type="text" id="apiKey" name="apiKey" value="[YOURKEY]" />
Publication Code:
<input type="text" class="w50" id="publicationCode" name="publicationCode" value="[YOURDATA]" />
Ad Spec Code:
<input type="text" class="w50" id="adSpecCode" name="adSpecCode" value="[YOURDATA]" />
Issue Code:
<input type="text" class="w50" id="issueCode" name="issueCode" value="[YOURDATA]" />
Color Profile Name:
<input type="text" class="w50" id="colorProfileName" name="colorProfileName" value="[YOURDATA]" />
Label:
<input type="text" class="w50" id="label" name="label" value="API TEST AD" />
Credit Hold:
<input type="text" class="w50" id="creditStatus" name="creditStatus" value="0" />
Ad Instructions:
<input type="text" class="w50" id="adInstructions" name="adInstructions" value="lorem ipsum..." />
<input type="submit" class="btn" name="mysubmit" value="Send">
</form>
Available Classes and Actions
This upload class contains all of the functions needed to post a file to SendMyAd and Virtual Publisher .
Note on uploading files
at this time file posting is limited to no more than 100mb per file and
files must be uploaded 1 at a time.
To post a file, your form must employ the method POST, GET will not
work and type of multipart/form-data. Your file form variable must be
named upload_0.
Supported file types
At this time the api supports PDF only. Each PDF must have a valid embedded xmp job ticket. Supported job ticket formats are GWG Ad Ticket and SMA Job Ticket format.
Available Actions
- upload : upload is the action which tells the api to upload the supplied file.
-
Params:
- action * String: The action variable tells the api what you want to do.
- className * String: The className variable tells the api where the action is located.
- apiKey * String: The apiKey allows the api to authenticate you. Api keys can be requested from SendMyAd staff.
- publisherCode * String: The publisherCode tells the api what publisher you are trying to connect with.
- upfile_0 * File: This is a reference to the file that you wish to upload.
-
Response:
<results>
<success>true/false</success>
<error>Each error that occurred as a text description. Each error will generate a new xml error tag.</error>
<processId>A unique string which represents the ad.</processId>
</results>
- uploadPage : uploadPage is the action which tells the api to upload the supplied file to a Virtual Publisher plan.
- Params:
- action * String: The action variable tells the api what you want to do.
- className * String: The className variable tells the api where the action is located.
- apiKey * String: The apiKey allows the api to authenticate you. Api keys can be requested from SendMyAd staff.
- publisherCode * String The publisherCode tells the api what publisher you are trying to connect with.
- issueCode * String: The issueCode tells the api to what issue the page will be assigned.
- upfile_0 * File: This is a reference to the file that you wish to upload.
- Response:
<results>
<success>true/false</success>
<error>Each error that occurred as a text description. Each error will generate a new xml error tag.</error>
<processId>A unique string which represents the ad.</processId>
</results>
This class contains ways to create reservations in the system.
Available Actions
- reserveAdSpace : Creates an insertion order to be fulfilled by an ad sender.
-
Params:
- apiKey *: supplied by SMA
- publisherCode *: The code of the publisher you wish to
send the space reservation to, must have been granted access or be the
same user company.
- publicationId * (one of 3 publication types is required): The
publications SMA id key you wish to use, publicationId over rides
publicationCode and publicationname. Publication Id keys can be obtained
through the publication class.
- publicationCode (one of publication types is required): The
publication code you wish to use, publicationCode over rides
publicationname
- publicationName (one of publication types is required): The
publication name you wish to use, must match a publication in the system
owned by the publisher.
- adSpecId * (one of the ad spec identifiers is required): The ad size SMA id you wish to use.
- adSpecCode (one of the ad spec identifiers is required): The ad size SMA code you wish to use.
- adSpecHeight (one of the ad spec identifiers is required): The
exact trim height size represented in the SMA system that you wish to
use.
- adSpecWidth (required if adSpecHeight is used): The exact trim width size represented in the SMA system that you wish to use.
- adSpecBleed (required if adSpecHeight is used): The exact bleed
side of the size represented in the SMA system that you wish to use.
- colorProfileId (one of the color profile identifiers is required): The color Profile SMA id you wish to use.
- colorProfileName (one of the color profile identifiers is required): The exact color profile name you wish to use.
- notify: 'true' or 'false': notify the assignment user
- assignmentUserId *: A valid SMA userId over rides
assignmentUserEmail, assignmentUserCompanyId, assignmentUserCompany, and
assignmentUserCompanyCode. Assignment user will be the advertiser user who is assigned to the ad. They will receive all notifications for the advertiser.
- assignmentUserEmail: A legal SMA user Email, over
rides $assignmentUserCompanyId, assignmentUserCompany, and
assignmentUserCompanyCode
- assignmentUserCompanyId: A legal SMA user companyId
(termId) , over rides assignmentUserCompany, and
assignmentUserCompanyCode
- assignmentUserCompanyCode: A legal SMA user company code, over rides assignmentUserCompany
- assignmentUserCompany: A legal SMA user company name
- issueId (one of 3 issue identifiers is required): a valid issueId for the publication.
- issueRunDate: a date of the format mm/dd/yyyy.
- issueCode: a SMA code which matches a running issue.
- bookingNumber: A booking number which will be tracked on the ad material.
- processId: if a unique processId is not supplied one
will be created for you. This should only be created by a machine.
- label: This is a label for the ad materials.
- product: The product label represented in the ad.
- headline: The headline represented in the ad.
- categoryId: (optional) : A system category ID, must be from a category already present in the system. See Publication.addAdCategory function.
- pageCount: Default is 1. If the chosen ad
specification is an open multipage ad, the page count defines how many
pages the ad should cover. Less than one is not supported.
- folioNumber: The intended folio number of the ad. This
does not dictate true layout placement and is only a suggested
position. Default is empty.
- advertiserNumber: A unique ad identifier supplied from
the advertiser's system or workflow. Possibly adId. Default is empty.
- publisherInfo: Publisher supplied information about the ad. Usually not usable for advertisers. Default is empty.
- productUrl: A web url which represents the product for the advertisement. Default empty
- externalId: An external unique identifier supplied by
the sending system. Usually used for finding ads by a 3rd party
system's id. Default empty
- planOnly: Defines if the reservation should only be
visible in the Virtual publisher product and not the SMA product.
Default 0. 1 true or 0 false
- printAdTypeId: Defines which type of ad this is.
Useful for categorization and reporting of ad types. Default 1
(Supplied Ad) Options: 1 (Supplied Ad), 2 (House Ad), 3 (PSA)
- positionTagIds (optional) : A comma-separated list of position tag IDs.
- positionTagCodes (optional) : A comma-separated list of position tag codes.
- positionTagNames (optional) : A comma-separated list of position tag names.
- creditStatus (optional) : 1 or 0 to place the ad on credit hold.
- cancelled (optional) : 1 or 0 to flag the ad as cancelled.
- salesRepId (optional) : A user ID who represents the publisher sales person for the ad.
- salesRepIds (optional) : A comma-separated list of user IDs that represents the publisher sales representatives for the ad.
- responseType (optional) : default xml , alternative option is "json". Allows system to send alternate response object type. All newly created api functions will default to JSON.
- adRate (optional) : A float money value which represents the ad's rate cost.
- netCost (optional) : A float money value which represents the ad's net cost.
- adInstructions String : Ad instructions from the advertiser
- brand String: Brand information
- externalPosition String: also referred to as Requested Position.
- Custom metadata fields:
format: custom_[internal name] where internal name matches the configuration in SendMyAd's Manage Custom Metadata Options screen.
-
Response:
<results>
<success>true/false</success>
<error>Each error that occurred as a text description. Each error will generate a new xml error tag.</error>
<processId>A unique string which represents the ad.</processId>
</results>
This class contains all of the functions needed to send messages related the SendMyAd Portal
Available Actions
- sendAdMaterialsReminder : This function will take supplied processIds and send out an email reminder to each ad contact.
-
Params:
- action * String: "sendAdMaterialsReminder" The action variable tells the api what you want to do.
- className * String: "Message" The className variable tells the api where the action is located.
- apiKey * String: The apiKey allows the api to authenticate you. API keys can be requested from SendMyAd staff.
- publisherCode * String: The publisherCode tells the api what publisher you are trying to connect with.
- processIds * String: This needs to be a comma delimited list of processIds or an url encoded json block of processIds.
-
Response:
<results>
<success>true/false</success>
<error>Each error that occurred as a text description. Each error will generate a new xml error tag.</error>
<emailsSentCount>The number of emails successfully sent out.</emailsSentCount>
</results>
Available Actions
- addPublisherSalesRep : Add a new publisher based sales representative user to the system.
- Params:
- action * String: "addPublisherSalesRep" The action variable tells the api what you want to do.
- className * String: "User" The className variable tells the api where the action is located.
- apiKey * String: supplied by SMA
- publisherCode * String: The code of the publisher, must have been granted access or be the same user company.
- email * String: a url encoded email address. This will be used as the username and email of the created user
- password * String(31): a password must be 8 characters or greater, no spaces, cannot contain special chars, and cannot contain any of the following: 1234, password, welcome, abc123, qwerty, asdfg, zxcvb, sunshine, princess
- firstName String(255): The first name of the user
- lastName String(255): The last name of the user
- phone String(25): The phone number
- ext String(10) The phone extension
- userPhone2 String(25): A secondary phone number
- jobTitle String(255) The user's job title
- notify: 1 or 0, trigger to send user a welcome email.
-
Response:
<results>
<success>true/false</success> <userId>the id of the newly created user.</userId> <msg>Any response message.</msg>
</results>
- addAgencyUser : Add a new agency based user to the system as non-admins.
- Params:
- action * String: "addAgencyUser" The action variable tells the api what you want to do.
- className * String: "User" The className variable tells the api where the action is located.
- apiKey * String: supplied by SMA
- publisherCode * String: The code of the publisher, must have been granted access or be the same user company.
- companyId *: The id of the agency company you wish to add the user to.
- email * String(255): a URL encoded email address. This will be used as the username and email of the created user
- password * String(31): a password must be 8 characters or greater, no spaces, cannot contain special chars, and cannot contain any of the following 1234, password, welcome, abc123, qwerty, asdfg, zxcvb, sunshine, princess
- firstName String(255): The first name of the user
- lastName String(255): The last name of the user
- phone String(25): The phone number
- ext String(10) The phone extension
- userPhone2 String(25): A secondary phone number
- jobTitle String(255) The user's job title
- notify: 1 or 0, trigger to send user a welcome email.
-
Response:
<results>
<success>true/false</success> <userId>the id of the newly created user.</userId> <msg>Any response message.</msg>
</results>
- addAdvertiserUser : Add a new advertiser based user to the system as non-admins.
- Params:
- action (String)(Required): "addAdvertiserUser" The action variable tells the api what you want to do.
- className (String)(Required): "User" The className variable tells the api where the action is located.
- apiKey (Required): supplied by SMA
- publisherCode (Required): The code of the publisher, must have been granted access or be the same user company.
- companyId (Required): The id of the advertiser company you wish to add the user to.
- email * String(255): a URL encoded email address. This will be used as the username and email of the created user
- password * String(31): a password must be 8 characters or greater, no spaces, cannot contain special chars, and cannot contain any of the following 1234, password, welcome, abc123, qwerty, asdfg, zxcvb, sunshine, princess
- firstName String(255): The first name of the user
- lastName String(255): The last name of the user
- phone String(25): The phone number
- ext String(10) The phone extension
- userPhone2 String(25): A secondary phone number
- jobTitle String(255) The user's job title
- notify: 1 or 0, trigger to send user a welcome email.
-
Response:
<results>
<success>true/false</success> <userId>the id of the newly created user.</userId> <msg>Any response message.</msg>
</results>
checkAdvertiserUserExists: Check if an advertiser user exists based on the supplied email address. Returns userId if found - Params:
- action * String: "addAdvertiserCompany" The action variable tells the API what you want to do.
- className * String: "Company" The className variable tells the api where the action is located.
- apiKey * String: supplied by SMA
- publisherCode * String: The code of the publisher, must have been granted access or be the same user company.
- email * String(255): a URL encoded email address.
- Response:
{"success":1,"msg":"", "userId":"123"}
- updateUser : Update a publisher, agency or advertiser user's information
- Params:
- action (String)(Required): "updateUser" The action variable tells the api what you want to do.
- className (String)(Required): "User" The className variable tells the api where the action is located.
- apiKey (Required): supplied by SMA
- publisherCode (Required): The code of the publisher, must have been granted access or be the same user company.
- companyId (Required): The id of the advertiser company you wish to add the user to.
- userId *: The ID of the user to edit.
(at least one of the following is required) - email String(255): a URL encoded email address. This will be used as the username and email of the created user
- firstName String(255): The first name of the user
- lastName String(255): The last name of the user
- phone String(25): The phone number
- ext String(10): The phone extension
- userPhone2 String(25): A secondary phone number
- jobTitle String(255): The user's job title
- Response:
{"success":1,"msg":"", "userId":"123"}
This class contains ways to get and update ad information in the system.
Available Actions
- getAdInfo: query an ad by its unique processId to list available information known about the ad
- Params:
- action * String: "getAdInfo" The action variable tells the api what you want to do.
- className * String: "Ad" The className variable tells the api where the action is located.
- apiKey * String: supplied by SMA
- publisherCode * String: The code of the publisher that owns the ad to be queried.
- processId * String: The unique identifier for the ad.
- Response:
{"success":"1","msg":"","data":{"key1":"value1","key2":"value2",...}
- getAdsByChanged: Return an ad list in json by last updated in number of minutes
- Params:
- action * String: "getAdsByChanged" The action variable tells the api what you want to do.
- className * String: "Ad" The className variable tells the api where the action is located.
- apiKey * String: supplied by SMA
- publisherCode * String: The code of the publisher that owns the ad to be queried.
- minutes * String: A number of minutes you wish to check by last changed. Must be between 1 and 44640.
- Response:
{"success":1,"rowCount":16,"data":{"123455":{"processId":"12342314","fileName":"my.pdf","publicationName":"My Publication",...}
- editAd: Edits an ad by processId using a pre-defined set of fields.
- Params:
- action * String: "editAd" The action variable tells the api what you want to do.
- className * String: "Ad" The className variable tells the api where the action is located.
- apiKey * String: supplied by SMA
- publisherCode * String: The code of the publisher that owns the ad to be queried.
- processId * String: The unique identifier for the ad.
At least one of the following fields is required:
- materialsId String
- creditStatus Int (0 or 1)
- cancelled Int (0 or 1)
- label String : The label of the ad (also seen as advertiser string in interface)
- headline String
- adInstructions String : Ad instructions from the advertiser
- publisherInfo String : Internal notes about the ad only seen by the publisher.
- salesRepId String : A publisher user who is a sales rep for the advertisement.
- salesRepIds String : A comma-separated list of user IDs that represents the publisher sales representatives for the ad.
- adRate Float : A money value which represents the ad's rate cost.
- netCost Float : A money value which represents the ad's net cost.
- folioNumber: The intended folio number of the ad. This does not dictate true layout placement and is only a suggested position. Default is empty.
- categoryId Int: A system category ID, must be from a category already present in the system. See Publication.addAdCategory function.
- adSpecId Int: An ad size (spec) ID. See AdSpec.getAdSpecList function.
- adSpecCode String: The ad size SMA code you wish to use.
NOTE: Ad sizes can only be edited for reservations without materials or for ads that have rejected materials.
Editing the ad spec value will move the ad to the clipboard in all Virtual Publisher plans on which it is placed.
- positionTagIds String: A comma-separated list of position tag IDs.
- positionTagCodes String: A comma-separated list of position tag codes.
- positionTagNames String: A comma-separated list of position tag names.
- brand String : Brand information
- externalPosition String: also referred to as Requested Position.
- Custom metadata fields:
format: custom_[internal name] where internal name matches the configuration in SendMyAd's Manage Custom Metadata Options screen.
- Response:
{"success":"1","msg":"","data":{"key1":"value1","key2":"value2",...}
- editIssue: assigns an issue to an existing ad
- Params:
- action * String: "getAdInfo" The action variable tells the api what you want to do.
- className * String: "Ad" The className variable tells the api where the action is located.
- apiKey * String: supplied by SMA
- publisherCode * String:The code of the publisher that owns the ad to be queried.
- processId * String: The unique identifier for the ad.
- publicationId * Int: the publicationId for the issue
- issueId (one of 2 issue identifiers is required): a valid issueId for the publication.
- issueCode: a SMA code which matches a running issue.
- Response:
{"success":"0 | 1","msg":"","issueId":1234}
- archiveAd: removes an ad or reservation
- Params:
- action * String: "getAdInfo" The action variable tells the api what you want to do.
- className * String: "Ad" The className variable tells the api where the action is located.
- apiKey * String: supplied by SMA
- publisherCode * String:The code of the publisher that owns the ad to be queried.
- processId * String: The unique identifier for the ad.
- publicationId * Int: the publicationId for the issue
- issueId (one of 2 issue identifiers is required): a valid issueId for the publication.
- Response:
{"success":"0 | 1","msg":""}
- unarchiveAd: restores an ad or reservation
- Params:
- action * String: "getAdInfo" The action variable tells the api what you want to do.
- className * String: "Ad" The className variable tells the api where the action is located.
- apiKey * String: supplied by SMA
- publisherCode * String:The code of the publisher that owns the ad to be queried.
- processId * String: The unique identifier for the ad.
- Response:
{"success":"0 | 1","msg":""}
Deprecated method, use editAd (above) instead:
- updatePrintAd: updates a metadata value for an ad
- Params:
- action * String: "getAdInfo" The action variable tells the api what you want to do.
- className * String: "Ad" The className variable tells the api where the action is located.
- apiKey * String: supplied by SMA
- publisherCode * String:The code of the publisher that owns the ad to be queried.
- processId * String: The unique identifier for the ad.
- key * String: the metadata field identifier
- value * String: the URL-encoded value to be updated.
- Response:
{"success":"0 | 1","msg":""}
This class contains ways to get ad specification (size) information in the system.
Available Actions
- getAdSpecList: return a list of active ad sizes by publication
- Params:
- action * String: "getAdSpecList" The action variable tells the api what you want to do.
- className * String: "AdSpec" The className variable tells the api where the action is located.
- apiKey * String: supplied by SMA
- publisherCode * String: The code of the publisher that owns the ad specifications to be queried.
- publicationId * String: The unique identifier for the publication.
- publicationCode String (required if publicationId or publicationCode not supplied): The unique code for the publication.
- publicationName String (required if publicationId or publicationName not supplied): The name of the publication.
- Response:
{"success":1,"rowCount":16,"data":{"216":{"adSpecId":"216","adSpecName":"Full Page","adSpecCode":"FP",...}
This class contains ways to create advertiser and agency companies associated with a publisher
Available Actions
- addAgencyCompany: creates a new agency company and links it to a publisher.
- Params:
- action * String: "addAgencyCompany" The action variable tells the API what you want to do.
- className * String: "Company" The className variable tells the API where the action is located.
- apiKey * String: supplied by SMA
- publisherCode * String: The code of the publisher, must have been granted access or be the same user company.
- name * String(255): The name of the company
- code String(12): The code of the company.
- address String(255): The address line 1 of the company.
- address2 String(255): The address line 2 of the company.
- city String(255): The city of the company.
- state String(4): The 2 digit state code of the company.
- country String(4): The 3 digit country code of the company.
- zip String(11): The zip/postal code of the company.
- phone String(12): The phone number of the company
- fax String(12): The fax number of the company
- website String(255): The web url the company
- Response:
{"success":1,"msg":""}
- addAdvertiserCompany: creates a new advertiser company and links it to a publisher.
- Params:
- action * String: "addAdvertiserCompany" The action variable tells the API what you want to do.
- className * String: "Company" The className variable tells the api where the action is located.
- apiKey * String: supplied by SMA
- publisherCode * String: The code of the publisher, must have been granted access or be the same user company.
- name * String(255): The name of the company
- code String(12): The code of the company.
- address String(255): The address line 1 of the company.
- address2 String(255): The address line 2 of the company.
- city String(255): The city of the company.
- state String(4): The 2 digit state code of the company.
- country String(4): The 3 digit country code of the company.
- zip String(11): The zip/postal code of the company.
- phone String(12): The phone number of the company
- fax String(12): The fax number of the company
- website String(255): The web url the company
- Response:
{"success":1,"msg":""}
- editCompany: allows editing of company information if the API user has been granted that right.
- Params:
- action * String: "editCompany" The action variable tells the API what you want to do.
- className * String: "Company" The className variable tells the api where the action is located.
- apiKey * String: supplied by SMA
- publisherCode * String: The code of the publisher, must have been granted access or be the same user company.
- companyId * Int: The ID of the company to be edited
(at least one of the following must be supplied)
- name String(255): The name of the company
- code String(12): The code of the company.
- address String(255): The address line 1 of the company.
- address2 String(255): The address line 2 of the company.
- city String(255): The city of the company.
- state String(4): The 2 digit state code of the company.
- country String(4): The 3 digit country code of the company.
- zip String(11): The zip/postal code of the company.
- phone String(12): The phone number of the company
- fax String(12): The fax number of the company
- website String(255): The web url the company
- Response:
{"success":1,"msg":""}
checkCompanyExists: Check if an advertiser or agency company exists based on the supplied company name or code.
- Params:
- action * String: "addAdvertiserCompany" The action variable tells the API what you want to do.
- className * String: "Company" The className variable tells the api where the action is located.
- apiKey * String: supplied by SMA
- publisherCode * String: The code of the publisher, must have been granted access or be the same user company.
- companyName * String(255): The name of the company (this or the company code is required)
- companyCode * String(12): The code of the company.
- Response:
{"success":1,"msg":"", "companyId":"123"}
- getAdvertisersList: a list of all the advertiser companies associated with this publisher
- Params:
- action * String: "getAdvertisersList" The action variable tells the API what you want to do.
- className * String: "Company" The className variable tells the api where the action is located.
- apiKey * String: supplied by SMA
- publisherCode * String: The code of the publisher, must have been granted access or be the same user company.
- Response:
{"success":1,"rowCount":4,"data":{["advertiserId":"411","advertiserName": ...]}
- getAgenciesList: a list of all the agency companies associated with this publisher
- Params:
- action * String: "getAgencyList" The action variable tells the API what you want to do.
- className * String: "Company" The className variable tells the api where the action is located.
- apiKey * String: supplied by SMA
- publisherCode * String: The code of the publisher, must have been granted access or be the same user company.
- Response:
{"success":1,"rowCount":3,"data":{["agency":"436","agencyName": ...]}
This class contains ways to find information about and add new issues.
Available Actions
- addIssue:
- Params:
- action * String: "addIssue" The action variable tells the API what you want to do.
- className * String: "Issue" The className variable tells the api where the action is located.
- apiKey * String: supplied by SMA
- publisherCode * String: The code of the publisher, must have been granted access or be the same user company.
- publicationId * String: (one publication type is required): The publication SMA id you wish to use, publicationId over rides $publicationCode and $publicationCode overrides $publicationName
- publicationCode (one publication type is required): The publication code you wish to use, publicationCode over rides $publicationname
- publicationName (one publication type is required): The publication name you wish to use
- name * String: The name of the issue.
- code: The code of the issue. Can be up to four characters
- runDate String: The issue run date. If not supplied, default will be today.
- materialsDueDate String: The ad materials due date: If not supplied, will be today.
- onSaleDate String: The issue on sale date. If not supplied will be issue run date.
- shipDate String: The issue ship date. If not supplied will be issue run date.
- description String(255): A description of the issue.
- Results:
{"success":1,"id":2437}
(note: our API will recognize most common date formats in your supplied string and convert to a proper date).
- issueExists: checks if an issue exists using a variety of different variables
- Params:
- action * String: "issueExists" The action variable tells the API what you want to do.
- className * String: "Issue" The className variable tells the API where the action is located.
- apiKey * String: supplied by SMA
- publisherCode * String: The code of the publisher for this request.
- issueId *: Look for an issue by id. If an issue id is not supplied, an issue name, run date, code or publication identifier will be required.
- name String: An issue name string.
- runDate: a date format mm/dd/yyyy.
- code: a SMA code which matches a running issue.
- publicationId (required if issueId not supplied): The SMA publication ID you wish to use, publicationId overrides $publicationCode and $publicationName
- publicationCode (required if publicationId is not supplied or another publication identifier) String: The publication code which contains the issue
- publicationName (required if publicationId is not supplied or another publication identifier) String: The exact publication name which contains the issue
- Results:
{"success":1,"exists":"0 | 1"}
- getIssueInfo: returns information about an issue
- Params:
- action * String: "getIssueInfo" The action variable tells the API what you want to do.
- className * String: "Issue" The className variable tells the API where the action is located.
- apiKey * String: supplied by SMA
- publisherCode * String: The code of the publisher for this request.
- issueId *: Look for an issue by id. If an issue id is not supplied, a publication identifier will be required, along with the issue name or runDate.
- name String: An issue name string.
- runDate String: a date format mm/dd/yyyy.
- code String: a SMA code which matches a running issue.
- publicationId (required if issueId not supplied): The SMA publication ID you wish to use, publicationId overrides $publicationCode and $publicationName
- publicationCode (required if publicationId is not supplied or another publication identifier) String:: The publication code which contains the issue
- publicationName (required if publicationId is not supplied or another publication identifier) String:: The exact publication name which contains the issue
- Results:
{"success":1,"data":{"issueId":"2436","issueCode":"","runDate":"2014-06-16 00:00:00",...}
- getIssueList: returns a list of issues for the specified publication.
- Params
- action * String: "getIssueList" The action variable tells the API what you want to do.
- className * String: "Issue" The className variable tells the API where the action is located.
- apiKey * String: supplied by SMA
- publisherCode * String: The code of the publisher for this request.
- publicationId *: The SMA publication ID you wish to use, publicationId overrides $publicationCode and $publicationName
- publicationCode (required if publicationId is not supplied or another publication identifier) String: The publication code which contains the issue
- publicationName (required if publicationId is not supplied or another publication identifier) String: The exact publication name which contains the issue
- allIssues : 0 = (default value if paramater not specified) Return only issues which are in the future and less the 190 days passed run date.
1 = Return all issues for publication.
- Results:
{"success":1,"rowCount":4,"data":{"1621":{"issueId":"1621","issueName":"2015","issueCode":"ISS2015","runDate":"2014-12-19 00:00:00",...}
- updateIssue: updates an issue's metadata value
- Params:
- action * String: "updateIssue" The action variable tells the API what you want to do.
- className * String: "Issue" The className variable tells the API where the action is located.
- apiKey * String: supplied by SMA
- publisherCode * String: The code of the publisher for this request.
- issueId * : Look for an issue by id. This will be used as the key to update issue info.
- code (required if issueId not supplied) String: Issue id or code is required. This will be used as the key to update issue info.
- key * String: A known database key.
- value * String: A URL-encoded string to update as the value.
- Results:
{"success":1,"msg":"Updated issue successfully."}
This class contains ways to find information about publications
Available Actions
- getPublicationList: returns a list of all publications for a given publisher.
- Params:
- action * String: "getPublicationList" The action variable tells the API what you want to do.
- className * String: "Publication" The className variable tells the API where the action is located.
- apiKey * String: supplied by SMA
- publisherCode * String: The code of the publisher for this request.
- Results:
{"success":1,"rowCount":7,"data":{"155":{"publicationId":"155","publicationName":"Testing Magazine",...}}
- getColorProfileList: returns a list of color profiles for the specified publication.
- Params:
- action * String: "getColorProfileList" The action variable tells the API what you want to do.
- className * String: "Publication" The className variable tells the API where the action is located.
- apiKey * String: supplied by SMA
- publisherCode * String: The code of the publisher for this request.
- publicationId *: The SMA publication ID you wish to use, publicationId overrides $publicationCode and $publicationName
- publicationCode (required if publicationId is not supplied or another publication identifier) String: The publication code which contains the color profiles
- publicationName (required if publicationId is not supplied or another publication identifier) String: The exact publication name which contains the color profiles
- Results:
{"success":1,"rowCount":3,"data":{"247":{"colorProfileId":"247","colorProfileName":"all warnings",...}}
- getAdCategoryList: returns a list of color profiles for the specified publication.
- Params:
- action * String: "getAdCategoryList" The action variable tells the API what you want to do.
- className * String: "Publication" The className variable tells the API where the action is located.
- apiKey * String: supplied by SMA
- publisherCode * String: The code of the publisher for this request.
- publicationId *: The SMA publication ID you wish to use, publicationId overrides $publicationCode and $publicationName
- publicationCode (required if publicationId is not supplied or another publication identifier) String: The publication code which contains the color profiles
- publicationName (required if publicationId is not supplied or another publication identifier) String: The exact publication name which contains the color profiles
- Results:
{"success":1,"rowCount":5,"data":{"13":{"adCategoryId":"13",...}}
- getSectionList: returns a list of color profiles for the specified publication.
- Params:
- action * String: "getSectionList" The action variable tells the API what you want to do.
- className * String: "Publication" The className variable tells the API where the action is located.
- apiKey * String: supplied by SMA
- publisherCode * String: The code of the publisher for this request.
- publicationId *: The SMA publication ID you wish to use, publicationId overrides $publicationCode and $publicationName
- publicationCode (required if publicationId is not supplied or another publication identifier) String: The publication code which contains the color profiles
- publicationName (required if publicationId is not supplied or another publication identifier) String: The exact publication name which contains the color profiles
- Results:
{"success":1,"rowCount":5,"data":{"2":{"sectionId":"2",...}}
- addAdCategory: adds a new ad category for this publication
- Params:
- action * String: "addAdCategory" The action variable tells the API what you want to do.
- className * String: "Publication" The className variable tells the API where the action is located.
- apiKey * String: supplied by SMA
- publisherCode * String: The code of the publisher for this request.
- publicationId *: The SMA publication ID you wish to use, publicationId overrides publicationCode and publicationName
- publicationCode (required if publicationId is not supplied or another publication identifier) String: The unique publication code, publicationCode overrides publicationName
- publicationName (required if publicationId is not supplied or another publication identifier) String: The exact publication name.
- name * String(255): The proposed name of the ad category
- code String(12): The proposed code of the ad category
- color String(7 or 3 comma delimited values): HEX or comma delimited RGB values (Optional) The proposed bar color of the ad category. Auto generated if none supplied. HTML HEX FORMAT: #FFFFFF
- compDistRuleOn Int(1): Decides if the competitive distance rule is on for this category. Default is off (0).
- compDistRule Int(1000): Decides how far apart in pages an item with the same category must be. Default is (0), which means not on the same page.
- Results:
{"success":1,"id":809,"msg":"Ad Category added successfully."}
- addSection: adds a new section for this publication
- Params:
- action * String: "addSection" The action variable tells the API what you want to do.
- className * String: "Publication" The className variable tells the API where the action is located.
- apiKey * String: supplied by SMA
- publisherCode * String: The code of the publisher for this request.
- publicationId *: The SMA publication ID you wish to use, publicationId overrides publicationCode and publicationName
- publicationCode (required if publicationId is not supplied or another publication identifier) String: The unique publication code, publicationCode overrides publicationName
- publicationName (required if publicationId is not supplied or another publication identifier) String: The exact publication name.
- name * String(255): The proposed name of the section
- color String(7): The proposed bar color of the publication section. Auto generated if none supplied. HTML HEX FORMAT: #FFFFFF
- fontColor String(7): The proposed font color of the publication section. Defaults to white if none supplied. HTML HEX FORMAT: #FFFFFF
- description String: The proposed description of the publication section
- Results:
{"success":1,"id":49,"msg":"Publication section added successfully."}
- getPositionTagsList: a list of all the position tags associated with a publication
- Params:
- action * String: "getPositionTagsList" The action variable tells the API what you want to do.
- className * String: "Publication" The className variable tells the API where the action is located.
- apiKey * String: supplied by SMA
- publisherCode * String: The code of the publisher for this request.
- publicationId *: The SMA publication ID you wish to use, publicationId overrides $publicationCode and $publicationName
- Results:
{"success":1,"rowCount":5,"data":{"45":{"tagId":"45",...}}
- addPositionTag: adds a new position tag for this publication
- Params:
- action * String: "addPositionTag" The action variable tells the API what you want to do.
- className * String: "Publication" The className variable tells the API where the action is located.
- apiKey * String: supplied by SMA
- publisherCode * String: The code of the publisher for this request.
- publicationId *: The SMA publication ID you wish to use
- name * String(255): The name of the new position tag
- code String(8): The code for the new position tag
- Results:
{"success":1,"tagId":342,"msg":"Position tag added successfully."}
- editPositionTag: edits a position tag by its ID
- Params:
- action * String: "addPositionTag" The action variable tells the API what you want to do.
- className * String: "Publication" The className variable tells the API where the action is located.
- apiKey * String: supplied by SMA
- publisherCode * String: The code of the publisher for this request.
- tagId *: The SMA publication ID you wish to use, publicationId overrides publicationCode and publicationName
(one of the following fields is required)
- name * String(255): The new name of the position tag
- code * String(8): The new code for the position tag
- Results:
{"success":1,"msg":"Position tag 342 edited successfully."}
This class contains ways to find information specific to a publisher
Available Actions
- getPrintAdTypeList: returns a list of all print ad types for a given publisher.
- Params:
- action * String: "updateIssue" The action variable tells the API what you want to do.
- className * String: "Publisher" The className variable tells the API where the action is located.
- apiKey * String: supplied by SMA
- publisherCode * String: The code of the publisher for this request.
- Results:
{"success":1,"rowCount":3,"data":{"2":{"name":"House Ad","code":"","description":"","publisherId":"0","id":"2"},"3":{"name":"PSA","code":"","description":"","publisherId":"0","id":"3"},"1":{"name":"Supplied Ad","code":"","description":"","publisherId":"0","id":"1"}}}
- addPrintAdType: returns a list of all print ad types for a given publisher.
This class contains ways to create digital ad reservations in the system.
Available Actions
- reserveAdSpace : Creates a digital ad space reservation to be fulfilled by an ad sender.
- Params:
- apiKey *: supplied by SMA
- publisherCode *: The code of the publisher you wish to send the space reservation to, must have been granted access or be the same user company.
- mediaProfileId * The mediaProfileId is required and can be found in the details of the media profiles list of your site or call getWebMediaProfilesList function for results. Note: The chosen mediaProfile must be turned on for advertisers in order for this option to work.
- publicationId The publications SMA id key you wish to use, publicationId over rides publicationCode and publicationname. Publication Id keys can be obtained through the publication class.
- publicationCode The publication code you wish to use, publicationCode over rides publicationname
- publicationName The publication name you wish to use, must match a publication in the sytem owned by the publisher.
- adSpecId * (one of the ad spec identifiers is required): The ad size SMA id you wish to use.
- adSpecCode (one of the ad spec identifiers is required): The ad size SMA code you wish to use.
- adSpecName (one of the ad spec identifiers is required): The ad size SMA name you wish to use.
- notify: 'true' or 'false': notify the assignment user
- assignmentUserId *: A valid SMA userId over rides assignmentUserEmail, assignmentUserCompanyId, assignmentUserCompany, and assignmentUserCompanyCode. Assignment user will be the advertiser user who is assigned to the ad. They will receive all notifications for the advertiser.
- assignmentUserEmail: A legal SMA user Email, over rides $assignmentUserCompanyId, assignmentUserCompany, and assignmentUserCompanyCode
- assignmentUserCompanyId: A legal SMA user companyId (termId) , over rides assignmentUserCompany, and assignmentUserCompanyCode
- assignmentUserCompanyCode: A legal SMA user company code, over rides assignmentUserCompany
- assignmentUserCompany: A legal SMA user company name
- issueId a valid issueId for the publication.
- issueCode: a SMA code which matches a running issue. Note, publisher must have issues and publications for digital ads turned on for this to work.
- processId: if a unique processId is not supplied one will be created for you. This should only be created by a machine.
- advertiser: This is a label for the ad materials.
- product: The product label represented in the ad.
- externalId: An external unique identifier supplied by the sending system. Usually used for finding ads by a 3rd party system's id. Default empty
- responseType (optional) : default xml , alternative option is "json". Allows system to send alternate response object type. All newly created api functions will default to JSON.
- adInstructions String : Ad instructions from the advertiser
- brand String: Brand information
- runFrom String: mm/dd/yyyy. The start run date of the ad.
- runTo String: mm/dd/yyyy. The end run date of the ad.
- clickUrl String: The url executed when the advertisement is clicked.
- Custom metadata fields:
- format: custom_[internal name] where internal name matches the configuration in SendMyAd's Manage Custom Metadata Options screen.
- Response:
<results>
<success>true/false</success>
<error>Each error that occurred as a text description. Each error will generate a new xml error tag.</error>
<processId>A unique string which represents the ad.</processId>
</results>
- getWebMediaProfilesList : Gets a list of mediaProfiles based on provided filters.
- Params:
- apiKey *: supplied by SMA
- publisherCode *: The code of the publisher you wish to send the space reservation to, must have been granted access or be the same user company.
|
|