List CP codes
GET https://{{host}}/papi/v1/cpcodes?contractId={{contractId}}&groupId={{groupId}}
This operation lists CP codes available within your contract and group pairing. You assign CP codes to a property within its rule tree. To list all CP codes in your account at once, without having to filter the request by contracts and groups, use the CP Codes and Reporting Groups API. CP codes include information about their product assignment. When creating a new property, you need to apply the same product you specified for the assigned CP code.
To view or update certain CP code data, such as name, time zone, and purgeability, use the CP Codes and Reporting Groups API.
Request Params
Key | Datatype | Required | Description |
---|---|---|---|
contractId | string | (Required) Unique identifier for the contract. See ID prefixes for details on omitting the value's ctr_ prefix. | |
groupId | string | (Required) Unique identifier for the group. See ID prefixes for details on omitting the value's grp_ prefix. | |
accountSwitchKey | string | (Optional) For customers who manage more than one account, this runs the operation from another account. The Identity and Access Management API provides a list of available account switch keys. |
HEADERS
Key | Datatype | Required | Description |
---|---|---|---|
PAPI-Use-Prefixes | string | (Required) Enum Sets whether to represent ID prefixes in response data. Set to false when exchanging PAPI data with other APIs. | |
Accept | string |
RESPONSES
status: OK
{"accountId":"act_A-CCT5678","contractId":"ctr_C-0N7RAC71","cpcodes":{"items":[{"cpcodeId":"cpc_7651234","cpcodeName":"SME WAA","createdDate":"2015-03-02T15:06:13Z","productIds":["prd_Web_App_Accel"]}]},"groupId":"grp_32145"}