Skip to content

Conversion cap usage history

GET
/v1/conversion-caps/history
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.

cap_id
required
integer

Conversion cap id

from
integer

Range start, unix seconds; default 48 hours, 30 days, 12 weeks or 12 months back

to
integer

Range end, unix seconds; default and at most now

Usage of the cap by periods

Media type application/json
object
data
object
app_id
integer
cap_id
integer
currency

Currency is the application currency, the unit of a cost cap.

string
limit_type
string
Allowed values: count cost
periods
Array<object>
object
over
integer
period_start

PeriodStart is null for the total window: it has a single period.

string
segments
Array<object>
object
current

Current marks the segment the cap counts in now.

boolean
limit
number
limit_type
string
Allowed values: count cost
over
integer
reset_at

ResetAt is the reset the generation started with, null for the first generation.

string
used
number
used
number
timezone

Timezone is the zone the periods start in: the application timezone, UTC if it is unknown.

string
window
string
Allowed values: hour day week month interval total
Example
{
"data": {
"limit_type": "count",
"periods": [
{
"segments": [
{
"limit_type": "count"
}
]
}
],
"window": "hour"
}
}

Bad request, a range of more than 1000 periods too

Media type application/json
string
Example generated
example

No credentials (answered with 403 until default-deny is enabled)

Media type application/json
string
Example generated
example

Invalid credentials or no access

Media type application/json
string
Example generated
example

Cap not found

Media type application/json
string
Example generated
example

Internal server error

Media type application/json
string
Example generated
example