Get token
curl --request POST \
--url https://gateway.varchev.com/peps/getToken \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"connection": "service-account",
"device": "Vlado-PC",
"grant_type": "password",
"scope": "openid service_account_id offline_access"
}
'import requests
url = "https://gateway.varchev.com/peps/getToken"
payload = {
"connection": "service-account",
"device": "Vlado-PC",
"grant_type": "password",
"scope": "openid service_account_id offline_access"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
connection: 'service-account',
device: 'Vlado-PC',
grant_type: 'password',
scope: 'openid service_account_id offline_access'
})
};
fetch('https://gateway.varchev.com/peps/getToken', 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://gateway.varchev.com/peps/getToken",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'connection' => 'service-account',
'device' => 'Vlado-PC',
'grant_type' => 'password',
'scope' => 'openid service_account_id offline_access'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://gateway.varchev.com/peps/getToken"
payload := strings.NewReader("{\n \"connection\": \"service-account\",\n \"device\": \"Vlado-PC\",\n \"grant_type\": \"password\",\n \"scope\": \"openid service_account_id offline_access\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://gateway.varchev.com/peps/getToken")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"connection\": \"service-account\",\n \"device\": \"Vlado-PC\",\n \"grant_type\": \"password\",\n \"scope\": \"openid service_account_id offline_access\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://gateway.varchev.com/peps/getToken")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"connection\": \"service-account\",\n \"device\": \"Vlado-PC\",\n \"grant_type\": \"password\",\n \"scope\": \"openid service_account_id offline_access\"\n}"
response = http.request(request)
puts response.read_body{
"id_token": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6",
"access_token": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6Ik4wSTJRekJEUWpRM04wUkJSakJFUkRVM05qaEZNREF5T0VWRlJqWkRSVVl4TWtFMU5ERXdSUSJ9.eyJzZXJ2aWNlX2FjY291bnRfaWQiOiI5U0VQMDAxMDAwIiwiaXNzIjoiaHR0cHM6Ly9hdXRoLmFjY291bnRzLmRvd2pvbmVzLmNvbS8iLCJzdWIiOiJhdXRoMHw2MGYwZjRmY2QzNDE1NDE3NDNjNzkwOGIiLCJhdWQiOiJmZlRCcGsxU3ZJMTQ0STJnVVB0dFBkWjRGbkdxcHZkNyIsImlhdCI6MTYzNDYyOTkwNiwiZXhwIjoxNjM0NjY1OTA2fQ.iSO9UxiIE8pNce_2mQugk2yRVHq-4m77NeqDh0Z07PfuppU1EmdAmxLUKjJwJIN5JiZXI5AYGDglofvFbT0f8cgyMWNVpV2ph4BqkHLs16n_hzjhiqniUKDAQupU877iB8nL3nPiyds8_yxoeadijyOZHlXv4SOngGRRJWlwRlJ_2ng-2brNq0RKi889epqUdVySyrGplj17RpPppUd5waT6nX4I6Mu8aB9AHAZHYKdyiQ6I-jE5nEcWYI4EI0FOqSGrplYolFvHXgpedwCio5FNOi5pTis7iOW3NtqdB_GbPPwYbfng3p9unYgM75B9Z0ZpnWpBhA28BOBiKxnRNA",
"refresh_token": "4m77NeqDh0Z07PfuppU1EmdAmxLUKjJwJIN5JiZXI5AYGDglofvFb",
"token_type": "bearear"
}Default
Get token
POST
/
getToken
Get token
curl --request POST \
--url https://gateway.varchev.com/peps/getToken \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"connection": "service-account",
"device": "Vlado-PC",
"grant_type": "password",
"scope": "openid service_account_id offline_access"
}
'import requests
url = "https://gateway.varchev.com/peps/getToken"
payload = {
"connection": "service-account",
"device": "Vlado-PC",
"grant_type": "password",
"scope": "openid service_account_id offline_access"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
connection: 'service-account',
device: 'Vlado-PC',
grant_type: 'password',
scope: 'openid service_account_id offline_access'
})
};
fetch('https://gateway.varchev.com/peps/getToken', 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://gateway.varchev.com/peps/getToken",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'connection' => 'service-account',
'device' => 'Vlado-PC',
'grant_type' => 'password',
'scope' => 'openid service_account_id offline_access'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://gateway.varchev.com/peps/getToken"
payload := strings.NewReader("{\n \"connection\": \"service-account\",\n \"device\": \"Vlado-PC\",\n \"grant_type\": \"password\",\n \"scope\": \"openid service_account_id offline_access\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://gateway.varchev.com/peps/getToken")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"connection\": \"service-account\",\n \"device\": \"Vlado-PC\",\n \"grant_type\": \"password\",\n \"scope\": \"openid service_account_id offline_access\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://gateway.varchev.com/peps/getToken")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"connection\": \"service-account\",\n \"device\": \"Vlado-PC\",\n \"grant_type\": \"password\",\n \"scope\": \"openid service_account_id offline_access\"\n}"
response = http.request(request)
puts response.read_body{
"id_token": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6",
"access_token": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6Ik4wSTJRekJEUWpRM04wUkJSakJFUkRVM05qaEZNREF5T0VWRlJqWkRSVVl4TWtFMU5ERXdSUSJ9.eyJzZXJ2aWNlX2FjY291bnRfaWQiOiI5U0VQMDAxMDAwIiwiaXNzIjoiaHR0cHM6Ly9hdXRoLmFjY291bnRzLmRvd2pvbmVzLmNvbS8iLCJzdWIiOiJhdXRoMHw2MGYwZjRmY2QzNDE1NDE3NDNjNzkwOGIiLCJhdWQiOiJmZlRCcGsxU3ZJMTQ0STJnVVB0dFBkWjRGbkdxcHZkNyIsImlhdCI6MTYzNDYyOTkwNiwiZXhwIjoxNjM0NjY1OTA2fQ.iSO9UxiIE8pNce_2mQugk2yRVHq-4m77NeqDh0Z07PfuppU1EmdAmxLUKjJwJIN5JiZXI5AYGDglofvFbT0f8cgyMWNVpV2ph4BqkHLs16n_hzjhiqniUKDAQupU877iB8nL3nPiyds8_yxoeadijyOZHlXv4SOngGRRJWlwRlJ_2ng-2brNq0RKi889epqUdVySyrGplj17RpPppUd5waT6nX4I6Mu8aB9AHAZHYKdyiQ6I-jE5nEcWYI4EI0FOqSGrplYolFvHXgpedwCio5FNOi5pTis7iOW3NtqdB_GbPPwYbfng3p9unYgM75B9Z0ZpnWpBhA28BOBiKxnRNA",
"refresh_token": "4m77NeqDh0Z07PfuppU1EmdAmxLUKjJwJIN5JiZXI5AYGDglofvFb",
"token_type": "bearear"
}Authorizations
The access token received from the authorization server in the OAuth 2.0 flow.
Body
application/json
Specifies the custom name of the Auth0 connection configured for the service account users. Set its value to
Specifies if a Refresh token is requested. In Service Account Integration, this parameter is mandatory when requesting a Refresh token, scope=openid service_account_id offline_access
Specifies the type of access grant. Set its value to password.
Specifies the scope returned in the AuthN ID token. You can specify the value as follows:- openid pib:- retrieves only the two AuthN tokens OR openid service_account_id offline_access:- retrieves the two AuthN tokens and the Refresh token.
⌘I

