Contract API Resources

The Contracts API provides information about Akamai contracts as well as the products included in those contracts. With this API, you have the option of retrieving product information for a specified time frame by either contract ID (contractId) or reporting group (reportingGroupId).

API Summary

Operation Method Endpoint
Contracts   (download RAML)
List Contracts GET /contract-api/v1/contracts/identifiers{?depth}
List Products per Contract GET /contract-api/v1/contracts/{contractId}/products/summaries{?from,to}
Reporting Groups   (download RAML)
List CP Code Reporting Groups GET /contract-api/v1/reportingGroups/
List CP Code Reporting Group IDs GET /contract-api/v1/reportingGroups/identifiers
List Products per Reporting Group GET /contract-api/v1/reportingGroups/{reportingGroupId}/products/summaries{?from,to}

List Contracts

Get the list of contracts that a user has access to.

GET /contract-api/v1/contracts/identifiers{?depth}

Sample: /contract-api/v1/contracts/identifiers?depth=TOP

Parameter Type Sample Description
Optional Query Parameters
depth Enumeration TOP Returns a specific set of contracts. Select TOP to return only parent contracts or ALL to return both parent and child contracts.

Status 200 application/json

Response Body:

[
    "1-3CV382",
    "1-6T5ZND"
]

List Products per Contract

Get the IDs and names of the products associated with a contract for the time frame selected.

GET /contract-api/v1/contracts/{contractId}/products/summaries{?from,to}

Sample: /contract-api/v1/contracts/2–4DW493/products/summaries?from=2015–01–31&to=2016–03–31

Parameter Type Sample Description
URL Parameters
contractId String 2–4DW493 The unique identifier for a contract.
Optional Query Parameters
from String 2015–01–31 The start date, in UTC, to use when looking for products associated with a contract. The search always begins at midnight (0:00) UTC of the specified date. The default start date is 30 days prior to the current date. For current contracts, you can select a date within the past 15 months of the current date. For expired contracts, you are limited to a date range of 30 days within the 15 month window.
to String 2016–03–31 The end date, in UTC, to use when looking for products associated with a contract. The search always ends at 23:59:59 UTC of the specified date. The default end date is the current date.

Status 200 application/json

Response Body:

{
    "products": {
        "contractId": "1-2RBL",
        "marketing-products": [
            {
                "marketingProductName": "Access Control - All Streaming Delivery",
                "marketingProductId": "B-3-96NY56"
            },
            {
                "marketingProductName": "Site and Visitor Intelligence",
                "marketingProductId": "B-3-A5ME5"
            },
            {
                "marketingProductName": "All Streaming Delivery",
                "marketingProductId": "B-4-1O78TS"
            }
        ]
    }
}
  1. Run the List Contracts operation and store the value as contractId.

  2. Optionally, set the earliest time from which you want to list records.

  3. Optionally, set the latest time to which you want to list records.

  4. Make a GET request to /contract-api/v1/contracts/{contractId}/products/summaries{?from,to}.

List CP Code Reporting Groups

Get the IDs of the Content Provider (CP) reporting groups that you have access to along with their names. To run this operation, your user account needs the CPCode Rep Group role. To add this role, use the Manage Users and Groups application.

GET /contract-api/v1/reportingGroups/

Status 200 application/json

Response Body:

[
    {
        "id": 12289,
        "name": "foo.com group"
    },
    {
        "id": 139267,
        "name": "*.example.com"
    },
    {
        "id": 139268,
        "name": "images traffic group"
    },
    {
        "id": 7182,
        "name": "www.bar.com"
    },
    {
        "id": 13844,
        "name": "Radio and Streaming"
    },
    {
        "id": 130221,
        "name": "All Mini Country sites"
    }
]

List CP Code Reporting Group IDs

Get the IDs of the Content Provider (CP) reporting groups that you have access to. To run this operation, your user account needs the CPCode Rep Group role. To add this role, use the Manage Users and Groups application.

GET /contract-api/v1/reportingGroups/identifiers

Status 200 application/json

Response Body:

[
    503,
    999,
    201
]

List Products per Reporting Group

Get the IDs and names of the products associated with the reporting group for the time frame selected. To run this operation, your user account needs the CPCode Rep Group role. To add this role, use the Manage Users and Groups application. When a request is successful, it may return either a 200 or a 300 response. The API returns a 200 (OK) response when the CP code reporting group is associated with only one contract. You’ll receive a 300 (Multiple Choices) response when the request returns a list of matching contracts because the CP code reporting group is associated with multiple contracts. To retrieve product information when you receive a 300 response code, make a new GET request to the hyperlinks provided in the response.

GET /contract-api/v1/reportingGroups/{reportingGroupId}/products/summaries{?from,to}

Sample: /contract-api/v1/reportingGroups/1001/products/summaries?from=2015–01–31&to=2016–03–31

Parameter Type Sample Description
URL Parameters
reportingGroupId Number 1001 The unique identifier for a Content Provider (CP) code reporting group.
Optional Query Parameters
from String 2015–01–31 The start date, in UTC, to use when looking for products associated with a contract. The search always begins at midnight (0:00) UTC of the specified date. The default start date is 30 days prior to the current date. For current contracts, you can select a date within the past 15 months of the current date. For expired contracts, you are limited to a date range of 30 days within the 15 month window.
to String 2016–03–31 The end date, in UTC, to use when looking for products associated with a contract. The search always ends at 23:59:59 UTC of the specified date. The default end date is the current date.

Status 200 application/json

Response Body:

{
    "products": {
        "contractId": "1-2RBL",
        "marketing-products": [
            {
                "marketingProductName": "Access Control - All Streaming Delivery",
                "marketingProductId": "B-3-96NY56"
            },
            {
                "marketingProductName": "Site and Visitor Intelligence",
                "marketingProductId": "B-3-A5ME5"
            },
            {
                "marketingProductName": "All Streaming Delivery",
                "marketingProductId": "B-4-1O78TS"
            }
        ]
    }
}

Status 300 application/json

Response Body:

{
    "contracts": [
        {
            "href": "/contract-api/v1/contracts/3-ZQ0H6H/products/summaries",
            "contractId": "3-ZQ0H6H"
        },
        {
            "href": "/contract-api/v1/contracts/3-1EBV5F/products/summaries",
            "contractId": "3-1EBV5F"
        },
        {
            "href": "/contract-api/v1/contracts/3-XC1A0F/products/summaries",
            "contractId": "3-XC1A0F"
        }
    ]
}
  1. If your user account needs the CPCode Rep Group role, use the Manage Users and Groups application to add it.

  2. Run the List CP Code Reporting Group IDs operation and store the reportingGroupId.

  3. Store the reportingGroupId.

  4. Optionally, set the earliest time from which you want to list records.

  5. Optionally, set the latest time to which you want to list records.

  6. Make a GET request to /contract-api/v1/reportingGroups/{reportingGroupId}/products/summaries{?from,to}.


Last modified: 11/10/2017