Request for access token
curl --request POST \
--url https://external.dev.onboardpay.co/auth/oauth/refresh-token \
--header 'x-auth-token: <api-key>'import requests
url = "https://external.dev.onboardpay.co/auth/oauth/refresh-token"
headers = {"x-auth-token": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {'x-auth-token': '<api-key>'}};
fetch('https://external.dev.onboardpay.co/auth/oauth/refresh-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://external.dev.onboardpay.co/auth/oauth/refresh-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-auth-token: <api-key>"
],
]);
$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://external.dev.onboardpay.co/auth/oauth/refresh-token"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("x-auth-token", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://external.dev.onboardpay.co/auth/oauth/refresh-token")
.header("x-auth-token", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://external.dev.onboardpay.co/auth/oauth/refresh-token")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-auth-token"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"userId": "<string>",
"accessToken": {
"token": "<string>",
"expiry": "2023-11-07T05:31:56Z"
},
"refreshToken": {
"token": "<string>",
"expiry": "2023-11-07T05:31:56Z"
}
}{
"code": "UNKNOWN_ERROR",
"message": "Request could not be completed due to an error",
"data": {}
}{
"code": "UNKNOWN_ERROR",
"message": "Request could not be completed due to an error",
"data": {}
}{
"code": "UNKNOWN_ERROR",
"message": "Request could not be completed due to an error",
"data": {}
}{
"code": "UNKNOWN_ERROR",
"message": "Request could not be completed due to an error",
"data": {}
}User Creation via API
Refresh token
Refresh access token by presenting previously acquired refresh token. Requires the refresh token initially acquired to be passed as x-auth-token in header
POST
/
auth
/
oauth
/
refresh-token
Request for access token
curl --request POST \
--url https://external.dev.onboardpay.co/auth/oauth/refresh-token \
--header 'x-auth-token: <api-key>'import requests
url = "https://external.dev.onboardpay.co/auth/oauth/refresh-token"
headers = {"x-auth-token": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {'x-auth-token': '<api-key>'}};
fetch('https://external.dev.onboardpay.co/auth/oauth/refresh-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://external.dev.onboardpay.co/auth/oauth/refresh-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-auth-token: <api-key>"
],
]);
$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://external.dev.onboardpay.co/auth/oauth/refresh-token"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("x-auth-token", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://external.dev.onboardpay.co/auth/oauth/refresh-token")
.header("x-auth-token", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://external.dev.onboardpay.co/auth/oauth/refresh-token")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-auth-token"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"userId": "<string>",
"accessToken": {
"token": "<string>",
"expiry": "2023-11-07T05:31:56Z"
},
"refreshToken": {
"token": "<string>",
"expiry": "2023-11-07T05:31:56Z"
}
}{
"code": "UNKNOWN_ERROR",
"message": "Request could not be completed due to an error",
"data": {}
}{
"code": "UNKNOWN_ERROR",
"message": "Request could not be completed due to an error",
"data": {}
}{
"code": "UNKNOWN_ERROR",
"message": "Request could not be completed due to an error",
"data": {}
}{
"code": "UNKNOWN_ERROR",
"message": "Request could not be completed due to an error",
"data": {}
}This endpoint allows users to refresh their expired or soon-to-expire access tokens using a valid refresh token. It returns a new access token without requiring the user to log in again.
⌘I