Making an API call
When submitting a request to the Conjointly API to provide a service or information, the message sent is referred to as an API call. An API call is made up of four elements:
- The HTTP verb.
- The url and endpoint of your request.
- The header.
- The parameters.
HTTP verb
The Conjointly API uses standard HTTP methods to operate on each request.
HTTP Method / Action | Description |
---|---|
GET | Get a list of resources |
POST | Create a new resource |
PUT | Update or replace an existing resource |
PATCH | Update or modify an existing resource |
DELETE | Delete a resource |
Request URL
The Uniform Resource Locator (URL) and endpoint of a Conjointly API call depend on the specific call being made. The base URL for all API requests is api.conjoint.ly
, and the endpoint for each call is listed as route in respective API documentation. For example, launching a Market Test has the route /api/ocmr/launch
, resulting in the full URL of https://api.conjoint.ly/api/ocmr/launch
.
Header fields
A header ensures the Conjointly API understands what you are requesting and ensures you are getting the response you are expecting. Four common headers in the Conjointly API are:
Header | Description |
---|---|
Authorization: Bearer ${token} | This header authenticates the sender of the request and confirms that they have permission to access or manipulate the relevant data. |
Content-type | This header helps the server to identify the media type of the request body. In general, the Conjointly API specifies the content-type to be application/json . |
Accept | This header indicates which content types the client is able to understand. Similarly, the Conjointly API specifies it to be application/json in most cases. |
X-Requested-With | This header helps to store information about the creation of the request such as client information, method used. For instance, the XMLHttpRequest . |
Parameters
The Conjointly API requires all register parameters to be included in a JSON. All JSON parameters must be of type String but able to be converted in the required type.
Once that an API call is made to Conjointly, you can expect the return of one of the HTTP Status Codes that lets you know the request was either processed successfully or unsuccessfully.
Next
- Learn more about troubleshooting error codes