Generate Portals
curl --request POST \
--url https://{tenant}/admin/organisations/{orgID}/generate-portals \
--header 'Admin-Auth: <api-key>' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data domain=tyk.ioimport requests
url = "https://{tenant}/admin/organisations/{orgID}/generate-portals"
payload = { "domain": "tyk.io" }
headers = {
"Admin-Auth": "<api-key>",
"Content-Type": "application/x-www-form-urlencoded"
}
response = requests.post(url, data=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Admin-Auth': '<api-key>', 'Content-Type': 'application/x-www-form-urlencoded'},
body: new URLSearchParams({domain: 'tyk.io'})
};
fetch('https://{tenant}/admin/organisations/{orgID}/generate-portals', 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/organisations/{orgID}/generate-portals",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "domain=tyk.io",
CURLOPT_HTTPHEADER => [
"Admin-Auth: <api-key>",
"Content-Type: application/x-www-form-urlencoded"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{tenant}/admin/organisations/{orgID}/generate-portals"
payload := strings.NewReader("domain=tyk.io")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Admin-Auth", "<api-key>")
req.Header.Add("Content-Type", "application/x-www-form-urlencoded")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://{tenant}/admin/organisations/{orgID}/generate-portals")
.header("Admin-Auth", "<api-key>")
.header("Content-Type", "application/x-www-form-urlencoded")
.body("domain=tyk.io")
.asString();require 'uri'
require 'net/http'
url = URI("https://{tenant}/admin/organisations/{orgID}/generate-portals")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Admin-Auth"] = '<api-key>'
request["Content-Type"] = 'application/x-www-form-urlencoded'
request.body = "domain=tyk.io"
response = http.request(request)
puts response.read_body{
"Message": "Org updated",
"Meta": null,
"Status": "OK"
}{
"Message": "Could not generate APIs",
"Meta": null,
"Status": "Error"
}Organisations
Generate Portals
Generate Portals
POST
/
admin
/
organisations
/
{orgID}
/
generate-portals
Generate Portals
curl --request POST \
--url https://{tenant}/admin/organisations/{orgID}/generate-portals \
--header 'Admin-Auth: <api-key>' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data domain=tyk.ioimport requests
url = "https://{tenant}/admin/organisations/{orgID}/generate-portals"
payload = { "domain": "tyk.io" }
headers = {
"Admin-Auth": "<api-key>",
"Content-Type": "application/x-www-form-urlencoded"
}
response = requests.post(url, data=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Admin-Auth': '<api-key>', 'Content-Type': 'application/x-www-form-urlencoded'},
body: new URLSearchParams({domain: 'tyk.io'})
};
fetch('https://{tenant}/admin/organisations/{orgID}/generate-portals', 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/organisations/{orgID}/generate-portals",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "domain=tyk.io",
CURLOPT_HTTPHEADER => [
"Admin-Auth: <api-key>",
"Content-Type: application/x-www-form-urlencoded"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{tenant}/admin/organisations/{orgID}/generate-portals"
payload := strings.NewReader("domain=tyk.io")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Admin-Auth", "<api-key>")
req.Header.Add("Content-Type", "application/x-www-form-urlencoded")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://{tenant}/admin/organisations/{orgID}/generate-portals")
.header("Admin-Auth", "<api-key>")
.header("Content-Type", "application/x-www-form-urlencoded")
.body("domain=tyk.io")
.asString();require 'uri'
require 'net/http'
url = URI("https://{tenant}/admin/organisations/{orgID}/generate-portals")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Admin-Auth"] = '<api-key>'
request["Content-Type"] = 'application/x-www-form-urlencoded'
request.body = "domain=tyk.io"
response = http.request(request)
puts response.read_body{
"Message": "Org updated",
"Meta": null,
"Status": "OK"
}{
"Message": "Could not generate APIs",
"Meta": null,
"Status": "Error"
}Was this page helpful?
⌘I