Start using the Web-Browser REST API
Before integrating our web-browser REST API, the Pricing API, read through the following information to help you get started:
The Pricing API does not require authentication.
The most relevant REST request header values for our Pricing API are the following:
||Format of the function call response that is desired.||
||Setting a value is required.|
||Contact's language preferences, in order of priority.||
In this example, the requested resource is a
json object and the preferred languages are Swiss French, French, English and German, respectively:
curl --request GET \ --url 'https://pricingapi.cleverbridge.com/prices?client_id=864&product_id=97772&internalproduct_id=¤cy=USD&country=US&coupon=BD3-1KK-UN3&price_rule=' \ --header 'accept: application/json' \ --header 'accept-language: fr-CH, fr;q=0.9, en;q=0.8, de;q=0.7, *;q=0.5'
The following describes the status codes that result from successful and unsuccessful calls to our REST APIs.
All cleverbridge REST-based APIs use conventional HTTP response codes to indicate success or failure of an API call. In general:
- Codes in the 2xx range indicate that the function call was successful.
- Codes in the 4xx range indicate an error that resulted from an incorrectly specified request (for example, a required parameter was missing or the data type passed in a parameter was incorrect).
- Codes in the 5xx range indicate an error on the cleverbridge side.
|200||Successful completion of the call.|
|400||Bad Request (incomplete message, required fields missing, incorrectly formatted XML/JSON).|
|401||Unauthorized Request. Authentication with cleverbridge failed (ID/password problem). Not applicable to Pricing API.|
|402||Request failed: Invalid parameters.|
|404||Not Found: The other unique identifier (for example, the subscription ID) set and passed in the call is invalid or does not exist.|
|500||Request failed due to server error.|
Upon calling an API endpoint, check the HTTP header status code.
- If the status code is 200, then the call was successful (and the
ResultMessagefield in the response is blank).
- In case of a non-200 status code, the
ResultMessagecontains more information to assist in diagnosis and error handling. For example:
- With a 404 status code, the
ResultMessagecould contain “Item not found.”
- With a 400 status code, the
ResultMessagecould contain “Missing required field.”
To guarantee a stable and reliable performance of our platform, cleverbridge places limits on the amount of data that can be consumed. API users are limited to a maximum of 150 requests per second from an IP address or range. All API requests count towards the rate limit.
When an individual IPv4 address or IPv6/64 IP range exceeds the per-second request limit, further requests to our API are blocked with an HTTP 429 status code until the block time has expired. This happens after one minute. The HTTP response contains a
Retry-After header to indicate when you can resume sending requests.
HTTP/1.1 429 Too Many Requests Content-Type: text/html Retry-After: 60
The most likely cause of an
HTTP 429 Too Many Requests error is that you perform a batch operation that sends multiple API requests in parallel. To avoid reaching the rate limit with batch operations, observe the following best practices:
- Send API requests in serial and not in parallel, that is the next call included in the batch operation cannot be made until the current call is completed.
- Limit concurrent threads that make requests (across all processes and machines) to a maximum of four.
In the following guide, you can find additional information about the Pricing API, including descriptions of how to implement particular use cases:
In the following reference documentation, you can find request and response examples, an API explorer, and parameter definitions for each of the back-end REST APIs: