Start using the Backend REST APIs

Before integrating our backend REST APIs, read through the following information to help you get started:

Authentication

Authentication for all of our backend REST APIs occurs via HTTP Basic Authentication (Basic Auth). To generate a valid authorization header, pass your base64-encoded cleverbridge username and password in the authorization request header field, as shown in the following example:

curl --request POST \
  --url 'https://rest.cleverbridge.com/urlgenerator/generateusersessionurl' \
  --header 'accept: application/json' \
  --header 'content-type: application/json' \
  --header 'authorization: Basic xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' \
  --data '{
    "TargetUrl": "https%3A%2F%2Fwww.cleverbridge.com%2F864%2F%3Fscope%3Dcheckout%26amp%3Bcart%3D97771%26amp%3Blanguage%3Den%26amp%3Bcurrency%3DUSD%26amp%3Bx-source%3Dwebsite-visit-05.2019
  }'

Note

To use your username and password to authenticate, your cleverbridge user must have the following privilege - API User. For more information about user account privileges, see Users ✱.

Header Values

The most relevant REST request header values for our backend REST APIs are the following:

Field Name Description Example
Values
Usage
Comments
Accept Format of the function call response that is desired. application/json or application/xml Setting a value is required.
Content-Type Format of the request content. application/json or application/xml Required for POST but not for GET.

In the following example, the requested resource is a json object:

curl --request POST \
  --url 'https://rest.cleverbridge.com/urlgenerator/generateusersessionurl' \
  --header 'accept: application/json' \
  --header 'content-type: application/json' \
  --header 'authorization: Basic xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' \
  --data '{
    "TargetUrl": "https%3A%2F%2Fwww.cleverbridge.com%2F864%2F%3Fscope%3Dcheckout%26amp%3Bcart%3D97771%26amp%3Blanguage%3Den%26amp%3Bcurrency%3DUSD%26amp%3Bx-source%3Dwebsite-visit-05.2019
  }'

Status Codes

The following describes the status codes that result from successful and unsuccessful calls to our REST APIs.

Testing Your Connection

To test your connectivity with our backend REST APIs, use the Test Connection resource:

curl --request GET \
  --url https://rest.cleverbridge.com/connection/test \
  --header 'accept: application/json'

This resource validates that:

  • You can connect with rest.cleverbridge.com.
  • Your API user credentials (authentication) are valid.

Developer Guides

In the following guides, you can find additional information about each of the backend REST APIs, including descriptions of how to implement particular use cases:

Reference Documentation

In the following reference documentation, you can find request and response examples, an API explorer, and parameter definitions for each of the backend REST APIs: