All API endpoints require the following query string parameters. These parameters must always be present on the query string, even when using the POST version of the APIs.
Parameter | Required? | Type | Multiples? | Notes |
---|---|---|---|---|
apiUser |
string |
Provided by Vendasta | ||
apiKey |
string |
Provided by Vendasta |
All API responses will be a JSON dictionary of the form:
{ "statusCode": 200, "responseTime": 13.12, "version": "1.1", "requestId": "5289947b00ff0b5f9a70d6c8f70001737e726570636f72652d70726f64000170726f642d312d37393400010139", "message": "A human-readable message.", # optional "deprecationWarnings": {}, # optional "data": {} # the actual API response data }where:
statusCode
responseTime
version
requestId
message
deprecationWarnings
data
Note
The API responses below indicate the data
portion of the response.
Note
Where multiple arguments are allowed, use repeated parameter names. E.g., foo=1&foo=2&foo=3
.
Note Certain data types require particular serialized forms:
datetime
has the form 2012-12-13T14:32:41Z
date
has the form 2012-12-13
time
has the form 14:32:41Z
boolean
has the formtrue
or false
Important Our APIs only accept a maximum url length
of 2,000 characters. If providing a large number of parameters, especially repeated parameters,
use the POST
form of API to guard against surpassing this limit.
For API endpoints denoted as "supports paged results", the response dictionary will have more information:
{ "statusCode": 200, ..., "data": ['a', 'b' , 'c'], "nextUrl": "https://www.example.com/abc123?page=998877", "nextQueryString": "page=998877", "totalResults": 213, "numberFoundAccuracy": 100 }where:
data
nextUrl
null
;
depending on the particular endpoint, it is also possible that the nextUrl
key does not even appear in the dictionary. In either case, this signifies that
there are no further results.
Important You must append your
apiUser
and apiKey
to the nextUrl
before
submitting the request; these values are explictly suppressed for security reasons.
nextQueryString
nextUrl
for convenience.
This is useful if you need to push the paging information to the browser (e.g., for
an Ajax-driven "next page" action) but want to protect the hostname.
totalResults
numberFoundAccuracy
totalResults
will only be an estimation.
This is only supported by certain endpoints and may not be present.
Unless otherwise noted, a 200 response code indicates success and a 500 response code indicates a server error. In general, 200-series responses are used to indicate success, 400-series responses are used to indicate client errors, and 500-series responses are used to indicate server errors. 400-series errors often contain a message with a description of the client error.
Each endpoint has a version number which consists of a major version and a minor version
(e.g., v1.1
).
As non-breaking changes are introduced, the minor version will increase. Non-breaking changes
include items like new optional parameters and new entries in dictionaries. It is important
that your implementation be able to handle these sorts of adjustments automatically.
If a breaking change is required, a new endpoint will be created with a new major version number (the major version number is included in the url path itself). When this occurs, the old version will be marked as deprecated, however it will continue to operate. If any formal sunsetting of the old endpoint is planned, this will be communicated to you via announcement and migration time will be allotted.
Note
When an endpoint has been marked as deprecated,
a deprecationWarnings
key will appear in the top-most response dictionary.
Note Version adjustments (major and minor) occur on individual endpoints, not for the entire suite of endpoints.
Webhooks allow our servers to push content to you as soon as possible. To use webhooks, you must build a handler on your server and configure the url of the handler on https://partners.vendasta.com.
Content will be sent to this url using a POST
method.
The content of the POST
will be a JSON-encoded dictionary, with the following
basic format:
{ "event": "some-event-code", "messageId": "cb7beb99090a4f5f8406a43ae9f56d88", "version": "1.1", "publishedDateTime": "2014-12-13T14:15:16Z", "data": {} # the actual webhook content }where:
event
messageId
version
data
block.
publishedDateTime
data
A message will be considered to be successfully delivered if your server returns a status code in the range 200-299. All other responses will be considered failures. If your server returns a 401 or 403, no retries will be attempted, otherwise delivery will be retried. Unless otherwise noted, the retry policy will attempt after 5 seconds, 10 seconds, 20 seconds, 40 seconds, 80 seconds etc. At least one delivery per day will be attempted, however, retries will end 7 days after the delivery was originally attempted.
Note No guarantee is made about the order of the messages, especially when retrying is in effect. Your handler must have enough logic to handle out of order messages as well as the small possibility of duplicate message delivery.
To prevent malicious attempts from other parties, it is possible for our servers to sign the webhook message using a shared cryptographic signing key. Your signing key can be configured at https://partners.vendasta.com.
When the signing key is configured, we will compute the signature based on the raw
content of the HTTP POST
body (not the headers). Make sure that you
strip any leading and trailing whitespace before computing the signature; the first
character will be "{
" and the last character will be "}
".
The signing technique follows the HMAC specification defined by RFC-2104, using a SHA1 hash. In Python code, the signing process is performed by the following code:
import hmac import sha payload = '' # the body of the HTTP POST signing_key = '' # the shared cryptographic key configured at https://partners.vendasta.com signature = hmac.new(signing_key, payload.strip(), sha.sha).hexdigest()
Once the signature is computed, you can compare it to the signature on the
header X-Vendasta-HMAC
found in the HTTP POST
headers.
If your computed signature matches the signature in the header, the message
is genuine.
These end-points are used for managing Brand v2 API
API endpoint to create a brand with a brand name and vTax category
POST https://brand-analytics-api.vendasta.com/api/v2/brand/create/
Parameter | Required? | Type | Multiples? | Notes |
---|---|---|---|---|
brandName
|
string
|
The actual name of the brand. | ||
activatedSources
|
string
|
A list of source ids from Reputation Intelligence as strings. | ||
advertisingTabEnabled
|
string
|
When enabled the Brand report will show Advertising data. | ||
customerVoiceExecutiveReportEnabled
|
string
|
When enabled the Brand report will show Customer Voice data. | ||
dataExportTabEnabled
|
string
|
When enabled allows data exporting of Executive Report. | ||
googleQAndATabEnabled
|
string
|
When enabled this Brand report will show the Google Q&A tab. | ||
insightsTabEnabled
|
string
|
When enabled this Brand report will show the Insights tab. | ||
keywordTrackingTabEnabled
|
string
|
When enabled this Brand report will show the Keyword Tracking tab. | ||
location
|
string
|
The vTax location for white list consideration e.g. CA | ||
locationNameTemplate
|
string
|
If provided, locations will be displayed by filling this template with the business' data. Ex. `{company_name}, {city}, {state}` | ||
mapTabEnabled
|
string
|
When enabled this Brand report will show the Map tab. | ||
marketId
|
string
|
The id of the market this brand belongs to. | ||
reportTabEnabled
|
string
|
When enabled the Report page will be available in Business Center. | ||
requestReviewsCardEnabled
|
string
|
When enabled the Request Reviews overview card will be available in Business Center | ||
requestReviewsPageEnabled
|
string
|
When enabled the Request Reviews page will be available in Business Center. | ||
reviewsTabEnabled
|
string
|
When enabled this Brand report will show the Reviews tab. | ||
socialTabEnabled
|
string
|
When enabled this Brand report will show the Social tab. | ||
taxId
|
string
|
The vTax category Id | ||
visibilityTabEnabled
|
string
|
When enabled this Brand report will show the Visibility tab. | ||
websiteTabEnabled
|
string
|
When enabled the Brand report will show Website data. |
"data": { "status": "success" }
API endpoint to add a node to a Brand hierarchy.
POST https://brand-analytics-api.vendasta.com/api/v2/brand/add-location/
Parameter | Required? | Type | Multiples? | Notes |
---|---|---|---|---|
accountGroupId
|
string
|
The account id associated to the location | ||
brandName
|
string
|
The actual name of the brand. | ||
locationName
|
string
|
The location name to be added to the brand | ||
regions
|
string
|
An ordered list of regions |
path
already exists or you have reached the maximum number of nodes."data": { "created": 4 }
API endpoint to retrieve the list of filtered visibility sources for a Brand
POST https://brand-analytics-api.vendasta.com/api/v2/activatedSources/get/
Parameter | Required? | Type | Multiples? | Notes |
---|---|---|---|---|
brandName
|
string
|
The actual name of the brand. |
"data": { "activatedSources": [ "source1", "source2", "source..." ] }
API endpoint to set the list of filtered visibility sources for a Brand Optionally a vtax category can be passed. If vtax is passed, do a lookup using core sdk for proper sources to be set in the brand Can only pass either the visibility sources or vtax category. Not both. Raise 400 if both sources and vtax are sent
POST https://brand-analytics-api.vendasta.com/api/v2/activatedSources/set/
Parameter | Required? | Type | Multiples? | Notes |
---|---|---|---|---|
brandName
|
string
|
The actual name of the brand. | ||
activatedSources
|
string
|
A list of source ids from Reputation Intelligence as strings. | ||
location
|
string
|
The vTax location for white list consideration e.g. CA | ||
taxId
|
string
|
The vTax category Id |
"data": { "status": "success" }
API endpoint to set the location name template for a Brand Raise 400 if the template is invalid
POST https://brand-analytics-api.vendasta.com/api/v2/locationNameTemplate/set/
Parameter | Required? | Type | Multiples? | Notes |
---|---|---|---|---|
brandName
|
string
|
The actual name of the brand. | ||
locationNameTemplate
|
string
|
If provided, locations will be displayed by filling this template with the business' data. Ex. `{company_name}, {city}, {state}` |
"data": { "status": "success" }
API endpoint to delete a location on a node via the account group id
POST https://brand-analytics-api.vendasta.com/api/v2/brand/delete-location/
Parameter | Required? | Type | Multiples? | Notes |
---|---|---|---|---|
accountGroupId
|
string
|
The account id associated to the location | ||
path
|
string
|
A group path with the group nodes separated by the pipe character "|" |
"data": { "deleted": 4 }
These end-points are used for managing Brand hierarchies
API endpoint to remove a node from a Brand hierarchy.
POST/GET https://brand-analytics-api.vendasta.com/api/v2/node/delete/
Parameter | Required? | Type | Multiples? | Notes |
---|---|---|---|---|
path
|
string
|
The address of a tree node. |
"data": { "deleted": 9 }
These end-points are used for getting Brand report Urls
Endpoint to get a signed URL for a report
POST https://brand-analytics-api.vendasta.com/api/v2/reportUrl/get/
Parameter | Required? | Type | Multiples? | Notes |
---|---|---|---|---|
path
|
string
|
The address of a tree node. Ensure the path is formed properly, is the minimum length and begins with the right pid. | ||
expiry
|
string
|
How long the signed report URL will be valid for (in seconds). Default: 86400 | ||
omitSignatureFlag
|
boolean
|
Whether or not to sign the URL and include the signature in the query params. Default: false |
"data": { "secureUrl": "https://[HOST]/report/?sig=[SIGNATURE]&exp=[EXPIRY]&path=[PATH]", "url": "http://[HOST]/report/?sig=[SIGNATURE]&exp=[EXPIRY]&path=[PATH]" }
These end-points are used to get Brand data
API endpoint for getting the Brands available for a partner
POST/GET https://brand-analytics-api.vendasta.com/api/v2/brands/get/
Parameter | Required? | Type | Multiples? | Notes |
---|---|---|---|---|
detailsFlag
|
boolean
|
Indicates whether to provide details about each brand including the names and paths in both original and url encoded form. |
"data": { "brands": [ "Vendasta Inc", "Your Brand" ], "details": [ { "brandName": "Vendasta Inc", "path": "PID2|Vendasta Inc", "urlEncodedBrandName": "Vendasta%20Inc", "urlEncodedPath": "PID2%7CVendasta%2520Inc" }, { "brandName": "Your Brand", "path": "PID2|Your Brand", "urlEncodedBrandName": "Your%20Brand", "urlEncodedPath": "PID2%7CYour%2520Brand" } ] }
API endpoint for getting the information for a whole tree or a portion thereof
POST/GET https://brand-analytics-api.vendasta.com/api/v2/tree/get/
Parameter | Required? | Type | Multiples? | Notes |
---|---|---|---|---|
path
|
string
|
The address of a tree node. | ||
fetchAllChildrenFlag
|
boolean
|
Indicator to fetch all of the children of the tree. Default: false |
"data": { "tree": { "children": [ { "groupNodes": [ "G-123", "G-456" ], "isLocation": false, "name": "California", "path": "PID|ABC|California", "urlEncodedPath": "PID%7CABC%7CCalifornia" }, { "groupNodes": [ "G-123", "G-456", "G-789" ], "isLocation": false, "name": "Monterey", "path": "PID|ABC|California|Monterey", "urlEncodedPath": "PID%7CABC%7CCalifornia%7CMonterey" }, { "groupNodes": [ "G-123", "G-456", "G-789", "G-897" ], "isLocation": true, "name": "Mikes Example Shop", "path": "PID|ABC|California|Monterey|Mikes%20Example%20Shop", "urlEncodedPath": "PID%7CABC%7CCalifornia%7CMonterey%7CMikes%2520Example%2520Shop" } ], "name": "ABC", "path": "PID|ABC" } }
API endpoint for getting details about a node or list of nodes. Limits to retrieving 100 at a time.
POST/GET https://brand-analytics-api.vendasta.com/api/v2/nodeDetails/get/
Parameter | Required? | Type | Multiples? | Notes |
---|---|---|---|---|
path
|
string
|
A list of addresses of tree nodes as strings. Maximum 100 addresses. |
"data": { "PID|ABC": { "accountGroupId": "", "createdDateTime": "2012-12-11T15:21:41Z", "marketId": "MARKET-ID", "path": "PID|ABC", "t": "brand", "updatedDateTime": "2012-12-11T15:21:41Z", "urlEncodedPath": "PID%7CABC" }, "PID|ABC|California": { "accountGroupId": "", "createdDateTime": "2013-01-13T14:08:16Z", "path": "PID|ABC|California", "t": "region", "updatedDateTime": "2013-01-23T17:31:35Z", "urlEncodedPath": "PID%7CABC%7CCalifornia" }, "PID|ABC|California|Monterey|Mikes Example Shop": { "accountGroupId": "SOMEAGID1234", "createdDateTime": "2013-01-17T14:08:16Z", "path": "PID|ABC|California|Monterey|Mikes Example Shop", "t": "location", "updatedDateTime": "2013-01-27T17:31:35Z", "urlEncodedPath": "PID%7CABC%7CCalifornia%7CMonterey%7CMikes%2520Example%2520Shop" } }
The following endpoints are deprecated. Alternate endpoints should be used because these endpoints will stop being supported in the future.
These end-points are used for managing Brand hierarchies
This endpoint is deprecated. Please use "/api/v2/brand/add-location/"
API endpoint to add a node to a Brand hierarchy.
POST/GET https://brand-analytics-api.vendasta.com/api/v2/node/create/
Parameter | Required? | Type | Multiples? | Notes |
---|---|---|---|---|
path
|
string
|
The address of a tree node. The path will be validated for any invalid whitespaces character for each node in the path i.e. Brand, Region, Location | ||
srid
|
string
|
A Reputation Intelligence account id. |
path
already exists or you have reached the maximum number of nodes."data": { "created": 4 }