Get a list of example API definitions.
curl --request GET \
--url https://{tenant}/api/examples \
--header 'Authorization: Bearer <token>'import requests
url = "https://{tenant}/api/examples"
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/examples', 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/examples",
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/examples"
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/examples")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{tenant}/api/examples")
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[
{
"location": "udg/vat-checker",
"name": "VAT number checker UDG",
"shortDescription": "Simple REST API wrapped in GQL using Universal Data Graph that allows user to check validity of a VAT number and display some details about it."
},
{
"location": "udg/geo-info",
"name": "Geo information about the World",
"shortDescription": "Countries GQL API extended with information from geocode.xyz"
},
{
"location": "udg/react-conferences",
"name": "React conferences in Europe",
"shortDescription": "Information about React conferences in Europe. This Data Graph stitches together two GQL APIs. The flag image is added by using Trevorblades API as a data source."
}
]{
"Message": "Invalid examples index file or root path.",
"Meta": null,
"Status": "Error"
}{
"Message": "Not authorised",
"Meta": null,
"Status": "Error"
}{
"Message": "access denied: You do not have permission to access /api/examples",
"Meta": null,
"Status": "Error"
}{
"Message": "Failed to fetch examples index file.",
"Meta": null,
"Status": "Error"
}APIs
Get a list of example API definitions.
Returns a list of all example API definitions available in “repository.json” file defined in “x-tyk-examples-index” header. If the header is not provided, Tyk will use the default value of this header which is tyk-examples repo.
GET
/
api
/
examples
Get a list of example API definitions.
curl --request GET \
--url https://{tenant}/api/examples \
--header 'Authorization: Bearer <token>'import requests
url = "https://{tenant}/api/examples"
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/examples', 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/examples",
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/examples"
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/examples")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{tenant}/api/examples")
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[
{
"location": "udg/vat-checker",
"name": "VAT number checker UDG",
"shortDescription": "Simple REST API wrapped in GQL using Universal Data Graph that allows user to check validity of a VAT number and display some details about it."
},
{
"location": "udg/geo-info",
"name": "Geo information about the World",
"shortDescription": "Countries GQL API extended with information from geocode.xyz"
},
{
"location": "udg/react-conferences",
"name": "React conferences in Europe",
"shortDescription": "Information about React conferences in Europe. This Data Graph stitches together two GQL APIs. The flag image is added by using Trevorblades API as a data source."
}
]{
"Message": "Invalid examples index file or root path.",
"Meta": null,
"Status": "Error"
}{
"Message": "Not authorised",
"Meta": null,
"Status": "Error"
}{
"Message": "access denied: You do not have permission to access /api/examples",
"Meta": null,
"Status": "Error"
}{
"Message": "Failed to fetch examples index file.",
"Meta": null,
"Status": "Error"
}Authorizations
The Tyk Dashboard API Access Credentials
Headers
x-tyk-examples-index
string
default:https://raw.githubusercontent.com/TykTechnologies/tyk-examples/main/repository.json
URL path to the repository.json in the repository defined in `x-tyk-repo-url.
Was this page helpful?
⌘I