Example API call - API tool


Using API tools is an easy way to get started with a new API, making it easy to test different calls to see the results. The following sections illustrate how to make and test an API call to launch a Market Test experiment, using one of the most common API tool – Postman.

Example of launching a market test for card game

  1. Select the desired method from the dropdown menu. In this example, we will use POST for the API call.
  2. Insert the full URL of the request. In this example, it is https://api.conjoint.ly/api/ocmr/launch.
  3. Navigate to Authorization and select Bearer Token from the dropdown menu. On the right pane, make sure you include a valid Conjointly API token.
  4. Navigate to Headers and ensure all the required headers are included.
  5. Navigate to Body and include the register parameters. To do this, select raw and make sure JSON is selected. Then, paste the query.
{
    "type": 'product-name-test'
    "stimuli": ["Arrizo","Mirai","Baccarat","Philomene","Efris"] 
    "productType": "Card game" 
    "description": "A new type of card game, to be played with groups of friends"
}
  1. Click Send to complete the API call.
  2. The bottom panel will return the status code of the API call. In the example, the call status is 201 created and the jobid 696035 is created.
Example of launching a market test for card game

Let’s follow another example to find out more about the status of the job we just created.

Example of checking the job status

  1. Open a new request.
  2. Select GET from the dropdown menu and insert the URL. For this example, it will be https://api.conjoint.ly/api/jobs/{jobId}/get, where {jobId} matches the id created in the above example, 696035.
  3. Make sure you include the valid token in authorization.
  4. Click Send to complete the API call.
  5. The bottom panel will return the status code of the API call. In the example, the job status contains an error message of insufficient balance.
Example of checking the job status