Token Endpoint
curl --request POST \
--url https://eu.phrase.com/idm/oauth/token \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data 'grant_type=<string>' \
--data 'subject_token=<string>' \
--data 'resource=<string>' \
--data 'audience=<string>' \
--data 'scope=<string>' \
--data requested_token_type=urn:ietf:params:oauth:token-type:access_token \
--data subject_token_type=urn:phrase:params:oauth:token-type:api_token \
--data 'actor_token=<string>' \
--data 'actor_token_type=<string>'import requests
url = "https://eu.phrase.com/idm/oauth/token"
payload = {
"grant_type": "<string>",
"subject_token": "<string>",
"resource": "<string>",
"audience": "<string>",
"scope": "<string>",
"requested_token_type": "urn:ietf:params:oauth:token-type:access_token",
"subject_token_type": "urn:phrase:params:oauth:token-type:api_token",
"actor_token": "<string>",
"actor_token_type": "<string>"
}
headers = {"Content-Type": "application/x-www-form-urlencoded"}
response = requests.post(url, data=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/x-www-form-urlencoded'},
body: new URLSearchParams({
grant_type: '<string>',
subject_token: '<string>',
resource: '<string>',
audience: '<string>',
scope: '<string>',
requested_token_type: 'urn:ietf:params:oauth:token-type:access_token',
subject_token_type: 'urn:phrase:params:oauth:token-type:api_token',
actor_token: '<string>',
actor_token_type: '<string>'
})
};
fetch('https://eu.phrase.com/idm/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://eu.phrase.com/idm/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_POSTFIELDS => "grant_type=%3Cstring%3E&subject_token=%3Cstring%3E&resource=%3Cstring%3E&audience=%3Cstring%3E&scope=%3Cstring%3E&requested_token_type=urn%3Aietf%3Aparams%3Aoauth%3Atoken-type%3Aaccess_token&subject_token_type=urn%3Aphrase%3Aparams%3Aoauth%3Atoken-type%3Aapi_token&actor_token=%3Cstring%3E&actor_token_type=%3Cstring%3E",
CURLOPT_HTTPHEADER => [
"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://eu.phrase.com/idm/oauth/token"
payload := strings.NewReader("grant_type=%3Cstring%3E&subject_token=%3Cstring%3E&resource=%3Cstring%3E&audience=%3Cstring%3E&scope=%3Cstring%3E&requested_token_type=urn%3Aietf%3Aparams%3Aoauth%3Atoken-type%3Aaccess_token&subject_token_type=urn%3Aphrase%3Aparams%3Aoauth%3Atoken-type%3Aapi_token&actor_token=%3Cstring%3E&actor_token_type=%3Cstring%3E")
req, _ := http.NewRequest("POST", url, payload)
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://eu.phrase.com/idm/oauth/token")
.header("Content-Type", "application/x-www-form-urlencoded")
.body("grant_type=%3Cstring%3E&subject_token=%3Cstring%3E&resource=%3Cstring%3E&audience=%3Cstring%3E&scope=%3Cstring%3E&requested_token_type=urn%3Aietf%3Aparams%3Aoauth%3Atoken-type%3Aaccess_token&subject_token_type=urn%3Aphrase%3Aparams%3Aoauth%3Atoken-type%3Aapi_token&actor_token=%3Cstring%3E&actor_token_type=%3Cstring%3E")
.asString();require 'uri'
require 'net/http'
url = URI("https://eu.phrase.com/idm/oauth/token")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/x-www-form-urlencoded'
request.body = "grant_type=%3Cstring%3E&subject_token=%3Cstring%3E&resource=%3Cstring%3E&audience=%3Cstring%3E&scope=%3Cstring%3E&requested_token_type=urn%3Aietf%3Aparams%3Aoauth%3Atoken-type%3Aaccess_token&subject_token_type=urn%3Aphrase%3Aparams%3Aoauth%3Atoken-type%3Aapi_token&actor_token=%3Cstring%3E&actor_token_type=%3Cstring%3E"
response = http.request(request)
puts response.read_body{
"access_token": "<string>",
"issued_token_type": "<string>",
"token_type": "<string>",
"expires_in": 123
}{
"error_description": "<string>"
}OAuth
Token Endpoint
Token Endpoint provides tokens according to OAuth 2.0/OIDC 1.0 (RFC-6749) specifications and its extension OAuth 2.0 Token Exchange (RFC-8693).
POST
/
oauth
/
token
Token Endpoint
curl --request POST \
--url https://eu.phrase.com/idm/oauth/token \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data 'grant_type=<string>' \
--data 'subject_token=<string>' \
--data 'resource=<string>' \
--data 'audience=<string>' \
--data 'scope=<string>' \
--data requested_token_type=urn:ietf:params:oauth:token-type:access_token \
--data subject_token_type=urn:phrase:params:oauth:token-type:api_token \
--data 'actor_token=<string>' \
--data 'actor_token_type=<string>'import requests
url = "https://eu.phrase.com/idm/oauth/token"
payload = {
"grant_type": "<string>",
"subject_token": "<string>",
"resource": "<string>",
"audience": "<string>",
"scope": "<string>",
"requested_token_type": "urn:ietf:params:oauth:token-type:access_token",
"subject_token_type": "urn:phrase:params:oauth:token-type:api_token",
"actor_token": "<string>",
"actor_token_type": "<string>"
}
headers = {"Content-Type": "application/x-www-form-urlencoded"}
response = requests.post(url, data=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/x-www-form-urlencoded'},
body: new URLSearchParams({
grant_type: '<string>',
subject_token: '<string>',
resource: '<string>',
audience: '<string>',
scope: '<string>',
requested_token_type: 'urn:ietf:params:oauth:token-type:access_token',
subject_token_type: 'urn:phrase:params:oauth:token-type:api_token',
actor_token: '<string>',
actor_token_type: '<string>'
})
};
fetch('https://eu.phrase.com/idm/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://eu.phrase.com/idm/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_POSTFIELDS => "grant_type=%3Cstring%3E&subject_token=%3Cstring%3E&resource=%3Cstring%3E&audience=%3Cstring%3E&scope=%3Cstring%3E&requested_token_type=urn%3Aietf%3Aparams%3Aoauth%3Atoken-type%3Aaccess_token&subject_token_type=urn%3Aphrase%3Aparams%3Aoauth%3Atoken-type%3Aapi_token&actor_token=%3Cstring%3E&actor_token_type=%3Cstring%3E",
CURLOPT_HTTPHEADER => [
"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://eu.phrase.com/idm/oauth/token"
payload := strings.NewReader("grant_type=%3Cstring%3E&subject_token=%3Cstring%3E&resource=%3Cstring%3E&audience=%3Cstring%3E&scope=%3Cstring%3E&requested_token_type=urn%3Aietf%3Aparams%3Aoauth%3Atoken-type%3Aaccess_token&subject_token_type=urn%3Aphrase%3Aparams%3Aoauth%3Atoken-type%3Aapi_token&actor_token=%3Cstring%3E&actor_token_type=%3Cstring%3E")
req, _ := http.NewRequest("POST", url, payload)
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://eu.phrase.com/idm/oauth/token")
.header("Content-Type", "application/x-www-form-urlencoded")
.body("grant_type=%3Cstring%3E&subject_token=%3Cstring%3E&resource=%3Cstring%3E&audience=%3Cstring%3E&scope=%3Cstring%3E&requested_token_type=urn%3Aietf%3Aparams%3Aoauth%3Atoken-type%3Aaccess_token&subject_token_type=urn%3Aphrase%3Aparams%3Aoauth%3Atoken-type%3Aapi_token&actor_token=%3Cstring%3E&actor_token_type=%3Cstring%3E")
.asString();require 'uri'
require 'net/http'
url = URI("https://eu.phrase.com/idm/oauth/token")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/x-www-form-urlencoded'
request.body = "grant_type=%3Cstring%3E&subject_token=%3Cstring%3E&resource=%3Cstring%3E&audience=%3Cstring%3E&scope=%3Cstring%3E&requested_token_type=urn%3Aietf%3Aparams%3Aoauth%3Atoken-type%3Aaccess_token&subject_token_type=urn%3Aphrase%3Aparams%3Aoauth%3Atoken-type%3Aapi_token&actor_token=%3Cstring%3E&actor_token_type=%3Cstring%3E"
response = http.request(request)
puts response.read_body{
"access_token": "<string>",
"issued_token_type": "<string>",
"token_type": "<string>",
"expires_in": 123
}{
"error_description": "<string>"
}Body
application/x-www-form-urlencoded
Type of grant for access token
Token of the subject
Target resource URI (not supported)
Logical name of the target service (not supported)
space-delimited, case-sensitive list of requested grants (not supported)
Token type requested
Type of the token (not supported)
Acting party token (not supported)
Type of the actor token (not supported)
Was this page helpful?
⌘I