List APIs lined to a certificate
curl --request GET \
--url https://{tenant}/api/certs/{certId}/apis \
--header 'Authorization: Bearer <token>'import requests
url = "https://{tenant}/api/certs/{certId}/apis"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://{tenant}/api/certs/{certId}/apis', 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}/api/certs/{certId}/apis",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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}/api/certs/{certId}/apis"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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}/api/certs/{certId}/apis")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{tenant}/api/certs/{certId}/apis")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"cert_id": "5e9d9544a1dcd60001d0ed208edce514c2d0a866063550c64d6c90be99d01561ac5aa7e82b8610b7e273d37d",
"pages": 1,
"apis": [
{
"api_id": "663a4ed9b6be920001b191ae",
"name": "First API",
"usage_type": [
"client",
"upstream"
],
"tyk_api_type": "Tyk OAS"
},
{
"api_id": "663a5ed9b6be920001b191ae",
"name": "Second API",
"usage_type": [
"server"
],
"tyk_api_type": "Tyk OAS"
}
]
}{
"Message": "Not authorised - You do not have permission, please contact your administrator",
"Meta": null,
"Status": "Error"
}{
"Message": "Certificate not found or access denied",
"Meta": null,
"Status": "Error"
}Certificates
List APIs lined to a certificate
Fetch APIs linked to a certificate
GET
/
api
/
certs
/
{certId}
/
apis
List APIs lined to a certificate
curl --request GET \
--url https://{tenant}/api/certs/{certId}/apis \
--header 'Authorization: Bearer <token>'import requests
url = "https://{tenant}/api/certs/{certId}/apis"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://{tenant}/api/certs/{certId}/apis', 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}/api/certs/{certId}/apis",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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}/api/certs/{certId}/apis"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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}/api/certs/{certId}/apis")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{tenant}/api/certs/{certId}/apis")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"cert_id": "5e9d9544a1dcd60001d0ed208edce514c2d0a866063550c64d6c90be99d01561ac5aa7e82b8610b7e273d37d",
"pages": 1,
"apis": [
{
"api_id": "663a4ed9b6be920001b191ae",
"name": "First API",
"usage_type": [
"client",
"upstream"
],
"tyk_api_type": "Tyk OAS"
},
{
"api_id": "663a5ed9b6be920001b191ae",
"name": "Second API",
"usage_type": [
"server"
],
"tyk_api_type": "Tyk OAS"
}
]
}{
"Message": "Not authorised - You do not have permission, please contact your administrator",
"Meta": null,
"Status": "Error"
}{
"Message": "Certificate not found or access denied",
"Meta": null,
"Status": "Error"
}Was this page helpful?
⌘I