List keys by API.
curl --request GET \
--url https://{tenant}/admin/org/keys \
--header 'Admin-Auth: <api-key>'import requests
url = "https://{tenant}/admin/org/keys"
headers = {"Admin-Auth": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'Admin-Auth': '<api-key>'}};
fetch('https://{tenant}/admin/org/keys', 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}/admin/org/keys",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Admin-Auth: <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}/admin/org/keys"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Admin-Auth", "<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}/admin/org/keys")
.header("Admin-Auth", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{tenant}/admin/org/keys")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Admin-Auth"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"data": {
"keys": [
"5e9d9544a1dcd60001d0ed20a28c495beff140a4a6d8c272a1956b99",
"5e9d9544a1dcd60001d0ed20e7f75f9e03534825b7aef9df749582e5",
"5e9d9544a1dcd60001d0ed2060ff87c0deab4a508dd2ac18ccb8b664"
]
},
"pages": 1
}{
"Message": "Could not retrieve keys",
"Meta": null,
"Status": "Error"
}{
"Message": "Failed to unmarshal keys data from Tyk API",
"Meta": null,
"Status": "Error"
}Keys
List keys by API.
Lists keys that grant access to the API with the ID .
GET
/
admin
/
org
/
keys
List keys by API.
curl --request GET \
--url https://{tenant}/admin/org/keys \
--header 'Admin-Auth: <api-key>'import requests
url = "https://{tenant}/admin/org/keys"
headers = {"Admin-Auth": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'Admin-Auth': '<api-key>'}};
fetch('https://{tenant}/admin/org/keys', 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}/admin/org/keys",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Admin-Auth: <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}/admin/org/keys"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Admin-Auth", "<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}/admin/org/keys")
.header("Admin-Auth", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{tenant}/admin/org/keys")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Admin-Auth"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"data": {
"keys": [
"5e9d9544a1dcd60001d0ed20a28c495beff140a4a6d8c272a1956b99",
"5e9d9544a1dcd60001d0ed20e7f75f9e03534825b7aef9df749582e5",
"5e9d9544a1dcd60001d0ed2060ff87c0deab4a508dd2ac18ccb8b664"
]
},
"pages": 1
}{
"Message": "Could not retrieve keys",
"Meta": null,
"Status": "Error"
}{
"Message": "Failed to unmarshal keys data from Tyk API",
"Meta": null,
"Status": "Error"
}Was this page helpful?
⌘I