API Description
The Brainysoft infrastructure consists of the following web services:
- Core
- Print Forms
- Gateway
- File Storage
The division into web services is reflected in the Brainysoft documentation. The screenshot below shows this division.

Each web service has its own REST-API. Each REST-API in turn consists of a collection of web methods (endpoints).
Web service methods are available at the following addresses:
- Core -
https://{customer}-api.brainysoft.ru/core - Print Forms -
https://{customer}-api.brainysoft.ru/print-forms - File Storage -
https://{customer}-api.brainysoft.ru/file-storage
Front/UI (interface) and the Personal Account use web service methods, which together form the backend.
Method
Due to the infrastructural specifics of the system, all core web service methods and core methods working with the gateway web service receive the bs-core prefix in the URL. For example, the core method GET /main/clients/{id} currently has the URL https://{customer}-saas.brainysoft.ru/bs-core/main/clients/{id}.
In response to a request, an object with the following structure is returned:
| Property | Description |
| status | Returns "ok" when the request is processed successfully. Otherwise, an error is returned. |
| timestamp | Returns the date+time (of the core) in unix timestamp format in milliseconds. |
| data | Entity object in valid JSON format. The response may return a collection, an object, or for example the identifier of the created entity "data": 3692 in valid JSON format. |
Response body example:
{
"status": "ok",
"timestamp": 1550653059521,
"data": 3692
}Example of a POST request (creating a lead) in Postman:
1.
2.
Example of a POST request (creating a lead) via cURL:
curl -X POST https://{customer}-saas.brainysoft.ru/bs-core/main/leads \
-H 'Content-Type: application/json' \
-H 'bsauth: {api_token}' \
-d '{
"firstName": "Фридрих",
"mobilePhone": "797762007719",
"lastName": "Эберт",
"birthDate": "1982-12-20",
"sexId": 101251,
"passport": {
"issueDate": "2012-01-23",
"no": "782573"
},
"addressData": { },
"registrationAddressData": { },
"amount": 99,
"subdivisionId": 101798,
"period": 30
}'A more detailed example "Creating a lead and from it a Client, Application" plus a PHP code example can be found here.