cURL
curl --request POST \
--url https://api.relay.link/access-tokens \
--header 'Content-Type: application/json' \
--header 'x-api-key: <x-api-key>' \
--data '{}'const options = {
method: 'POST',
headers: {'x-api-key': '<x-api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({})
};
fetch('https://api.relay.link/access-tokens', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.relay.link/access-tokens"
payload = {}
headers = {
"x-api-key": "<x-api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"token": "<string>",
"tokenType": "Bearer",
"expiresAt": "2023-11-07T05:31:56Z",
"scope": "public-api"
}{
"message": "<string>",
"errorCode": "<string>"
}{
"message": "<string>",
"errorCode": "<string>"
}{
"message": "<string>",
"errorCode": "<string>"
}{
"message": "<string>",
"errorCode": "<string>"
}{
"message": "<string>",
"errorCode": "<string>"
}API Reference
Create Access Token
Exchange an API key for a short-lived access token that a browser or mobile client can send to Relay
POST
/
access-tokens
cURL
curl --request POST \
--url https://api.relay.link/access-tokens \
--header 'Content-Type: application/json' \
--header 'x-api-key: <x-api-key>' \
--data '{}'const options = {
method: 'POST',
headers: {'x-api-key': '<x-api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({})
};
fetch('https://api.relay.link/access-tokens', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.relay.link/access-tokens"
payload = {}
headers = {
"x-api-key": "<x-api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"token": "<string>",
"tokenType": "Bearer",
"expiresAt": "2023-11-07T05:31:56Z",
"scope": "public-api"
}{
"message": "<string>",
"errorCode": "<string>"
}{
"message": "<string>",
"errorCode": "<string>"
}{
"message": "<string>",
"errorCode": "<string>"
}{
"message": "<string>",
"errorCode": "<string>"
}{
"message": "<string>",
"errorCode": "<string>"
}Mint tokens on your backend and send them from the client. For when to use them, limits, and errors, see the Access Tokens guide.
Was this page helpful?