List OAS API versions.
curl --request GET \
--url https://{tenant}/api/apis/oas/{apiId}/versions \
--header 'Authorization: Bearer <token>'import requests
url = "https://{tenant}/api/apis/oas/{apiId}/versions"
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/apis/oas/{apiId}/versions', 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/apis/oas/{apiId}/versions",
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/apis/oas/{apiId}/versions"
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/apis/oas/{apiId}/versions")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{tenant}/api/apis/oas/{apiId}/versions")
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{
"apis": [
{
"expirationDate": "2024-11-30 12:00",
"id": "5b633de8673e40e44bc88b6b248f0937",
"internal": false,
"isDefaultVersion": true,
"name": "user",
"versionName": "Default"
},
{
"expirationDate": "2024-11-30 12:00",
"id": "0fec4eb890cf4b8c5cb6fc011456c315",
"internal": false,
"isDefaultVersion": false,
"name": "user",
"versionName": "v2"
}
],
"pages": 1
}{
"Message": "Not authorised",
"Meta": null,
"Status": "Error"
}{
"Message": "access denied: You do not have permission to access /api/apis/oas/{apiId}/versions",
"Meta": null,
"Status": "Error"
}{
"Message": "Could not retrieve API detail.",
"Meta": null,
"Status": "Error"
}{
"Message": "{apiId} is not recognised",
"Meta": null,
"Status": "Error"
}OAS APIs
List OAS API versions.
List all the versions of an OAS API.
GET
/
api
/
apis
/
oas
/
{apiId}
/
versions
List OAS API versions.
curl --request GET \
--url https://{tenant}/api/apis/oas/{apiId}/versions \
--header 'Authorization: Bearer <token>'import requests
url = "https://{tenant}/api/apis/oas/{apiId}/versions"
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/apis/oas/{apiId}/versions', 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/apis/oas/{apiId}/versions",
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/apis/oas/{apiId}/versions"
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/apis/oas/{apiId}/versions")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{tenant}/api/apis/oas/{apiId}/versions")
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{
"apis": [
{
"expirationDate": "2024-11-30 12:00",
"id": "5b633de8673e40e44bc88b6b248f0937",
"internal": false,
"isDefaultVersion": true,
"name": "user",
"versionName": "Default"
},
{
"expirationDate": "2024-11-30 12:00",
"id": "0fec4eb890cf4b8c5cb6fc011456c315",
"internal": false,
"isDefaultVersion": false,
"name": "user",
"versionName": "v2"
}
],
"pages": 1
}{
"Message": "Not authorised",
"Meta": null,
"Status": "Error"
}{
"Message": "access denied: You do not have permission to access /api/apis/oas/{apiId}/versions",
"Meta": null,
"Status": "Error"
}{
"Message": "Could not retrieve API detail.",
"Meta": null,
"Status": "Error"
}{
"Message": "{apiId} is not recognised",
"Meta": null,
"Status": "Error"
}Authorizations
The Tyk Dashboard API Access Credentials
Path Parameters
ID of the API you want to fetch.
Query Parameters
Search for API version name.
Filter for internal or external API versions.
Available options:
internal, external Was this page helpful?
⌘I