Update a page
curl --request PUT \
--url http://localhost:3001/portal-api/pages/{page_id} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"AllowFormSubmission": false,
"PageTypeID": 123,
"Path": "/about-us",
"Status": "/about-us",
"Template": "home",
"Title": "About Tyk Portal"
}
'import requests
url = "http://localhost:3001/portal-api/pages/{page_id}"
payload = {
"AllowFormSubmission": False,
"PageTypeID": 123,
"Path": "/about-us",
"Status": "/about-us",
"Template": "home",
"Title": "About Tyk Portal"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
AllowFormSubmission: false,
PageTypeID: 123,
Path: '/about-us',
Status: '/about-us',
Template: 'home',
Title: 'About Tyk Portal'
})
};
fetch('http://localhost:3001/portal-api/pages/{page_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "3001",
CURLOPT_URL => "http://localhost:3001/portal-api/pages/{page_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'AllowFormSubmission' => false,
'PageTypeID' => 123,
'Path' => '/about-us',
'Status' => '/about-us',
'Template' => 'home',
'Title' => 'About Tyk Portal'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$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 := "http://localhost:3001/portal-api/pages/{page_id}"
payload := strings.NewReader("{\n \"AllowFormSubmission\": false,\n \"PageTypeID\": 123,\n \"Path\": \"/about-us\",\n \"Status\": \"/about-us\",\n \"Template\": \"home\",\n \"Title\": \"About Tyk Portal\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("http://localhost:3001/portal-api/pages/{page_id}")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"AllowFormSubmission\": false,\n \"PageTypeID\": 123,\n \"Path\": \"/about-us\",\n \"Status\": \"/about-us\",\n \"Template\": \"home\",\n \"Title\": \"About Tyk Portal\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:3001/portal-api/pages/{page_id}")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Put.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"AllowFormSubmission\": false,\n \"PageTypeID\": 123,\n \"Path\": \"/about-us\",\n \"Status\": \"/about-us\",\n \"Template\": \"home\",\n \"Title\": \"About Tyk Portal\"\n}"
response = http.request(request)
puts response.read_body{
"AllowFormSubmission": false,
"PageTypeID": 123,
"Path": "/about-us",
"Status": "/about-us",
"Template": "home",
"Title": "About Tyk Portal",
"ID": 1,
"CreatedAt": "2023-06-25 13:37",
"UpdatedAt": "2023-06-25 13:37"
}{
"AllowFormSubmission": false,
"PageTypeID": 123,
"Path": "/about-us",
"Status": "/about-us",
"Template": "home",
"Title": "About Tyk Portal",
"ID": 1,
"CreatedAt": "2023-06-25 13:37",
"UpdatedAt": "2023-06-25 13:37"
}Pages and content
Update a page
Update a page including title, path, and status
PUT
/
pages
/
{page_id}
Update a page
curl --request PUT \
--url http://localhost:3001/portal-api/pages/{page_id} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"AllowFormSubmission": false,
"PageTypeID": 123,
"Path": "/about-us",
"Status": "/about-us",
"Template": "home",
"Title": "About Tyk Portal"
}
'import requests
url = "http://localhost:3001/portal-api/pages/{page_id}"
payload = {
"AllowFormSubmission": False,
"PageTypeID": 123,
"Path": "/about-us",
"Status": "/about-us",
"Template": "home",
"Title": "About Tyk Portal"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
AllowFormSubmission: false,
PageTypeID: 123,
Path: '/about-us',
Status: '/about-us',
Template: 'home',
Title: 'About Tyk Portal'
})
};
fetch('http://localhost:3001/portal-api/pages/{page_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "3001",
CURLOPT_URL => "http://localhost:3001/portal-api/pages/{page_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'AllowFormSubmission' => false,
'PageTypeID' => 123,
'Path' => '/about-us',
'Status' => '/about-us',
'Template' => 'home',
'Title' => 'About Tyk Portal'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$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 := "http://localhost:3001/portal-api/pages/{page_id}"
payload := strings.NewReader("{\n \"AllowFormSubmission\": false,\n \"PageTypeID\": 123,\n \"Path\": \"/about-us\",\n \"Status\": \"/about-us\",\n \"Template\": \"home\",\n \"Title\": \"About Tyk Portal\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("http://localhost:3001/portal-api/pages/{page_id}")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"AllowFormSubmission\": false,\n \"PageTypeID\": 123,\n \"Path\": \"/about-us\",\n \"Status\": \"/about-us\",\n \"Template\": \"home\",\n \"Title\": \"About Tyk Portal\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:3001/portal-api/pages/{page_id}")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Put.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"AllowFormSubmission\": false,\n \"PageTypeID\": 123,\n \"Path\": \"/about-us\",\n \"Status\": \"/about-us\",\n \"Template\": \"home\",\n \"Title\": \"About Tyk Portal\"\n}"
response = http.request(request)
puts response.read_body{
"AllowFormSubmission": false,
"PageTypeID": 123,
"Path": "/about-us",
"Status": "/about-us",
"Template": "home",
"Title": "About Tyk Portal",
"ID": 1,
"CreatedAt": "2023-06-25 13:37",
"UpdatedAt": "2023-06-25 13:37"
}{
"AllowFormSubmission": false,
"PageTypeID": 123,
"Path": "/about-us",
"Status": "/about-us",
"Template": "home",
"Title": "About Tyk Portal",
"ID": 1,
"CreatedAt": "2023-06-25 13:37",
"UpdatedAt": "2023-06-25 13:37"
}Authorizations
Path Parameters
UID of the page
Example:
1
Body
application/json
dsf
Example:
false
Path to this page
Example:
"/about-us"
Path to this page
Example:
"/about-us"
Name of templates that is used by this page. Value of this property must match one of template names in theme.json
Example:
"home"
Title of the page
Example:
"About Tyk Portal"
Response
OK
dsf
Example:
false
Path to this page
Example:
"/about-us"
Path to this page
Example:
"/about-us"
Name of templates that is used by this page. Value of this property must match one of template names in theme.json
Example:
"home"
Title of the page
Example:
"About Tyk Portal"
UID of this page
Example:
1
Timestamp of when this access request was created
Pattern:
^\d{4}-\d{2}-\d{2} \d{2}:\d{2}$Example:
"2023-06-25 13:37"
Timestamp of when this access request was updated the last time
Pattern:
^\d{4}-\d{2}-\d{2} \d{2}:\d{2}$Example:
"2023-06-25 13:37"
Was this page helpful?
⌘I