Introduction
ANSCER Robot UI offers a range of capabilities you can access through the REST APIs. Each robot runs its own Robot UI server, and its REST APIs are designed in accordance with OpenAPI standards, which ensure that the robot's features can be integrated with other applications and systems such as WMS, MES or ERP. By utilizing these APIs, you can tap into the robot's capabilities through programmatic methods. To run missions and follow their state from a third-party tool, see 3rd Party Integration.
Paths
Every API's URI has the prefix of the version and the resource, such as: /api/v1/...
Each robot serves the APIs on port 5015, such as: http://<robot-ip>:5015/api/v1/...
Authentication
ANSCER Robot UI supports bearer token user authentication:
Bearer Token
ANSCER Robot UI uses bearer tokens to provide secure API authentication and authorization. Sign in once with a Robot UI username and password to get a token, then use the token in individual API requests in order to authenticate and authorize the request. The token is passed as part of the HTTP request header and in the following format:
- Key: Authorization
- Value:
Bearer <token>, where<token>is thetokenreturned by Sign in and get an API token. E.g.Bearer abc123...
curl --location --request \
POST 'http://<robot-ip>:5015/api/auth/sign-in/username' \
--header 'Content-Type: application/json' \
--data '{"username": "<username>", "password": "<password>"}'
Accounts are created by an administrator in the Robot UI under Settings → User Management, with access granted per feature. Self sign-up is disabled.
Requests
All requests to ANSCER Robot UI's API should be in the JSON format. When making requests, ensure that you adhere to the following guidelines:
HTTP Methods
The ANSCER Robot UI API supports the following HTTP methods for making requests:
| HTTP Method | Description |
|---|---|
| GET | Use the GET method to retrieve information or data from the API. GET requests are typically used for reading or querying data. |
| POST | Employ the POST method to create new resources or submit data to the API. For example, use POST to create new Maps/Waypoints/Missions. |
| PUT | Utilize the PUT method to update or replace existing resources. PUT requests are used to modify data. |
| DELETE | Employ the DELETE method to remove resources from the API. DELETE requests are used to delete records or data. |
Response Codes
The API returns standard HTTP response codes:
| HTTP Code | Description |
|---|---|
| 200 | Request succeeded. The response payload will vary depending upon the API. Refer to the respective API response schema. |
| 400 | Bad request. The request does not adhere to the API request payload schema. |
| 401 | Missing authorization token or invalid authorization token. |
| 403 | The API operation is forbidden for the user. |
| 404 | The resource or the dependent resource is not found for the operation. |
| 500 | Operational error. The server responds with an error message. |
| 503 | The robot's control system is not connected. Retry later. |
Request Headers
When sending requests to the ANSCER Robot UI API, include the following headers to ensure proper communication:
Content-Type: Set the
Content-Typeheader toapplication/jsonto indicate that the request payload is in JSON format.Authorization: Include an
Authorizationheader with the valueBearer <token>.
Request Parameters
Requests to ANSCER Robot UI's API may require specific parameters to be included in the request payload or query string. The required parameters vary depending on the API endpoint and the nature of the request. Refer to the API documentation for each endpoint to understand the required parameters for specific operations.
Example Request
Here's an example of a GET request to retrieve the saved missions from the API:
curl --location --request \
GET 'http://<robot-ip>:5015/api/v1/missions/all' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer abc123...'
Example Response
Here's an example of a response of the GET request from the API:
{
"success": true,
"message": "Missions fetched successfully",
"data": {
"missions_json": "[{\"id\":\"1700000000001\",\"name\":\"example_mission\", ...}]"
},
"status": 200
}
If you do not provide the Authentication token, you will get the following error:
{
"success": false,
"message": "Unauthorized",
"data": null,
"status": 401
}