Bacloud API (1.0)
In order to use the API you need an access token.
Sign in into the Bacloud client area using your user credentials.
Choose an API Management.
Press Create API client and then on Action menu click Generate API tokens.
Make sure to copy both the Access Token and the Refresh Token because it won’t be shown to you again.
Alternatively, you can generate both the Access and the Refresh tokens by using Access Tokens -> Generate token endpoint.
To order services using the API, you must have enough money in a credit balance on your Bacloud account. If your credit balance is too low, the service won't launch automatically. In that case, you have to add money to your balance and pay the invoice manually in the Bacloud client area.
You can check your credit balance using an API endpoint /v1/billing/credit.
Some endpoints support pagination. If they support pagination, it can be controlled with the page and per_page query parameters.
page - The page number to retrieve. Defaults to the first page which is 1.
per_page - The number of items to retrieve per page. Defaults to 25. Maximum value is 100 unless stated otherwise.
Details of pagination can be found in the response body meta object, pagination key.
Pagination response contains the following keys:
page- current page (number);perPage- number of items per page (number);firstPage- first page (number), usually 1.;prevPage- previous page (number). Can be null if you are on the first page;nextPage- next page (number). Can be null if you are on the last page;lastPage- last page (number).;totalItems- total number of items (number);
Along with the HTTP methods that the API responds to, it will also return standard HTTP statuses, including error codes.
In the event of a problem, the status will contain the error code, while the body of the response will usually contain additional information about the problem that was encountered.
Responses in the 200 range indicates that the request was successful and no errors were encountered.
Responses in the 400 range indicates that there is an issue with the requests and it should be changed before trying it again. It will usually contain the message describing what went wrong.
Responses in the 500 range indicates the server-side problem. In that case the issue is on our end and the request was not completed.
Possible responses:
| Response | Description |
|---|---|
| 200 OK | The request was successful. |
| 201 Created | The request was successful and a new resource was created. |
| 202 Accepted | Your request was accepted and a resource was updated. |
| 204 No Content | Your request succeeded, there is no additional information returned. |
| 400 Bad Request | The request could not be completed due to a malformed request of wrongly used endpoint. |
| 401 Unauthorized | The request could not be completed due to an invalid authentication credentials. This response is possible at all endpoints except for /v1/token/generate and /v1/token/refresh. |
| 403 Forbidden | You are not allowed to access the requested resource. This response is possible at all endpoints. |
| 404 Not Found | The requested resource was not found. |
| 409 Conflict | The request could not be completed due to a conflict with the current state of the resource. |
| 422 Validation Error | The request could not be completed due to invalid data. |
| 429 Too Many Requests | The request could not be completed due to rate limiting. This response is possible at all endpoints. |
| 500 Internal Server Error | The request could not be completed due to server-side problems. This response is possible at all endpoints. |
