Authentication
To authenticate when making API requests to the Rappi API, you require an Access Token.
The Rappi API uses a Bearer authentication scheme, as the HTTP authentication method for API requests.
To make API requests, send the token in a customer header to interact with protected resources.
Rappi uses the following scheme for the Bearer authentication:
Key | Value |
---|---|
x-authorization | Bearer: <access_token> |
The following table describes the different contents of the Authentication resource:
Resource | Description | Observations |
---|---|---|
POST v1/token/login/integrations | Use this endpoint to generate an access token for integrations services | _New_ |
POST v1/token/login/utils | Use this endpoint to generate an access token for utils services | _new_ |
POST integrations login
Use this endpoint to generate an access token. This token allows you to authenticate when making API requests for integrations.
Endpoint URL
Use the following URLs to make a request with this endpoint:
URL: https://{NEW_DOMAIN}/restaurants/auth/v1/token/login/integrations
{NEW_DOMAIN}
: This is your new Rappi Country Domain. See the list of new Country Domains.
Endpoint Properties
This resource has the following properties:
request body | json |
response body | json |
Parameters
This endpoint does not permit additional parameters.
Sample Request
This is an example of an API request using this endpoint:
POST https://api.dev.rappi.com/restaurants/auth/v1/token/login/integrations
This is an example of the request:
{ "client_id": "7iCfjZCO4bTns3OjqLK4de2GV3sp6Ymd", "client_secret": "40iFFYJV9A1LrVmJsaIeARW40iFFYJV9A1LrVmJsaIeARW40iFFYJV9A1LrVmJsaIeARW" }
This table describes the attributes that the JSON
of your request requires:
Attributes | Requested | Description | |
---|---|---|---|
client_id | string | true | Client Id of your Rappi Credentials. |
client_secret | string | true | Client Secret of your Rappi Credentials. |
URL url = new URL("https://api.dev.rappi.com/restaurants/auth/v1/token/login/integrations"); HttpURLConnection connection = (HttpURLConnection) url.openConnection(); connection.setRequestMethod("POST"); connection.setRequestProperty("User-Agent", "Mozilla/5.0"); connection.setRequestProperty("Content-Type", "application/json"); connection.setRequestProperty("Accept", "application/json"); connection.setDoOutput(true); final String jsonInputString = "{\n" + " \"client_id\":\"7iCfjZCO4bTns3OjqLK4de2GV3sp6Ymd\",\n" + " \"client_secret\":\"40iFFYJV9A1LrVmJsaIeARW40iFFYJV9A1LrVmJsaIeARW40iFFYJV9A1LrVmJsaIeARW\"\n" + "}"; try (OutputStream os = connection.getOutputStream()) { byte[] input = jsonInputString.getBytes(StandardCharsets.UTF_8); os.write(input, 0, input.length); } try (BufferedReader br = new BufferedReader(new InputStreamReader(connection.getInputStream(), StandardCharsets.UTF_8))) { StringBuilder response = new StringBuilder(); String responseLine; while ((responseLine = br.readLine()) != null) { response.append(responseLine.trim()); } System.out.println("Response body: " + response.toString()); } System.out.println("Response Code : " + connection.getResponseCode());
Status Codes
These are the possible status codes of the response for this endpoint:
Sample Response
This is an example of the response:
{ "access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpeyJhbGciOiJIUzI1NiIsInR5cCI6IkpeyJhbGciOiJIUzI1NiIsInR5cCI6Ikp", "token_type": "Bearer", "expires_in": 86400 }
This table describes the objects contained in the response example:
Response Object | Object Description | |
---|---|---|
access_token | string | Access token to access secure endpoints. |
token_type | string | Token type. |
expires_in | integer | Token expiration time in seconds. |
POST utils login
Use this endpoint to generate an access token. This token allows you to authenticate when making API requests for utils.
Endpoint URL
Use the following URLs to make a request with this endpoint:
URL: https://{NEW_DOMAIN}/restaurants/auth/v1/token/login/utils
{NEW_DOMAIN}
: This is your new Rappi Country Domain. See the list of new Country Domains.
Endpoint Properties
This resource has the following properties:
request body | json |
response body | json |
Parameters
This endpoint does not permit additional parameters.
Sample Request
This is an example of an API request using this endpoint:
POST https://api.dev.rappi.com/restaurants/auth/v1/token/login/utils
This is an example of the request:
{ "client_id": "7iCfjZCO4bTns3OjqLK4de2GV3sp6Ymd", "client_secret": "40iFFYJV9A1LrVmJsaIeARW40iFFYJV9A1LrVmJsaIeARW40iFFYJV9A1LrVmJsaIeARW" }
This table describes the attributes that the JSON
of your request requires:
Attributes | Requirement | Description | |
---|---|---|---|
client_id | string | required | Client Id of your Rappi Credentials. |
client_secret | string | required | Client Secret of your Rappi Credentials. |
URL url = new URL("https://api.dev.rappi.com/restaurants/auth/v1/token/login/utils"); HttpURLConnection connection = (HttpURLConnection) url.openConnection(); connection.setRequestMethod("POST"); connection.setRequestProperty("User-Agent", "Mozilla/5.0"); connection.setRequestProperty("Content-Type", "application/json"); connection.setRequestProperty("Accept", "application/json"); connection.setDoOutput(true); final String jsonInputString = "{\n" + " \"client_id\":\"7iCfjZCO4bTns3OjqLK4de2GV3sp6Ymd\",\n" + " \"client_secret\":\"40iFFYJV9A1LrVmJsaIeARW40iFFYJV9A1LrVmJsaIeARW40iFFYJV9A1LrVmJsaIeARW\"\n" + "}"; try (OutputStream os = connection.getOutputStream()) { byte[] input = jsonInputString.getBytes(StandardCharsets.UTF_8); os.write(input, 0, input.length); } try (BufferedReader br = new BufferedReader(new InputStreamReader(connection.getInputStream(), StandardCharsets.UTF_8))) { StringBuilder response = new StringBuilder(); String responseLine; while ((responseLine = br.readLine()) != null) { response.append(responseLine.trim()); } System.out.println("Response body: " + response.toString()); } System.out.println("Response Code : " + connection.getResponseCode());
Status Codes
These are the possible status codes of the response for this endpoint:
Sample Response
This is an example of the response:
{ "access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpeyJhbGciOiJIUzI1NiIsInR5cCI6IkpeyJhbGciOiJIUzI1NiIsInR5cCI6Ikp", "token_type": "Bearer", "expires_in": 604798 }
This table describes the objects contained in the response example:
Response Object | Object Description | |
---|---|---|
access_token | string | Access token to access secure endpoints. |
token_type | string | Token type. |
expires_in | integer | Token expiration time in seconds. |