Get authentication token
curl --request GET \
--url https://apix.us.amity.co/api/v3/authentication/token \
--header 'x-server-key: <x-server-key>'import requests
url = "https://apix.us.amity.co/api/v3/authentication/token"
headers = {"x-server-key": "<x-server-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-server-key': '<x-server-key>'}};
fetch('https://apix.us.amity.co/api/v3/authentication/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://apix.us.amity.co/api/v3/authentication/token",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-server-key: <x-server-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://apix.us.amity.co/api/v3/authentication/token"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-server-key", "<x-server-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://apix.us.amity.co/api/v3/authentication/token")
.header("x-server-key", "<x-server-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://apix.us.amity.co/api/v3/authentication/token")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-server-key"] = '<x-server-key>'
response = http.request(request)
puts response.read_body"s9qne0wEqVb2e05271177748659f574a4e8ab85e08"{
"status": "error",
"code": 400300,
"message": "Forbidden error."
}{
"status": "error",
"code": 500000,
"message": "Parameters error.",
"data": {
"detail": [
"The 'data.text' field length must be less than or equal to 20000 characters long."
]
}
}Authentication
Get authentication token
deprecated
GET
/
api
/
v3
/
authentication
/
token
Get authentication token
curl --request GET \
--url https://apix.us.amity.co/api/v3/authentication/token \
--header 'x-server-key: <x-server-key>'import requests
url = "https://apix.us.amity.co/api/v3/authentication/token"
headers = {"x-server-key": "<x-server-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-server-key': '<x-server-key>'}};
fetch('https://apix.us.amity.co/api/v3/authentication/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://apix.us.amity.co/api/v3/authentication/token",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-server-key: <x-server-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://apix.us.amity.co/api/v3/authentication/token"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-server-key", "<x-server-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://apix.us.amity.co/api/v3/authentication/token")
.header("x-server-key", "<x-server-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://apix.us.amity.co/api/v3/authentication/token")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-server-key"] = '<x-server-key>'
response = http.request(request)
puts response.read_body"s9qne0wEqVb2e05271177748659f574a4e8ab85e08"{
"status": "error",
"code": 400300,
"message": "Forbidden error."
}{
"status": "error",
"code": 500000,
"message": "Parameters error.",
"data": {
"detail": [
"The 'data.text' field length must be less than or equal to 20000 characters long."
]
}
}Headers
Server key to authenticate the request
Maximum string length:
150Query Parameters
User ID to get token for
Maximum string length:
100Response
Return authentication token string
The response is of type string.
Example:
"s9qne0wEqVb2e05271177748659f574a4e8ab85e08"
⌘I