Get authentication token
curl --request POST \
--url https://app.allyy.io/api/authentication/connect/token \
--header 'Content-Type: <content-type>' \
--data '
{
"client_id": "<string>",
"client_secret": "<string>",
"grant_type": "<string>",
"allyy_api": "<string>"
}
'import requests
url = "https://app.allyy.io/api/authentication/connect/token"
payload = {
"client_id": "<string>",
"client_secret": "<string>",
"grant_type": "<string>",
"allyy_api": "<string>"
}
headers = {"Content-Type": "<content-type>"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': '<content-type>'},
body: JSON.stringify({
client_id: '<string>',
client_secret: '<string>',
grant_type: '<string>',
allyy_api: '<string>'
})
};
fetch('https://app.allyy.io/api/authentication/connect/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://app.allyy.io/api/authentication/connect/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([
'client_id' => '<string>',
'client_secret' => '<string>',
'grant_type' => '<string>',
'allyy_api' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: <content-type>"
],
]);
$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://app.allyy.io/api/authentication/connect/token"
payload := strings.NewReader("{\n \"client_id\": \"<string>\",\n \"client_secret\": \"<string>\",\n \"grant_type\": \"<string>\",\n \"allyy_api\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "<content-type>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://app.allyy.io/api/authentication/connect/token")
.header("Content-Type", "<content-type>")
.body("{\n \"client_id\": \"<string>\",\n \"client_secret\": \"<string>\",\n \"grant_type\": \"<string>\",\n \"allyy_api\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.allyy.io/api/authentication/connect/token")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = '<content-type>'
request.body = "{\n \"client_id\": \"<string>\",\n \"client_secret\": \"<string>\",\n \"grant_type\": \"<string>\",\n \"allyy_api\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"access_token": "my bearer token",
"expires_in": 3600,
"token_type": "Bearer",
"scope": "allyy_api oneprediction_api"
}
{
"error": "invalid_request"
}
API Documentation
Get authentication token
POST
/
api
/
authentication
/
connect
/
token
Get authentication token
curl --request POST \
--url https://app.allyy.io/api/authentication/connect/token \
--header 'Content-Type: <content-type>' \
--data '
{
"client_id": "<string>",
"client_secret": "<string>",
"grant_type": "<string>",
"allyy_api": "<string>"
}
'import requests
url = "https://app.allyy.io/api/authentication/connect/token"
payload = {
"client_id": "<string>",
"client_secret": "<string>",
"grant_type": "<string>",
"allyy_api": "<string>"
}
headers = {"Content-Type": "<content-type>"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': '<content-type>'},
body: JSON.stringify({
client_id: '<string>',
client_secret: '<string>',
grant_type: '<string>',
allyy_api: '<string>'
})
};
fetch('https://app.allyy.io/api/authentication/connect/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://app.allyy.io/api/authentication/connect/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([
'client_id' => '<string>',
'client_secret' => '<string>',
'grant_type' => '<string>',
'allyy_api' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: <content-type>"
],
]);
$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://app.allyy.io/api/authentication/connect/token"
payload := strings.NewReader("{\n \"client_id\": \"<string>\",\n \"client_secret\": \"<string>\",\n \"grant_type\": \"<string>\",\n \"allyy_api\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "<content-type>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://app.allyy.io/api/authentication/connect/token")
.header("Content-Type", "<content-type>")
.body("{\n \"client_id\": \"<string>\",\n \"client_secret\": \"<string>\",\n \"grant_type\": \"<string>\",\n \"allyy_api\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.allyy.io/api/authentication/connect/token")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = '<content-type>'
request.body = "{\n \"client_id\": \"<string>\",\n \"client_secret\": \"<string>\",\n \"grant_type\": \"<string>\",\n \"allyy_api\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"access_token": "my bearer token",
"expires_in": 3600,
"token_type": "Bearer",
"scope": "allyy_api oneprediction_api"
}
{
"error": "invalid_request"
}
Body
The request body have to be sent inx-www-form-urlencoded format
string
required
Client ID. You can generate a client credentials on Allyy settings page
string
required
Client Secret. You can generate a client credentials on Allyy settings page
string
default:"client_credentials"
required
Always
client_credentialsstring
default:"allyy_api"
required
Always
allyy_apiHeaders
string
default:"application/x-www-form-urlencoded"
required
Only
application/x-www-form-urlencoded supportedResponses
string
required
Access token to be used for authentication
string
required
Token type
integer
required
Validity periot in seconds
string
required
Available scopes
{
"access_token": "my bearer token",
"expires_in": 3600,
"token_type": "Bearer",
"scope": "allyy_api oneprediction_api"
}
{
"error": "invalid_request"
}
⌘I