Ratecards

This API returns all rates in the system, along with specific product data as well

The POST /api/ad/rates/all endpoint will basically return everything that I am selling within the system, with several parameters available for filtering. This could take a long time to return data depending on how large a query you do, so it may need to be run in Postman or other API utility as Swagger will eventually time out if the query is large.

Like the other APIs Swagger will display the expected results values at the top in the "Example Values" box. This is a huge list of datapoints getting returned.

The Parameters which can be passed in here are as follows:

**Known limitation currently - I will remove this when it gets changed - IncludeRatecardData can be set here are true OR false and the same data will be returned. It is forced currently to always return ratecard data.

Since this is a rather large data return, I will break it down for you a bit here. Depending on if your input for "IncludeProductData" is set to true the amount of data may differ, but if you are including everything this is what you should expect. For display purposes, some of the data has been collapsed.

This is the Payload passed in (just 2 days worth of issues here, so that the data set would be a little smaller for demo purposes:

The data returned includes the following details, highlighted with arrows below.

  1. Query was for ABC Product Group so I see that group at the first arrow

  2. The products returned with the group (two shown below with others collapsed to save space in the screenshot) are products which have valid issue dates in the start/end period passed in and includes rate cards which are valid in the start/end period passed in.

  3. After the Product array for ABC Group is a ratecard array for the GROUP Ratecards for the Product Group ABC.

  4. And finally, the entire Product Group repeats for the DEMO Product Group - while the Demo product group was not specifically passed in in the payload, several products in the ABC Product Group have a primary product group of "DEMO" so that is why we are seeing that.

If product details are true in the payload, then the details at the top of this screenshot will be displayed. Restricted Ad Types and Sizes are arrays which will repeat for each of the AdTypes and Sizes which are allowed on the product. Closing Override is also an array which will repeat for each closing override configured on the product. If this is a print or issue based product, the Issue Dates will be repeated for every issue in the Start and End Dates provided in the payload.

Product Ratecards are returned within the "Products" array, along with the related product. There is an additional array after products within the Product Group. This will be blank, as shown below for the Demo product group, if there are no product GROUP ratecards, if there are no product group ratecards which are valid during the provided date range, or if a product group ID was not passed in in the payload.

Below is a table of the parameters which can be included in the payload and a brief description of each. All fields are technically optional, but it is advisable to at least start with a small date range and some sort of filter on the Products/Product Groups until you are comfortable with the volume of data that will be getting returned.

Parameter
Description

StartDate

The start date is the beginning of the query period. This will control issue dates returned in the product details and also rates that were valid during that date range

EndDate

Working in conjunction with the Start Date above this will be the ending of the query period. Both should be formatted as yyyy-mm-dd

ProductGroupIDs

This is an array of Product Group ID's which should be returned in the query. Multiple product Groups should be comma separated

ProductIDs

This is an array of Product ID's which should be returned in the query. Multiple products should be comma separated. Example:

AdTypeIDs

This is an array of Ad Type ID's which should be returned in the query. Multiple AdTypes should be comma separated.

SizeIDs

This is an array of Size ID's which should be returned in the query. Multiple sizes should be comma separated.

SectionIDs

This is an array of Section ID's which should be returned in the query. Multiple sections should be comma separated.

PositionIDs

This is an array of Position ID's which should be returned in the query. Multiple positions should be comma separated.

FormatIDs

This is an array of Format ID's which should be returned in the query. Multiple formats should be comma separated.

IncludeRatecardData

FUTURE FUNCTIONALITY — DOESN'T CURRENTLY CHANGE OUTPUT IF THIS IS TRUE OR FALSE. TRUE is always assumed here. AD2-9889

IncludeProductData

Set this to True to include product data in the results. If this is set to false, there will still be a product array in the result, but much of the data details will be stripped from it.

Was this helpful?