Get an Organisation Key
curl --request GET \
--url https://{tenant}/tyk/org/keys/{keyID} \
--header 'X-Tyk-Authorization: <api-key>'import requests
url = "https://{tenant}/tyk/org/keys/{keyID}"
headers = {"X-Tyk-Authorization": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-Tyk-Authorization': '<api-key>'}};
fetch('https://{tenant}/tyk/org/keys/{keyID}', 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://{tenant}/tyk/org/keys/{keyID}",
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-Tyk-Authorization: <api-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://{tenant}/tyk/org/keys/{keyID}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-Tyk-Authorization", "<api-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://{tenant}/tyk/org/keys/{keyID}")
.header("X-Tyk-Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{tenant}/tyk/org/keys/{keyID}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-Tyk-Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"access_rights": {
"itachi-api": {
"allowed_urls": [
{
"methods": [
"GET"
],
"url": "/users"
}
],
"api_id": "8ddd91f3cda9453442c477b06c4e2da4",
"api_name": "Itachi api",
"limit": {
"per": 60,
"quota_max": 10000,
"quota_remaining": 10000,
"quota_renewal_rate": 3600,
"rate": 1000,
"throttle_interval": 10,
"throttle_retry_limit": 10
},
"versions": [
"Default"
]
}
},
"alias": "portal-key",
"allowance": 1000,
"apply_policies": [
"5ead7120575961000181867e"
],
"date_created": "2024-08-09T14:40:34.87614+03:00",
"enable_detailed_recording": true,
"last_updated": "1723203634",
"meta_data": {
"new-update-key-sample": "update-key-sample",
"tyk_developer_id": "62b3fb9a1d5e4f00017226f5",
"update": "sample policy update",
"user_type": "mobile_user"
},
"org_id": "5e9d9544a1dcd60001d0ed20",
"per": 60,
"quota_max": 10000,
"quota_renewal_rate": 3600,
"quota_renews": 1723207234,
"rate": 1000,
"tags": [
"security",
"edge",
"edge-eu"
],
"throttle_interval": 10,
"throttle_retry_limit": 10
}{
"message": "Attempted administrative access with invalid or missing key!",
"status": "error"
}{
"message": "Org not found",
"status": "error"
}Organisation Quotas
Get an Organisation Key
Get session info about specified organisation key. Should return up to date rate limit and quota usage numbers.
GET
/
tyk
/
org
/
keys
/
{keyID}
Get an Organisation Key
curl --request GET \
--url https://{tenant}/tyk/org/keys/{keyID} \
--header 'X-Tyk-Authorization: <api-key>'import requests
url = "https://{tenant}/tyk/org/keys/{keyID}"
headers = {"X-Tyk-Authorization": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-Tyk-Authorization': '<api-key>'}};
fetch('https://{tenant}/tyk/org/keys/{keyID}', 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://{tenant}/tyk/org/keys/{keyID}",
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-Tyk-Authorization: <api-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://{tenant}/tyk/org/keys/{keyID}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-Tyk-Authorization", "<api-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://{tenant}/tyk/org/keys/{keyID}")
.header("X-Tyk-Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{tenant}/tyk/org/keys/{keyID}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-Tyk-Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"access_rights": {
"itachi-api": {
"allowed_urls": [
{
"methods": [
"GET"
],
"url": "/users"
}
],
"api_id": "8ddd91f3cda9453442c477b06c4e2da4",
"api_name": "Itachi api",
"limit": {
"per": 60,
"quota_max": 10000,
"quota_remaining": 10000,
"quota_renewal_rate": 3600,
"rate": 1000,
"throttle_interval": 10,
"throttle_retry_limit": 10
},
"versions": [
"Default"
]
}
},
"alias": "portal-key",
"allowance": 1000,
"apply_policies": [
"5ead7120575961000181867e"
],
"date_created": "2024-08-09T14:40:34.87614+03:00",
"enable_detailed_recording": true,
"last_updated": "1723203634",
"meta_data": {
"new-update-key-sample": "update-key-sample",
"tyk_developer_id": "62b3fb9a1d5e4f00017226f5",
"update": "sample policy update",
"user_type": "mobile_user"
},
"org_id": "5e9d9544a1dcd60001d0ed20",
"per": 60,
"quota_max": 10000,
"quota_renewal_rate": 3600,
"quota_renews": 1723207234,
"rate": 1000,
"tags": [
"security",
"edge",
"edge-eu"
],
"throttle_interval": 10,
"throttle_retry_limit": 10
}{
"message": "Attempted administrative access with invalid or missing key!",
"status": "error"
}{
"message": "Org not found",
"status": "error"
}Response
OK
Was this page helpful?