Documentation IndexFetch the complete documentation index at: /docs/llms.txtUse this file to discover all available pages before exploring further.
Fetch the complete documentation index at: /docs/llms.txt
Use this file to discover all available pages before exploring further.
Contact support
cURL
curl --request GET \ --url https://{tenant}/tyk/apis/{apiID} \ --header 'X-Tyk-Authorization: <api-key>'
import requests url = "https://{tenant}/tyk/apis/{apiID}" 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/apis/{apiID}', 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/apis/{apiID}", 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/apis/{apiID}" 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/apis/{apiID}") .header("X-Tyk-Authorization", "<api-key>") .asString();
require 'uri' require 'net/http' url = URI("https://{tenant}/tyk/apis/{apiID}") 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
{ "api_id": "b84fe1a04e5648927971c0557971565c", "auth": { "auth_header_name": "authorization" }, "definition": { "key": "version", "location": "header" }, "name": "Tyk Test API", "org_id": "664a14650619d40001f1f00f", "proxy": { "listen_path": "/tyk-api-test/", "strip_listen_path": true, "target_url": "https://httpbin.org" }, "use_oauth2": true, "version_data": { "not_versioned": true, "versions": { "Default": { "name": "Default" } } } }
{ "message": "Attempted administrative access with invalid or missing key!", "status": "error" }
{ "message": "API not found.", "status": "error" }
Get API definition from Tyk Gateway.
Api key
The API ID.
API definition.
Show child attributes
x >= 0
["Default", "v1"]
Was this page helpful?