Conversion cap usage history
const url = 'https://restapi.affattr.com/v1/conversion-caps/history?cap_id=1';const options = {method: 'GET', headers: {'API-KEY': '<API-KEY>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url 'https://restapi.affattr.com/v1/conversion-caps/history?cap_id=1' \ --header 'API-KEY: <API-KEY>'Periods of the window of the cap in the range of from and to, the ones nothing was counted in with zeros and no segments. A segment is what the cap counted between two resets under one limit: an edit of the limit makes a new segment in the period, a reset or a change of the type, window or filters makes a segment with a new reset_at. used of a period sums its segments of the current limit type of the cap. An interval or total cap has one period, from and to do not apply to it. Rows counted under another window of the cap are not shown.
Authorizations
Section titled “Authorizations ”Parameters
Section titled “ Parameters ”Query Parameters
Section titled “Query Parameters ”Conversion cap id
Range start, unix seconds; default 48 hours, 30 days, 12 weeks or 12 months back
Range end, unix seconds; default and at most now
Responses
Section titled “ Responses ”Usage of the cap by periods
object
object
Currency is the application currency, the unit of a cost cap.
object
PeriodStart is null for the total window: it has a single period.
object
Current marks the segment the cap counts in now.
ResetAt is the reset the generation started with, null for the first generation.
Timezone is the zone the periods start in: the application timezone, UTC if it is unknown.
Example
{ "data": { "limit_type": "count", "periods": [ { "segments": [ { "limit_type": "count" } ] } ], "window": "hour" }}Bad request, a range of more than 1000 periods too
Example generated
exampleNo credentials (answered with 403 until default-deny is enabled)
Example generated
exampleInvalid credentials or no access
Example generated
exampleCap not found
Example generated
exampleInternal server error
Example generated
example