Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

There are many reasons why you may choose to update a quota quantity. You can use the quota quantity to:

...

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:

  • PATCH PUT - Request 1

  • PUT PATCH - Request 2

  • DEPRECATED - Request 3

Request 1 (

...

PUT)

...

PATCH 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: 

Code Block
languagejs
[
  {
    "opbuyer_quota_id": "replaceqb30",
    "pathrequired_count": "/current_target"100,
    "valuecriteria": 171
  }
]

Response

Response Code

200

Response Body

Code Block
{
[{
   "quantities": {         "hasValidQuotas": true,         "isFlexible"qualification_code": true214,
        "minimum": 35,            "maximumcondition_codes": 35,[
        "flexibility": 0,         "number": 200,     "112"
   "percentage": 100,         "achieved": 0,      ]
  "remaining": 0,         "currently_open": 0,   }]
}

Response

...

Response Code

200

Response Body

Code Block
{
    "supbuyer_currentlyquota_openid": 0"qb30",
        "currentrequired_targetcount": 171
    }100,
    "countercriteria": [{
        "Buyer_side_In_Progress": 0,            "Buyerqualification_Survey_Startscode": 0214,
        "Buyer_Valid_Clicks": 0       },     "buyercondition_quota_idcodes": "qb30",[
    "marker": "",     "locked": false,     "criteria": [{...}],
    "crtd_on": 1611074478715,     "mod_on112":
 1611246548389,     "_id": "60070bae00d59f3155555e44",     "isActive": true,     "type": 0, ]
   "quotaCategory": "autoNested",     "quota_id": "d113426df-38de-3434-a69a-1734380f8d28",     "suppliers": {...}]
}

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: 

Code Block
languagejs
[
  {
    "buyer_quota_idop": "qb30replace",
    "required_countpath": 100"/current_target",
    "criteriavalue": [{171
  }
]

Response

...

Response Code

200

Response Body

Code Block
languagejson
{
    "quantities": {
          "qualification_codehasValidQuotas": 217true,
        "isFlexible": true,
          "condition_codesminimum": [35,
          "maximum": 35,
             "114flexibility": 0,
        "number": 200,
         ]"percentage": 100,
                }"achieved": 0,
           "remaining": 0,
    {                     "qualification_code"currently_open": 2140,
                    "condition_codes": [
          "sup_currently_open": 0,
             "111"
 "current_target": 171
                  ]
                },
                {
          "counter": {
         "qualification_codeBuyer_side_In_Progress": 2110,
                    "condition_codes"Buyer_Survey_Starts": [0,
                        "111"
                    ]
  "Buyer_Valid_Clicks": 0
             }]
}

Response

Response Code

200

Response Body

Code Block
},
     "buyer_quota_id": "qb30",
    "required_countmarker": 100"",
    "criterialocked": [{
  false,
                 "qualification_code"criteria": 217,
[{...}],
                   "condition_codes"crtd_on": [
  1611074478715,
                     "114"
                    ]
                }"mod_on": 1611246548389,
                {
                    "qualification_codeid": 214,
        "60070bae00d59f3155555e44",
           "condition_codes"isActive": [
    true,
                   "111"
                    ]
                },
                {"type": 0,
                    "qualification_code"quotaCategory": 211"autoNested",
                    "condition_codes": ["quota_id": "d113426df-38de-3434-a69a-1734380f8d28",
                        "111"
                    ]
                }]"suppliers": {...}
}

Request 3 [DEPRICATED]

...

Body: 

Code Block
languagejs
[{
    "op": "replace",
    "path": "/required_count",
    "value": 171
}]

Response

...

Response Code

200

Response Body

Code Block
{
    "ps_buyer_quota_id": "qb30",
    "required_count": 171
}

...