Overview

How to access our APIs

Below is a tutorial with the first steps necessary to access our APIs.

  1. Select the option “Register” at the top of the page.
  2. The system will present the page for creating a new account. Fill in the requested fields and select the option “Criar Nova Conta”.
  3. At this time, the system will register and log into the portal. A confirmation email will be sent to you.
  4. Select the “APPs” option at the top of the page. The system will direct you to an empty access list.
  5. Select the option “Cadastrar nova APP”. The system will display a registration page.
  6. Fill in the requested information and select the option “Registrar”. Your APP is created.
  7. In order to provide access to the Production environment, we will request the client_id generated in the registration of your APP, reserve this information.

All APIs available in ANBIMA Feed use the OAUTH2 protocol to perform authentication and authorization of access to contracted APIs

After performing the steps indicated above, it is time to obtain the access_token, which will allow access to ANBIMA’s APIs. For this, it is necessary to have the client_id and client_secret generated for your APP.

In practice, it is necessary to make the request below for our OAuth API:

POST
https://api.anbima.com.br/oauth/access-token
HEADER
Content-Type: application/json
Authorization: Basic base64(client_id:client_secret)
REQUEST BODY
{
        "grant_type": "client_credentials"
}

The information entered to the Authorization field must be encoded in base 64. For example, to generate the Authorization header for the pair client_id = aC2yaac23 and client_secret = 1bhS45TT, the base64 of string aC2yaac23:1bhS45TT must be generated, what will result in the example key YUMyeWFhYzIzOjFiaFM0NVRU. Thus, the header should be: ‘Authorization’: ‘Basic YUMyeWFhYzIzOjFiaFM0NVRU’.

After making this request, the following OAuth 2.0 API response should be obtained:

{
	// O access_token gerado deve ser armazenado para ser utilizado nas chamadas à API	"access_token": "222rkya88",
	"token_type": "access_token",
	"expires_in": 3600
}

In the response, the expiration time in seconds for the access_token is indicated. After expiration, the same procedure indicated must be repeated to obtain a new token.

Now your application can finally make requests to the APIs using the Sandbox (test) and Production endpoints.

If you are interested in accessing our APIs on Production environment, please contact:
anbimafeed@anbima.com.br