Skip to main content
POST
/
oauth2
/
token
/
Acquire Access Token
curl --request POST \
  --url https://skala-sandbox.ripio.com/oauth2/token/ \
  --header 'Authorization: Basic <encoded-value>' \
  --header 'Content-Type: application/x-www-form-urlencoded' \
  --data grant_type=client_credentials
import requests

url = "https://skala-sandbox.ripio.com/oauth2/token/"

payload = { "grant_type": "client_credentials" }
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/x-www-form-urlencoded"
}

response = requests.post(url, data=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {
Authorization: 'Basic <encoded-value>',
'Content-Type': 'application/x-www-form-urlencoded'
},
body: new URLSearchParams({grant_type: 'client_credentials'})
};

fetch('https://skala-sandbox.ripio.com/oauth2/token/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://skala-sandbox.ripio.com/oauth2/token/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "grant_type=client_credentials",
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"Content-Type: application/x-www-form-urlencoded"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"strings"
"net/http"
"io"
)

func main() {

url := "https://skala-sandbox.ripio.com/oauth2/token/"

payload := strings.NewReader("grant_type=client_credentials")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("Authorization", "Basic <encoded-value>")
req.Header.Add("Content-Type", "application/x-www-form-urlencoded")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://skala-sandbox.ripio.com/oauth2/token/")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/x-www-form-urlencoded")
.body("grant_type=client_credentials")
.asString();
require 'uri'
require 'net/http'

url = URI("https://skala-sandbox.ripio.com/oauth2/token/")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/x-www-form-urlencoded'
request.body = "grant_type=client_credentials"

response = http.request(request)
puts response.read_body
{
  "accessToken": "UfpqHJaQEjV27rR6itJyhUz5x6eOxz",
  "expiresIn": 36000,
  "tokenType": "Bearer",
  "scope": "read write"
}
{
"error": "unsupported_grant_type"
}
{
"error": "invalid_client"
}
Credentials must be requested in order to generate an Authentication token needed to use the Ramp API. Contact Ripio support to request the partner’s registration and obtain client_id and client_secret, which univocally identify you as a Ripio customer. It is the partner’s responsibility to secure these credentials.

Authorizations

Authorization
string
header
required

Use Basic Auth with base64 encoded client_id:client_secret.

Body

application/x-www-form-urlencoded
grant_type
enum<string>
required

Must be 'client_credentials'

Available options:
client_credentials

Response

Access token granted successfully.

accessToken
string
required

The access token to be used for subsequent API calls.

Example:

"UfpqHJaQEjV27rR6itJyhUz5x6eOxz"

expiresIn
integer
required

The expiration time for the access token in seconds.

Example:

36000

tokenType
string
required

The type of token issued (always "Bearer" for this flow).

Example:

"Bearer"

scope
string

The scope of access granted by the token.

Example:

"read write"