Introduction to UseResponse RESTful API

General Information

UseResponse is a complex platform to support customers and social CRM but if you use other systems for project management, invoicing, billing, hosting, you can enhance your experience with customers by integrating our Restful API into your platform.


When making RESTful API requests you need to be prepared to handle returned HTTP response codes


API Basics

With UseResponse API you can use following REST commands over HTTP using JSON: POST, GET. PUT, DELETE.

All requests should be done to your platform (resource URL) preferably using the https protocol. Make sure to use cURL to make requests, SDK or from your command line. 

Here is how we refer to the specific resource:

GET /api/3.0/users/search.json

It means that you need to prepend your custom domain before the request that is similar to the example below:

https://mydomain.useresponse.com/api/3.0/users/search.json

You can get the domain name from your user profile in the API Settings that are under Options.

All requests are done in JSON format. Examples of requests and responses are stated in each section of the documentation. 

Authentication and Tokens

In order to make any requests to UseResponse API, you'll need to authorize your requests by providing a valid API key. If guest API is available, you can make requests without providing any API Key.

But first, you need to enable Restful API in Administration » Applications where you can manage the API settings. You have the ability to turn off API, use guest API, and set permissions to use it only for specific admins and agents.

To fetch the data, you need to have permissions that are defined by the agent team in the system. For example, if you'll use guest API, you would get only those information, that is available to guests in the community.

API Keys could be taken and regenerated at User Profile - Options - API Settings. You can also turn off keys for specific users.

There is also option to set trusted domains in the settings in order to allow making api requests only from specific hosts.

Sample of GET request made with API key using cURL
curl -i -H "Accept: application/json" -H "Content-Type: application/json" -X GET https://domain.com/api/3.0/users/search.json?apiKey=<your_api_key>&role=user

Pagination

By default, the returned number of records per page could be 50. You can change the number of retrieved records with COUNT parameter. 

GET /api/3.0/users/search.json?page=1&count=30

The returned request will include the total number of objects, objects per page, number of pages (first, next, last)

Response Codes

Success or error codes returned by UseResponse API would give you an explanation about the status of your request in case you'll experience any issues:

Code Status Description
200 OK Successful request.
204 No Content   Request is successful, but no results were found
400 Bad Request Invalid request and/or request parameters
401 Bad Authentication Data Authentication is required in order to retrieve data. Either invalid api key or wrong format of api key
403 Forbidden API request is prohibited due to lack of permissions
404 Not Found When the requested resource is not found (resource doesn't exist or 401/403 security error codes are returned). For example, API request was made on invalid URL.
405 Method Not Allowed The requested method is not allowed. For example, API request was made using DELETE method, but resource accepts GET or POST only.
409 Conflict Whenever a resource conflict would be caused by fulfilling the request or duplicated entries
500 Internal Server Error The general catch-all error when the server-side throws an exception
503 Service Unavailable API interface unavailable or disabled

API Clients - SDK

API client on PHP will help you quickly implement UseResponse API and optimizes working with data using ready methods to work with tickets, topics, users, etc.

The client could be added using a composer or as standalone autoloader.

The archive also includes examples of making typical API requests in order to understand how it works located at /src/Sdk/Examples.

Is this article helpful?
6 1 6