- URL Construction
- Sample Response
- Grouping Dimensions
Introductionback to top
Requests are made to the Data WareHouse using the GET method of the HTTP protocol. The default response format is XML, although JSON and CSV are also supported.
All requests require your clientId. You can find your clientId under the Account Profile section when you login to your GPN account.
The following endpoints are supported:
- campaignActivity - Retrieve data associated with your ads or links.
- order - Retrieve data associated with your sales.
- ledger - Retrieve data related to your commission and invoices.
URL Constructionback to top
Either campaignActivity, order or ledger depending on the data you are trying to access.
- Client Id
All requests require your clientId. You can find your clientId under the Account Profile section when you log in to to your GPN account.
Any combination of the dimensions supported by the endpoint. At least one dimension must be chosen.
At least one date range filter must supplied.
The results returned from a query may be sorted in ascending or descending order.
Refer to section on timezone for sample requests.
The results may be paged.
Sample Responseback to top
Retrieve all order data for the year 2019, filtered by USD currency, in JSON format.
In this example we are querying the order endpoint and grouping on the dimension date. We apply a date filter for the month of April. We append the '.json' to end endpoint to retrieve the data in JSON format.
The response is composed of the following fields:
The total number of records found.
The total for each of the measures associated with the endpoint. Each endpoint has its own set of measures.
A list of the dimensions used in the request.
The records array consists of the following object fields
An array of dimension information. In this example, the information available on the date dimension.
The total of the measures associated with the record.
Grouping Dimensionsback to top
For each of the endpoints grouping is mandatory. The grouping is specified by using the keyword 'group' as key in the query parameter
The api allows the user to make grouping on every available dimension or information. It allows also to group on multiple levels. To that purpose, use | to join groupings of information.
Retrieve all link data for the year 2019 using the dimension campaign and information name, filtered by USD currency.
Retrieve all order data for the year 2019 using dimensions order, campaign and deal, filtered by USD currency. This shows all orders for the year 2019 by campaign and permalink.
Filteringback to top
Filters are composed by combining the information available on dimensions. Filters are combined by using the & operator. If you have sales in more than one currency, it is recommended that you add a currency filter to the API call.
Retrieve all link data filtering for the year 2019, filtered by USD currency
|=||equals||Retrieve all link date for a date e.g.
|=!||not equals||Retrieve all link data except that of France e.g.
|=]||greater than||Retrieve all link data after a date e.g.
|=[||greater than or equal to||Retrieve all link data after a date but include the date e.g.
|=value[||less than||Retrieve all link data before a date e.g.
|=value]||less than or equal to||Retrieve all link data before a date but include the date e.g.
|*||like (only for String)||Retrieve all link data with link name like 'shopping' e.g.
|!*||not like (only for String)||Retrieve all link data with link name not like 'shopping' e.g.
Retrieve all link data for the year 2019 inclusive of the first and last day of the month, filtered by USD currency.
Sortingback to top
The endpoints allow you to sort the results on the available dimensions, information or measures. The usage of the character '-' before a sorting criteria, will reverse the order of the result for the query.
Retrieve all link data for the month of April 2019 sorted by the number of sales in descending order, filtered by USD currency.
Retrieve all link data for the month of April 2019 sorted by link type (FIXED, CAT, RSS, BOOKMARKLET), filtered by USD currency.
Paginationback to top
The endpoints support paging of results.
- pageSize - The number of records returned per page of results
- page - The page number (starts from 1)
Retrieve the top 10 links by sale count over the year 2019, filtered by USD currency.