Overview

This API user guide was developed to provide clients with a detailed overview of the most recent version of the vCE API and to help them with the transition from previous versions to the new v3 API. The new API allows for clients to pull all of their vCE reporting regardless of country and methodology version. The User Guide documents a basic overview on how to get started with the vCE API, the benefits of the new API, testing and workflow of the API, common reporting terms used with the API, an overview of the API calls, and an FAQ section with common client questions. The User Guide along with the Help Page can be referenced to get started with integrating the vCE API into your systems, but if you have any additional questions please reach out to your comScore representative. Please check back for new versions of the API User Guide as we add additional API calls or make API changes.
GET
Used to retrieve a resource from the endpoint. Returns 200 OK.
POST
Used to create a resource at the current endpoint. Returns 201 Created + location header.
PUT
Used to update a resource at a specific endpoint. Returns 200 OK.
DELETE
Used to delete a resource at a specific endpoint. Returns 200 OK.
400 BAD REQUEST
Bad Request, the request was invalid.
403 FORBIDDEN
You do not have access to the requested resource.
404 NOT FOUND
We could not locate the requested resource.
405 METHOD NOT ALLOWED
The request method is not supported at the requested resource.
408 REQUEST TIME OUT
The request has timed out. Please retry your request.
409 CONFLICT
The request conflicts with an existing resource.
415 UNSUPPORTED MEDIA TYPE
An incorrect "Content-Type" or no "Content-Type" has been defined for the call. Supported ContentTypes are:
  • application/json
  • text/xml
  • multipart/mixed
500 INTERNAL SERVER ERROR
Internal Server Error. We're actively investigating.
501 Not Implemented
The server either does not recognize the request method, or it lacks the ability to fulfill the request. Please check that the HTTP Verb used is of the supported types.
503 SERVICE UNAVAILABLE
The server is currently unavailable (because it is overloaded or down for maintenance). Please retry your request again later.
INSERTED
The Job was successfully inserted into queue and is awaiting action by the Job Processor.
UPDATED
The Job has been updated and is awaiting action by the Job Processor.
HOLDING
The Job has been put on hold and will be ignored by the Job Processor.
PREPARED
The Job has been identified in queue and prepared for processing.
PROCESSING
The Job has been picked up and is currently being processed.
COMPLETED
The Job has been completed and awaits no further action.
ERRED
There was an error in the handling of this Job. We're investigating.
DELETED
The Job has been deleted and awaits no further action.
DATE
"MM-dd-yyyy".   Example: "05-01-2014"
DATE TIME
"MM-dd-yyyy hh:mm:ss tt".   Example: "05-01-2014 12:00:00 AM"

Authorization Header

You must use the Authorization header to send the server authentication credentials.

The Authorization header is constructed as follows:
1. Username and password are combined into a string "username:password"
2. The resulting string literal is then encoded using the RFC2045-MIME variant of Base64, except not limited to 76 char/line
3. The authorization method and a space i.e. "Basic " is then put before the encoded string.

For example, if the user agent uses 'Aladdin' as the username and 'open sesame' as the password then the header is formed as follows:

Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==

Content Type

You must supply a Content-Type header on PUT and POST operations. This can be application/json or text/xml.

Example:

  • Content-Type: application/json

Accept

You must set an Accept header on all requests. This can be application/json, text/xml, multipart/mixed, text/csv or text/tsv (text/csv and text/tsv can only be used in Get Result endpoint of Reporting Jobs). You may get a text/plain response in case of error, e.g. in case of a bad request, you should treat this as an error you need to take action on.

Example:

  • Accept: application/json

Reporting Jobs

For the Get Result endpoint you must set the Accept header to the same Media Type defined in the Reporting Job. If the reporting job doesn't have a Media Type defined, then it will default to application/json and Accept should be provided with application/json.

Compression

You can specify a Compression algorithm to improve the data transfer. This must be set in the Content-Encoding header. Supported Compression Algorithms are:

  • gzip
  • deflate

Sample Compression


var request = new HttpRequestMessage(HttpMethod.Get, baseAddress + "clients/11223344/jobs/reporting/123456789/result");
request.Headers.Authorization = GetAuthentication();
request.Headers.Add("Accept", new List {"text/csv"});
request.Headers.Add("Content-Encoding", new List {"gzip"});
                                       
var result = client.SendAsync(request).Result;
var streamProvider = result.Content.ReadAsByteArrayAsync();
var decompress = Decompress(streamProvider);
var response = Encoding.ASCII.GetString(decompress);

Batching is a web API feature that allows a customer to pack several API requests and send them to the web API service in one HTTP request and receive a single HTTP response with the response to all their requests.

Request

The maximum number of requests for a single call is 1000, and the maximum request length is 10 MB.

Supported ContentTypes are:

  • Multipart/mixed
  • Application/json

Sample multipart/mixed


var batchRequest = new HttpRequestMessage(HttpMethod.Post, baseAddress + "/batch")
{
    Content = new MultipartContent("mixed")
    {
        new HttpMessageContent(new HttpRequestMessage(HttpMethod.Post,
            baseAddress + "clients/11223344/jobs/reporting/KeyMetrics"))
    }
};

batchRequest.Headers.Authorization = GetAuthentication();
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("multipart/mixed"));

Sample application/json

Request Description

Parameter Type
Id Int32
To String
Body String (json)
Method String

Response

The response is a list of individual responses. Each response will be of BatchResponse type and it will have the request Id, code status, headers, body. If a request returns an error, this will be displayed in the BatchResponse.body. The status code for this response will also be displayed in the BatchResponse.code.

Supported Accept headers are:

  • Multipart/mixed
  • Application/json

Multipart/mixed


--2bb99265-6ef5-4372-be45-68dd92ca8e4a
Content-Type: application/http; msgtype=response

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

{
  "data": {
    "message": "OK"
  },
  "url": "http://.../v3/health"
}
--2bb99265-6ef5-4372-be45-68dd92ca8e4a
Content-Type: application/http; msgtype=response

HTTP/1.1 400 Bad Request
Content-Type: application/json; charset=utf-8

{
    "error": {
        "code": 400,
        "error": "BadRequest",
        "message": "We have found errors trying to process your request.",
        "details": []
    },
    "url": "http://.../v3/clients/11223344/jobs/reporting/KeyMetrics"

}
--5394c015-cfaf-4b61-9ccd-22bf97faa47e--
                                     

Application/json

Response Description

Parameter Type
Id Int32
Headers {{batch.sampleDictionary}}
Body Object
Code Int16
Message String
Filter:

{{apiDoc.itemName}}

{{endpoint.action}}
{{endpoint.path}}
Description
{{endpoint.description}}
Parameter Type Source
{{parameter.name}} {{parameter.type}} {{parameter.source}}
{{endpoint.modelName}} Description
* Indicates a Required parameter.
Parameter Type
{{inputDetail.type}}
{{sample.type}}