cURL
curl --request POST \
--url https://public-api.setle.app/v1/oauth/token \
--header 'x-setle-client-id: <x-setle-client-id>' \
--header 'x-setle-client-secret: <x-setle-client-secret>'import requests
url = "https://public-api.setle.app/v1/oauth/token"
headers = {
"x-setle-client-id": "<x-setle-client-id>",
"x-setle-client-secret": "<x-setle-client-secret>"
}
response = requests.post(url, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-setle-client-id': '<x-setle-client-id>',
'x-setle-client-secret': '<x-setle-client-secret>'
}
};
fetch('https://public-api.setle.app/v1/oauth/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://public-api.setle.app/v1/oauth/token",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"x-setle-client-id: <x-setle-client-id>",
"x-setle-client-secret: <x-setle-client-secret>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://public-api.setle.app/v1/oauth/token"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("x-setle-client-id", "<x-setle-client-id>")
req.Header.Add("x-setle-client-secret", "<x-setle-client-secret>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://public-api.setle.app/v1/oauth/token")
.header("x-setle-client-id", "<x-setle-client-id>")
.header("x-setle-client-secret", "<x-setle-client-secret>")
.asString();require 'uri'
require 'net/http'
url = URI("https://public-api.setle.app/v1/oauth/token")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-setle-client-id"] = '<x-setle-client-id>'
request["x-setle-client-secret"] = '<x-setle-client-secret>'
response = http.request(request)
puts response.read_body{
"access_token": "<string>",
"expires_in": 123,
"token_type": "<string>"
}{
"statusCode": 400,
"message": [
"Name should not be empty.",
"Password must contain at least 1 uppercase character."
],
"error": "Bad Request"
}{}Authentication
Create new Access Token
Provides Bearer access tokens based on the client credentials grant type.
POST
/
v1
/
oauth
/
token
cURL
curl --request POST \
--url https://public-api.setle.app/v1/oauth/token \
--header 'x-setle-client-id: <x-setle-client-id>' \
--header 'x-setle-client-secret: <x-setle-client-secret>'import requests
url = "https://public-api.setle.app/v1/oauth/token"
headers = {
"x-setle-client-id": "<x-setle-client-id>",
"x-setle-client-secret": "<x-setle-client-secret>"
}
response = requests.post(url, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-setle-client-id': '<x-setle-client-id>',
'x-setle-client-secret': '<x-setle-client-secret>'
}
};
fetch('https://public-api.setle.app/v1/oauth/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://public-api.setle.app/v1/oauth/token",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"x-setle-client-id: <x-setle-client-id>",
"x-setle-client-secret: <x-setle-client-secret>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://public-api.setle.app/v1/oauth/token"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("x-setle-client-id", "<x-setle-client-id>")
req.Header.Add("x-setle-client-secret", "<x-setle-client-secret>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://public-api.setle.app/v1/oauth/token")
.header("x-setle-client-id", "<x-setle-client-id>")
.header("x-setle-client-secret", "<x-setle-client-secret>")
.asString();require 'uri'
require 'net/http'
url = URI("https://public-api.setle.app/v1/oauth/token")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-setle-client-id"] = '<x-setle-client-id>'
request["x-setle-client-secret"] = '<x-setle-client-secret>'
response = http.request(request)
puts response.read_body{
"access_token": "<string>",
"expires_in": 123,
"token_type": "<string>"
}{
"statusCode": 400,
"message": [
"Name should not be empty.",
"Password must contain at least 1 uppercase character."
],
"error": "Bad Request"
}{}You will need valid
Client Credentials (client_id + client_secret) to call this endpoint. See Quickstart or Authentication to get started.access_token for your client. You can reuse the token in your service and only call this endpoint when the time you retrieved this + expires_in is going to pass.⌘I