What is an API?
It means “Application Programming Interface”. Through APIs, applications can communicate with each other without user intervention. They work by communicating different codes, defining specific behaviors of a given object in an interface.
In general, an API consists of a series of functions accessible only programmatically.
Our APIs are RESTFul (Representational State Transfer), meaning that they don’t store state; therefore, each call is fully independent from other calls. A Rest API has advantages over the methodologies defined by the HTTP protocol, such as the use of verbs already specified for representing actions to be carried out in the resources. Examples: use of the GET method for search of information, POST method for creating new resources, DELETE for excluding, etc.
An API is accessible through an URI comprising the following elements:
Due to the encryption needed for the safe transfer of data, the protocol used is always “https”. The other elements are described in detail below:
product: represents the ANBIMA product exposed through the API in question
version: represents the version of the API in question
resources: identify the information expected to be obtained when a certain service is requested (within the scope of this API, it refers to the packages and items that contain information of indices).
API Response Content Format
However, for some APIs, it is possible to send a header to obtain the XML format.
Technology and Standards
Architecture for providing resources through distributed systems, commonly used with HTTP protocol. For more details, access: https://www.w3.org/2001/sw/wiki/REST.
Standard for describing data used to exchange information between systems. It is simpler and lighter than some other market alternatives, such as XML. For more details, access: https://www.w3.org/TR/html-json-forms/#introduction.
A set of standard characters for communication among distributed systems. For more details, access: https://www.w3.org/International/questions/qa-choosing-encodings.
Standard format specific for date and time data.
There are only two endpoints for accessing our APIs, namely, Production and Sandbox. While developing your application, always use the Sandbox endpoint, and only change to Production when the entire integration of your application is concluded. The ANBIMA’s endpoints to access the environments are as follows:
|Production URL||Sandbox URL|
Important note: Don’t forget to include the API version before the resource. For example: /api/v1, for version 1 of the API.
HTTP Status Codes
|1xx||Informative – Not used for APIs|
Main variations of Status Code 2xx:
Main variations of Status Code 4xx:
|Código de Status||Descrição|
|405||Method not Allowed|
|413||Request Entity Too large|
|415||Unsupported Media Type|
|429||Too many requests|
Main variations of Status Code 5xx:
|Código de Status||Descrição|
|500||Internal Server Error|
Field and Region Format Data:
|First day of the week:||Sunday|
|Date format:||YYYY-MM-DD (ex,.: 2021-06-14)|
|Thousand separator:||Dot (ex.: 1.000)|
|Decimal separator:||Comma (ex.: 0,57)|