Edit the quantity of a quota using PUT or PATCH
There are many reasons why you may choose to update a quota quantity. You can use the quota quantity to:
limit traffic to a quota
increase traffic to a quota
stop traffic to a quota
update quota quantities so that the remaining quantity is consistent with your system’s remaining quantity
You may update the quota quantity to any value greater than or equal to 0. If the new quantity is less than or equal to the quantity fielded, this quota will not receive any traffic.
In our system we have 2 parameters that helps to limit the traffic to a quota:
required_count
current_target
We use the first one (required_count
) to limit the quota and we can change it via the request 1. This is the max value on completes that will reach the quota.
We use the second one (current_target
) to monitor and limit the quota and the value can never be bigger than required_count
. Here the rule:
current_target
<=required_count
REST API versions:
PUT - Request 1
PATCH - Request 2
DEPRECATED - Request 3
Request 1 (PUT)
PUT $apihost/$basepath/surveys/7654/quotas/qb30
($apihost is the environment against which you are testing, and $basepath is the base path with the api version. All Buy API calls will require access-token parameter in the header)
Body:
{
"buyer_quota_id": "qb30",
"required_count": 100,
"criteria": [{
"qualification_code": 214,
"condition_codes": [
"112"
]
}]
}
Response 1 (PUT)
Response Code
200
Response Body
{
"buyer_quota_id": "qb30",
"required_count": 100,
"criteria": [{
"qualification_code": 214,
"condition_codes": [
"112"
]
}]
}
Request 2 (PATCH)
PATCH $apihost/$basepath/surveys/7654/quotas/qb30
($apihost is the environment against which you are testing, and $basepath is the base path with the api version. All Buy API calls will require access-token parameter in the header)
Body:
[
{
"op": "replace",
"path": "/current_target",
"value": 171
}
]
Response 2 (PATCH)
Response Code
200
Response Body
Request 3 [DEPRICATED]
Body:
Response 3 [DEPRICATED]
Response Code
200
Response Body