Partner API Documentation Help

API Quickstart

Prerequisites

Before you can start using the Anymaster Partner API, you need a partner account with API access rights. If you do not have an account yet, please reach out to Anymaster support to get one.

Authentication

Once you have a partner account, you can authorize via the API to get your API token. To do this, make a POST request to the /auth/authorize endpoint with your login and password in the body of the request:

{ "login": "your_login", "password": "your_password" }

Replace "your_login" and "your_password" with your actual login and password.

The server will respond with:

{ "status": "ok", "statusCode": 200, "data": { "token": "your_token", "user": { /* user data */ } } }

The token returned from the above call must be used for authentication in subsequent API requests. Simply include it in the header token of your requests.

Making Your First Request

Now that you have your API token, you can make a simple request to fetch the list of orders. Include your API token in the token header of your requests and make GET request to /order/list to get list of created orders.

Response Handling

All good Anymaster API responses represent in application/json and follow the same structure:

statusokstatusCode200data   ............

Successful requests will return "ok" for the status and a 200 for the statusCode. The data object contains the results of your request. For compactness, the following descriptions of method responses describe exactly data objects.

If an error occurs, you will have follow response structure with additional fields:

{ "name": "UnAuthorizedError", // of another error short name "message": "Unauthorized", // message about what's wrong "code": 401, // error code "type": "NO_RIGHTS", // type of error "statusCode": 401, "status": "error", "data": null }

API Usage Tips

  • Store your API token securely. It provides authentication to sensitive data.

  • Always check the 'statusCode' and 'status' fields in the response to ensure your request was successful.

  • Use error messages returned in status for troubleshooting.

Next Steps

You are now ready to explore more capabilities of the Anymaster Partner API. Refer to the detailed API documentation to understand more about available API endpoints, request parameters, and response formats.

Last modified: 09 February 2024