Testing Using Postman

It is far more efficient to test your ClearProcess APIs in an API client like Postman. Once you have perfected your APIs, you can then easily add them to a ClearWork page or any other system capable of REST integration. Download it to start testing.

Logging In

After you have downloaded Postman, the first thing you need to do is create a session with your Clear instance to obtain a CSRF token. Create a new scenario called Log In and enter the following on the Headers tab:

  • POST – enter https://your-subdomain.clearui.com/clearui/login/. If you don’t know your subdomain, contact your Clear administrator.
  • Content-Type – enter application/json
  • Accept – enter application/json
  • Referer – enter https://your-subdomain.clearui.com/

Click on the Body tab and enter your username and password as a JSON object, then click the Send button:

The response will contain a CSRF token. Copy this token to use in your API testing:

Testing an API

Create a new scenario that matches the name of your ClearProcess API. Click on the Headers tab and enter the following:

  • POST – enter https://your-subdomain.clearui.com/clearui/rpc/
  • Content-Type – enter application/json
  • Accept – enter application/json
  • X-CSRFToken – paste the token value from the previous step (Logging In)
  • Referer – enter https://your-subdomain.clearui.com/

Click on the Body tab and enter the following, the click the Send button:

  • api – the name of the ClearProcess API you wish to test
  • parameters – the JSON data you wish to pass to the API. These appear in ClearProcess with the prefix “user_parameters”

The response will display:

“CSRF Failed: CSRF token missing or incorrect.”

You will get this message when:

  1. Your session has expired and you need to log in again. Your Clear administrator controls the session length and it can range from 15 minutes to 2 weeks.
  2. Your cookies have multiple CSRF tokens. Be sure to clear your cookies if the first step does not solve your problem.