curl --request POST \
--url https://api.use3p.com/api/token \
--header 'Content-Type: application/json' \
--data '
{
"secret_key": "<string>"
}
'import requests
url = "https://api.use3p.com/api/token"
payload = { "secret_key": "<string>" }
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({secret_key: '<string>'})
};
fetch('https://api.use3p.com/api/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://api.use3p.com/api/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 => json_encode([
'secret_key' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"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://api.use3p.com/api/token"
payload := strings.NewReader("{\n \"secret_key\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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://api.use3p.com/api/token")
.header("Content-Type", "application/json")
.body("{\n \"secret_key\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.use3p.com/api/token")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"secret_key\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"access_token": "<string>",
"expires_in": 123,
"expiry": "<string>",
"refresh_token": "<string>",
"token_type": "<string>"
}Get access token
Validate API key and get access token
curl --request POST \
--url https://api.use3p.com/api/token \
--header 'Content-Type: application/json' \
--data '
{
"secret_key": "<string>"
}
'import requests
url = "https://api.use3p.com/api/token"
payload = { "secret_key": "<string>" }
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({secret_key: '<string>'})
};
fetch('https://api.use3p.com/api/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://api.use3p.com/api/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 => json_encode([
'secret_key' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"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://api.use3p.com/api/token"
payload := strings.NewReader("{\n \"secret_key\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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://api.use3p.com/api/token")
.header("Content-Type", "application/json")
.body("{\n \"secret_key\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.use3p.com/api/token")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"secret_key\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"access_token": "<string>",
"expires_in": 123,
"expiry": "<string>",
"refresh_token": "<string>",
"token_type": "<string>"
}Body
API key validation data
Response
Access token
AccessToken is the token that authorizes and authenticates the requests.
ExpiresIn is the OAuth2 wire format "expires_in" field,
which specifies how many seconds later the token expires,
relative to an unknown time base approximately around "now".
It is the application's responsibility to populate
Expiry from ExpiresIn when required.
Expiry is the optional expiration time of the access token.
If zero, [TokenSource] implementations will reuse the same token forever and RefreshToken or equivalent mechanisms for that TokenSource will not be used.
RefreshToken is a token that's used by the application (as opposed to the user) to refresh the access token if it expires.
TokenType is the type of token. The Type method returns either this or "Bearer", the default.