ApiMp Structure
Methods, URL, authentication, headers, bodies, status, pagination, and request limits of ApiMp.
Methods
Section titled “Methods”ApiMp follows the REST standard:
- POST: record creation.
- PUT: record update.
- GET: query and listing.
Host for all requests:
https://api.demander.com.brEndpoint examples:
api-mp/v1/clientes(GET and POST)api-mp/v1/clientes/{id}(PUT)
Authentication
Section titled “Authentication”The key is sent in the CompanyToken header.
Configuration is located in Demander Web, under ApiMp Configuration.
Request Headers
Section titled “Request Headers”- Sent: mandatory to provide
CompanyTokenandContent-Type: application/json. - Response: depends on the method.
- GET:
Content-Typeand pagination headers. - POST and PUT: JSON type, record ID, and URL to query it.
- GET:
Request Bodies
Section titled “Request Bodies”- Sent: validated on POST and PUT. Fields by method and table are listed in the fields article.
- Response: also varies by method and table; the complete list is in the same article.
Response Status Codes
Section titled “Response Status Codes”- 200: success.
- 201: creation completed.
- 403: inactive company.
- 412: error in request body.
- 422: record does not exist.
- 429: too many requests in a short period.
Pagination
Section titled “Pagination”Applies only to GET. Control is provided by three values in the response header:
- Record limit: indicates if pagination occurred.
- Total number of records: how many records were returned in the page (maximum 150).
- Extra requests: how many pages remain with the parameters used.
Performance Control
Section titled “Performance Control”The limit applies to all methods, based on the CompanyToken key.
Each company has a request cap. When exceeded, the API responds with HTTP 429:
{ "tempo_ate_permitir_novamente": 120, "limite_de_requisicoes": 100}If the ERP continues sending requests after a 429, the integration may be temporarily blocked:
{ "mensagem": "Integração bloqueada por desrespeitar as políticas de throttling, entre em contato com o suporte.", "tempo_ate_permitir_novamente": 9999999, "limite_de_requisicoes": 0}