Pages
POST
Attach a landing page to a multi-language group
{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/attach-to-lang-group
HEADERS
private-app-legacy
{{apiKey}}
BODY json
{
"language": "",
"id": "",
"primaryId": "",
"primaryLanguage": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/attach-to-lang-group");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "private-app-legacy: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"language\": \"\",\n \"id\": \"\",\n \"primaryId\": \"\",\n \"primaryLanguage\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/attach-to-lang-group" {:headers {:private-app-legacy "{{apiKey}}"}
:content-type :json
:form-params {:language ""
:id ""
:primaryId ""
:primaryLanguage ""}})
require "http/client"
url = "{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/attach-to-lang-group"
headers = HTTP::Headers{
"private-app-legacy" => "{{apiKey}}"
"content-type" => "application/json"
}
reqBody = "{\n \"language\": \"\",\n \"id\": \"\",\n \"primaryId\": \"\",\n \"primaryLanguage\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/attach-to-lang-group"),
Headers =
{
{ "private-app-legacy", "{{apiKey}}" },
},
Content = new StringContent("{\n \"language\": \"\",\n \"id\": \"\",\n \"primaryId\": \"\",\n \"primaryLanguage\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/attach-to-lang-group");
var request = new RestRequest("", Method.Post);
request.AddHeader("private-app-legacy", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"language\": \"\",\n \"id\": \"\",\n \"primaryId\": \"\",\n \"primaryLanguage\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/attach-to-lang-group"
payload := strings.NewReader("{\n \"language\": \"\",\n \"id\": \"\",\n \"primaryId\": \"\",\n \"primaryLanguage\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("private-app-legacy", "{{apiKey}}")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/cms/v3/pages/landing-pages/multi-language/attach-to-lang-group HTTP/1.1
Private-App-Legacy: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 76
{
"language": "",
"id": "",
"primaryId": "",
"primaryLanguage": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/attach-to-lang-group")
.setHeader("private-app-legacy", "{{apiKey}}")
.setHeader("content-type", "application/json")
.setBody("{\n \"language\": \"\",\n \"id\": \"\",\n \"primaryId\": \"\",\n \"primaryLanguage\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/attach-to-lang-group"))
.header("private-app-legacy", "{{apiKey}}")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"language\": \"\",\n \"id\": \"\",\n \"primaryId\": \"\",\n \"primaryLanguage\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"language\": \"\",\n \"id\": \"\",\n \"primaryId\": \"\",\n \"primaryLanguage\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/attach-to-lang-group")
.post(body)
.addHeader("private-app-legacy", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/attach-to-lang-group")
.header("private-app-legacy", "{{apiKey}}")
.header("content-type", "application/json")
.body("{\n \"language\": \"\",\n \"id\": \"\",\n \"primaryId\": \"\",\n \"primaryLanguage\": \"\"\n}")
.asString();
const data = JSON.stringify({
language: '',
id: '',
primaryId: '',
primaryLanguage: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/attach-to-lang-group');
xhr.setRequestHeader('private-app-legacy', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/attach-to-lang-group',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
data: {language: '', id: '', primaryId: '', primaryLanguage: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/attach-to-lang-group';
const options = {
method: 'POST',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
body: '{"language":"","id":"","primaryId":"","primaryLanguage":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/attach-to-lang-group',
method: 'POST',
headers: {
'private-app-legacy': '{{apiKey}}',
'content-type': 'application/json'
},
processData: false,
data: '{\n "language": "",\n "id": "",\n "primaryId": "",\n "primaryLanguage": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"language\": \"\",\n \"id\": \"\",\n \"primaryId\": \"\",\n \"primaryLanguage\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/attach-to-lang-group")
.post(body)
.addHeader("private-app-legacy", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/cms/v3/pages/landing-pages/multi-language/attach-to-lang-group',
headers: {
'private-app-legacy': '{{apiKey}}',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({language: '', id: '', primaryId: '', primaryLanguage: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/attach-to-lang-group',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
body: {language: '', id: '', primaryId: '', primaryLanguage: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/attach-to-lang-group');
req.headers({
'private-app-legacy': '{{apiKey}}',
'content-type': 'application/json'
});
req.type('json');
req.send({
language: '',
id: '',
primaryId: '',
primaryLanguage: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/attach-to-lang-group',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
data: {language: '', id: '', primaryId: '', primaryLanguage: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/attach-to-lang-group';
const options = {
method: 'POST',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
body: '{"language":"","id":"","primaryId":"","primaryLanguage":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"private-app-legacy": @"{{apiKey}}",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"language": @"",
@"id": @"",
@"primaryId": @"",
@"primaryLanguage": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/attach-to-lang-group"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/attach-to-lang-group" in
let headers = Header.add_list (Header.init ()) [
("private-app-legacy", "{{apiKey}}");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"language\": \"\",\n \"id\": \"\",\n \"primaryId\": \"\",\n \"primaryLanguage\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/attach-to-lang-group",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'language' => '',
'id' => '',
'primaryId' => '',
'primaryLanguage' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"private-app-legacy: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/attach-to-lang-group', [
'body' => '{
"language": "",
"id": "",
"primaryId": "",
"primaryLanguage": ""
}',
'headers' => [
'content-type' => 'application/json',
'private-app-legacy' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/attach-to-lang-group');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'private-app-legacy' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'language' => '',
'id' => '',
'primaryId' => '',
'primaryLanguage' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'language' => '',
'id' => '',
'primaryId' => '',
'primaryLanguage' => ''
]));
$request->setRequestUrl('{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/attach-to-lang-group');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'private-app-legacy' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("private-app-legacy", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/attach-to-lang-group' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"language": "",
"id": "",
"primaryId": "",
"primaryLanguage": ""
}'
$headers=@{}
$headers.Add("private-app-legacy", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/attach-to-lang-group' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"language": "",
"id": "",
"primaryId": "",
"primaryLanguage": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"language\": \"\",\n \"id\": \"\",\n \"primaryId\": \"\",\n \"primaryLanguage\": \"\"\n}"
headers = {
'private-app-legacy': "{{apiKey}}",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/cms/v3/pages/landing-pages/multi-language/attach-to-lang-group", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/attach-to-lang-group"
payload = {
"language": "",
"id": "",
"primaryId": "",
"primaryLanguage": ""
}
headers = {
"private-app-legacy": "{{apiKey}}",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/attach-to-lang-group"
payload <- "{\n \"language\": \"\",\n \"id\": \"\",\n \"primaryId\": \"\",\n \"primaryLanguage\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('private-app-legacy' = '{{apiKey}}'), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/attach-to-lang-group")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["private-app-legacy"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n \"language\": \"\",\n \"id\": \"\",\n \"primaryId\": \"\",\n \"primaryLanguage\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/cms/v3/pages/landing-pages/multi-language/attach-to-lang-group') do |req|
req.headers['private-app-legacy'] = '{{apiKey}}'
req.body = "{\n \"language\": \"\",\n \"id\": \"\",\n \"primaryId\": \"\",\n \"primaryLanguage\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/attach-to-lang-group";
let payload = json!({
"language": "",
"id": "",
"primaryId": "",
"primaryLanguage": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("private-app-legacy", "{{apiKey}}".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/cms/v3/pages/landing-pages/multi-language/attach-to-lang-group \
--header 'content-type: application/json' \
--header 'private-app-legacy: {{apiKey}}' \
--data '{
"language": "",
"id": "",
"primaryId": "",
"primaryLanguage": ""
}'
echo '{
"language": "",
"id": "",
"primaryId": "",
"primaryLanguage": ""
}' | \
http POST {{baseUrl}}/cms/v3/pages/landing-pages/multi-language/attach-to-lang-group \
content-type:application/json \
private-app-legacy:'{{apiKey}}'
wget --quiet \
--method POST \
--header 'private-app-legacy: {{apiKey}}' \
--header 'content-type: application/json' \
--body-data '{\n "language": "",\n "id": "",\n "primaryId": "",\n "primaryLanguage": ""\n}' \
--output-document \
- {{baseUrl}}/cms/v3/pages/landing-pages/multi-language/attach-to-lang-group
import Foundation
let headers = [
"private-app-legacy": "{{apiKey}}",
"content-type": "application/json"
]
let parameters = [
"language": "",
"id": "",
"primaryId": "",
"primaryLanguage": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/attach-to-lang-group")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
*/*
RESPONSE BODY text
{
"message": "Invalid input (details will vary based on the error)",
"correlationId": "aeb5f871-7f07-4993-9211-075dc63e7cbf",
"category": "VALIDATION_ERROR",
"links": {
"knowledge-base": "https://www.hubspot.com/products/service/knowledge-base"
}
}
POST
Clone a Landing Page
{{baseUrl}}/cms/v3/pages/landing-pages/clone
HEADERS
private-app-legacy
{{apiKey}}
BODY json
{
"cloneName": "",
"id": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/cms/v3/pages/landing-pages/clone");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "private-app-legacy: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"cloneName\": \"\",\n \"id\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/cms/v3/pages/landing-pages/clone" {:headers {:private-app-legacy "{{apiKey}}"}
:content-type :json
:form-params {:cloneName ""
:id ""}})
require "http/client"
url = "{{baseUrl}}/cms/v3/pages/landing-pages/clone"
headers = HTTP::Headers{
"private-app-legacy" => "{{apiKey}}"
"content-type" => "application/json"
}
reqBody = "{\n \"cloneName\": \"\",\n \"id\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/cms/v3/pages/landing-pages/clone"),
Headers =
{
{ "private-app-legacy", "{{apiKey}}" },
},
Content = new StringContent("{\n \"cloneName\": \"\",\n \"id\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/cms/v3/pages/landing-pages/clone");
var request = new RestRequest("", Method.Post);
request.AddHeader("private-app-legacy", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"cloneName\": \"\",\n \"id\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/cms/v3/pages/landing-pages/clone"
payload := strings.NewReader("{\n \"cloneName\": \"\",\n \"id\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("private-app-legacy", "{{apiKey}}")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/cms/v3/pages/landing-pages/clone HTTP/1.1
Private-App-Legacy: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 33
{
"cloneName": "",
"id": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/cms/v3/pages/landing-pages/clone")
.setHeader("private-app-legacy", "{{apiKey}}")
.setHeader("content-type", "application/json")
.setBody("{\n \"cloneName\": \"\",\n \"id\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/cms/v3/pages/landing-pages/clone"))
.header("private-app-legacy", "{{apiKey}}")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"cloneName\": \"\",\n \"id\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"cloneName\": \"\",\n \"id\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/cms/v3/pages/landing-pages/clone")
.post(body)
.addHeader("private-app-legacy", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/cms/v3/pages/landing-pages/clone")
.header("private-app-legacy", "{{apiKey}}")
.header("content-type", "application/json")
.body("{\n \"cloneName\": \"\",\n \"id\": \"\"\n}")
.asString();
const data = JSON.stringify({
cloneName: '',
id: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/cms/v3/pages/landing-pages/clone');
xhr.setRequestHeader('private-app-legacy', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/cms/v3/pages/landing-pages/clone',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
data: {cloneName: '', id: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/cms/v3/pages/landing-pages/clone';
const options = {
method: 'POST',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
body: '{"cloneName":"","id":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/cms/v3/pages/landing-pages/clone',
method: 'POST',
headers: {
'private-app-legacy': '{{apiKey}}',
'content-type': 'application/json'
},
processData: false,
data: '{\n "cloneName": "",\n "id": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"cloneName\": \"\",\n \"id\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/cms/v3/pages/landing-pages/clone")
.post(body)
.addHeader("private-app-legacy", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/cms/v3/pages/landing-pages/clone',
headers: {
'private-app-legacy': '{{apiKey}}',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({cloneName: '', id: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/cms/v3/pages/landing-pages/clone',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
body: {cloneName: '', id: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/cms/v3/pages/landing-pages/clone');
req.headers({
'private-app-legacy': '{{apiKey}}',
'content-type': 'application/json'
});
req.type('json');
req.send({
cloneName: '',
id: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/cms/v3/pages/landing-pages/clone',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
data: {cloneName: '', id: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/cms/v3/pages/landing-pages/clone';
const options = {
method: 'POST',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
body: '{"cloneName":"","id":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"private-app-legacy": @"{{apiKey}}",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"cloneName": @"",
@"id": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/cms/v3/pages/landing-pages/clone"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/cms/v3/pages/landing-pages/clone" in
let headers = Header.add_list (Header.init ()) [
("private-app-legacy", "{{apiKey}}");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"cloneName\": \"\",\n \"id\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/cms/v3/pages/landing-pages/clone",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'cloneName' => '',
'id' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"private-app-legacy: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/cms/v3/pages/landing-pages/clone', [
'body' => '{
"cloneName": "",
"id": ""
}',
'headers' => [
'content-type' => 'application/json',
'private-app-legacy' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/cms/v3/pages/landing-pages/clone');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'private-app-legacy' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'cloneName' => '',
'id' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'cloneName' => '',
'id' => ''
]));
$request->setRequestUrl('{{baseUrl}}/cms/v3/pages/landing-pages/clone');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'private-app-legacy' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("private-app-legacy", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/cms/v3/pages/landing-pages/clone' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"cloneName": "",
"id": ""
}'
$headers=@{}
$headers.Add("private-app-legacy", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/cms/v3/pages/landing-pages/clone' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"cloneName": "",
"id": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"cloneName\": \"\",\n \"id\": \"\"\n}"
headers = {
'private-app-legacy': "{{apiKey}}",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/cms/v3/pages/landing-pages/clone", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/cms/v3/pages/landing-pages/clone"
payload = {
"cloneName": "",
"id": ""
}
headers = {
"private-app-legacy": "{{apiKey}}",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/cms/v3/pages/landing-pages/clone"
payload <- "{\n \"cloneName\": \"\",\n \"id\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('private-app-legacy' = '{{apiKey}}'), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/cms/v3/pages/landing-pages/clone")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["private-app-legacy"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n \"cloneName\": \"\",\n \"id\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/cms/v3/pages/landing-pages/clone') do |req|
req.headers['private-app-legacy'] = '{{apiKey}}'
req.body = "{\n \"cloneName\": \"\",\n \"id\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/cms/v3/pages/landing-pages/clone";
let payload = json!({
"cloneName": "",
"id": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("private-app-legacy", "{{apiKey}}".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/cms/v3/pages/landing-pages/clone \
--header 'content-type: application/json' \
--header 'private-app-legacy: {{apiKey}}' \
--data '{
"cloneName": "",
"id": ""
}'
echo '{
"cloneName": "",
"id": ""
}' | \
http POST {{baseUrl}}/cms/v3/pages/landing-pages/clone \
content-type:application/json \
private-app-legacy:'{{apiKey}}'
wget --quiet \
--method POST \
--header 'private-app-legacy: {{apiKey}}' \
--header 'content-type: application/json' \
--body-data '{\n "cloneName": "",\n "id": ""\n}' \
--output-document \
- {{baseUrl}}/cms/v3/pages/landing-pages/clone
import Foundation
let headers = [
"private-app-legacy": "{{apiKey}}",
"content-type": "application/json"
]
let parameters = [
"cloneName": "",
"id": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/cms/v3/pages/landing-pages/clone")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
*/*
RESPONSE BODY text
{
"message": "Invalid input (details will vary based on the error)",
"correlationId": "aeb5f871-7f07-4993-9211-075dc63e7cbf",
"category": "VALIDATION_ERROR",
"links": {
"knowledge-base": "https://www.hubspot.com/products/service/knowledge-base"
}
}
POST
Create a batch of Folders
{{baseUrl}}/cms/v3/pages/landing-pages/folders/batch/create
HEADERS
private-app-legacy
{{apiKey}}
BODY json
{
"inputs": [
{
"deletedAt": "",
"parentFolderId": 0,
"created": "",
"name": "",
"id": "",
"category": 0,
"updated": ""
}
]
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/cms/v3/pages/landing-pages/folders/batch/create");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "private-app-legacy: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"inputs\": [\n {\n \"deletedAt\": \"\",\n \"parentFolderId\": 0,\n \"created\": \"\",\n \"name\": \"\",\n \"id\": \"\",\n \"category\": 0,\n \"updated\": \"\"\n }\n ]\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/cms/v3/pages/landing-pages/folders/batch/create" {:headers {:private-app-legacy "{{apiKey}}"}
:content-type :json
:form-params {:inputs [{:deletedAt ""
:parentFolderId 0
:created ""
:name ""
:id ""
:category 0
:updated ""}]}})
require "http/client"
url = "{{baseUrl}}/cms/v3/pages/landing-pages/folders/batch/create"
headers = HTTP::Headers{
"private-app-legacy" => "{{apiKey}}"
"content-type" => "application/json"
}
reqBody = "{\n \"inputs\": [\n {\n \"deletedAt\": \"\",\n \"parentFolderId\": 0,\n \"created\": \"\",\n \"name\": \"\",\n \"id\": \"\",\n \"category\": 0,\n \"updated\": \"\"\n }\n ]\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/cms/v3/pages/landing-pages/folders/batch/create"),
Headers =
{
{ "private-app-legacy", "{{apiKey}}" },
},
Content = new StringContent("{\n \"inputs\": [\n {\n \"deletedAt\": \"\",\n \"parentFolderId\": 0,\n \"created\": \"\",\n \"name\": \"\",\n \"id\": \"\",\n \"category\": 0,\n \"updated\": \"\"\n }\n ]\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/cms/v3/pages/landing-pages/folders/batch/create");
var request = new RestRequest("", Method.Post);
request.AddHeader("private-app-legacy", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"inputs\": [\n {\n \"deletedAt\": \"\",\n \"parentFolderId\": 0,\n \"created\": \"\",\n \"name\": \"\",\n \"id\": \"\",\n \"category\": 0,\n \"updated\": \"\"\n }\n ]\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/cms/v3/pages/landing-pages/folders/batch/create"
payload := strings.NewReader("{\n \"inputs\": [\n {\n \"deletedAt\": \"\",\n \"parentFolderId\": 0,\n \"created\": \"\",\n \"name\": \"\",\n \"id\": \"\",\n \"category\": 0,\n \"updated\": \"\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("private-app-legacy", "{{apiKey}}")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/cms/v3/pages/landing-pages/folders/batch/create HTTP/1.1
Private-App-Legacy: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 179
{
"inputs": [
{
"deletedAt": "",
"parentFolderId": 0,
"created": "",
"name": "",
"id": "",
"category": 0,
"updated": ""
}
]
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/cms/v3/pages/landing-pages/folders/batch/create")
.setHeader("private-app-legacy", "{{apiKey}}")
.setHeader("content-type", "application/json")
.setBody("{\n \"inputs\": [\n {\n \"deletedAt\": \"\",\n \"parentFolderId\": 0,\n \"created\": \"\",\n \"name\": \"\",\n \"id\": \"\",\n \"category\": 0,\n \"updated\": \"\"\n }\n ]\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/cms/v3/pages/landing-pages/folders/batch/create"))
.header("private-app-legacy", "{{apiKey}}")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"inputs\": [\n {\n \"deletedAt\": \"\",\n \"parentFolderId\": 0,\n \"created\": \"\",\n \"name\": \"\",\n \"id\": \"\",\n \"category\": 0,\n \"updated\": \"\"\n }\n ]\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"inputs\": [\n {\n \"deletedAt\": \"\",\n \"parentFolderId\": 0,\n \"created\": \"\",\n \"name\": \"\",\n \"id\": \"\",\n \"category\": 0,\n \"updated\": \"\"\n }\n ]\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/cms/v3/pages/landing-pages/folders/batch/create")
.post(body)
.addHeader("private-app-legacy", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/cms/v3/pages/landing-pages/folders/batch/create")
.header("private-app-legacy", "{{apiKey}}")
.header("content-type", "application/json")
.body("{\n \"inputs\": [\n {\n \"deletedAt\": \"\",\n \"parentFolderId\": 0,\n \"created\": \"\",\n \"name\": \"\",\n \"id\": \"\",\n \"category\": 0,\n \"updated\": \"\"\n }\n ]\n}")
.asString();
const data = JSON.stringify({
inputs: [
{
deletedAt: '',
parentFolderId: 0,
created: '',
name: '',
id: '',
category: 0,
updated: ''
}
]
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/cms/v3/pages/landing-pages/folders/batch/create');
xhr.setRequestHeader('private-app-legacy', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/cms/v3/pages/landing-pages/folders/batch/create',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
data: {
inputs: [
{
deletedAt: '',
parentFolderId: 0,
created: '',
name: '',
id: '',
category: 0,
updated: ''
}
]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/cms/v3/pages/landing-pages/folders/batch/create';
const options = {
method: 'POST',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
body: '{"inputs":[{"deletedAt":"","parentFolderId":0,"created":"","name":"","id":"","category":0,"updated":""}]}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/cms/v3/pages/landing-pages/folders/batch/create',
method: 'POST',
headers: {
'private-app-legacy': '{{apiKey}}',
'content-type': 'application/json'
},
processData: false,
data: '{\n "inputs": [\n {\n "deletedAt": "",\n "parentFolderId": 0,\n "created": "",\n "name": "",\n "id": "",\n "category": 0,\n "updated": ""\n }\n ]\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"inputs\": [\n {\n \"deletedAt\": \"\",\n \"parentFolderId\": 0,\n \"created\": \"\",\n \"name\": \"\",\n \"id\": \"\",\n \"category\": 0,\n \"updated\": \"\"\n }\n ]\n}")
val request = Request.Builder()
.url("{{baseUrl}}/cms/v3/pages/landing-pages/folders/batch/create")
.post(body)
.addHeader("private-app-legacy", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/cms/v3/pages/landing-pages/folders/batch/create',
headers: {
'private-app-legacy': '{{apiKey}}',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
inputs: [
{
deletedAt: '',
parentFolderId: 0,
created: '',
name: '',
id: '',
category: 0,
updated: ''
}
]
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/cms/v3/pages/landing-pages/folders/batch/create',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
body: {
inputs: [
{
deletedAt: '',
parentFolderId: 0,
created: '',
name: '',
id: '',
category: 0,
updated: ''
}
]
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/cms/v3/pages/landing-pages/folders/batch/create');
req.headers({
'private-app-legacy': '{{apiKey}}',
'content-type': 'application/json'
});
req.type('json');
req.send({
inputs: [
{
deletedAt: '',
parentFolderId: 0,
created: '',
name: '',
id: '',
category: 0,
updated: ''
}
]
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/cms/v3/pages/landing-pages/folders/batch/create',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
data: {
inputs: [
{
deletedAt: '',
parentFolderId: 0,
created: '',
name: '',
id: '',
category: 0,
updated: ''
}
]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/cms/v3/pages/landing-pages/folders/batch/create';
const options = {
method: 'POST',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
body: '{"inputs":[{"deletedAt":"","parentFolderId":0,"created":"","name":"","id":"","category":0,"updated":""}]}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"private-app-legacy": @"{{apiKey}}",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"inputs": @[ @{ @"deletedAt": @"", @"parentFolderId": @0, @"created": @"", @"name": @"", @"id": @"", @"category": @0, @"updated": @"" } ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/cms/v3/pages/landing-pages/folders/batch/create"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/cms/v3/pages/landing-pages/folders/batch/create" in
let headers = Header.add_list (Header.init ()) [
("private-app-legacy", "{{apiKey}}");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"inputs\": [\n {\n \"deletedAt\": \"\",\n \"parentFolderId\": 0,\n \"created\": \"\",\n \"name\": \"\",\n \"id\": \"\",\n \"category\": 0,\n \"updated\": \"\"\n }\n ]\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/cms/v3/pages/landing-pages/folders/batch/create",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'inputs' => [
[
'deletedAt' => '',
'parentFolderId' => 0,
'created' => '',
'name' => '',
'id' => '',
'category' => 0,
'updated' => ''
]
]
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"private-app-legacy: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/cms/v3/pages/landing-pages/folders/batch/create', [
'body' => '{
"inputs": [
{
"deletedAt": "",
"parentFolderId": 0,
"created": "",
"name": "",
"id": "",
"category": 0,
"updated": ""
}
]
}',
'headers' => [
'content-type' => 'application/json',
'private-app-legacy' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/cms/v3/pages/landing-pages/folders/batch/create');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'private-app-legacy' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'inputs' => [
[
'deletedAt' => '',
'parentFolderId' => 0,
'created' => '',
'name' => '',
'id' => '',
'category' => 0,
'updated' => ''
]
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'inputs' => [
[
'deletedAt' => '',
'parentFolderId' => 0,
'created' => '',
'name' => '',
'id' => '',
'category' => 0,
'updated' => ''
]
]
]));
$request->setRequestUrl('{{baseUrl}}/cms/v3/pages/landing-pages/folders/batch/create');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'private-app-legacy' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("private-app-legacy", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/cms/v3/pages/landing-pages/folders/batch/create' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"inputs": [
{
"deletedAt": "",
"parentFolderId": 0,
"created": "",
"name": "",
"id": "",
"category": 0,
"updated": ""
}
]
}'
$headers=@{}
$headers.Add("private-app-legacy", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/cms/v3/pages/landing-pages/folders/batch/create' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"inputs": [
{
"deletedAt": "",
"parentFolderId": 0,
"created": "",
"name": "",
"id": "",
"category": 0,
"updated": ""
}
]
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"inputs\": [\n {\n \"deletedAt\": \"\",\n \"parentFolderId\": 0,\n \"created\": \"\",\n \"name\": \"\",\n \"id\": \"\",\n \"category\": 0,\n \"updated\": \"\"\n }\n ]\n}"
headers = {
'private-app-legacy': "{{apiKey}}",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/cms/v3/pages/landing-pages/folders/batch/create", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/cms/v3/pages/landing-pages/folders/batch/create"
payload = { "inputs": [
{
"deletedAt": "",
"parentFolderId": 0,
"created": "",
"name": "",
"id": "",
"category": 0,
"updated": ""
}
] }
headers = {
"private-app-legacy": "{{apiKey}}",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/cms/v3/pages/landing-pages/folders/batch/create"
payload <- "{\n \"inputs\": [\n {\n \"deletedAt\": \"\",\n \"parentFolderId\": 0,\n \"created\": \"\",\n \"name\": \"\",\n \"id\": \"\",\n \"category\": 0,\n \"updated\": \"\"\n }\n ]\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('private-app-legacy' = '{{apiKey}}'), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/cms/v3/pages/landing-pages/folders/batch/create")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["private-app-legacy"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n \"inputs\": [\n {\n \"deletedAt\": \"\",\n \"parentFolderId\": 0,\n \"created\": \"\",\n \"name\": \"\",\n \"id\": \"\",\n \"category\": 0,\n \"updated\": \"\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/cms/v3/pages/landing-pages/folders/batch/create') do |req|
req.headers['private-app-legacy'] = '{{apiKey}}'
req.body = "{\n \"inputs\": [\n {\n \"deletedAt\": \"\",\n \"parentFolderId\": 0,\n \"created\": \"\",\n \"name\": \"\",\n \"id\": \"\",\n \"category\": 0,\n \"updated\": \"\"\n }\n ]\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/cms/v3/pages/landing-pages/folders/batch/create";
let payload = json!({"inputs": (
json!({
"deletedAt": "",
"parentFolderId": 0,
"created": "",
"name": "",
"id": "",
"category": 0,
"updated": ""
})
)});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("private-app-legacy", "{{apiKey}}".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/cms/v3/pages/landing-pages/folders/batch/create \
--header 'content-type: application/json' \
--header 'private-app-legacy: {{apiKey}}' \
--data '{
"inputs": [
{
"deletedAt": "",
"parentFolderId": 0,
"created": "",
"name": "",
"id": "",
"category": 0,
"updated": ""
}
]
}'
echo '{
"inputs": [
{
"deletedAt": "",
"parentFolderId": 0,
"created": "",
"name": "",
"id": "",
"category": 0,
"updated": ""
}
]
}' | \
http POST {{baseUrl}}/cms/v3/pages/landing-pages/folders/batch/create \
content-type:application/json \
private-app-legacy:'{{apiKey}}'
wget --quiet \
--method POST \
--header 'private-app-legacy: {{apiKey}}' \
--header 'content-type: application/json' \
--body-data '{\n "inputs": [\n {\n "deletedAt": "",\n "parentFolderId": 0,\n "created": "",\n "name": "",\n "id": "",\n "category": 0,\n "updated": ""\n }\n ]\n}' \
--output-document \
- {{baseUrl}}/cms/v3/pages/landing-pages/folders/batch/create
import Foundation
let headers = [
"private-app-legacy": "{{apiKey}}",
"content-type": "application/json"
]
let parameters = ["inputs": [
[
"deletedAt": "",
"parentFolderId": 0,
"created": "",
"name": "",
"id": "",
"category": 0,
"updated": ""
]
]] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/cms/v3/pages/landing-pages/folders/batch/create")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
*/*
RESPONSE BODY text
{
"message": "Invalid input (details will vary based on the error)",
"correlationId": "aeb5f871-7f07-4993-9211-075dc63e7cbf",
"category": "VALIDATION_ERROR",
"links": {
"knowledge-base": "https://www.hubspot.com/products/service/knowledge-base"
}
}
POST
Create a batch of Landing Pages
{{baseUrl}}/cms/v3/pages/landing-pages/batch/create
HEADERS
private-app-legacy
{{apiKey}}
BODY json
{
"inputs": [
{
"publishDate": "",
"language": "",
"enableLayoutStylesheets": false,
"metaDescription": "",
"attachedStylesheets": [
{}
],
"password": "",
"publishImmediately": false,
"htmlTitle": "",
"translations": {},
"id": "",
"state": "",
"slug": "",
"createdById": "",
"currentlyPublished": false,
"archivedInDashboard": false,
"created": "",
"contentTypeCategory": "",
"mabExperimentId": "",
"updatedById": "",
"translatedFromId": "",
"folderId": "",
"widgetContainers": {},
"pageExpiryRedirectId": 0,
"dynamicPageDataSourceType": 0,
"featuredImage": "",
"authorName": "",
"domain": "",
"name": "",
"dynamicPageHubDbTableId": "",
"campaign": "",
"dynamicPageDataSourceId": "",
"enableDomainStylesheets": false,
"includeDefaultCustomCss": false,
"subcategory": "",
"layoutSections": {},
"updated": "",
"footerHtml": "",
"widgets": {},
"headHtml": "",
"pageExpiryRedirectUrl": "",
"abStatus": "",
"useFeaturedImage": false,
"abTestId": "",
"featuredImageAltText": "",
"contentGroupId": "",
"pageExpiryEnabled": false,
"templatePath": "",
"url": "",
"publicAccessRules": [
{}
],
"archivedAt": "",
"themeSettingsValues": {},
"pageExpiryDate": 0,
"publicAccessRulesEnabled": false,
"pageRedirected": false,
"currentState": "",
"categoryId": 0,
"linkRelCanonicalUrl": ""
}
]
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/cms/v3/pages/landing-pages/batch/create");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "private-app-legacy: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"inputs\": [\n {\n \"publishDate\": \"\",\n \"language\": \"\",\n \"enableLayoutStylesheets\": false,\n \"metaDescription\": \"\",\n \"attachedStylesheets\": [\n {}\n ],\n \"password\": \"\",\n \"publishImmediately\": false,\n \"htmlTitle\": \"\",\n \"translations\": {},\n \"id\": \"\",\n \"state\": \"\",\n \"slug\": \"\",\n \"createdById\": \"\",\n \"currentlyPublished\": false,\n \"archivedInDashboard\": false,\n \"created\": \"\",\n \"contentTypeCategory\": \"\",\n \"mabExperimentId\": \"\",\n \"updatedById\": \"\",\n \"translatedFromId\": \"\",\n \"folderId\": \"\",\n \"widgetContainers\": {},\n \"pageExpiryRedirectId\": 0,\n \"dynamicPageDataSourceType\": 0,\n \"featuredImage\": \"\",\n \"authorName\": \"\",\n \"domain\": \"\",\n \"name\": \"\",\n \"dynamicPageHubDbTableId\": \"\",\n \"campaign\": \"\",\n \"dynamicPageDataSourceId\": \"\",\n \"enableDomainStylesheets\": false,\n \"includeDefaultCustomCss\": false,\n \"subcategory\": \"\",\n \"layoutSections\": {},\n \"updated\": \"\",\n \"footerHtml\": \"\",\n \"widgets\": {},\n \"headHtml\": \"\",\n \"pageExpiryRedirectUrl\": \"\",\n \"abStatus\": \"\",\n \"useFeaturedImage\": false,\n \"abTestId\": \"\",\n \"featuredImageAltText\": \"\",\n \"contentGroupId\": \"\",\n \"pageExpiryEnabled\": false,\n \"templatePath\": \"\",\n \"url\": \"\",\n \"publicAccessRules\": [\n {}\n ],\n \"archivedAt\": \"\",\n \"themeSettingsValues\": {},\n \"pageExpiryDate\": 0,\n \"publicAccessRulesEnabled\": false,\n \"pageRedirected\": false,\n \"currentState\": \"\",\n \"categoryId\": 0,\n \"linkRelCanonicalUrl\": \"\"\n }\n ]\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/cms/v3/pages/landing-pages/batch/create" {:headers {:private-app-legacy "{{apiKey}}"}
:content-type :json
:form-params {:inputs [{:publishDate ""
:language ""
:enableLayoutStylesheets false
:metaDescription ""
:attachedStylesheets [{}]
:password ""
:publishImmediately false
:htmlTitle ""
:translations {}
:id ""
:state ""
:slug ""
:createdById ""
:currentlyPublished false
:archivedInDashboard false
:created ""
:contentTypeCategory ""
:mabExperimentId ""
:updatedById ""
:translatedFromId ""
:folderId ""
:widgetContainers {}
:pageExpiryRedirectId 0
:dynamicPageDataSourceType 0
:featuredImage ""
:authorName ""
:domain ""
:name ""
:dynamicPageHubDbTableId ""
:campaign ""
:dynamicPageDataSourceId ""
:enableDomainStylesheets false
:includeDefaultCustomCss false
:subcategory ""
:layoutSections {}
:updated ""
:footerHtml ""
:widgets {}
:headHtml ""
:pageExpiryRedirectUrl ""
:abStatus ""
:useFeaturedImage false
:abTestId ""
:featuredImageAltText ""
:contentGroupId ""
:pageExpiryEnabled false
:templatePath ""
:url ""
:publicAccessRules [{}]
:archivedAt ""
:themeSettingsValues {}
:pageExpiryDate 0
:publicAccessRulesEnabled false
:pageRedirected false
:currentState ""
:categoryId 0
:linkRelCanonicalUrl ""}]}})
require "http/client"
url = "{{baseUrl}}/cms/v3/pages/landing-pages/batch/create"
headers = HTTP::Headers{
"private-app-legacy" => "{{apiKey}}"
"content-type" => "application/json"
}
reqBody = "{\n \"inputs\": [\n {\n \"publishDate\": \"\",\n \"language\": \"\",\n \"enableLayoutStylesheets\": false,\n \"metaDescription\": \"\",\n \"attachedStylesheets\": [\n {}\n ],\n \"password\": \"\",\n \"publishImmediately\": false,\n \"htmlTitle\": \"\",\n \"translations\": {},\n \"id\": \"\",\n \"state\": \"\",\n \"slug\": \"\",\n \"createdById\": \"\",\n \"currentlyPublished\": false,\n \"archivedInDashboard\": false,\n \"created\": \"\",\n \"contentTypeCategory\": \"\",\n \"mabExperimentId\": \"\",\n \"updatedById\": \"\",\n \"translatedFromId\": \"\",\n \"folderId\": \"\",\n \"widgetContainers\": {},\n \"pageExpiryRedirectId\": 0,\n \"dynamicPageDataSourceType\": 0,\n \"featuredImage\": \"\",\n \"authorName\": \"\",\n \"domain\": \"\",\n \"name\": \"\",\n \"dynamicPageHubDbTableId\": \"\",\n \"campaign\": \"\",\n \"dynamicPageDataSourceId\": \"\",\n \"enableDomainStylesheets\": false,\n \"includeDefaultCustomCss\": false,\n \"subcategory\": \"\",\n \"layoutSections\": {},\n \"updated\": \"\",\n \"footerHtml\": \"\",\n \"widgets\": {},\n \"headHtml\": \"\",\n \"pageExpiryRedirectUrl\": \"\",\n \"abStatus\": \"\",\n \"useFeaturedImage\": false,\n \"abTestId\": \"\",\n \"featuredImageAltText\": \"\",\n \"contentGroupId\": \"\",\n \"pageExpiryEnabled\": false,\n \"templatePath\": \"\",\n \"url\": \"\",\n \"publicAccessRules\": [\n {}\n ],\n \"archivedAt\": \"\",\n \"themeSettingsValues\": {},\n \"pageExpiryDate\": 0,\n \"publicAccessRulesEnabled\": false,\n \"pageRedirected\": false,\n \"currentState\": \"\",\n \"categoryId\": 0,\n \"linkRelCanonicalUrl\": \"\"\n }\n ]\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/cms/v3/pages/landing-pages/batch/create"),
Headers =
{
{ "private-app-legacy", "{{apiKey}}" },
},
Content = new StringContent("{\n \"inputs\": [\n {\n \"publishDate\": \"\",\n \"language\": \"\",\n \"enableLayoutStylesheets\": false,\n \"metaDescription\": \"\",\n \"attachedStylesheets\": [\n {}\n ],\n \"password\": \"\",\n \"publishImmediately\": false,\n \"htmlTitle\": \"\",\n \"translations\": {},\n \"id\": \"\",\n \"state\": \"\",\n \"slug\": \"\",\n \"createdById\": \"\",\n \"currentlyPublished\": false,\n \"archivedInDashboard\": false,\n \"created\": \"\",\n \"contentTypeCategory\": \"\",\n \"mabExperimentId\": \"\",\n \"updatedById\": \"\",\n \"translatedFromId\": \"\",\n \"folderId\": \"\",\n \"widgetContainers\": {},\n \"pageExpiryRedirectId\": 0,\n \"dynamicPageDataSourceType\": 0,\n \"featuredImage\": \"\",\n \"authorName\": \"\",\n \"domain\": \"\",\n \"name\": \"\",\n \"dynamicPageHubDbTableId\": \"\",\n \"campaign\": \"\",\n \"dynamicPageDataSourceId\": \"\",\n \"enableDomainStylesheets\": false,\n \"includeDefaultCustomCss\": false,\n \"subcategory\": \"\",\n \"layoutSections\": {},\n \"updated\": \"\",\n \"footerHtml\": \"\",\n \"widgets\": {},\n \"headHtml\": \"\",\n \"pageExpiryRedirectUrl\": \"\",\n \"abStatus\": \"\",\n \"useFeaturedImage\": false,\n \"abTestId\": \"\",\n \"featuredImageAltText\": \"\",\n \"contentGroupId\": \"\",\n \"pageExpiryEnabled\": false,\n \"templatePath\": \"\",\n \"url\": \"\",\n \"publicAccessRules\": [\n {}\n ],\n \"archivedAt\": \"\",\n \"themeSettingsValues\": {},\n \"pageExpiryDate\": 0,\n \"publicAccessRulesEnabled\": false,\n \"pageRedirected\": false,\n \"currentState\": \"\",\n \"categoryId\": 0,\n \"linkRelCanonicalUrl\": \"\"\n }\n ]\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/cms/v3/pages/landing-pages/batch/create");
var request = new RestRequest("", Method.Post);
request.AddHeader("private-app-legacy", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"inputs\": [\n {\n \"publishDate\": \"\",\n \"language\": \"\",\n \"enableLayoutStylesheets\": false,\n \"metaDescription\": \"\",\n \"attachedStylesheets\": [\n {}\n ],\n \"password\": \"\",\n \"publishImmediately\": false,\n \"htmlTitle\": \"\",\n \"translations\": {},\n \"id\": \"\",\n \"state\": \"\",\n \"slug\": \"\",\n \"createdById\": \"\",\n \"currentlyPublished\": false,\n \"archivedInDashboard\": false,\n \"created\": \"\",\n \"contentTypeCategory\": \"\",\n \"mabExperimentId\": \"\",\n \"updatedById\": \"\",\n \"translatedFromId\": \"\",\n \"folderId\": \"\",\n \"widgetContainers\": {},\n \"pageExpiryRedirectId\": 0,\n \"dynamicPageDataSourceType\": 0,\n \"featuredImage\": \"\",\n \"authorName\": \"\",\n \"domain\": \"\",\n \"name\": \"\",\n \"dynamicPageHubDbTableId\": \"\",\n \"campaign\": \"\",\n \"dynamicPageDataSourceId\": \"\",\n \"enableDomainStylesheets\": false,\n \"includeDefaultCustomCss\": false,\n \"subcategory\": \"\",\n \"layoutSections\": {},\n \"updated\": \"\",\n \"footerHtml\": \"\",\n \"widgets\": {},\n \"headHtml\": \"\",\n \"pageExpiryRedirectUrl\": \"\",\n \"abStatus\": \"\",\n \"useFeaturedImage\": false,\n \"abTestId\": \"\",\n \"featuredImageAltText\": \"\",\n \"contentGroupId\": \"\",\n \"pageExpiryEnabled\": false,\n \"templatePath\": \"\",\n \"url\": \"\",\n \"publicAccessRules\": [\n {}\n ],\n \"archivedAt\": \"\",\n \"themeSettingsValues\": {},\n \"pageExpiryDate\": 0,\n \"publicAccessRulesEnabled\": false,\n \"pageRedirected\": false,\n \"currentState\": \"\",\n \"categoryId\": 0,\n \"linkRelCanonicalUrl\": \"\"\n }\n ]\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/cms/v3/pages/landing-pages/batch/create"
payload := strings.NewReader("{\n \"inputs\": [\n {\n \"publishDate\": \"\",\n \"language\": \"\",\n \"enableLayoutStylesheets\": false,\n \"metaDescription\": \"\",\n \"attachedStylesheets\": [\n {}\n ],\n \"password\": \"\",\n \"publishImmediately\": false,\n \"htmlTitle\": \"\",\n \"translations\": {},\n \"id\": \"\",\n \"state\": \"\",\n \"slug\": \"\",\n \"createdById\": \"\",\n \"currentlyPublished\": false,\n \"archivedInDashboard\": false,\n \"created\": \"\",\n \"contentTypeCategory\": \"\",\n \"mabExperimentId\": \"\",\n \"updatedById\": \"\",\n \"translatedFromId\": \"\",\n \"folderId\": \"\",\n \"widgetContainers\": {},\n \"pageExpiryRedirectId\": 0,\n \"dynamicPageDataSourceType\": 0,\n \"featuredImage\": \"\",\n \"authorName\": \"\",\n \"domain\": \"\",\n \"name\": \"\",\n \"dynamicPageHubDbTableId\": \"\",\n \"campaign\": \"\",\n \"dynamicPageDataSourceId\": \"\",\n \"enableDomainStylesheets\": false,\n \"includeDefaultCustomCss\": false,\n \"subcategory\": \"\",\n \"layoutSections\": {},\n \"updated\": \"\",\n \"footerHtml\": \"\",\n \"widgets\": {},\n \"headHtml\": \"\",\n \"pageExpiryRedirectUrl\": \"\",\n \"abStatus\": \"\",\n \"useFeaturedImage\": false,\n \"abTestId\": \"\",\n \"featuredImageAltText\": \"\",\n \"contentGroupId\": \"\",\n \"pageExpiryEnabled\": false,\n \"templatePath\": \"\",\n \"url\": \"\",\n \"publicAccessRules\": [\n {}\n ],\n \"archivedAt\": \"\",\n \"themeSettingsValues\": {},\n \"pageExpiryDate\": 0,\n \"publicAccessRulesEnabled\": false,\n \"pageRedirected\": false,\n \"currentState\": \"\",\n \"categoryId\": 0,\n \"linkRelCanonicalUrl\": \"\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("private-app-legacy", "{{apiKey}}")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/cms/v3/pages/landing-pages/batch/create HTTP/1.1
Private-App-Legacy: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 1659
{
"inputs": [
{
"publishDate": "",
"language": "",
"enableLayoutStylesheets": false,
"metaDescription": "",
"attachedStylesheets": [
{}
],
"password": "",
"publishImmediately": false,
"htmlTitle": "",
"translations": {},
"id": "",
"state": "",
"slug": "",
"createdById": "",
"currentlyPublished": false,
"archivedInDashboard": false,
"created": "",
"contentTypeCategory": "",
"mabExperimentId": "",
"updatedById": "",
"translatedFromId": "",
"folderId": "",
"widgetContainers": {},
"pageExpiryRedirectId": 0,
"dynamicPageDataSourceType": 0,
"featuredImage": "",
"authorName": "",
"domain": "",
"name": "",
"dynamicPageHubDbTableId": "",
"campaign": "",
"dynamicPageDataSourceId": "",
"enableDomainStylesheets": false,
"includeDefaultCustomCss": false,
"subcategory": "",
"layoutSections": {},
"updated": "",
"footerHtml": "",
"widgets": {},
"headHtml": "",
"pageExpiryRedirectUrl": "",
"abStatus": "",
"useFeaturedImage": false,
"abTestId": "",
"featuredImageAltText": "",
"contentGroupId": "",
"pageExpiryEnabled": false,
"templatePath": "",
"url": "",
"publicAccessRules": [
{}
],
"archivedAt": "",
"themeSettingsValues": {},
"pageExpiryDate": 0,
"publicAccessRulesEnabled": false,
"pageRedirected": false,
"currentState": "",
"categoryId": 0,
"linkRelCanonicalUrl": ""
}
]
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/cms/v3/pages/landing-pages/batch/create")
.setHeader("private-app-legacy", "{{apiKey}}")
.setHeader("content-type", "application/json")
.setBody("{\n \"inputs\": [\n {\n \"publishDate\": \"\",\n \"language\": \"\",\n \"enableLayoutStylesheets\": false,\n \"metaDescription\": \"\",\n \"attachedStylesheets\": [\n {}\n ],\n \"password\": \"\",\n \"publishImmediately\": false,\n \"htmlTitle\": \"\",\n \"translations\": {},\n \"id\": \"\",\n \"state\": \"\",\n \"slug\": \"\",\n \"createdById\": \"\",\n \"currentlyPublished\": false,\n \"archivedInDashboard\": false,\n \"created\": \"\",\n \"contentTypeCategory\": \"\",\n \"mabExperimentId\": \"\",\n \"updatedById\": \"\",\n \"translatedFromId\": \"\",\n \"folderId\": \"\",\n \"widgetContainers\": {},\n \"pageExpiryRedirectId\": 0,\n \"dynamicPageDataSourceType\": 0,\n \"featuredImage\": \"\",\n \"authorName\": \"\",\n \"domain\": \"\",\n \"name\": \"\",\n \"dynamicPageHubDbTableId\": \"\",\n \"campaign\": \"\",\n \"dynamicPageDataSourceId\": \"\",\n \"enableDomainStylesheets\": false,\n \"includeDefaultCustomCss\": false,\n \"subcategory\": \"\",\n \"layoutSections\": {},\n \"updated\": \"\",\n \"footerHtml\": \"\",\n \"widgets\": {},\n \"headHtml\": \"\",\n \"pageExpiryRedirectUrl\": \"\",\n \"abStatus\": \"\",\n \"useFeaturedImage\": false,\n \"abTestId\": \"\",\n \"featuredImageAltText\": \"\",\n \"contentGroupId\": \"\",\n \"pageExpiryEnabled\": false,\n \"templatePath\": \"\",\n \"url\": \"\",\n \"publicAccessRules\": [\n {}\n ],\n \"archivedAt\": \"\",\n \"themeSettingsValues\": {},\n \"pageExpiryDate\": 0,\n \"publicAccessRulesEnabled\": false,\n \"pageRedirected\": false,\n \"currentState\": \"\",\n \"categoryId\": 0,\n \"linkRelCanonicalUrl\": \"\"\n }\n ]\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/cms/v3/pages/landing-pages/batch/create"))
.header("private-app-legacy", "{{apiKey}}")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"inputs\": [\n {\n \"publishDate\": \"\",\n \"language\": \"\",\n \"enableLayoutStylesheets\": false,\n \"metaDescription\": \"\",\n \"attachedStylesheets\": [\n {}\n ],\n \"password\": \"\",\n \"publishImmediately\": false,\n \"htmlTitle\": \"\",\n \"translations\": {},\n \"id\": \"\",\n \"state\": \"\",\n \"slug\": \"\",\n \"createdById\": \"\",\n \"currentlyPublished\": false,\n \"archivedInDashboard\": false,\n \"created\": \"\",\n \"contentTypeCategory\": \"\",\n \"mabExperimentId\": \"\",\n \"updatedById\": \"\",\n \"translatedFromId\": \"\",\n \"folderId\": \"\",\n \"widgetContainers\": {},\n \"pageExpiryRedirectId\": 0,\n \"dynamicPageDataSourceType\": 0,\n \"featuredImage\": \"\",\n \"authorName\": \"\",\n \"domain\": \"\",\n \"name\": \"\",\n \"dynamicPageHubDbTableId\": \"\",\n \"campaign\": \"\",\n \"dynamicPageDataSourceId\": \"\",\n \"enableDomainStylesheets\": false,\n \"includeDefaultCustomCss\": false,\n \"subcategory\": \"\",\n \"layoutSections\": {},\n \"updated\": \"\",\n \"footerHtml\": \"\",\n \"widgets\": {},\n \"headHtml\": \"\",\n \"pageExpiryRedirectUrl\": \"\",\n \"abStatus\": \"\",\n \"useFeaturedImage\": false,\n \"abTestId\": \"\",\n \"featuredImageAltText\": \"\",\n \"contentGroupId\": \"\",\n \"pageExpiryEnabled\": false,\n \"templatePath\": \"\",\n \"url\": \"\",\n \"publicAccessRules\": [\n {}\n ],\n \"archivedAt\": \"\",\n \"themeSettingsValues\": {},\n \"pageExpiryDate\": 0,\n \"publicAccessRulesEnabled\": false,\n \"pageRedirected\": false,\n \"currentState\": \"\",\n \"categoryId\": 0,\n \"linkRelCanonicalUrl\": \"\"\n }\n ]\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"inputs\": [\n {\n \"publishDate\": \"\",\n \"language\": \"\",\n \"enableLayoutStylesheets\": false,\n \"metaDescription\": \"\",\n \"attachedStylesheets\": [\n {}\n ],\n \"password\": \"\",\n \"publishImmediately\": false,\n \"htmlTitle\": \"\",\n \"translations\": {},\n \"id\": \"\",\n \"state\": \"\",\n \"slug\": \"\",\n \"createdById\": \"\",\n \"currentlyPublished\": false,\n \"archivedInDashboard\": false,\n \"created\": \"\",\n \"contentTypeCategory\": \"\",\n \"mabExperimentId\": \"\",\n \"updatedById\": \"\",\n \"translatedFromId\": \"\",\n \"folderId\": \"\",\n \"widgetContainers\": {},\n \"pageExpiryRedirectId\": 0,\n \"dynamicPageDataSourceType\": 0,\n \"featuredImage\": \"\",\n \"authorName\": \"\",\n \"domain\": \"\",\n \"name\": \"\",\n \"dynamicPageHubDbTableId\": \"\",\n \"campaign\": \"\",\n \"dynamicPageDataSourceId\": \"\",\n \"enableDomainStylesheets\": false,\n \"includeDefaultCustomCss\": false,\n \"subcategory\": \"\",\n \"layoutSections\": {},\n \"updated\": \"\",\n \"footerHtml\": \"\",\n \"widgets\": {},\n \"headHtml\": \"\",\n \"pageExpiryRedirectUrl\": \"\",\n \"abStatus\": \"\",\n \"useFeaturedImage\": false,\n \"abTestId\": \"\",\n \"featuredImageAltText\": \"\",\n \"contentGroupId\": \"\",\n \"pageExpiryEnabled\": false,\n \"templatePath\": \"\",\n \"url\": \"\",\n \"publicAccessRules\": [\n {}\n ],\n \"archivedAt\": \"\",\n \"themeSettingsValues\": {},\n \"pageExpiryDate\": 0,\n \"publicAccessRulesEnabled\": false,\n \"pageRedirected\": false,\n \"currentState\": \"\",\n \"categoryId\": 0,\n \"linkRelCanonicalUrl\": \"\"\n }\n ]\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/cms/v3/pages/landing-pages/batch/create")
.post(body)
.addHeader("private-app-legacy", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/cms/v3/pages/landing-pages/batch/create")
.header("private-app-legacy", "{{apiKey}}")
.header("content-type", "application/json")
.body("{\n \"inputs\": [\n {\n \"publishDate\": \"\",\n \"language\": \"\",\n \"enableLayoutStylesheets\": false,\n \"metaDescription\": \"\",\n \"attachedStylesheets\": [\n {}\n ],\n \"password\": \"\",\n \"publishImmediately\": false,\n \"htmlTitle\": \"\",\n \"translations\": {},\n \"id\": \"\",\n \"state\": \"\",\n \"slug\": \"\",\n \"createdById\": \"\",\n \"currentlyPublished\": false,\n \"archivedInDashboard\": false,\n \"created\": \"\",\n \"contentTypeCategory\": \"\",\n \"mabExperimentId\": \"\",\n \"updatedById\": \"\",\n \"translatedFromId\": \"\",\n \"folderId\": \"\",\n \"widgetContainers\": {},\n \"pageExpiryRedirectId\": 0,\n \"dynamicPageDataSourceType\": 0,\n \"featuredImage\": \"\",\n \"authorName\": \"\",\n \"domain\": \"\",\n \"name\": \"\",\n \"dynamicPageHubDbTableId\": \"\",\n \"campaign\": \"\",\n \"dynamicPageDataSourceId\": \"\",\n \"enableDomainStylesheets\": false,\n \"includeDefaultCustomCss\": false,\n \"subcategory\": \"\",\n \"layoutSections\": {},\n \"updated\": \"\",\n \"footerHtml\": \"\",\n \"widgets\": {},\n \"headHtml\": \"\",\n \"pageExpiryRedirectUrl\": \"\",\n \"abStatus\": \"\",\n \"useFeaturedImage\": false,\n \"abTestId\": \"\",\n \"featuredImageAltText\": \"\",\n \"contentGroupId\": \"\",\n \"pageExpiryEnabled\": false,\n \"templatePath\": \"\",\n \"url\": \"\",\n \"publicAccessRules\": [\n {}\n ],\n \"archivedAt\": \"\",\n \"themeSettingsValues\": {},\n \"pageExpiryDate\": 0,\n \"publicAccessRulesEnabled\": false,\n \"pageRedirected\": false,\n \"currentState\": \"\",\n \"categoryId\": 0,\n \"linkRelCanonicalUrl\": \"\"\n }\n ]\n}")
.asString();
const data = JSON.stringify({
inputs: [
{
publishDate: '',
language: '',
enableLayoutStylesheets: false,
metaDescription: '',
attachedStylesheets: [
{}
],
password: '',
publishImmediately: false,
htmlTitle: '',
translations: {},
id: '',
state: '',
slug: '',
createdById: '',
currentlyPublished: false,
archivedInDashboard: false,
created: '',
contentTypeCategory: '',
mabExperimentId: '',
updatedById: '',
translatedFromId: '',
folderId: '',
widgetContainers: {},
pageExpiryRedirectId: 0,
dynamicPageDataSourceType: 0,
featuredImage: '',
authorName: '',
domain: '',
name: '',
dynamicPageHubDbTableId: '',
campaign: '',
dynamicPageDataSourceId: '',
enableDomainStylesheets: false,
includeDefaultCustomCss: false,
subcategory: '',
layoutSections: {},
updated: '',
footerHtml: '',
widgets: {},
headHtml: '',
pageExpiryRedirectUrl: '',
abStatus: '',
useFeaturedImage: false,
abTestId: '',
featuredImageAltText: '',
contentGroupId: '',
pageExpiryEnabled: false,
templatePath: '',
url: '',
publicAccessRules: [
{}
],
archivedAt: '',
themeSettingsValues: {},
pageExpiryDate: 0,
publicAccessRulesEnabled: false,
pageRedirected: false,
currentState: '',
categoryId: 0,
linkRelCanonicalUrl: ''
}
]
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/cms/v3/pages/landing-pages/batch/create');
xhr.setRequestHeader('private-app-legacy', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/cms/v3/pages/landing-pages/batch/create',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
data: {
inputs: [
{
publishDate: '',
language: '',
enableLayoutStylesheets: false,
metaDescription: '',
attachedStylesheets: [{}],
password: '',
publishImmediately: false,
htmlTitle: '',
translations: {},
id: '',
state: '',
slug: '',
createdById: '',
currentlyPublished: false,
archivedInDashboard: false,
created: '',
contentTypeCategory: '',
mabExperimentId: '',
updatedById: '',
translatedFromId: '',
folderId: '',
widgetContainers: {},
pageExpiryRedirectId: 0,
dynamicPageDataSourceType: 0,
featuredImage: '',
authorName: '',
domain: '',
name: '',
dynamicPageHubDbTableId: '',
campaign: '',
dynamicPageDataSourceId: '',
enableDomainStylesheets: false,
includeDefaultCustomCss: false,
subcategory: '',
layoutSections: {},
updated: '',
footerHtml: '',
widgets: {},
headHtml: '',
pageExpiryRedirectUrl: '',
abStatus: '',
useFeaturedImage: false,
abTestId: '',
featuredImageAltText: '',
contentGroupId: '',
pageExpiryEnabled: false,
templatePath: '',
url: '',
publicAccessRules: [{}],
archivedAt: '',
themeSettingsValues: {},
pageExpiryDate: 0,
publicAccessRulesEnabled: false,
pageRedirected: false,
currentState: '',
categoryId: 0,
linkRelCanonicalUrl: ''
}
]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/cms/v3/pages/landing-pages/batch/create';
const options = {
method: 'POST',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
body: '{"inputs":[{"publishDate":"","language":"","enableLayoutStylesheets":false,"metaDescription":"","attachedStylesheets":[{}],"password":"","publishImmediately":false,"htmlTitle":"","translations":{},"id":"","state":"","slug":"","createdById":"","currentlyPublished":false,"archivedInDashboard":false,"created":"","contentTypeCategory":"","mabExperimentId":"","updatedById":"","translatedFromId":"","folderId":"","widgetContainers":{},"pageExpiryRedirectId":0,"dynamicPageDataSourceType":0,"featuredImage":"","authorName":"","domain":"","name":"","dynamicPageHubDbTableId":"","campaign":"","dynamicPageDataSourceId":"","enableDomainStylesheets":false,"includeDefaultCustomCss":false,"subcategory":"","layoutSections":{},"updated":"","footerHtml":"","widgets":{},"headHtml":"","pageExpiryRedirectUrl":"","abStatus":"","useFeaturedImage":false,"abTestId":"","featuredImageAltText":"","contentGroupId":"","pageExpiryEnabled":false,"templatePath":"","url":"","publicAccessRules":[{}],"archivedAt":"","themeSettingsValues":{},"pageExpiryDate":0,"publicAccessRulesEnabled":false,"pageRedirected":false,"currentState":"","categoryId":0,"linkRelCanonicalUrl":""}]}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/cms/v3/pages/landing-pages/batch/create',
method: 'POST',
headers: {
'private-app-legacy': '{{apiKey}}',
'content-type': 'application/json'
},
processData: false,
data: '{\n "inputs": [\n {\n "publishDate": "",\n "language": "",\n "enableLayoutStylesheets": false,\n "metaDescription": "",\n "attachedStylesheets": [\n {}\n ],\n "password": "",\n "publishImmediately": false,\n "htmlTitle": "",\n "translations": {},\n "id": "",\n "state": "",\n "slug": "",\n "createdById": "",\n "currentlyPublished": false,\n "archivedInDashboard": false,\n "created": "",\n "contentTypeCategory": "",\n "mabExperimentId": "",\n "updatedById": "",\n "translatedFromId": "",\n "folderId": "",\n "widgetContainers": {},\n "pageExpiryRedirectId": 0,\n "dynamicPageDataSourceType": 0,\n "featuredImage": "",\n "authorName": "",\n "domain": "",\n "name": "",\n "dynamicPageHubDbTableId": "",\n "campaign": "",\n "dynamicPageDataSourceId": "",\n "enableDomainStylesheets": false,\n "includeDefaultCustomCss": false,\n "subcategory": "",\n "layoutSections": {},\n "updated": "",\n "footerHtml": "",\n "widgets": {},\n "headHtml": "",\n "pageExpiryRedirectUrl": "",\n "abStatus": "",\n "useFeaturedImage": false,\n "abTestId": "",\n "featuredImageAltText": "",\n "contentGroupId": "",\n "pageExpiryEnabled": false,\n "templatePath": "",\n "url": "",\n "publicAccessRules": [\n {}\n ],\n "archivedAt": "",\n "themeSettingsValues": {},\n "pageExpiryDate": 0,\n "publicAccessRulesEnabled": false,\n "pageRedirected": false,\n "currentState": "",\n "categoryId": 0,\n "linkRelCanonicalUrl": ""\n }\n ]\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"inputs\": [\n {\n \"publishDate\": \"\",\n \"language\": \"\",\n \"enableLayoutStylesheets\": false,\n \"metaDescription\": \"\",\n \"attachedStylesheets\": [\n {}\n ],\n \"password\": \"\",\n \"publishImmediately\": false,\n \"htmlTitle\": \"\",\n \"translations\": {},\n \"id\": \"\",\n \"state\": \"\",\n \"slug\": \"\",\n \"createdById\": \"\",\n \"currentlyPublished\": false,\n \"archivedInDashboard\": false,\n \"created\": \"\",\n \"contentTypeCategory\": \"\",\n \"mabExperimentId\": \"\",\n \"updatedById\": \"\",\n \"translatedFromId\": \"\",\n \"folderId\": \"\",\n \"widgetContainers\": {},\n \"pageExpiryRedirectId\": 0,\n \"dynamicPageDataSourceType\": 0,\n \"featuredImage\": \"\",\n \"authorName\": \"\",\n \"domain\": \"\",\n \"name\": \"\",\n \"dynamicPageHubDbTableId\": \"\",\n \"campaign\": \"\",\n \"dynamicPageDataSourceId\": \"\",\n \"enableDomainStylesheets\": false,\n \"includeDefaultCustomCss\": false,\n \"subcategory\": \"\",\n \"layoutSections\": {},\n \"updated\": \"\",\n \"footerHtml\": \"\",\n \"widgets\": {},\n \"headHtml\": \"\",\n \"pageExpiryRedirectUrl\": \"\",\n \"abStatus\": \"\",\n \"useFeaturedImage\": false,\n \"abTestId\": \"\",\n \"featuredImageAltText\": \"\",\n \"contentGroupId\": \"\",\n \"pageExpiryEnabled\": false,\n \"templatePath\": \"\",\n \"url\": \"\",\n \"publicAccessRules\": [\n {}\n ],\n \"archivedAt\": \"\",\n \"themeSettingsValues\": {},\n \"pageExpiryDate\": 0,\n \"publicAccessRulesEnabled\": false,\n \"pageRedirected\": false,\n \"currentState\": \"\",\n \"categoryId\": 0,\n \"linkRelCanonicalUrl\": \"\"\n }\n ]\n}")
val request = Request.Builder()
.url("{{baseUrl}}/cms/v3/pages/landing-pages/batch/create")
.post(body)
.addHeader("private-app-legacy", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/cms/v3/pages/landing-pages/batch/create',
headers: {
'private-app-legacy': '{{apiKey}}',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
inputs: [
{
publishDate: '',
language: '',
enableLayoutStylesheets: false,
metaDescription: '',
attachedStylesheets: [{}],
password: '',
publishImmediately: false,
htmlTitle: '',
translations: {},
id: '',
state: '',
slug: '',
createdById: '',
currentlyPublished: false,
archivedInDashboard: false,
created: '',
contentTypeCategory: '',
mabExperimentId: '',
updatedById: '',
translatedFromId: '',
folderId: '',
widgetContainers: {},
pageExpiryRedirectId: 0,
dynamicPageDataSourceType: 0,
featuredImage: '',
authorName: '',
domain: '',
name: '',
dynamicPageHubDbTableId: '',
campaign: '',
dynamicPageDataSourceId: '',
enableDomainStylesheets: false,
includeDefaultCustomCss: false,
subcategory: '',
layoutSections: {},
updated: '',
footerHtml: '',
widgets: {},
headHtml: '',
pageExpiryRedirectUrl: '',
abStatus: '',
useFeaturedImage: false,
abTestId: '',
featuredImageAltText: '',
contentGroupId: '',
pageExpiryEnabled: false,
templatePath: '',
url: '',
publicAccessRules: [{}],
archivedAt: '',
themeSettingsValues: {},
pageExpiryDate: 0,
publicAccessRulesEnabled: false,
pageRedirected: false,
currentState: '',
categoryId: 0,
linkRelCanonicalUrl: ''
}
]
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/cms/v3/pages/landing-pages/batch/create',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
body: {
inputs: [
{
publishDate: '',
language: '',
enableLayoutStylesheets: false,
metaDescription: '',
attachedStylesheets: [{}],
password: '',
publishImmediately: false,
htmlTitle: '',
translations: {},
id: '',
state: '',
slug: '',
createdById: '',
currentlyPublished: false,
archivedInDashboard: false,
created: '',
contentTypeCategory: '',
mabExperimentId: '',
updatedById: '',
translatedFromId: '',
folderId: '',
widgetContainers: {},
pageExpiryRedirectId: 0,
dynamicPageDataSourceType: 0,
featuredImage: '',
authorName: '',
domain: '',
name: '',
dynamicPageHubDbTableId: '',
campaign: '',
dynamicPageDataSourceId: '',
enableDomainStylesheets: false,
includeDefaultCustomCss: false,
subcategory: '',
layoutSections: {},
updated: '',
footerHtml: '',
widgets: {},
headHtml: '',
pageExpiryRedirectUrl: '',
abStatus: '',
useFeaturedImage: false,
abTestId: '',
featuredImageAltText: '',
contentGroupId: '',
pageExpiryEnabled: false,
templatePath: '',
url: '',
publicAccessRules: [{}],
archivedAt: '',
themeSettingsValues: {},
pageExpiryDate: 0,
publicAccessRulesEnabled: false,
pageRedirected: false,
currentState: '',
categoryId: 0,
linkRelCanonicalUrl: ''
}
]
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/cms/v3/pages/landing-pages/batch/create');
req.headers({
'private-app-legacy': '{{apiKey}}',
'content-type': 'application/json'
});
req.type('json');
req.send({
inputs: [
{
publishDate: '',
language: '',
enableLayoutStylesheets: false,
metaDescription: '',
attachedStylesheets: [
{}
],
password: '',
publishImmediately: false,
htmlTitle: '',
translations: {},
id: '',
state: '',
slug: '',
createdById: '',
currentlyPublished: false,
archivedInDashboard: false,
created: '',
contentTypeCategory: '',
mabExperimentId: '',
updatedById: '',
translatedFromId: '',
folderId: '',
widgetContainers: {},
pageExpiryRedirectId: 0,
dynamicPageDataSourceType: 0,
featuredImage: '',
authorName: '',
domain: '',
name: '',
dynamicPageHubDbTableId: '',
campaign: '',
dynamicPageDataSourceId: '',
enableDomainStylesheets: false,
includeDefaultCustomCss: false,
subcategory: '',
layoutSections: {},
updated: '',
footerHtml: '',
widgets: {},
headHtml: '',
pageExpiryRedirectUrl: '',
abStatus: '',
useFeaturedImage: false,
abTestId: '',
featuredImageAltText: '',
contentGroupId: '',
pageExpiryEnabled: false,
templatePath: '',
url: '',
publicAccessRules: [
{}
],
archivedAt: '',
themeSettingsValues: {},
pageExpiryDate: 0,
publicAccessRulesEnabled: false,
pageRedirected: false,
currentState: '',
categoryId: 0,
linkRelCanonicalUrl: ''
}
]
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/cms/v3/pages/landing-pages/batch/create',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
data: {
inputs: [
{
publishDate: '',
language: '',
enableLayoutStylesheets: false,
metaDescription: '',
attachedStylesheets: [{}],
password: '',
publishImmediately: false,
htmlTitle: '',
translations: {},
id: '',
state: '',
slug: '',
createdById: '',
currentlyPublished: false,
archivedInDashboard: false,
created: '',
contentTypeCategory: '',
mabExperimentId: '',
updatedById: '',
translatedFromId: '',
folderId: '',
widgetContainers: {},
pageExpiryRedirectId: 0,
dynamicPageDataSourceType: 0,
featuredImage: '',
authorName: '',
domain: '',
name: '',
dynamicPageHubDbTableId: '',
campaign: '',
dynamicPageDataSourceId: '',
enableDomainStylesheets: false,
includeDefaultCustomCss: false,
subcategory: '',
layoutSections: {},
updated: '',
footerHtml: '',
widgets: {},
headHtml: '',
pageExpiryRedirectUrl: '',
abStatus: '',
useFeaturedImage: false,
abTestId: '',
featuredImageAltText: '',
contentGroupId: '',
pageExpiryEnabled: false,
templatePath: '',
url: '',
publicAccessRules: [{}],
archivedAt: '',
themeSettingsValues: {},
pageExpiryDate: 0,
publicAccessRulesEnabled: false,
pageRedirected: false,
currentState: '',
categoryId: 0,
linkRelCanonicalUrl: ''
}
]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/cms/v3/pages/landing-pages/batch/create';
const options = {
method: 'POST',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
body: '{"inputs":[{"publishDate":"","language":"","enableLayoutStylesheets":false,"metaDescription":"","attachedStylesheets":[{}],"password":"","publishImmediately":false,"htmlTitle":"","translations":{},"id":"","state":"","slug":"","createdById":"","currentlyPublished":false,"archivedInDashboard":false,"created":"","contentTypeCategory":"","mabExperimentId":"","updatedById":"","translatedFromId":"","folderId":"","widgetContainers":{},"pageExpiryRedirectId":0,"dynamicPageDataSourceType":0,"featuredImage":"","authorName":"","domain":"","name":"","dynamicPageHubDbTableId":"","campaign":"","dynamicPageDataSourceId":"","enableDomainStylesheets":false,"includeDefaultCustomCss":false,"subcategory":"","layoutSections":{},"updated":"","footerHtml":"","widgets":{},"headHtml":"","pageExpiryRedirectUrl":"","abStatus":"","useFeaturedImage":false,"abTestId":"","featuredImageAltText":"","contentGroupId":"","pageExpiryEnabled":false,"templatePath":"","url":"","publicAccessRules":[{}],"archivedAt":"","themeSettingsValues":{},"pageExpiryDate":0,"publicAccessRulesEnabled":false,"pageRedirected":false,"currentState":"","categoryId":0,"linkRelCanonicalUrl":""}]}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"private-app-legacy": @"{{apiKey}}",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"inputs": @[ @{ @"publishDate": @"", @"language": @"", @"enableLayoutStylesheets": @NO, @"metaDescription": @"", @"attachedStylesheets": @[ @{ } ], @"password": @"", @"publishImmediately": @NO, @"htmlTitle": @"", @"translations": @{ }, @"id": @"", @"state": @"", @"slug": @"", @"createdById": @"", @"currentlyPublished": @NO, @"archivedInDashboard": @NO, @"created": @"", @"contentTypeCategory": @"", @"mabExperimentId": @"", @"updatedById": @"", @"translatedFromId": @"", @"folderId": @"", @"widgetContainers": @{ }, @"pageExpiryRedirectId": @0, @"dynamicPageDataSourceType": @0, @"featuredImage": @"", @"authorName": @"", @"domain": @"", @"name": @"", @"dynamicPageHubDbTableId": @"", @"campaign": @"", @"dynamicPageDataSourceId": @"", @"enableDomainStylesheets": @NO, @"includeDefaultCustomCss": @NO, @"subcategory": @"", @"layoutSections": @{ }, @"updated": @"", @"footerHtml": @"", @"widgets": @{ }, @"headHtml": @"", @"pageExpiryRedirectUrl": @"", @"abStatus": @"", @"useFeaturedImage": @NO, @"abTestId": @"", @"featuredImageAltText": @"", @"contentGroupId": @"", @"pageExpiryEnabled": @NO, @"templatePath": @"", @"url": @"", @"publicAccessRules": @[ @{ } ], @"archivedAt": @"", @"themeSettingsValues": @{ }, @"pageExpiryDate": @0, @"publicAccessRulesEnabled": @NO, @"pageRedirected": @NO, @"currentState": @"", @"categoryId": @0, @"linkRelCanonicalUrl": @"" } ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/cms/v3/pages/landing-pages/batch/create"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/cms/v3/pages/landing-pages/batch/create" in
let headers = Header.add_list (Header.init ()) [
("private-app-legacy", "{{apiKey}}");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"inputs\": [\n {\n \"publishDate\": \"\",\n \"language\": \"\",\n \"enableLayoutStylesheets\": false,\n \"metaDescription\": \"\",\n \"attachedStylesheets\": [\n {}\n ],\n \"password\": \"\",\n \"publishImmediately\": false,\n \"htmlTitle\": \"\",\n \"translations\": {},\n \"id\": \"\",\n \"state\": \"\",\n \"slug\": \"\",\n \"createdById\": \"\",\n \"currentlyPublished\": false,\n \"archivedInDashboard\": false,\n \"created\": \"\",\n \"contentTypeCategory\": \"\",\n \"mabExperimentId\": \"\",\n \"updatedById\": \"\",\n \"translatedFromId\": \"\",\n \"folderId\": \"\",\n \"widgetContainers\": {},\n \"pageExpiryRedirectId\": 0,\n \"dynamicPageDataSourceType\": 0,\n \"featuredImage\": \"\",\n \"authorName\": \"\",\n \"domain\": \"\",\n \"name\": \"\",\n \"dynamicPageHubDbTableId\": \"\",\n \"campaign\": \"\",\n \"dynamicPageDataSourceId\": \"\",\n \"enableDomainStylesheets\": false,\n \"includeDefaultCustomCss\": false,\n \"subcategory\": \"\",\n \"layoutSections\": {},\n \"updated\": \"\",\n \"footerHtml\": \"\",\n \"widgets\": {},\n \"headHtml\": \"\",\n \"pageExpiryRedirectUrl\": \"\",\n \"abStatus\": \"\",\n \"useFeaturedImage\": false,\n \"abTestId\": \"\",\n \"featuredImageAltText\": \"\",\n \"contentGroupId\": \"\",\n \"pageExpiryEnabled\": false,\n \"templatePath\": \"\",\n \"url\": \"\",\n \"publicAccessRules\": [\n {}\n ],\n \"archivedAt\": \"\",\n \"themeSettingsValues\": {},\n \"pageExpiryDate\": 0,\n \"publicAccessRulesEnabled\": false,\n \"pageRedirected\": false,\n \"currentState\": \"\",\n \"categoryId\": 0,\n \"linkRelCanonicalUrl\": \"\"\n }\n ]\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/cms/v3/pages/landing-pages/batch/create",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'inputs' => [
[
'publishDate' => '',
'language' => '',
'enableLayoutStylesheets' => null,
'metaDescription' => '',
'attachedStylesheets' => [
[
]
],
'password' => '',
'publishImmediately' => null,
'htmlTitle' => '',
'translations' => [
],
'id' => '',
'state' => '',
'slug' => '',
'createdById' => '',
'currentlyPublished' => null,
'archivedInDashboard' => null,
'created' => '',
'contentTypeCategory' => '',
'mabExperimentId' => '',
'updatedById' => '',
'translatedFromId' => '',
'folderId' => '',
'widgetContainers' => [
],
'pageExpiryRedirectId' => 0,
'dynamicPageDataSourceType' => 0,
'featuredImage' => '',
'authorName' => '',
'domain' => '',
'name' => '',
'dynamicPageHubDbTableId' => '',
'campaign' => '',
'dynamicPageDataSourceId' => '',
'enableDomainStylesheets' => null,
'includeDefaultCustomCss' => null,
'subcategory' => '',
'layoutSections' => [
],
'updated' => '',
'footerHtml' => '',
'widgets' => [
],
'headHtml' => '',
'pageExpiryRedirectUrl' => '',
'abStatus' => '',
'useFeaturedImage' => null,
'abTestId' => '',
'featuredImageAltText' => '',
'contentGroupId' => '',
'pageExpiryEnabled' => null,
'templatePath' => '',
'url' => '',
'publicAccessRules' => [
[
]
],
'archivedAt' => '',
'themeSettingsValues' => [
],
'pageExpiryDate' => 0,
'publicAccessRulesEnabled' => null,
'pageRedirected' => null,
'currentState' => '',
'categoryId' => 0,
'linkRelCanonicalUrl' => ''
]
]
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"private-app-legacy: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/cms/v3/pages/landing-pages/batch/create', [
'body' => '{
"inputs": [
{
"publishDate": "",
"language": "",
"enableLayoutStylesheets": false,
"metaDescription": "",
"attachedStylesheets": [
{}
],
"password": "",
"publishImmediately": false,
"htmlTitle": "",
"translations": {},
"id": "",
"state": "",
"slug": "",
"createdById": "",
"currentlyPublished": false,
"archivedInDashboard": false,
"created": "",
"contentTypeCategory": "",
"mabExperimentId": "",
"updatedById": "",
"translatedFromId": "",
"folderId": "",
"widgetContainers": {},
"pageExpiryRedirectId": 0,
"dynamicPageDataSourceType": 0,
"featuredImage": "",
"authorName": "",
"domain": "",
"name": "",
"dynamicPageHubDbTableId": "",
"campaign": "",
"dynamicPageDataSourceId": "",
"enableDomainStylesheets": false,
"includeDefaultCustomCss": false,
"subcategory": "",
"layoutSections": {},
"updated": "",
"footerHtml": "",
"widgets": {},
"headHtml": "",
"pageExpiryRedirectUrl": "",
"abStatus": "",
"useFeaturedImage": false,
"abTestId": "",
"featuredImageAltText": "",
"contentGroupId": "",
"pageExpiryEnabled": false,
"templatePath": "",
"url": "",
"publicAccessRules": [
{}
],
"archivedAt": "",
"themeSettingsValues": {},
"pageExpiryDate": 0,
"publicAccessRulesEnabled": false,
"pageRedirected": false,
"currentState": "",
"categoryId": 0,
"linkRelCanonicalUrl": ""
}
]
}',
'headers' => [
'content-type' => 'application/json',
'private-app-legacy' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/cms/v3/pages/landing-pages/batch/create');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'private-app-legacy' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'inputs' => [
[
'publishDate' => '',
'language' => '',
'enableLayoutStylesheets' => null,
'metaDescription' => '',
'attachedStylesheets' => [
[
]
],
'password' => '',
'publishImmediately' => null,
'htmlTitle' => '',
'translations' => [
],
'id' => '',
'state' => '',
'slug' => '',
'createdById' => '',
'currentlyPublished' => null,
'archivedInDashboard' => null,
'created' => '',
'contentTypeCategory' => '',
'mabExperimentId' => '',
'updatedById' => '',
'translatedFromId' => '',
'folderId' => '',
'widgetContainers' => [
],
'pageExpiryRedirectId' => 0,
'dynamicPageDataSourceType' => 0,
'featuredImage' => '',
'authorName' => '',
'domain' => '',
'name' => '',
'dynamicPageHubDbTableId' => '',
'campaign' => '',
'dynamicPageDataSourceId' => '',
'enableDomainStylesheets' => null,
'includeDefaultCustomCss' => null,
'subcategory' => '',
'layoutSections' => [
],
'updated' => '',
'footerHtml' => '',
'widgets' => [
],
'headHtml' => '',
'pageExpiryRedirectUrl' => '',
'abStatus' => '',
'useFeaturedImage' => null,
'abTestId' => '',
'featuredImageAltText' => '',
'contentGroupId' => '',
'pageExpiryEnabled' => null,
'templatePath' => '',
'url' => '',
'publicAccessRules' => [
[
]
],
'archivedAt' => '',
'themeSettingsValues' => [
],
'pageExpiryDate' => 0,
'publicAccessRulesEnabled' => null,
'pageRedirected' => null,
'currentState' => '',
'categoryId' => 0,
'linkRelCanonicalUrl' => ''
]
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'inputs' => [
[
'publishDate' => '',
'language' => '',
'enableLayoutStylesheets' => null,
'metaDescription' => '',
'attachedStylesheets' => [
[
]
],
'password' => '',
'publishImmediately' => null,
'htmlTitle' => '',
'translations' => [
],
'id' => '',
'state' => '',
'slug' => '',
'createdById' => '',
'currentlyPublished' => null,
'archivedInDashboard' => null,
'created' => '',
'contentTypeCategory' => '',
'mabExperimentId' => '',
'updatedById' => '',
'translatedFromId' => '',
'folderId' => '',
'widgetContainers' => [
],
'pageExpiryRedirectId' => 0,
'dynamicPageDataSourceType' => 0,
'featuredImage' => '',
'authorName' => '',
'domain' => '',
'name' => '',
'dynamicPageHubDbTableId' => '',
'campaign' => '',
'dynamicPageDataSourceId' => '',
'enableDomainStylesheets' => null,
'includeDefaultCustomCss' => null,
'subcategory' => '',
'layoutSections' => [
],
'updated' => '',
'footerHtml' => '',
'widgets' => [
],
'headHtml' => '',
'pageExpiryRedirectUrl' => '',
'abStatus' => '',
'useFeaturedImage' => null,
'abTestId' => '',
'featuredImageAltText' => '',
'contentGroupId' => '',
'pageExpiryEnabled' => null,
'templatePath' => '',
'url' => '',
'publicAccessRules' => [
[
]
],
'archivedAt' => '',
'themeSettingsValues' => [
],
'pageExpiryDate' => 0,
'publicAccessRulesEnabled' => null,
'pageRedirected' => null,
'currentState' => '',
'categoryId' => 0,
'linkRelCanonicalUrl' => ''
]
]
]));
$request->setRequestUrl('{{baseUrl}}/cms/v3/pages/landing-pages/batch/create');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'private-app-legacy' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("private-app-legacy", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/cms/v3/pages/landing-pages/batch/create' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"inputs": [
{
"publishDate": "",
"language": "",
"enableLayoutStylesheets": false,
"metaDescription": "",
"attachedStylesheets": [
{}
],
"password": "",
"publishImmediately": false,
"htmlTitle": "",
"translations": {},
"id": "",
"state": "",
"slug": "",
"createdById": "",
"currentlyPublished": false,
"archivedInDashboard": false,
"created": "",
"contentTypeCategory": "",
"mabExperimentId": "",
"updatedById": "",
"translatedFromId": "",
"folderId": "",
"widgetContainers": {},
"pageExpiryRedirectId": 0,
"dynamicPageDataSourceType": 0,
"featuredImage": "",
"authorName": "",
"domain": "",
"name": "",
"dynamicPageHubDbTableId": "",
"campaign": "",
"dynamicPageDataSourceId": "",
"enableDomainStylesheets": false,
"includeDefaultCustomCss": false,
"subcategory": "",
"layoutSections": {},
"updated": "",
"footerHtml": "",
"widgets": {},
"headHtml": "",
"pageExpiryRedirectUrl": "",
"abStatus": "",
"useFeaturedImage": false,
"abTestId": "",
"featuredImageAltText": "",
"contentGroupId": "",
"pageExpiryEnabled": false,
"templatePath": "",
"url": "",
"publicAccessRules": [
{}
],
"archivedAt": "",
"themeSettingsValues": {},
"pageExpiryDate": 0,
"publicAccessRulesEnabled": false,
"pageRedirected": false,
"currentState": "",
"categoryId": 0,
"linkRelCanonicalUrl": ""
}
]
}'
$headers=@{}
$headers.Add("private-app-legacy", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/cms/v3/pages/landing-pages/batch/create' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"inputs": [
{
"publishDate": "",
"language": "",
"enableLayoutStylesheets": false,
"metaDescription": "",
"attachedStylesheets": [
{}
],
"password": "",
"publishImmediately": false,
"htmlTitle": "",
"translations": {},
"id": "",
"state": "",
"slug": "",
"createdById": "",
"currentlyPublished": false,
"archivedInDashboard": false,
"created": "",
"contentTypeCategory": "",
"mabExperimentId": "",
"updatedById": "",
"translatedFromId": "",
"folderId": "",
"widgetContainers": {},
"pageExpiryRedirectId": 0,
"dynamicPageDataSourceType": 0,
"featuredImage": "",
"authorName": "",
"domain": "",
"name": "",
"dynamicPageHubDbTableId": "",
"campaign": "",
"dynamicPageDataSourceId": "",
"enableDomainStylesheets": false,
"includeDefaultCustomCss": false,
"subcategory": "",
"layoutSections": {},
"updated": "",
"footerHtml": "",
"widgets": {},
"headHtml": "",
"pageExpiryRedirectUrl": "",
"abStatus": "",
"useFeaturedImage": false,
"abTestId": "",
"featuredImageAltText": "",
"contentGroupId": "",
"pageExpiryEnabled": false,
"templatePath": "",
"url": "",
"publicAccessRules": [
{}
],
"archivedAt": "",
"themeSettingsValues": {},
"pageExpiryDate": 0,
"publicAccessRulesEnabled": false,
"pageRedirected": false,
"currentState": "",
"categoryId": 0,
"linkRelCanonicalUrl": ""
}
]
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"inputs\": [\n {\n \"publishDate\": \"\",\n \"language\": \"\",\n \"enableLayoutStylesheets\": false,\n \"metaDescription\": \"\",\n \"attachedStylesheets\": [\n {}\n ],\n \"password\": \"\",\n \"publishImmediately\": false,\n \"htmlTitle\": \"\",\n \"translations\": {},\n \"id\": \"\",\n \"state\": \"\",\n \"slug\": \"\",\n \"createdById\": \"\",\n \"currentlyPublished\": false,\n \"archivedInDashboard\": false,\n \"created\": \"\",\n \"contentTypeCategory\": \"\",\n \"mabExperimentId\": \"\",\n \"updatedById\": \"\",\n \"translatedFromId\": \"\",\n \"folderId\": \"\",\n \"widgetContainers\": {},\n \"pageExpiryRedirectId\": 0,\n \"dynamicPageDataSourceType\": 0,\n \"featuredImage\": \"\",\n \"authorName\": \"\",\n \"domain\": \"\",\n \"name\": \"\",\n \"dynamicPageHubDbTableId\": \"\",\n \"campaign\": \"\",\n \"dynamicPageDataSourceId\": \"\",\n \"enableDomainStylesheets\": false,\n \"includeDefaultCustomCss\": false,\n \"subcategory\": \"\",\n \"layoutSections\": {},\n \"updated\": \"\",\n \"footerHtml\": \"\",\n \"widgets\": {},\n \"headHtml\": \"\",\n \"pageExpiryRedirectUrl\": \"\",\n \"abStatus\": \"\",\n \"useFeaturedImage\": false,\n \"abTestId\": \"\",\n \"featuredImageAltText\": \"\",\n \"contentGroupId\": \"\",\n \"pageExpiryEnabled\": false,\n \"templatePath\": \"\",\n \"url\": \"\",\n \"publicAccessRules\": [\n {}\n ],\n \"archivedAt\": \"\",\n \"themeSettingsValues\": {},\n \"pageExpiryDate\": 0,\n \"publicAccessRulesEnabled\": false,\n \"pageRedirected\": false,\n \"currentState\": \"\",\n \"categoryId\": 0,\n \"linkRelCanonicalUrl\": \"\"\n }\n ]\n}"
headers = {
'private-app-legacy': "{{apiKey}}",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/cms/v3/pages/landing-pages/batch/create", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/cms/v3/pages/landing-pages/batch/create"
payload = { "inputs": [
{
"publishDate": "",
"language": "",
"enableLayoutStylesheets": False,
"metaDescription": "",
"attachedStylesheets": [{}],
"password": "",
"publishImmediately": False,
"htmlTitle": "",
"translations": {},
"id": "",
"state": "",
"slug": "",
"createdById": "",
"currentlyPublished": False,
"archivedInDashboard": False,
"created": "",
"contentTypeCategory": "",
"mabExperimentId": "",
"updatedById": "",
"translatedFromId": "",
"folderId": "",
"widgetContainers": {},
"pageExpiryRedirectId": 0,
"dynamicPageDataSourceType": 0,
"featuredImage": "",
"authorName": "",
"domain": "",
"name": "",
"dynamicPageHubDbTableId": "",
"campaign": "",
"dynamicPageDataSourceId": "",
"enableDomainStylesheets": False,
"includeDefaultCustomCss": False,
"subcategory": "",
"layoutSections": {},
"updated": "",
"footerHtml": "",
"widgets": {},
"headHtml": "",
"pageExpiryRedirectUrl": "",
"abStatus": "",
"useFeaturedImage": False,
"abTestId": "",
"featuredImageAltText": "",
"contentGroupId": "",
"pageExpiryEnabled": False,
"templatePath": "",
"url": "",
"publicAccessRules": [{}],
"archivedAt": "",
"themeSettingsValues": {},
"pageExpiryDate": 0,
"publicAccessRulesEnabled": False,
"pageRedirected": False,
"currentState": "",
"categoryId": 0,
"linkRelCanonicalUrl": ""
}
] }
headers = {
"private-app-legacy": "{{apiKey}}",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/cms/v3/pages/landing-pages/batch/create"
payload <- "{\n \"inputs\": [\n {\n \"publishDate\": \"\",\n \"language\": \"\",\n \"enableLayoutStylesheets\": false,\n \"metaDescription\": \"\",\n \"attachedStylesheets\": [\n {}\n ],\n \"password\": \"\",\n \"publishImmediately\": false,\n \"htmlTitle\": \"\",\n \"translations\": {},\n \"id\": \"\",\n \"state\": \"\",\n \"slug\": \"\",\n \"createdById\": \"\",\n \"currentlyPublished\": false,\n \"archivedInDashboard\": false,\n \"created\": \"\",\n \"contentTypeCategory\": \"\",\n \"mabExperimentId\": \"\",\n \"updatedById\": \"\",\n \"translatedFromId\": \"\",\n \"folderId\": \"\",\n \"widgetContainers\": {},\n \"pageExpiryRedirectId\": 0,\n \"dynamicPageDataSourceType\": 0,\n \"featuredImage\": \"\",\n \"authorName\": \"\",\n \"domain\": \"\",\n \"name\": \"\",\n \"dynamicPageHubDbTableId\": \"\",\n \"campaign\": \"\",\n \"dynamicPageDataSourceId\": \"\",\n \"enableDomainStylesheets\": false,\n \"includeDefaultCustomCss\": false,\n \"subcategory\": \"\",\n \"layoutSections\": {},\n \"updated\": \"\",\n \"footerHtml\": \"\",\n \"widgets\": {},\n \"headHtml\": \"\",\n \"pageExpiryRedirectUrl\": \"\",\n \"abStatus\": \"\",\n \"useFeaturedImage\": false,\n \"abTestId\": \"\",\n \"featuredImageAltText\": \"\",\n \"contentGroupId\": \"\",\n \"pageExpiryEnabled\": false,\n \"templatePath\": \"\",\n \"url\": \"\",\n \"publicAccessRules\": [\n {}\n ],\n \"archivedAt\": \"\",\n \"themeSettingsValues\": {},\n \"pageExpiryDate\": 0,\n \"publicAccessRulesEnabled\": false,\n \"pageRedirected\": false,\n \"currentState\": \"\",\n \"categoryId\": 0,\n \"linkRelCanonicalUrl\": \"\"\n }\n ]\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('private-app-legacy' = '{{apiKey}}'), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/cms/v3/pages/landing-pages/batch/create")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["private-app-legacy"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n \"inputs\": [\n {\n \"publishDate\": \"\",\n \"language\": \"\",\n \"enableLayoutStylesheets\": false,\n \"metaDescription\": \"\",\n \"attachedStylesheets\": [\n {}\n ],\n \"password\": \"\",\n \"publishImmediately\": false,\n \"htmlTitle\": \"\",\n \"translations\": {},\n \"id\": \"\",\n \"state\": \"\",\n \"slug\": \"\",\n \"createdById\": \"\",\n \"currentlyPublished\": false,\n \"archivedInDashboard\": false,\n \"created\": \"\",\n \"contentTypeCategory\": \"\",\n \"mabExperimentId\": \"\",\n \"updatedById\": \"\",\n \"translatedFromId\": \"\",\n \"folderId\": \"\",\n \"widgetContainers\": {},\n \"pageExpiryRedirectId\": 0,\n \"dynamicPageDataSourceType\": 0,\n \"featuredImage\": \"\",\n \"authorName\": \"\",\n \"domain\": \"\",\n \"name\": \"\",\n \"dynamicPageHubDbTableId\": \"\",\n \"campaign\": \"\",\n \"dynamicPageDataSourceId\": \"\",\n \"enableDomainStylesheets\": false,\n \"includeDefaultCustomCss\": false,\n \"subcategory\": \"\",\n \"layoutSections\": {},\n \"updated\": \"\",\n \"footerHtml\": \"\",\n \"widgets\": {},\n \"headHtml\": \"\",\n \"pageExpiryRedirectUrl\": \"\",\n \"abStatus\": \"\",\n \"useFeaturedImage\": false,\n \"abTestId\": \"\",\n \"featuredImageAltText\": \"\",\n \"contentGroupId\": \"\",\n \"pageExpiryEnabled\": false,\n \"templatePath\": \"\",\n \"url\": \"\",\n \"publicAccessRules\": [\n {}\n ],\n \"archivedAt\": \"\",\n \"themeSettingsValues\": {},\n \"pageExpiryDate\": 0,\n \"publicAccessRulesEnabled\": false,\n \"pageRedirected\": false,\n \"currentState\": \"\",\n \"categoryId\": 0,\n \"linkRelCanonicalUrl\": \"\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/cms/v3/pages/landing-pages/batch/create') do |req|
req.headers['private-app-legacy'] = '{{apiKey}}'
req.body = "{\n \"inputs\": [\n {\n \"publishDate\": \"\",\n \"language\": \"\",\n \"enableLayoutStylesheets\": false,\n \"metaDescription\": \"\",\n \"attachedStylesheets\": [\n {}\n ],\n \"password\": \"\",\n \"publishImmediately\": false,\n \"htmlTitle\": \"\",\n \"translations\": {},\n \"id\": \"\",\n \"state\": \"\",\n \"slug\": \"\",\n \"createdById\": \"\",\n \"currentlyPublished\": false,\n \"archivedInDashboard\": false,\n \"created\": \"\",\n \"contentTypeCategory\": \"\",\n \"mabExperimentId\": \"\",\n \"updatedById\": \"\",\n \"translatedFromId\": \"\",\n \"folderId\": \"\",\n \"widgetContainers\": {},\n \"pageExpiryRedirectId\": 0,\n \"dynamicPageDataSourceType\": 0,\n \"featuredImage\": \"\",\n \"authorName\": \"\",\n \"domain\": \"\",\n \"name\": \"\",\n \"dynamicPageHubDbTableId\": \"\",\n \"campaign\": \"\",\n \"dynamicPageDataSourceId\": \"\",\n \"enableDomainStylesheets\": false,\n \"includeDefaultCustomCss\": false,\n \"subcategory\": \"\",\n \"layoutSections\": {},\n \"updated\": \"\",\n \"footerHtml\": \"\",\n \"widgets\": {},\n \"headHtml\": \"\",\n \"pageExpiryRedirectUrl\": \"\",\n \"abStatus\": \"\",\n \"useFeaturedImage\": false,\n \"abTestId\": \"\",\n \"featuredImageAltText\": \"\",\n \"contentGroupId\": \"\",\n \"pageExpiryEnabled\": false,\n \"templatePath\": \"\",\n \"url\": \"\",\n \"publicAccessRules\": [\n {}\n ],\n \"archivedAt\": \"\",\n \"themeSettingsValues\": {},\n \"pageExpiryDate\": 0,\n \"publicAccessRulesEnabled\": false,\n \"pageRedirected\": false,\n \"currentState\": \"\",\n \"categoryId\": 0,\n \"linkRelCanonicalUrl\": \"\"\n }\n ]\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/cms/v3/pages/landing-pages/batch/create";
let payload = json!({"inputs": (
json!({
"publishDate": "",
"language": "",
"enableLayoutStylesheets": false,
"metaDescription": "",
"attachedStylesheets": (json!({})),
"password": "",
"publishImmediately": false,
"htmlTitle": "",
"translations": json!({}),
"id": "",
"state": "",
"slug": "",
"createdById": "",
"currentlyPublished": false,
"archivedInDashboard": false,
"created": "",
"contentTypeCategory": "",
"mabExperimentId": "",
"updatedById": "",
"translatedFromId": "",
"folderId": "",
"widgetContainers": json!({}),
"pageExpiryRedirectId": 0,
"dynamicPageDataSourceType": 0,
"featuredImage": "",
"authorName": "",
"domain": "",
"name": "",
"dynamicPageHubDbTableId": "",
"campaign": "",
"dynamicPageDataSourceId": "",
"enableDomainStylesheets": false,
"includeDefaultCustomCss": false,
"subcategory": "",
"layoutSections": json!({}),
"updated": "",
"footerHtml": "",
"widgets": json!({}),
"headHtml": "",
"pageExpiryRedirectUrl": "",
"abStatus": "",
"useFeaturedImage": false,
"abTestId": "",
"featuredImageAltText": "",
"contentGroupId": "",
"pageExpiryEnabled": false,
"templatePath": "",
"url": "",
"publicAccessRules": (json!({})),
"archivedAt": "",
"themeSettingsValues": json!({}),
"pageExpiryDate": 0,
"publicAccessRulesEnabled": false,
"pageRedirected": false,
"currentState": "",
"categoryId": 0,
"linkRelCanonicalUrl": ""
})
)});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("private-app-legacy", "{{apiKey}}".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/cms/v3/pages/landing-pages/batch/create \
--header 'content-type: application/json' \
--header 'private-app-legacy: {{apiKey}}' \
--data '{
"inputs": [
{
"publishDate": "",
"language": "",
"enableLayoutStylesheets": false,
"metaDescription": "",
"attachedStylesheets": [
{}
],
"password": "",
"publishImmediately": false,
"htmlTitle": "",
"translations": {},
"id": "",
"state": "",
"slug": "",
"createdById": "",
"currentlyPublished": false,
"archivedInDashboard": false,
"created": "",
"contentTypeCategory": "",
"mabExperimentId": "",
"updatedById": "",
"translatedFromId": "",
"folderId": "",
"widgetContainers": {},
"pageExpiryRedirectId": 0,
"dynamicPageDataSourceType": 0,
"featuredImage": "",
"authorName": "",
"domain": "",
"name": "",
"dynamicPageHubDbTableId": "",
"campaign": "",
"dynamicPageDataSourceId": "",
"enableDomainStylesheets": false,
"includeDefaultCustomCss": false,
"subcategory": "",
"layoutSections": {},
"updated": "",
"footerHtml": "",
"widgets": {},
"headHtml": "",
"pageExpiryRedirectUrl": "",
"abStatus": "",
"useFeaturedImage": false,
"abTestId": "",
"featuredImageAltText": "",
"contentGroupId": "",
"pageExpiryEnabled": false,
"templatePath": "",
"url": "",
"publicAccessRules": [
{}
],
"archivedAt": "",
"themeSettingsValues": {},
"pageExpiryDate": 0,
"publicAccessRulesEnabled": false,
"pageRedirected": false,
"currentState": "",
"categoryId": 0,
"linkRelCanonicalUrl": ""
}
]
}'
echo '{
"inputs": [
{
"publishDate": "",
"language": "",
"enableLayoutStylesheets": false,
"metaDescription": "",
"attachedStylesheets": [
{}
],
"password": "",
"publishImmediately": false,
"htmlTitle": "",
"translations": {},
"id": "",
"state": "",
"slug": "",
"createdById": "",
"currentlyPublished": false,
"archivedInDashboard": false,
"created": "",
"contentTypeCategory": "",
"mabExperimentId": "",
"updatedById": "",
"translatedFromId": "",
"folderId": "",
"widgetContainers": {},
"pageExpiryRedirectId": 0,
"dynamicPageDataSourceType": 0,
"featuredImage": "",
"authorName": "",
"domain": "",
"name": "",
"dynamicPageHubDbTableId": "",
"campaign": "",
"dynamicPageDataSourceId": "",
"enableDomainStylesheets": false,
"includeDefaultCustomCss": false,
"subcategory": "",
"layoutSections": {},
"updated": "",
"footerHtml": "",
"widgets": {},
"headHtml": "",
"pageExpiryRedirectUrl": "",
"abStatus": "",
"useFeaturedImage": false,
"abTestId": "",
"featuredImageAltText": "",
"contentGroupId": "",
"pageExpiryEnabled": false,
"templatePath": "",
"url": "",
"publicAccessRules": [
{}
],
"archivedAt": "",
"themeSettingsValues": {},
"pageExpiryDate": 0,
"publicAccessRulesEnabled": false,
"pageRedirected": false,
"currentState": "",
"categoryId": 0,
"linkRelCanonicalUrl": ""
}
]
}' | \
http POST {{baseUrl}}/cms/v3/pages/landing-pages/batch/create \
content-type:application/json \
private-app-legacy:'{{apiKey}}'
wget --quiet \
--method POST \
--header 'private-app-legacy: {{apiKey}}' \
--header 'content-type: application/json' \
--body-data '{\n "inputs": [\n {\n "publishDate": "",\n "language": "",\n "enableLayoutStylesheets": false,\n "metaDescription": "",\n "attachedStylesheets": [\n {}\n ],\n "password": "",\n "publishImmediately": false,\n "htmlTitle": "",\n "translations": {},\n "id": "",\n "state": "",\n "slug": "",\n "createdById": "",\n "currentlyPublished": false,\n "archivedInDashboard": false,\n "created": "",\n "contentTypeCategory": "",\n "mabExperimentId": "",\n "updatedById": "",\n "translatedFromId": "",\n "folderId": "",\n "widgetContainers": {},\n "pageExpiryRedirectId": 0,\n "dynamicPageDataSourceType": 0,\n "featuredImage": "",\n "authorName": "",\n "domain": "",\n "name": "",\n "dynamicPageHubDbTableId": "",\n "campaign": "",\n "dynamicPageDataSourceId": "",\n "enableDomainStylesheets": false,\n "includeDefaultCustomCss": false,\n "subcategory": "",\n "layoutSections": {},\n "updated": "",\n "footerHtml": "",\n "widgets": {},\n "headHtml": "",\n "pageExpiryRedirectUrl": "",\n "abStatus": "",\n "useFeaturedImage": false,\n "abTestId": "",\n "featuredImageAltText": "",\n "contentGroupId": "",\n "pageExpiryEnabled": false,\n "templatePath": "",\n "url": "",\n "publicAccessRules": [\n {}\n ],\n "archivedAt": "",\n "themeSettingsValues": {},\n "pageExpiryDate": 0,\n "publicAccessRulesEnabled": false,\n "pageRedirected": false,\n "currentState": "",\n "categoryId": 0,\n "linkRelCanonicalUrl": ""\n }\n ]\n}' \
--output-document \
- {{baseUrl}}/cms/v3/pages/landing-pages/batch/create
import Foundation
let headers = [
"private-app-legacy": "{{apiKey}}",
"content-type": "application/json"
]
let parameters = ["inputs": [
[
"publishDate": "",
"language": "",
"enableLayoutStylesheets": false,
"metaDescription": "",
"attachedStylesheets": [[]],
"password": "",
"publishImmediately": false,
"htmlTitle": "",
"translations": [],
"id": "",
"state": "",
"slug": "",
"createdById": "",
"currentlyPublished": false,
"archivedInDashboard": false,
"created": "",
"contentTypeCategory": "",
"mabExperimentId": "",
"updatedById": "",
"translatedFromId": "",
"folderId": "",
"widgetContainers": [],
"pageExpiryRedirectId": 0,
"dynamicPageDataSourceType": 0,
"featuredImage": "",
"authorName": "",
"domain": "",
"name": "",
"dynamicPageHubDbTableId": "",
"campaign": "",
"dynamicPageDataSourceId": "",
"enableDomainStylesheets": false,
"includeDefaultCustomCss": false,
"subcategory": "",
"layoutSections": [],
"updated": "",
"footerHtml": "",
"widgets": [],
"headHtml": "",
"pageExpiryRedirectUrl": "",
"abStatus": "",
"useFeaturedImage": false,
"abTestId": "",
"featuredImageAltText": "",
"contentGroupId": "",
"pageExpiryEnabled": false,
"templatePath": "",
"url": "",
"publicAccessRules": [[]],
"archivedAt": "",
"themeSettingsValues": [],
"pageExpiryDate": 0,
"publicAccessRulesEnabled": false,
"pageRedirected": false,
"currentState": "",
"categoryId": 0,
"linkRelCanonicalUrl": ""
]
]] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/cms/v3/pages/landing-pages/batch/create")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
*/*
RESPONSE BODY text
{
"message": "Invalid input (details will vary based on the error)",
"correlationId": "aeb5f871-7f07-4993-9211-075dc63e7cbf",
"category": "VALIDATION_ERROR",
"links": {
"knowledge-base": "https://www.hubspot.com/products/service/knowledge-base"
}
}
POST
Create a new A-B test variation (POST)
{{baseUrl}}/cms/v3/pages/landing-pages/ab-test/create-variation
HEADERS
private-app-legacy
{{apiKey}}
BODY json
{
"variationName": "",
"contentId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/cms/v3/pages/landing-pages/ab-test/create-variation");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "private-app-legacy: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"variationName\": \"\",\n \"contentId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/cms/v3/pages/landing-pages/ab-test/create-variation" {:headers {:private-app-legacy "{{apiKey}}"}
:content-type :json
:form-params {:variationName ""
:contentId ""}})
require "http/client"
url = "{{baseUrl}}/cms/v3/pages/landing-pages/ab-test/create-variation"
headers = HTTP::Headers{
"private-app-legacy" => "{{apiKey}}"
"content-type" => "application/json"
}
reqBody = "{\n \"variationName\": \"\",\n \"contentId\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/cms/v3/pages/landing-pages/ab-test/create-variation"),
Headers =
{
{ "private-app-legacy", "{{apiKey}}" },
},
Content = new StringContent("{\n \"variationName\": \"\",\n \"contentId\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/cms/v3/pages/landing-pages/ab-test/create-variation");
var request = new RestRequest("", Method.Post);
request.AddHeader("private-app-legacy", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"variationName\": \"\",\n \"contentId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/cms/v3/pages/landing-pages/ab-test/create-variation"
payload := strings.NewReader("{\n \"variationName\": \"\",\n \"contentId\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("private-app-legacy", "{{apiKey}}")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/cms/v3/pages/landing-pages/ab-test/create-variation HTTP/1.1
Private-App-Legacy: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 44
{
"variationName": "",
"contentId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/cms/v3/pages/landing-pages/ab-test/create-variation")
.setHeader("private-app-legacy", "{{apiKey}}")
.setHeader("content-type", "application/json")
.setBody("{\n \"variationName\": \"\",\n \"contentId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/cms/v3/pages/landing-pages/ab-test/create-variation"))
.header("private-app-legacy", "{{apiKey}}")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"variationName\": \"\",\n \"contentId\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"variationName\": \"\",\n \"contentId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/cms/v3/pages/landing-pages/ab-test/create-variation")
.post(body)
.addHeader("private-app-legacy", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/cms/v3/pages/landing-pages/ab-test/create-variation")
.header("private-app-legacy", "{{apiKey}}")
.header("content-type", "application/json")
.body("{\n \"variationName\": \"\",\n \"contentId\": \"\"\n}")
.asString();
const data = JSON.stringify({
variationName: '',
contentId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/cms/v3/pages/landing-pages/ab-test/create-variation');
xhr.setRequestHeader('private-app-legacy', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/cms/v3/pages/landing-pages/ab-test/create-variation',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
data: {variationName: '', contentId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/cms/v3/pages/landing-pages/ab-test/create-variation';
const options = {
method: 'POST',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
body: '{"variationName":"","contentId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/cms/v3/pages/landing-pages/ab-test/create-variation',
method: 'POST',
headers: {
'private-app-legacy': '{{apiKey}}',
'content-type': 'application/json'
},
processData: false,
data: '{\n "variationName": "",\n "contentId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"variationName\": \"\",\n \"contentId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/cms/v3/pages/landing-pages/ab-test/create-variation")
.post(body)
.addHeader("private-app-legacy", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/cms/v3/pages/landing-pages/ab-test/create-variation',
headers: {
'private-app-legacy': '{{apiKey}}',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({variationName: '', contentId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/cms/v3/pages/landing-pages/ab-test/create-variation',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
body: {variationName: '', contentId: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/cms/v3/pages/landing-pages/ab-test/create-variation');
req.headers({
'private-app-legacy': '{{apiKey}}',
'content-type': 'application/json'
});
req.type('json');
req.send({
variationName: '',
contentId: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/cms/v3/pages/landing-pages/ab-test/create-variation',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
data: {variationName: '', contentId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/cms/v3/pages/landing-pages/ab-test/create-variation';
const options = {
method: 'POST',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
body: '{"variationName":"","contentId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"private-app-legacy": @"{{apiKey}}",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"variationName": @"",
@"contentId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/cms/v3/pages/landing-pages/ab-test/create-variation"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/cms/v3/pages/landing-pages/ab-test/create-variation" in
let headers = Header.add_list (Header.init ()) [
("private-app-legacy", "{{apiKey}}");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"variationName\": \"\",\n \"contentId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/cms/v3/pages/landing-pages/ab-test/create-variation",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'variationName' => '',
'contentId' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"private-app-legacy: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/cms/v3/pages/landing-pages/ab-test/create-variation', [
'body' => '{
"variationName": "",
"contentId": ""
}',
'headers' => [
'content-type' => 'application/json',
'private-app-legacy' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/cms/v3/pages/landing-pages/ab-test/create-variation');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'private-app-legacy' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'variationName' => '',
'contentId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'variationName' => '',
'contentId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/cms/v3/pages/landing-pages/ab-test/create-variation');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'private-app-legacy' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("private-app-legacy", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/cms/v3/pages/landing-pages/ab-test/create-variation' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"variationName": "",
"contentId": ""
}'
$headers=@{}
$headers.Add("private-app-legacy", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/cms/v3/pages/landing-pages/ab-test/create-variation' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"variationName": "",
"contentId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"variationName\": \"\",\n \"contentId\": \"\"\n}"
headers = {
'private-app-legacy': "{{apiKey}}",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/cms/v3/pages/landing-pages/ab-test/create-variation", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/cms/v3/pages/landing-pages/ab-test/create-variation"
payload = {
"variationName": "",
"contentId": ""
}
headers = {
"private-app-legacy": "{{apiKey}}",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/cms/v3/pages/landing-pages/ab-test/create-variation"
payload <- "{\n \"variationName\": \"\",\n \"contentId\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('private-app-legacy' = '{{apiKey}}'), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/cms/v3/pages/landing-pages/ab-test/create-variation")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["private-app-legacy"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n \"variationName\": \"\",\n \"contentId\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/cms/v3/pages/landing-pages/ab-test/create-variation') do |req|
req.headers['private-app-legacy'] = '{{apiKey}}'
req.body = "{\n \"variationName\": \"\",\n \"contentId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/cms/v3/pages/landing-pages/ab-test/create-variation";
let payload = json!({
"variationName": "",
"contentId": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("private-app-legacy", "{{apiKey}}".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/cms/v3/pages/landing-pages/ab-test/create-variation \
--header 'content-type: application/json' \
--header 'private-app-legacy: {{apiKey}}' \
--data '{
"variationName": "",
"contentId": ""
}'
echo '{
"variationName": "",
"contentId": ""
}' | \
http POST {{baseUrl}}/cms/v3/pages/landing-pages/ab-test/create-variation \
content-type:application/json \
private-app-legacy:'{{apiKey}}'
wget --quiet \
--method POST \
--header 'private-app-legacy: {{apiKey}}' \
--header 'content-type: application/json' \
--body-data '{\n "variationName": "",\n "contentId": ""\n}' \
--output-document \
- {{baseUrl}}/cms/v3/pages/landing-pages/ab-test/create-variation
import Foundation
let headers = [
"private-app-legacy": "{{apiKey}}",
"content-type": "application/json"
]
let parameters = [
"variationName": "",
"contentId": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/cms/v3/pages/landing-pages/ab-test/create-variation")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
*/*
RESPONSE BODY text
{
"message": "Invalid input (details will vary based on the error)",
"correlationId": "aeb5f871-7f07-4993-9211-075dc63e7cbf",
"category": "VALIDATION_ERROR",
"links": {
"knowledge-base": "https://www.hubspot.com/products/service/knowledge-base"
}
}
POST
Create a new Folder
{{baseUrl}}/cms/v3/pages/landing-pages/folders
HEADERS
private-app-legacy
{{apiKey}}
BODY json
{
"deletedAt": "",
"parentFolderId": 0,
"created": "",
"name": "",
"id": "",
"category": 0,
"updated": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/cms/v3/pages/landing-pages/folders");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "private-app-legacy: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"deletedAt\": \"\",\n \"parentFolderId\": 0,\n \"created\": \"\",\n \"name\": \"\",\n \"id\": \"\",\n \"category\": 0,\n \"updated\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/cms/v3/pages/landing-pages/folders" {:headers {:private-app-legacy "{{apiKey}}"}
:content-type :json
:form-params {:deletedAt ""
:parentFolderId 0
:created ""
:name ""
:id ""
:category 0
:updated ""}})
require "http/client"
url = "{{baseUrl}}/cms/v3/pages/landing-pages/folders"
headers = HTTP::Headers{
"private-app-legacy" => "{{apiKey}}"
"content-type" => "application/json"
}
reqBody = "{\n \"deletedAt\": \"\",\n \"parentFolderId\": 0,\n \"created\": \"\",\n \"name\": \"\",\n \"id\": \"\",\n \"category\": 0,\n \"updated\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/cms/v3/pages/landing-pages/folders"),
Headers =
{
{ "private-app-legacy", "{{apiKey}}" },
},
Content = new StringContent("{\n \"deletedAt\": \"\",\n \"parentFolderId\": 0,\n \"created\": \"\",\n \"name\": \"\",\n \"id\": \"\",\n \"category\": 0,\n \"updated\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/cms/v3/pages/landing-pages/folders");
var request = new RestRequest("", Method.Post);
request.AddHeader("private-app-legacy", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"deletedAt\": \"\",\n \"parentFolderId\": 0,\n \"created\": \"\",\n \"name\": \"\",\n \"id\": \"\",\n \"category\": 0,\n \"updated\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/cms/v3/pages/landing-pages/folders"
payload := strings.NewReader("{\n \"deletedAt\": \"\",\n \"parentFolderId\": 0,\n \"created\": \"\",\n \"name\": \"\",\n \"id\": \"\",\n \"category\": 0,\n \"updated\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("private-app-legacy", "{{apiKey}}")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/cms/v3/pages/landing-pages/folders HTTP/1.1
Private-App-Legacy: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 121
{
"deletedAt": "",
"parentFolderId": 0,
"created": "",
"name": "",
"id": "",
"category": 0,
"updated": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/cms/v3/pages/landing-pages/folders")
.setHeader("private-app-legacy", "{{apiKey}}")
.setHeader("content-type", "application/json")
.setBody("{\n \"deletedAt\": \"\",\n \"parentFolderId\": 0,\n \"created\": \"\",\n \"name\": \"\",\n \"id\": \"\",\n \"category\": 0,\n \"updated\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/cms/v3/pages/landing-pages/folders"))
.header("private-app-legacy", "{{apiKey}}")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"deletedAt\": \"\",\n \"parentFolderId\": 0,\n \"created\": \"\",\n \"name\": \"\",\n \"id\": \"\",\n \"category\": 0,\n \"updated\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"deletedAt\": \"\",\n \"parentFolderId\": 0,\n \"created\": \"\",\n \"name\": \"\",\n \"id\": \"\",\n \"category\": 0,\n \"updated\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/cms/v3/pages/landing-pages/folders")
.post(body)
.addHeader("private-app-legacy", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/cms/v3/pages/landing-pages/folders")
.header("private-app-legacy", "{{apiKey}}")
.header("content-type", "application/json")
.body("{\n \"deletedAt\": \"\",\n \"parentFolderId\": 0,\n \"created\": \"\",\n \"name\": \"\",\n \"id\": \"\",\n \"category\": 0,\n \"updated\": \"\"\n}")
.asString();
const data = JSON.stringify({
deletedAt: '',
parentFolderId: 0,
created: '',
name: '',
id: '',
category: 0,
updated: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/cms/v3/pages/landing-pages/folders');
xhr.setRequestHeader('private-app-legacy', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/cms/v3/pages/landing-pages/folders',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
data: {
deletedAt: '',
parentFolderId: 0,
created: '',
name: '',
id: '',
category: 0,
updated: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/cms/v3/pages/landing-pages/folders';
const options = {
method: 'POST',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
body: '{"deletedAt":"","parentFolderId":0,"created":"","name":"","id":"","category":0,"updated":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/cms/v3/pages/landing-pages/folders',
method: 'POST',
headers: {
'private-app-legacy': '{{apiKey}}',
'content-type': 'application/json'
},
processData: false,
data: '{\n "deletedAt": "",\n "parentFolderId": 0,\n "created": "",\n "name": "",\n "id": "",\n "category": 0,\n "updated": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"deletedAt\": \"\",\n \"parentFolderId\": 0,\n \"created\": \"\",\n \"name\": \"\",\n \"id\": \"\",\n \"category\": 0,\n \"updated\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/cms/v3/pages/landing-pages/folders")
.post(body)
.addHeader("private-app-legacy", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/cms/v3/pages/landing-pages/folders',
headers: {
'private-app-legacy': '{{apiKey}}',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
deletedAt: '',
parentFolderId: 0,
created: '',
name: '',
id: '',
category: 0,
updated: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/cms/v3/pages/landing-pages/folders',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
body: {
deletedAt: '',
parentFolderId: 0,
created: '',
name: '',
id: '',
category: 0,
updated: ''
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/cms/v3/pages/landing-pages/folders');
req.headers({
'private-app-legacy': '{{apiKey}}',
'content-type': 'application/json'
});
req.type('json');
req.send({
deletedAt: '',
parentFolderId: 0,
created: '',
name: '',
id: '',
category: 0,
updated: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/cms/v3/pages/landing-pages/folders',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
data: {
deletedAt: '',
parentFolderId: 0,
created: '',
name: '',
id: '',
category: 0,
updated: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/cms/v3/pages/landing-pages/folders';
const options = {
method: 'POST',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
body: '{"deletedAt":"","parentFolderId":0,"created":"","name":"","id":"","category":0,"updated":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"private-app-legacy": @"{{apiKey}}",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"deletedAt": @"",
@"parentFolderId": @0,
@"created": @"",
@"name": @"",
@"id": @"",
@"category": @0,
@"updated": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/cms/v3/pages/landing-pages/folders"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/cms/v3/pages/landing-pages/folders" in
let headers = Header.add_list (Header.init ()) [
("private-app-legacy", "{{apiKey}}");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"deletedAt\": \"\",\n \"parentFolderId\": 0,\n \"created\": \"\",\n \"name\": \"\",\n \"id\": \"\",\n \"category\": 0,\n \"updated\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/cms/v3/pages/landing-pages/folders",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'deletedAt' => '',
'parentFolderId' => 0,
'created' => '',
'name' => '',
'id' => '',
'category' => 0,
'updated' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"private-app-legacy: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/cms/v3/pages/landing-pages/folders', [
'body' => '{
"deletedAt": "",
"parentFolderId": 0,
"created": "",
"name": "",
"id": "",
"category": 0,
"updated": ""
}',
'headers' => [
'content-type' => 'application/json',
'private-app-legacy' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/cms/v3/pages/landing-pages/folders');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'private-app-legacy' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'deletedAt' => '',
'parentFolderId' => 0,
'created' => '',
'name' => '',
'id' => '',
'category' => 0,
'updated' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'deletedAt' => '',
'parentFolderId' => 0,
'created' => '',
'name' => '',
'id' => '',
'category' => 0,
'updated' => ''
]));
$request->setRequestUrl('{{baseUrl}}/cms/v3/pages/landing-pages/folders');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'private-app-legacy' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("private-app-legacy", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/cms/v3/pages/landing-pages/folders' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"deletedAt": "",
"parentFolderId": 0,
"created": "",
"name": "",
"id": "",
"category": 0,
"updated": ""
}'
$headers=@{}
$headers.Add("private-app-legacy", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/cms/v3/pages/landing-pages/folders' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"deletedAt": "",
"parentFolderId": 0,
"created": "",
"name": "",
"id": "",
"category": 0,
"updated": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"deletedAt\": \"\",\n \"parentFolderId\": 0,\n \"created\": \"\",\n \"name\": \"\",\n \"id\": \"\",\n \"category\": 0,\n \"updated\": \"\"\n}"
headers = {
'private-app-legacy': "{{apiKey}}",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/cms/v3/pages/landing-pages/folders", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/cms/v3/pages/landing-pages/folders"
payload = {
"deletedAt": "",
"parentFolderId": 0,
"created": "",
"name": "",
"id": "",
"category": 0,
"updated": ""
}
headers = {
"private-app-legacy": "{{apiKey}}",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/cms/v3/pages/landing-pages/folders"
payload <- "{\n \"deletedAt\": \"\",\n \"parentFolderId\": 0,\n \"created\": \"\",\n \"name\": \"\",\n \"id\": \"\",\n \"category\": 0,\n \"updated\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('private-app-legacy' = '{{apiKey}}'), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/cms/v3/pages/landing-pages/folders")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["private-app-legacy"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n \"deletedAt\": \"\",\n \"parentFolderId\": 0,\n \"created\": \"\",\n \"name\": \"\",\n \"id\": \"\",\n \"category\": 0,\n \"updated\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/cms/v3/pages/landing-pages/folders') do |req|
req.headers['private-app-legacy'] = '{{apiKey}}'
req.body = "{\n \"deletedAt\": \"\",\n \"parentFolderId\": 0,\n \"created\": \"\",\n \"name\": \"\",\n \"id\": \"\",\n \"category\": 0,\n \"updated\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/cms/v3/pages/landing-pages/folders";
let payload = json!({
"deletedAt": "",
"parentFolderId": 0,
"created": "",
"name": "",
"id": "",
"category": 0,
"updated": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("private-app-legacy", "{{apiKey}}".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/cms/v3/pages/landing-pages/folders \
--header 'content-type: application/json' \
--header 'private-app-legacy: {{apiKey}}' \
--data '{
"deletedAt": "",
"parentFolderId": 0,
"created": "",
"name": "",
"id": "",
"category": 0,
"updated": ""
}'
echo '{
"deletedAt": "",
"parentFolderId": 0,
"created": "",
"name": "",
"id": "",
"category": 0,
"updated": ""
}' | \
http POST {{baseUrl}}/cms/v3/pages/landing-pages/folders \
content-type:application/json \
private-app-legacy:'{{apiKey}}'
wget --quiet \
--method POST \
--header 'private-app-legacy: {{apiKey}}' \
--header 'content-type: application/json' \
--body-data '{\n "deletedAt": "",\n "parentFolderId": 0,\n "created": "",\n "name": "",\n "id": "",\n "category": 0,\n "updated": ""\n}' \
--output-document \
- {{baseUrl}}/cms/v3/pages/landing-pages/folders
import Foundation
let headers = [
"private-app-legacy": "{{apiKey}}",
"content-type": "application/json"
]
let parameters = [
"deletedAt": "",
"parentFolderId": 0,
"created": "",
"name": "",
"id": "",
"category": 0,
"updated": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/cms/v3/pages/landing-pages/folders")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
*/*
RESPONSE BODY text
{
"message": "Invalid input (details will vary based on the error)",
"correlationId": "aeb5f871-7f07-4993-9211-075dc63e7cbf",
"category": "VALIDATION_ERROR",
"links": {
"knowledge-base": "https://www.hubspot.com/products/service/knowledge-base"
}
}
POST
Create a new Landing Page
{{baseUrl}}/cms/v3/pages/landing-pages
HEADERS
private-app-legacy
{{apiKey}}
BODY json
{
"publishDate": "",
"language": "",
"enableLayoutStylesheets": false,
"metaDescription": "",
"attachedStylesheets": [
{}
],
"password": "",
"publishImmediately": false,
"htmlTitle": "",
"translations": {},
"id": "",
"state": "",
"slug": "",
"createdById": "",
"currentlyPublished": false,
"archivedInDashboard": false,
"created": "",
"contentTypeCategory": "",
"mabExperimentId": "",
"updatedById": "",
"translatedFromId": "",
"folderId": "",
"widgetContainers": {},
"pageExpiryRedirectId": 0,
"dynamicPageDataSourceType": 0,
"featuredImage": "",
"authorName": "",
"domain": "",
"name": "",
"dynamicPageHubDbTableId": "",
"campaign": "",
"dynamicPageDataSourceId": "",
"enableDomainStylesheets": false,
"includeDefaultCustomCss": false,
"subcategory": "",
"layoutSections": {},
"updated": "",
"footerHtml": "",
"widgets": {},
"headHtml": "",
"pageExpiryRedirectUrl": "",
"abStatus": "",
"useFeaturedImage": false,
"abTestId": "",
"featuredImageAltText": "",
"contentGroupId": "",
"pageExpiryEnabled": false,
"templatePath": "",
"url": "",
"publicAccessRules": [
{}
],
"archivedAt": "",
"themeSettingsValues": {},
"pageExpiryDate": 0,
"publicAccessRulesEnabled": false,
"pageRedirected": false,
"currentState": "",
"categoryId": 0,
"linkRelCanonicalUrl": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/cms/v3/pages/landing-pages");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "private-app-legacy: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"publishDate\": \"\",\n \"language\": \"\",\n \"enableLayoutStylesheets\": false,\n \"metaDescription\": \"\",\n \"attachedStylesheets\": [\n {}\n ],\n \"password\": \"\",\n \"publishImmediately\": false,\n \"htmlTitle\": \"\",\n \"translations\": {},\n \"id\": \"\",\n \"state\": \"\",\n \"slug\": \"\",\n \"createdById\": \"\",\n \"currentlyPublished\": false,\n \"archivedInDashboard\": false,\n \"created\": \"\",\n \"contentTypeCategory\": \"\",\n \"mabExperimentId\": \"\",\n \"updatedById\": \"\",\n \"translatedFromId\": \"\",\n \"folderId\": \"\",\n \"widgetContainers\": {},\n \"pageExpiryRedirectId\": 0,\n \"dynamicPageDataSourceType\": 0,\n \"featuredImage\": \"\",\n \"authorName\": \"\",\n \"domain\": \"\",\n \"name\": \"\",\n \"dynamicPageHubDbTableId\": \"\",\n \"campaign\": \"\",\n \"dynamicPageDataSourceId\": \"\",\n \"enableDomainStylesheets\": false,\n \"includeDefaultCustomCss\": false,\n \"subcategory\": \"\",\n \"layoutSections\": {},\n \"updated\": \"\",\n \"footerHtml\": \"\",\n \"widgets\": {},\n \"headHtml\": \"\",\n \"pageExpiryRedirectUrl\": \"\",\n \"abStatus\": \"\",\n \"useFeaturedImage\": false,\n \"abTestId\": \"\",\n \"featuredImageAltText\": \"\",\n \"contentGroupId\": \"\",\n \"pageExpiryEnabled\": false,\n \"templatePath\": \"\",\n \"url\": \"\",\n \"publicAccessRules\": [\n {}\n ],\n \"archivedAt\": \"\",\n \"themeSettingsValues\": {},\n \"pageExpiryDate\": 0,\n \"publicAccessRulesEnabled\": false,\n \"pageRedirected\": false,\n \"currentState\": \"\",\n \"categoryId\": 0,\n \"linkRelCanonicalUrl\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/cms/v3/pages/landing-pages" {:headers {:private-app-legacy "{{apiKey}}"}
:content-type :json
:form-params {:publishDate ""
:language ""
:enableLayoutStylesheets false
:metaDescription ""
:attachedStylesheets [{}]
:password ""
:publishImmediately false
:htmlTitle ""
:translations {}
:id ""
:state ""
:slug ""
:createdById ""
:currentlyPublished false
:archivedInDashboard false
:created ""
:contentTypeCategory ""
:mabExperimentId ""
:updatedById ""
:translatedFromId ""
:folderId ""
:widgetContainers {}
:pageExpiryRedirectId 0
:dynamicPageDataSourceType 0
:featuredImage ""
:authorName ""
:domain ""
:name ""
:dynamicPageHubDbTableId ""
:campaign ""
:dynamicPageDataSourceId ""
:enableDomainStylesheets false
:includeDefaultCustomCss false
:subcategory ""
:layoutSections {}
:updated ""
:footerHtml ""
:widgets {}
:headHtml ""
:pageExpiryRedirectUrl ""
:abStatus ""
:useFeaturedImage false
:abTestId ""
:featuredImageAltText ""
:contentGroupId ""
:pageExpiryEnabled false
:templatePath ""
:url ""
:publicAccessRules [{}]
:archivedAt ""
:themeSettingsValues {}
:pageExpiryDate 0
:publicAccessRulesEnabled false
:pageRedirected false
:currentState ""
:categoryId 0
:linkRelCanonicalUrl ""}})
require "http/client"
url = "{{baseUrl}}/cms/v3/pages/landing-pages"
headers = HTTP::Headers{
"private-app-legacy" => "{{apiKey}}"
"content-type" => "application/json"
}
reqBody = "{\n \"publishDate\": \"\",\n \"language\": \"\",\n \"enableLayoutStylesheets\": false,\n \"metaDescription\": \"\",\n \"attachedStylesheets\": [\n {}\n ],\n \"password\": \"\",\n \"publishImmediately\": false,\n \"htmlTitle\": \"\",\n \"translations\": {},\n \"id\": \"\",\n \"state\": \"\",\n \"slug\": \"\",\n \"createdById\": \"\",\n \"currentlyPublished\": false,\n \"archivedInDashboard\": false,\n \"created\": \"\",\n \"contentTypeCategory\": \"\",\n \"mabExperimentId\": \"\",\n \"updatedById\": \"\",\n \"translatedFromId\": \"\",\n \"folderId\": \"\",\n \"widgetContainers\": {},\n \"pageExpiryRedirectId\": 0,\n \"dynamicPageDataSourceType\": 0,\n \"featuredImage\": \"\",\n \"authorName\": \"\",\n \"domain\": \"\",\n \"name\": \"\",\n \"dynamicPageHubDbTableId\": \"\",\n \"campaign\": \"\",\n \"dynamicPageDataSourceId\": \"\",\n \"enableDomainStylesheets\": false,\n \"includeDefaultCustomCss\": false,\n \"subcategory\": \"\",\n \"layoutSections\": {},\n \"updated\": \"\",\n \"footerHtml\": \"\",\n \"widgets\": {},\n \"headHtml\": \"\",\n \"pageExpiryRedirectUrl\": \"\",\n \"abStatus\": \"\",\n \"useFeaturedImage\": false,\n \"abTestId\": \"\",\n \"featuredImageAltText\": \"\",\n \"contentGroupId\": \"\",\n \"pageExpiryEnabled\": false,\n \"templatePath\": \"\",\n \"url\": \"\",\n \"publicAccessRules\": [\n {}\n ],\n \"archivedAt\": \"\",\n \"themeSettingsValues\": {},\n \"pageExpiryDate\": 0,\n \"publicAccessRulesEnabled\": false,\n \"pageRedirected\": false,\n \"currentState\": \"\",\n \"categoryId\": 0,\n \"linkRelCanonicalUrl\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/cms/v3/pages/landing-pages"),
Headers =
{
{ "private-app-legacy", "{{apiKey}}" },
},
Content = new StringContent("{\n \"publishDate\": \"\",\n \"language\": \"\",\n \"enableLayoutStylesheets\": false,\n \"metaDescription\": \"\",\n \"attachedStylesheets\": [\n {}\n ],\n \"password\": \"\",\n \"publishImmediately\": false,\n \"htmlTitle\": \"\",\n \"translations\": {},\n \"id\": \"\",\n \"state\": \"\",\n \"slug\": \"\",\n \"createdById\": \"\",\n \"currentlyPublished\": false,\n \"archivedInDashboard\": false,\n \"created\": \"\",\n \"contentTypeCategory\": \"\",\n \"mabExperimentId\": \"\",\n \"updatedById\": \"\",\n \"translatedFromId\": \"\",\n \"folderId\": \"\",\n \"widgetContainers\": {},\n \"pageExpiryRedirectId\": 0,\n \"dynamicPageDataSourceType\": 0,\n \"featuredImage\": \"\",\n \"authorName\": \"\",\n \"domain\": \"\",\n \"name\": \"\",\n \"dynamicPageHubDbTableId\": \"\",\n \"campaign\": \"\",\n \"dynamicPageDataSourceId\": \"\",\n \"enableDomainStylesheets\": false,\n \"includeDefaultCustomCss\": false,\n \"subcategory\": \"\",\n \"layoutSections\": {},\n \"updated\": \"\",\n \"footerHtml\": \"\",\n \"widgets\": {},\n \"headHtml\": \"\",\n \"pageExpiryRedirectUrl\": \"\",\n \"abStatus\": \"\",\n \"useFeaturedImage\": false,\n \"abTestId\": \"\",\n \"featuredImageAltText\": \"\",\n \"contentGroupId\": \"\",\n \"pageExpiryEnabled\": false,\n \"templatePath\": \"\",\n \"url\": \"\",\n \"publicAccessRules\": [\n {}\n ],\n \"archivedAt\": \"\",\n \"themeSettingsValues\": {},\n \"pageExpiryDate\": 0,\n \"publicAccessRulesEnabled\": false,\n \"pageRedirected\": false,\n \"currentState\": \"\",\n \"categoryId\": 0,\n \"linkRelCanonicalUrl\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/cms/v3/pages/landing-pages");
var request = new RestRequest("", Method.Post);
request.AddHeader("private-app-legacy", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"publishDate\": \"\",\n \"language\": \"\",\n \"enableLayoutStylesheets\": false,\n \"metaDescription\": \"\",\n \"attachedStylesheets\": [\n {}\n ],\n \"password\": \"\",\n \"publishImmediately\": false,\n \"htmlTitle\": \"\",\n \"translations\": {},\n \"id\": \"\",\n \"state\": \"\",\n \"slug\": \"\",\n \"createdById\": \"\",\n \"currentlyPublished\": false,\n \"archivedInDashboard\": false,\n \"created\": \"\",\n \"contentTypeCategory\": \"\",\n \"mabExperimentId\": \"\",\n \"updatedById\": \"\",\n \"translatedFromId\": \"\",\n \"folderId\": \"\",\n \"widgetContainers\": {},\n \"pageExpiryRedirectId\": 0,\n \"dynamicPageDataSourceType\": 0,\n \"featuredImage\": \"\",\n \"authorName\": \"\",\n \"domain\": \"\",\n \"name\": \"\",\n \"dynamicPageHubDbTableId\": \"\",\n \"campaign\": \"\",\n \"dynamicPageDataSourceId\": \"\",\n \"enableDomainStylesheets\": false,\n \"includeDefaultCustomCss\": false,\n \"subcategory\": \"\",\n \"layoutSections\": {},\n \"updated\": \"\",\n \"footerHtml\": \"\",\n \"widgets\": {},\n \"headHtml\": \"\",\n \"pageExpiryRedirectUrl\": \"\",\n \"abStatus\": \"\",\n \"useFeaturedImage\": false,\n \"abTestId\": \"\",\n \"featuredImageAltText\": \"\",\n \"contentGroupId\": \"\",\n \"pageExpiryEnabled\": false,\n \"templatePath\": \"\",\n \"url\": \"\",\n \"publicAccessRules\": [\n {}\n ],\n \"archivedAt\": \"\",\n \"themeSettingsValues\": {},\n \"pageExpiryDate\": 0,\n \"publicAccessRulesEnabled\": false,\n \"pageRedirected\": false,\n \"currentState\": \"\",\n \"categoryId\": 0,\n \"linkRelCanonicalUrl\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/cms/v3/pages/landing-pages"
payload := strings.NewReader("{\n \"publishDate\": \"\",\n \"language\": \"\",\n \"enableLayoutStylesheets\": false,\n \"metaDescription\": \"\",\n \"attachedStylesheets\": [\n {}\n ],\n \"password\": \"\",\n \"publishImmediately\": false,\n \"htmlTitle\": \"\",\n \"translations\": {},\n \"id\": \"\",\n \"state\": \"\",\n \"slug\": \"\",\n \"createdById\": \"\",\n \"currentlyPublished\": false,\n \"archivedInDashboard\": false,\n \"created\": \"\",\n \"contentTypeCategory\": \"\",\n \"mabExperimentId\": \"\",\n \"updatedById\": \"\",\n \"translatedFromId\": \"\",\n \"folderId\": \"\",\n \"widgetContainers\": {},\n \"pageExpiryRedirectId\": 0,\n \"dynamicPageDataSourceType\": 0,\n \"featuredImage\": \"\",\n \"authorName\": \"\",\n \"domain\": \"\",\n \"name\": \"\",\n \"dynamicPageHubDbTableId\": \"\",\n \"campaign\": \"\",\n \"dynamicPageDataSourceId\": \"\",\n \"enableDomainStylesheets\": false,\n \"includeDefaultCustomCss\": false,\n \"subcategory\": \"\",\n \"layoutSections\": {},\n \"updated\": \"\",\n \"footerHtml\": \"\",\n \"widgets\": {},\n \"headHtml\": \"\",\n \"pageExpiryRedirectUrl\": \"\",\n \"abStatus\": \"\",\n \"useFeaturedImage\": false,\n \"abTestId\": \"\",\n \"featuredImageAltText\": \"\",\n \"contentGroupId\": \"\",\n \"pageExpiryEnabled\": false,\n \"templatePath\": \"\",\n \"url\": \"\",\n \"publicAccessRules\": [\n {}\n ],\n \"archivedAt\": \"\",\n \"themeSettingsValues\": {},\n \"pageExpiryDate\": 0,\n \"publicAccessRulesEnabled\": false,\n \"pageRedirected\": false,\n \"currentState\": \"\",\n \"categoryId\": 0,\n \"linkRelCanonicalUrl\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("private-app-legacy", "{{apiKey}}")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/cms/v3/pages/landing-pages HTTP/1.1
Private-App-Legacy: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 1385
{
"publishDate": "",
"language": "",
"enableLayoutStylesheets": false,
"metaDescription": "",
"attachedStylesheets": [
{}
],
"password": "",
"publishImmediately": false,
"htmlTitle": "",
"translations": {},
"id": "",
"state": "",
"slug": "",
"createdById": "",
"currentlyPublished": false,
"archivedInDashboard": false,
"created": "",
"contentTypeCategory": "",
"mabExperimentId": "",
"updatedById": "",
"translatedFromId": "",
"folderId": "",
"widgetContainers": {},
"pageExpiryRedirectId": 0,
"dynamicPageDataSourceType": 0,
"featuredImage": "",
"authorName": "",
"domain": "",
"name": "",
"dynamicPageHubDbTableId": "",
"campaign": "",
"dynamicPageDataSourceId": "",
"enableDomainStylesheets": false,
"includeDefaultCustomCss": false,
"subcategory": "",
"layoutSections": {},
"updated": "",
"footerHtml": "",
"widgets": {},
"headHtml": "",
"pageExpiryRedirectUrl": "",
"abStatus": "",
"useFeaturedImage": false,
"abTestId": "",
"featuredImageAltText": "",
"contentGroupId": "",
"pageExpiryEnabled": false,
"templatePath": "",
"url": "",
"publicAccessRules": [
{}
],
"archivedAt": "",
"themeSettingsValues": {},
"pageExpiryDate": 0,
"publicAccessRulesEnabled": false,
"pageRedirected": false,
"currentState": "",
"categoryId": 0,
"linkRelCanonicalUrl": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/cms/v3/pages/landing-pages")
.setHeader("private-app-legacy", "{{apiKey}}")
.setHeader("content-type", "application/json")
.setBody("{\n \"publishDate\": \"\",\n \"language\": \"\",\n \"enableLayoutStylesheets\": false,\n \"metaDescription\": \"\",\n \"attachedStylesheets\": [\n {}\n ],\n \"password\": \"\",\n \"publishImmediately\": false,\n \"htmlTitle\": \"\",\n \"translations\": {},\n \"id\": \"\",\n \"state\": \"\",\n \"slug\": \"\",\n \"createdById\": \"\",\n \"currentlyPublished\": false,\n \"archivedInDashboard\": false,\n \"created\": \"\",\n \"contentTypeCategory\": \"\",\n \"mabExperimentId\": \"\",\n \"updatedById\": \"\",\n \"translatedFromId\": \"\",\n \"folderId\": \"\",\n \"widgetContainers\": {},\n \"pageExpiryRedirectId\": 0,\n \"dynamicPageDataSourceType\": 0,\n \"featuredImage\": \"\",\n \"authorName\": \"\",\n \"domain\": \"\",\n \"name\": \"\",\n \"dynamicPageHubDbTableId\": \"\",\n \"campaign\": \"\",\n \"dynamicPageDataSourceId\": \"\",\n \"enableDomainStylesheets\": false,\n \"includeDefaultCustomCss\": false,\n \"subcategory\": \"\",\n \"layoutSections\": {},\n \"updated\": \"\",\n \"footerHtml\": \"\",\n \"widgets\": {},\n \"headHtml\": \"\",\n \"pageExpiryRedirectUrl\": \"\",\n \"abStatus\": \"\",\n \"useFeaturedImage\": false,\n \"abTestId\": \"\",\n \"featuredImageAltText\": \"\",\n \"contentGroupId\": \"\",\n \"pageExpiryEnabled\": false,\n \"templatePath\": \"\",\n \"url\": \"\",\n \"publicAccessRules\": [\n {}\n ],\n \"archivedAt\": \"\",\n \"themeSettingsValues\": {},\n \"pageExpiryDate\": 0,\n \"publicAccessRulesEnabled\": false,\n \"pageRedirected\": false,\n \"currentState\": \"\",\n \"categoryId\": 0,\n \"linkRelCanonicalUrl\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/cms/v3/pages/landing-pages"))
.header("private-app-legacy", "{{apiKey}}")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"publishDate\": \"\",\n \"language\": \"\",\n \"enableLayoutStylesheets\": false,\n \"metaDescription\": \"\",\n \"attachedStylesheets\": [\n {}\n ],\n \"password\": \"\",\n \"publishImmediately\": false,\n \"htmlTitle\": \"\",\n \"translations\": {},\n \"id\": \"\",\n \"state\": \"\",\n \"slug\": \"\",\n \"createdById\": \"\",\n \"currentlyPublished\": false,\n \"archivedInDashboard\": false,\n \"created\": \"\",\n \"contentTypeCategory\": \"\",\n \"mabExperimentId\": \"\",\n \"updatedById\": \"\",\n \"translatedFromId\": \"\",\n \"folderId\": \"\",\n \"widgetContainers\": {},\n \"pageExpiryRedirectId\": 0,\n \"dynamicPageDataSourceType\": 0,\n \"featuredImage\": \"\",\n \"authorName\": \"\",\n \"domain\": \"\",\n \"name\": \"\",\n \"dynamicPageHubDbTableId\": \"\",\n \"campaign\": \"\",\n \"dynamicPageDataSourceId\": \"\",\n \"enableDomainStylesheets\": false,\n \"includeDefaultCustomCss\": false,\n \"subcategory\": \"\",\n \"layoutSections\": {},\n \"updated\": \"\",\n \"footerHtml\": \"\",\n \"widgets\": {},\n \"headHtml\": \"\",\n \"pageExpiryRedirectUrl\": \"\",\n \"abStatus\": \"\",\n \"useFeaturedImage\": false,\n \"abTestId\": \"\",\n \"featuredImageAltText\": \"\",\n \"contentGroupId\": \"\",\n \"pageExpiryEnabled\": false,\n \"templatePath\": \"\",\n \"url\": \"\",\n \"publicAccessRules\": [\n {}\n ],\n \"archivedAt\": \"\",\n \"themeSettingsValues\": {},\n \"pageExpiryDate\": 0,\n \"publicAccessRulesEnabled\": false,\n \"pageRedirected\": false,\n \"currentState\": \"\",\n \"categoryId\": 0,\n \"linkRelCanonicalUrl\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"publishDate\": \"\",\n \"language\": \"\",\n \"enableLayoutStylesheets\": false,\n \"metaDescription\": \"\",\n \"attachedStylesheets\": [\n {}\n ],\n \"password\": \"\",\n \"publishImmediately\": false,\n \"htmlTitle\": \"\",\n \"translations\": {},\n \"id\": \"\",\n \"state\": \"\",\n \"slug\": \"\",\n \"createdById\": \"\",\n \"currentlyPublished\": false,\n \"archivedInDashboard\": false,\n \"created\": \"\",\n \"contentTypeCategory\": \"\",\n \"mabExperimentId\": \"\",\n \"updatedById\": \"\",\n \"translatedFromId\": \"\",\n \"folderId\": \"\",\n \"widgetContainers\": {},\n \"pageExpiryRedirectId\": 0,\n \"dynamicPageDataSourceType\": 0,\n \"featuredImage\": \"\",\n \"authorName\": \"\",\n \"domain\": \"\",\n \"name\": \"\",\n \"dynamicPageHubDbTableId\": \"\",\n \"campaign\": \"\",\n \"dynamicPageDataSourceId\": \"\",\n \"enableDomainStylesheets\": false,\n \"includeDefaultCustomCss\": false,\n \"subcategory\": \"\",\n \"layoutSections\": {},\n \"updated\": \"\",\n \"footerHtml\": \"\",\n \"widgets\": {},\n \"headHtml\": \"\",\n \"pageExpiryRedirectUrl\": \"\",\n \"abStatus\": \"\",\n \"useFeaturedImage\": false,\n \"abTestId\": \"\",\n \"featuredImageAltText\": \"\",\n \"contentGroupId\": \"\",\n \"pageExpiryEnabled\": false,\n \"templatePath\": \"\",\n \"url\": \"\",\n \"publicAccessRules\": [\n {}\n ],\n \"archivedAt\": \"\",\n \"themeSettingsValues\": {},\n \"pageExpiryDate\": 0,\n \"publicAccessRulesEnabled\": false,\n \"pageRedirected\": false,\n \"currentState\": \"\",\n \"categoryId\": 0,\n \"linkRelCanonicalUrl\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/cms/v3/pages/landing-pages")
.post(body)
.addHeader("private-app-legacy", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/cms/v3/pages/landing-pages")
.header("private-app-legacy", "{{apiKey}}")
.header("content-type", "application/json")
.body("{\n \"publishDate\": \"\",\n \"language\": \"\",\n \"enableLayoutStylesheets\": false,\n \"metaDescription\": \"\",\n \"attachedStylesheets\": [\n {}\n ],\n \"password\": \"\",\n \"publishImmediately\": false,\n \"htmlTitle\": \"\",\n \"translations\": {},\n \"id\": \"\",\n \"state\": \"\",\n \"slug\": \"\",\n \"createdById\": \"\",\n \"currentlyPublished\": false,\n \"archivedInDashboard\": false,\n \"created\": \"\",\n \"contentTypeCategory\": \"\",\n \"mabExperimentId\": \"\",\n \"updatedById\": \"\",\n \"translatedFromId\": \"\",\n \"folderId\": \"\",\n \"widgetContainers\": {},\n \"pageExpiryRedirectId\": 0,\n \"dynamicPageDataSourceType\": 0,\n \"featuredImage\": \"\",\n \"authorName\": \"\",\n \"domain\": \"\",\n \"name\": \"\",\n \"dynamicPageHubDbTableId\": \"\",\n \"campaign\": \"\",\n \"dynamicPageDataSourceId\": \"\",\n \"enableDomainStylesheets\": false,\n \"includeDefaultCustomCss\": false,\n \"subcategory\": \"\",\n \"layoutSections\": {},\n \"updated\": \"\",\n \"footerHtml\": \"\",\n \"widgets\": {},\n \"headHtml\": \"\",\n \"pageExpiryRedirectUrl\": \"\",\n \"abStatus\": \"\",\n \"useFeaturedImage\": false,\n \"abTestId\": \"\",\n \"featuredImageAltText\": \"\",\n \"contentGroupId\": \"\",\n \"pageExpiryEnabled\": false,\n \"templatePath\": \"\",\n \"url\": \"\",\n \"publicAccessRules\": [\n {}\n ],\n \"archivedAt\": \"\",\n \"themeSettingsValues\": {},\n \"pageExpiryDate\": 0,\n \"publicAccessRulesEnabled\": false,\n \"pageRedirected\": false,\n \"currentState\": \"\",\n \"categoryId\": 0,\n \"linkRelCanonicalUrl\": \"\"\n}")
.asString();
const data = JSON.stringify({
publishDate: '',
language: '',
enableLayoutStylesheets: false,
metaDescription: '',
attachedStylesheets: [
{}
],
password: '',
publishImmediately: false,
htmlTitle: '',
translations: {},
id: '',
state: '',
slug: '',
createdById: '',
currentlyPublished: false,
archivedInDashboard: false,
created: '',
contentTypeCategory: '',
mabExperimentId: '',
updatedById: '',
translatedFromId: '',
folderId: '',
widgetContainers: {},
pageExpiryRedirectId: 0,
dynamicPageDataSourceType: 0,
featuredImage: '',
authorName: '',
domain: '',
name: '',
dynamicPageHubDbTableId: '',
campaign: '',
dynamicPageDataSourceId: '',
enableDomainStylesheets: false,
includeDefaultCustomCss: false,
subcategory: '',
layoutSections: {},
updated: '',
footerHtml: '',
widgets: {},
headHtml: '',
pageExpiryRedirectUrl: '',
abStatus: '',
useFeaturedImage: false,
abTestId: '',
featuredImageAltText: '',
contentGroupId: '',
pageExpiryEnabled: false,
templatePath: '',
url: '',
publicAccessRules: [
{}
],
archivedAt: '',
themeSettingsValues: {},
pageExpiryDate: 0,
publicAccessRulesEnabled: false,
pageRedirected: false,
currentState: '',
categoryId: 0,
linkRelCanonicalUrl: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/cms/v3/pages/landing-pages');
xhr.setRequestHeader('private-app-legacy', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/cms/v3/pages/landing-pages',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
data: {
publishDate: '',
language: '',
enableLayoutStylesheets: false,
metaDescription: '',
attachedStylesheets: [{}],
password: '',
publishImmediately: false,
htmlTitle: '',
translations: {},
id: '',
state: '',
slug: '',
createdById: '',
currentlyPublished: false,
archivedInDashboard: false,
created: '',
contentTypeCategory: '',
mabExperimentId: '',
updatedById: '',
translatedFromId: '',
folderId: '',
widgetContainers: {},
pageExpiryRedirectId: 0,
dynamicPageDataSourceType: 0,
featuredImage: '',
authorName: '',
domain: '',
name: '',
dynamicPageHubDbTableId: '',
campaign: '',
dynamicPageDataSourceId: '',
enableDomainStylesheets: false,
includeDefaultCustomCss: false,
subcategory: '',
layoutSections: {},
updated: '',
footerHtml: '',
widgets: {},
headHtml: '',
pageExpiryRedirectUrl: '',
abStatus: '',
useFeaturedImage: false,
abTestId: '',
featuredImageAltText: '',
contentGroupId: '',
pageExpiryEnabled: false,
templatePath: '',
url: '',
publicAccessRules: [{}],
archivedAt: '',
themeSettingsValues: {},
pageExpiryDate: 0,
publicAccessRulesEnabled: false,
pageRedirected: false,
currentState: '',
categoryId: 0,
linkRelCanonicalUrl: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/cms/v3/pages/landing-pages';
const options = {
method: 'POST',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
body: '{"publishDate":"","language":"","enableLayoutStylesheets":false,"metaDescription":"","attachedStylesheets":[{}],"password":"","publishImmediately":false,"htmlTitle":"","translations":{},"id":"","state":"","slug":"","createdById":"","currentlyPublished":false,"archivedInDashboard":false,"created":"","contentTypeCategory":"","mabExperimentId":"","updatedById":"","translatedFromId":"","folderId":"","widgetContainers":{},"pageExpiryRedirectId":0,"dynamicPageDataSourceType":0,"featuredImage":"","authorName":"","domain":"","name":"","dynamicPageHubDbTableId":"","campaign":"","dynamicPageDataSourceId":"","enableDomainStylesheets":false,"includeDefaultCustomCss":false,"subcategory":"","layoutSections":{},"updated":"","footerHtml":"","widgets":{},"headHtml":"","pageExpiryRedirectUrl":"","abStatus":"","useFeaturedImage":false,"abTestId":"","featuredImageAltText":"","contentGroupId":"","pageExpiryEnabled":false,"templatePath":"","url":"","publicAccessRules":[{}],"archivedAt":"","themeSettingsValues":{},"pageExpiryDate":0,"publicAccessRulesEnabled":false,"pageRedirected":false,"currentState":"","categoryId":0,"linkRelCanonicalUrl":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/cms/v3/pages/landing-pages',
method: 'POST',
headers: {
'private-app-legacy': '{{apiKey}}',
'content-type': 'application/json'
},
processData: false,
data: '{\n "publishDate": "",\n "language": "",\n "enableLayoutStylesheets": false,\n "metaDescription": "",\n "attachedStylesheets": [\n {}\n ],\n "password": "",\n "publishImmediately": false,\n "htmlTitle": "",\n "translations": {},\n "id": "",\n "state": "",\n "slug": "",\n "createdById": "",\n "currentlyPublished": false,\n "archivedInDashboard": false,\n "created": "",\n "contentTypeCategory": "",\n "mabExperimentId": "",\n "updatedById": "",\n "translatedFromId": "",\n "folderId": "",\n "widgetContainers": {},\n "pageExpiryRedirectId": 0,\n "dynamicPageDataSourceType": 0,\n "featuredImage": "",\n "authorName": "",\n "domain": "",\n "name": "",\n "dynamicPageHubDbTableId": "",\n "campaign": "",\n "dynamicPageDataSourceId": "",\n "enableDomainStylesheets": false,\n "includeDefaultCustomCss": false,\n "subcategory": "",\n "layoutSections": {},\n "updated": "",\n "footerHtml": "",\n "widgets": {},\n "headHtml": "",\n "pageExpiryRedirectUrl": "",\n "abStatus": "",\n "useFeaturedImage": false,\n "abTestId": "",\n "featuredImageAltText": "",\n "contentGroupId": "",\n "pageExpiryEnabled": false,\n "templatePath": "",\n "url": "",\n "publicAccessRules": [\n {}\n ],\n "archivedAt": "",\n "themeSettingsValues": {},\n "pageExpiryDate": 0,\n "publicAccessRulesEnabled": false,\n "pageRedirected": false,\n "currentState": "",\n "categoryId": 0,\n "linkRelCanonicalUrl": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"publishDate\": \"\",\n \"language\": \"\",\n \"enableLayoutStylesheets\": false,\n \"metaDescription\": \"\",\n \"attachedStylesheets\": [\n {}\n ],\n \"password\": \"\",\n \"publishImmediately\": false,\n \"htmlTitle\": \"\",\n \"translations\": {},\n \"id\": \"\",\n \"state\": \"\",\n \"slug\": \"\",\n \"createdById\": \"\",\n \"currentlyPublished\": false,\n \"archivedInDashboard\": false,\n \"created\": \"\",\n \"contentTypeCategory\": \"\",\n \"mabExperimentId\": \"\",\n \"updatedById\": \"\",\n \"translatedFromId\": \"\",\n \"folderId\": \"\",\n \"widgetContainers\": {},\n \"pageExpiryRedirectId\": 0,\n \"dynamicPageDataSourceType\": 0,\n \"featuredImage\": \"\",\n \"authorName\": \"\",\n \"domain\": \"\",\n \"name\": \"\",\n \"dynamicPageHubDbTableId\": \"\",\n \"campaign\": \"\",\n \"dynamicPageDataSourceId\": \"\",\n \"enableDomainStylesheets\": false,\n \"includeDefaultCustomCss\": false,\n \"subcategory\": \"\",\n \"layoutSections\": {},\n \"updated\": \"\",\n \"footerHtml\": \"\",\n \"widgets\": {},\n \"headHtml\": \"\",\n \"pageExpiryRedirectUrl\": \"\",\n \"abStatus\": \"\",\n \"useFeaturedImage\": false,\n \"abTestId\": \"\",\n \"featuredImageAltText\": \"\",\n \"contentGroupId\": \"\",\n \"pageExpiryEnabled\": false,\n \"templatePath\": \"\",\n \"url\": \"\",\n \"publicAccessRules\": [\n {}\n ],\n \"archivedAt\": \"\",\n \"themeSettingsValues\": {},\n \"pageExpiryDate\": 0,\n \"publicAccessRulesEnabled\": false,\n \"pageRedirected\": false,\n \"currentState\": \"\",\n \"categoryId\": 0,\n \"linkRelCanonicalUrl\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/cms/v3/pages/landing-pages")
.post(body)
.addHeader("private-app-legacy", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/cms/v3/pages/landing-pages',
headers: {
'private-app-legacy': '{{apiKey}}',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
publishDate: '',
language: '',
enableLayoutStylesheets: false,
metaDescription: '',
attachedStylesheets: [{}],
password: '',
publishImmediately: false,
htmlTitle: '',
translations: {},
id: '',
state: '',
slug: '',
createdById: '',
currentlyPublished: false,
archivedInDashboard: false,
created: '',
contentTypeCategory: '',
mabExperimentId: '',
updatedById: '',
translatedFromId: '',
folderId: '',
widgetContainers: {},
pageExpiryRedirectId: 0,
dynamicPageDataSourceType: 0,
featuredImage: '',
authorName: '',
domain: '',
name: '',
dynamicPageHubDbTableId: '',
campaign: '',
dynamicPageDataSourceId: '',
enableDomainStylesheets: false,
includeDefaultCustomCss: false,
subcategory: '',
layoutSections: {},
updated: '',
footerHtml: '',
widgets: {},
headHtml: '',
pageExpiryRedirectUrl: '',
abStatus: '',
useFeaturedImage: false,
abTestId: '',
featuredImageAltText: '',
contentGroupId: '',
pageExpiryEnabled: false,
templatePath: '',
url: '',
publicAccessRules: [{}],
archivedAt: '',
themeSettingsValues: {},
pageExpiryDate: 0,
publicAccessRulesEnabled: false,
pageRedirected: false,
currentState: '',
categoryId: 0,
linkRelCanonicalUrl: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/cms/v3/pages/landing-pages',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
body: {
publishDate: '',
language: '',
enableLayoutStylesheets: false,
metaDescription: '',
attachedStylesheets: [{}],
password: '',
publishImmediately: false,
htmlTitle: '',
translations: {},
id: '',
state: '',
slug: '',
createdById: '',
currentlyPublished: false,
archivedInDashboard: false,
created: '',
contentTypeCategory: '',
mabExperimentId: '',
updatedById: '',
translatedFromId: '',
folderId: '',
widgetContainers: {},
pageExpiryRedirectId: 0,
dynamicPageDataSourceType: 0,
featuredImage: '',
authorName: '',
domain: '',
name: '',
dynamicPageHubDbTableId: '',
campaign: '',
dynamicPageDataSourceId: '',
enableDomainStylesheets: false,
includeDefaultCustomCss: false,
subcategory: '',
layoutSections: {},
updated: '',
footerHtml: '',
widgets: {},
headHtml: '',
pageExpiryRedirectUrl: '',
abStatus: '',
useFeaturedImage: false,
abTestId: '',
featuredImageAltText: '',
contentGroupId: '',
pageExpiryEnabled: false,
templatePath: '',
url: '',
publicAccessRules: [{}],
archivedAt: '',
themeSettingsValues: {},
pageExpiryDate: 0,
publicAccessRulesEnabled: false,
pageRedirected: false,
currentState: '',
categoryId: 0,
linkRelCanonicalUrl: ''
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/cms/v3/pages/landing-pages');
req.headers({
'private-app-legacy': '{{apiKey}}',
'content-type': 'application/json'
});
req.type('json');
req.send({
publishDate: '',
language: '',
enableLayoutStylesheets: false,
metaDescription: '',
attachedStylesheets: [
{}
],
password: '',
publishImmediately: false,
htmlTitle: '',
translations: {},
id: '',
state: '',
slug: '',
createdById: '',
currentlyPublished: false,
archivedInDashboard: false,
created: '',
contentTypeCategory: '',
mabExperimentId: '',
updatedById: '',
translatedFromId: '',
folderId: '',
widgetContainers: {},
pageExpiryRedirectId: 0,
dynamicPageDataSourceType: 0,
featuredImage: '',
authorName: '',
domain: '',
name: '',
dynamicPageHubDbTableId: '',
campaign: '',
dynamicPageDataSourceId: '',
enableDomainStylesheets: false,
includeDefaultCustomCss: false,
subcategory: '',
layoutSections: {},
updated: '',
footerHtml: '',
widgets: {},
headHtml: '',
pageExpiryRedirectUrl: '',
abStatus: '',
useFeaturedImage: false,
abTestId: '',
featuredImageAltText: '',
contentGroupId: '',
pageExpiryEnabled: false,
templatePath: '',
url: '',
publicAccessRules: [
{}
],
archivedAt: '',
themeSettingsValues: {},
pageExpiryDate: 0,
publicAccessRulesEnabled: false,
pageRedirected: false,
currentState: '',
categoryId: 0,
linkRelCanonicalUrl: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/cms/v3/pages/landing-pages',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
data: {
publishDate: '',
language: '',
enableLayoutStylesheets: false,
metaDescription: '',
attachedStylesheets: [{}],
password: '',
publishImmediately: false,
htmlTitle: '',
translations: {},
id: '',
state: '',
slug: '',
createdById: '',
currentlyPublished: false,
archivedInDashboard: false,
created: '',
contentTypeCategory: '',
mabExperimentId: '',
updatedById: '',
translatedFromId: '',
folderId: '',
widgetContainers: {},
pageExpiryRedirectId: 0,
dynamicPageDataSourceType: 0,
featuredImage: '',
authorName: '',
domain: '',
name: '',
dynamicPageHubDbTableId: '',
campaign: '',
dynamicPageDataSourceId: '',
enableDomainStylesheets: false,
includeDefaultCustomCss: false,
subcategory: '',
layoutSections: {},
updated: '',
footerHtml: '',
widgets: {},
headHtml: '',
pageExpiryRedirectUrl: '',
abStatus: '',
useFeaturedImage: false,
abTestId: '',
featuredImageAltText: '',
contentGroupId: '',
pageExpiryEnabled: false,
templatePath: '',
url: '',
publicAccessRules: [{}],
archivedAt: '',
themeSettingsValues: {},
pageExpiryDate: 0,
publicAccessRulesEnabled: false,
pageRedirected: false,
currentState: '',
categoryId: 0,
linkRelCanonicalUrl: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/cms/v3/pages/landing-pages';
const options = {
method: 'POST',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
body: '{"publishDate":"","language":"","enableLayoutStylesheets":false,"metaDescription":"","attachedStylesheets":[{}],"password":"","publishImmediately":false,"htmlTitle":"","translations":{},"id":"","state":"","slug":"","createdById":"","currentlyPublished":false,"archivedInDashboard":false,"created":"","contentTypeCategory":"","mabExperimentId":"","updatedById":"","translatedFromId":"","folderId":"","widgetContainers":{},"pageExpiryRedirectId":0,"dynamicPageDataSourceType":0,"featuredImage":"","authorName":"","domain":"","name":"","dynamicPageHubDbTableId":"","campaign":"","dynamicPageDataSourceId":"","enableDomainStylesheets":false,"includeDefaultCustomCss":false,"subcategory":"","layoutSections":{},"updated":"","footerHtml":"","widgets":{},"headHtml":"","pageExpiryRedirectUrl":"","abStatus":"","useFeaturedImage":false,"abTestId":"","featuredImageAltText":"","contentGroupId":"","pageExpiryEnabled":false,"templatePath":"","url":"","publicAccessRules":[{}],"archivedAt":"","themeSettingsValues":{},"pageExpiryDate":0,"publicAccessRulesEnabled":false,"pageRedirected":false,"currentState":"","categoryId":0,"linkRelCanonicalUrl":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"private-app-legacy": @"{{apiKey}}",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"publishDate": @"",
@"language": @"",
@"enableLayoutStylesheets": @NO,
@"metaDescription": @"",
@"attachedStylesheets": @[ @{ } ],
@"password": @"",
@"publishImmediately": @NO,
@"htmlTitle": @"",
@"translations": @{ },
@"id": @"",
@"state": @"",
@"slug": @"",
@"createdById": @"",
@"currentlyPublished": @NO,
@"archivedInDashboard": @NO,
@"created": @"",
@"contentTypeCategory": @"",
@"mabExperimentId": @"",
@"updatedById": @"",
@"translatedFromId": @"",
@"folderId": @"",
@"widgetContainers": @{ },
@"pageExpiryRedirectId": @0,
@"dynamicPageDataSourceType": @0,
@"featuredImage": @"",
@"authorName": @"",
@"domain": @"",
@"name": @"",
@"dynamicPageHubDbTableId": @"",
@"campaign": @"",
@"dynamicPageDataSourceId": @"",
@"enableDomainStylesheets": @NO,
@"includeDefaultCustomCss": @NO,
@"subcategory": @"",
@"layoutSections": @{ },
@"updated": @"",
@"footerHtml": @"",
@"widgets": @{ },
@"headHtml": @"",
@"pageExpiryRedirectUrl": @"",
@"abStatus": @"",
@"useFeaturedImage": @NO,
@"abTestId": @"",
@"featuredImageAltText": @"",
@"contentGroupId": @"",
@"pageExpiryEnabled": @NO,
@"templatePath": @"",
@"url": @"",
@"publicAccessRules": @[ @{ } ],
@"archivedAt": @"",
@"themeSettingsValues": @{ },
@"pageExpiryDate": @0,
@"publicAccessRulesEnabled": @NO,
@"pageRedirected": @NO,
@"currentState": @"",
@"categoryId": @0,
@"linkRelCanonicalUrl": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/cms/v3/pages/landing-pages"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/cms/v3/pages/landing-pages" in
let headers = Header.add_list (Header.init ()) [
("private-app-legacy", "{{apiKey}}");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"publishDate\": \"\",\n \"language\": \"\",\n \"enableLayoutStylesheets\": false,\n \"metaDescription\": \"\",\n \"attachedStylesheets\": [\n {}\n ],\n \"password\": \"\",\n \"publishImmediately\": false,\n \"htmlTitle\": \"\",\n \"translations\": {},\n \"id\": \"\",\n \"state\": \"\",\n \"slug\": \"\",\n \"createdById\": \"\",\n \"currentlyPublished\": false,\n \"archivedInDashboard\": false,\n \"created\": \"\",\n \"contentTypeCategory\": \"\",\n \"mabExperimentId\": \"\",\n \"updatedById\": \"\",\n \"translatedFromId\": \"\",\n \"folderId\": \"\",\n \"widgetContainers\": {},\n \"pageExpiryRedirectId\": 0,\n \"dynamicPageDataSourceType\": 0,\n \"featuredImage\": \"\",\n \"authorName\": \"\",\n \"domain\": \"\",\n \"name\": \"\",\n \"dynamicPageHubDbTableId\": \"\",\n \"campaign\": \"\",\n \"dynamicPageDataSourceId\": \"\",\n \"enableDomainStylesheets\": false,\n \"includeDefaultCustomCss\": false,\n \"subcategory\": \"\",\n \"layoutSections\": {},\n \"updated\": \"\",\n \"footerHtml\": \"\",\n \"widgets\": {},\n \"headHtml\": \"\",\n \"pageExpiryRedirectUrl\": \"\",\n \"abStatus\": \"\",\n \"useFeaturedImage\": false,\n \"abTestId\": \"\",\n \"featuredImageAltText\": \"\",\n \"contentGroupId\": \"\",\n \"pageExpiryEnabled\": false,\n \"templatePath\": \"\",\n \"url\": \"\",\n \"publicAccessRules\": [\n {}\n ],\n \"archivedAt\": \"\",\n \"themeSettingsValues\": {},\n \"pageExpiryDate\": 0,\n \"publicAccessRulesEnabled\": false,\n \"pageRedirected\": false,\n \"currentState\": \"\",\n \"categoryId\": 0,\n \"linkRelCanonicalUrl\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/cms/v3/pages/landing-pages",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'publishDate' => '',
'language' => '',
'enableLayoutStylesheets' => null,
'metaDescription' => '',
'attachedStylesheets' => [
[
]
],
'password' => '',
'publishImmediately' => null,
'htmlTitle' => '',
'translations' => [
],
'id' => '',
'state' => '',
'slug' => '',
'createdById' => '',
'currentlyPublished' => null,
'archivedInDashboard' => null,
'created' => '',
'contentTypeCategory' => '',
'mabExperimentId' => '',
'updatedById' => '',
'translatedFromId' => '',
'folderId' => '',
'widgetContainers' => [
],
'pageExpiryRedirectId' => 0,
'dynamicPageDataSourceType' => 0,
'featuredImage' => '',
'authorName' => '',
'domain' => '',
'name' => '',
'dynamicPageHubDbTableId' => '',
'campaign' => '',
'dynamicPageDataSourceId' => '',
'enableDomainStylesheets' => null,
'includeDefaultCustomCss' => null,
'subcategory' => '',
'layoutSections' => [
],
'updated' => '',
'footerHtml' => '',
'widgets' => [
],
'headHtml' => '',
'pageExpiryRedirectUrl' => '',
'abStatus' => '',
'useFeaturedImage' => null,
'abTestId' => '',
'featuredImageAltText' => '',
'contentGroupId' => '',
'pageExpiryEnabled' => null,
'templatePath' => '',
'url' => '',
'publicAccessRules' => [
[
]
],
'archivedAt' => '',
'themeSettingsValues' => [
],
'pageExpiryDate' => 0,
'publicAccessRulesEnabled' => null,
'pageRedirected' => null,
'currentState' => '',
'categoryId' => 0,
'linkRelCanonicalUrl' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"private-app-legacy: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/cms/v3/pages/landing-pages', [
'body' => '{
"publishDate": "",
"language": "",
"enableLayoutStylesheets": false,
"metaDescription": "",
"attachedStylesheets": [
{}
],
"password": "",
"publishImmediately": false,
"htmlTitle": "",
"translations": {},
"id": "",
"state": "",
"slug": "",
"createdById": "",
"currentlyPublished": false,
"archivedInDashboard": false,
"created": "",
"contentTypeCategory": "",
"mabExperimentId": "",
"updatedById": "",
"translatedFromId": "",
"folderId": "",
"widgetContainers": {},
"pageExpiryRedirectId": 0,
"dynamicPageDataSourceType": 0,
"featuredImage": "",
"authorName": "",
"domain": "",
"name": "",
"dynamicPageHubDbTableId": "",
"campaign": "",
"dynamicPageDataSourceId": "",
"enableDomainStylesheets": false,
"includeDefaultCustomCss": false,
"subcategory": "",
"layoutSections": {},
"updated": "",
"footerHtml": "",
"widgets": {},
"headHtml": "",
"pageExpiryRedirectUrl": "",
"abStatus": "",
"useFeaturedImage": false,
"abTestId": "",
"featuredImageAltText": "",
"contentGroupId": "",
"pageExpiryEnabled": false,
"templatePath": "",
"url": "",
"publicAccessRules": [
{}
],
"archivedAt": "",
"themeSettingsValues": {},
"pageExpiryDate": 0,
"publicAccessRulesEnabled": false,
"pageRedirected": false,
"currentState": "",
"categoryId": 0,
"linkRelCanonicalUrl": ""
}',
'headers' => [
'content-type' => 'application/json',
'private-app-legacy' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/cms/v3/pages/landing-pages');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'private-app-legacy' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'publishDate' => '',
'language' => '',
'enableLayoutStylesheets' => null,
'metaDescription' => '',
'attachedStylesheets' => [
[
]
],
'password' => '',
'publishImmediately' => null,
'htmlTitle' => '',
'translations' => [
],
'id' => '',
'state' => '',
'slug' => '',
'createdById' => '',
'currentlyPublished' => null,
'archivedInDashboard' => null,
'created' => '',
'contentTypeCategory' => '',
'mabExperimentId' => '',
'updatedById' => '',
'translatedFromId' => '',
'folderId' => '',
'widgetContainers' => [
],
'pageExpiryRedirectId' => 0,
'dynamicPageDataSourceType' => 0,
'featuredImage' => '',
'authorName' => '',
'domain' => '',
'name' => '',
'dynamicPageHubDbTableId' => '',
'campaign' => '',
'dynamicPageDataSourceId' => '',
'enableDomainStylesheets' => null,
'includeDefaultCustomCss' => null,
'subcategory' => '',
'layoutSections' => [
],
'updated' => '',
'footerHtml' => '',
'widgets' => [
],
'headHtml' => '',
'pageExpiryRedirectUrl' => '',
'abStatus' => '',
'useFeaturedImage' => null,
'abTestId' => '',
'featuredImageAltText' => '',
'contentGroupId' => '',
'pageExpiryEnabled' => null,
'templatePath' => '',
'url' => '',
'publicAccessRules' => [
[
]
],
'archivedAt' => '',
'themeSettingsValues' => [
],
'pageExpiryDate' => 0,
'publicAccessRulesEnabled' => null,
'pageRedirected' => null,
'currentState' => '',
'categoryId' => 0,
'linkRelCanonicalUrl' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'publishDate' => '',
'language' => '',
'enableLayoutStylesheets' => null,
'metaDescription' => '',
'attachedStylesheets' => [
[
]
],
'password' => '',
'publishImmediately' => null,
'htmlTitle' => '',
'translations' => [
],
'id' => '',
'state' => '',
'slug' => '',
'createdById' => '',
'currentlyPublished' => null,
'archivedInDashboard' => null,
'created' => '',
'contentTypeCategory' => '',
'mabExperimentId' => '',
'updatedById' => '',
'translatedFromId' => '',
'folderId' => '',
'widgetContainers' => [
],
'pageExpiryRedirectId' => 0,
'dynamicPageDataSourceType' => 0,
'featuredImage' => '',
'authorName' => '',
'domain' => '',
'name' => '',
'dynamicPageHubDbTableId' => '',
'campaign' => '',
'dynamicPageDataSourceId' => '',
'enableDomainStylesheets' => null,
'includeDefaultCustomCss' => null,
'subcategory' => '',
'layoutSections' => [
],
'updated' => '',
'footerHtml' => '',
'widgets' => [
],
'headHtml' => '',
'pageExpiryRedirectUrl' => '',
'abStatus' => '',
'useFeaturedImage' => null,
'abTestId' => '',
'featuredImageAltText' => '',
'contentGroupId' => '',
'pageExpiryEnabled' => null,
'templatePath' => '',
'url' => '',
'publicAccessRules' => [
[
]
],
'archivedAt' => '',
'themeSettingsValues' => [
],
'pageExpiryDate' => 0,
'publicAccessRulesEnabled' => null,
'pageRedirected' => null,
'currentState' => '',
'categoryId' => 0,
'linkRelCanonicalUrl' => ''
]));
$request->setRequestUrl('{{baseUrl}}/cms/v3/pages/landing-pages');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'private-app-legacy' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("private-app-legacy", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/cms/v3/pages/landing-pages' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"publishDate": "",
"language": "",
"enableLayoutStylesheets": false,
"metaDescription": "",
"attachedStylesheets": [
{}
],
"password": "",
"publishImmediately": false,
"htmlTitle": "",
"translations": {},
"id": "",
"state": "",
"slug": "",
"createdById": "",
"currentlyPublished": false,
"archivedInDashboard": false,
"created": "",
"contentTypeCategory": "",
"mabExperimentId": "",
"updatedById": "",
"translatedFromId": "",
"folderId": "",
"widgetContainers": {},
"pageExpiryRedirectId": 0,
"dynamicPageDataSourceType": 0,
"featuredImage": "",
"authorName": "",
"domain": "",
"name": "",
"dynamicPageHubDbTableId": "",
"campaign": "",
"dynamicPageDataSourceId": "",
"enableDomainStylesheets": false,
"includeDefaultCustomCss": false,
"subcategory": "",
"layoutSections": {},
"updated": "",
"footerHtml": "",
"widgets": {},
"headHtml": "",
"pageExpiryRedirectUrl": "",
"abStatus": "",
"useFeaturedImage": false,
"abTestId": "",
"featuredImageAltText": "",
"contentGroupId": "",
"pageExpiryEnabled": false,
"templatePath": "",
"url": "",
"publicAccessRules": [
{}
],
"archivedAt": "",
"themeSettingsValues": {},
"pageExpiryDate": 0,
"publicAccessRulesEnabled": false,
"pageRedirected": false,
"currentState": "",
"categoryId": 0,
"linkRelCanonicalUrl": ""
}'
$headers=@{}
$headers.Add("private-app-legacy", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/cms/v3/pages/landing-pages' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"publishDate": "",
"language": "",
"enableLayoutStylesheets": false,
"metaDescription": "",
"attachedStylesheets": [
{}
],
"password": "",
"publishImmediately": false,
"htmlTitle": "",
"translations": {},
"id": "",
"state": "",
"slug": "",
"createdById": "",
"currentlyPublished": false,
"archivedInDashboard": false,
"created": "",
"contentTypeCategory": "",
"mabExperimentId": "",
"updatedById": "",
"translatedFromId": "",
"folderId": "",
"widgetContainers": {},
"pageExpiryRedirectId": 0,
"dynamicPageDataSourceType": 0,
"featuredImage": "",
"authorName": "",
"domain": "",
"name": "",
"dynamicPageHubDbTableId": "",
"campaign": "",
"dynamicPageDataSourceId": "",
"enableDomainStylesheets": false,
"includeDefaultCustomCss": false,
"subcategory": "",
"layoutSections": {},
"updated": "",
"footerHtml": "",
"widgets": {},
"headHtml": "",
"pageExpiryRedirectUrl": "",
"abStatus": "",
"useFeaturedImage": false,
"abTestId": "",
"featuredImageAltText": "",
"contentGroupId": "",
"pageExpiryEnabled": false,
"templatePath": "",
"url": "",
"publicAccessRules": [
{}
],
"archivedAt": "",
"themeSettingsValues": {},
"pageExpiryDate": 0,
"publicAccessRulesEnabled": false,
"pageRedirected": false,
"currentState": "",
"categoryId": 0,
"linkRelCanonicalUrl": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"publishDate\": \"\",\n \"language\": \"\",\n \"enableLayoutStylesheets\": false,\n \"metaDescription\": \"\",\n \"attachedStylesheets\": [\n {}\n ],\n \"password\": \"\",\n \"publishImmediately\": false,\n \"htmlTitle\": \"\",\n \"translations\": {},\n \"id\": \"\",\n \"state\": \"\",\n \"slug\": \"\",\n \"createdById\": \"\",\n \"currentlyPublished\": false,\n \"archivedInDashboard\": false,\n \"created\": \"\",\n \"contentTypeCategory\": \"\",\n \"mabExperimentId\": \"\",\n \"updatedById\": \"\",\n \"translatedFromId\": \"\",\n \"folderId\": \"\",\n \"widgetContainers\": {},\n \"pageExpiryRedirectId\": 0,\n \"dynamicPageDataSourceType\": 0,\n \"featuredImage\": \"\",\n \"authorName\": \"\",\n \"domain\": \"\",\n \"name\": \"\",\n \"dynamicPageHubDbTableId\": \"\",\n \"campaign\": \"\",\n \"dynamicPageDataSourceId\": \"\",\n \"enableDomainStylesheets\": false,\n \"includeDefaultCustomCss\": false,\n \"subcategory\": \"\",\n \"layoutSections\": {},\n \"updated\": \"\",\n \"footerHtml\": \"\",\n \"widgets\": {},\n \"headHtml\": \"\",\n \"pageExpiryRedirectUrl\": \"\",\n \"abStatus\": \"\",\n \"useFeaturedImage\": false,\n \"abTestId\": \"\",\n \"featuredImageAltText\": \"\",\n \"contentGroupId\": \"\",\n \"pageExpiryEnabled\": false,\n \"templatePath\": \"\",\n \"url\": \"\",\n \"publicAccessRules\": [\n {}\n ],\n \"archivedAt\": \"\",\n \"themeSettingsValues\": {},\n \"pageExpiryDate\": 0,\n \"publicAccessRulesEnabled\": false,\n \"pageRedirected\": false,\n \"currentState\": \"\",\n \"categoryId\": 0,\n \"linkRelCanonicalUrl\": \"\"\n}"
headers = {
'private-app-legacy': "{{apiKey}}",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/cms/v3/pages/landing-pages", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/cms/v3/pages/landing-pages"
payload = {
"publishDate": "",
"language": "",
"enableLayoutStylesheets": False,
"metaDescription": "",
"attachedStylesheets": [{}],
"password": "",
"publishImmediately": False,
"htmlTitle": "",
"translations": {},
"id": "",
"state": "",
"slug": "",
"createdById": "",
"currentlyPublished": False,
"archivedInDashboard": False,
"created": "",
"contentTypeCategory": "",
"mabExperimentId": "",
"updatedById": "",
"translatedFromId": "",
"folderId": "",
"widgetContainers": {},
"pageExpiryRedirectId": 0,
"dynamicPageDataSourceType": 0,
"featuredImage": "",
"authorName": "",
"domain": "",
"name": "",
"dynamicPageHubDbTableId": "",
"campaign": "",
"dynamicPageDataSourceId": "",
"enableDomainStylesheets": False,
"includeDefaultCustomCss": False,
"subcategory": "",
"layoutSections": {},
"updated": "",
"footerHtml": "",
"widgets": {},
"headHtml": "",
"pageExpiryRedirectUrl": "",
"abStatus": "",
"useFeaturedImage": False,
"abTestId": "",
"featuredImageAltText": "",
"contentGroupId": "",
"pageExpiryEnabled": False,
"templatePath": "",
"url": "",
"publicAccessRules": [{}],
"archivedAt": "",
"themeSettingsValues": {},
"pageExpiryDate": 0,
"publicAccessRulesEnabled": False,
"pageRedirected": False,
"currentState": "",
"categoryId": 0,
"linkRelCanonicalUrl": ""
}
headers = {
"private-app-legacy": "{{apiKey}}",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/cms/v3/pages/landing-pages"
payload <- "{\n \"publishDate\": \"\",\n \"language\": \"\",\n \"enableLayoutStylesheets\": false,\n \"metaDescription\": \"\",\n \"attachedStylesheets\": [\n {}\n ],\n \"password\": \"\",\n \"publishImmediately\": false,\n \"htmlTitle\": \"\",\n \"translations\": {},\n \"id\": \"\",\n \"state\": \"\",\n \"slug\": \"\",\n \"createdById\": \"\",\n \"currentlyPublished\": false,\n \"archivedInDashboard\": false,\n \"created\": \"\",\n \"contentTypeCategory\": \"\",\n \"mabExperimentId\": \"\",\n \"updatedById\": \"\",\n \"translatedFromId\": \"\",\n \"folderId\": \"\",\n \"widgetContainers\": {},\n \"pageExpiryRedirectId\": 0,\n \"dynamicPageDataSourceType\": 0,\n \"featuredImage\": \"\",\n \"authorName\": \"\",\n \"domain\": \"\",\n \"name\": \"\",\n \"dynamicPageHubDbTableId\": \"\",\n \"campaign\": \"\",\n \"dynamicPageDataSourceId\": \"\",\n \"enableDomainStylesheets\": false,\n \"includeDefaultCustomCss\": false,\n \"subcategory\": \"\",\n \"layoutSections\": {},\n \"updated\": \"\",\n \"footerHtml\": \"\",\n \"widgets\": {},\n \"headHtml\": \"\",\n \"pageExpiryRedirectUrl\": \"\",\n \"abStatus\": \"\",\n \"useFeaturedImage\": false,\n \"abTestId\": \"\",\n \"featuredImageAltText\": \"\",\n \"contentGroupId\": \"\",\n \"pageExpiryEnabled\": false,\n \"templatePath\": \"\",\n \"url\": \"\",\n \"publicAccessRules\": [\n {}\n ],\n \"archivedAt\": \"\",\n \"themeSettingsValues\": {},\n \"pageExpiryDate\": 0,\n \"publicAccessRulesEnabled\": false,\n \"pageRedirected\": false,\n \"currentState\": \"\",\n \"categoryId\": 0,\n \"linkRelCanonicalUrl\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('private-app-legacy' = '{{apiKey}}'), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/cms/v3/pages/landing-pages")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["private-app-legacy"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n \"publishDate\": \"\",\n \"language\": \"\",\n \"enableLayoutStylesheets\": false,\n \"metaDescription\": \"\",\n \"attachedStylesheets\": [\n {}\n ],\n \"password\": \"\",\n \"publishImmediately\": false,\n \"htmlTitle\": \"\",\n \"translations\": {},\n \"id\": \"\",\n \"state\": \"\",\n \"slug\": \"\",\n \"createdById\": \"\",\n \"currentlyPublished\": false,\n \"archivedInDashboard\": false,\n \"created\": \"\",\n \"contentTypeCategory\": \"\",\n \"mabExperimentId\": \"\",\n \"updatedById\": \"\",\n \"translatedFromId\": \"\",\n \"folderId\": \"\",\n \"widgetContainers\": {},\n \"pageExpiryRedirectId\": 0,\n \"dynamicPageDataSourceType\": 0,\n \"featuredImage\": \"\",\n \"authorName\": \"\",\n \"domain\": \"\",\n \"name\": \"\",\n \"dynamicPageHubDbTableId\": \"\",\n \"campaign\": \"\",\n \"dynamicPageDataSourceId\": \"\",\n \"enableDomainStylesheets\": false,\n \"includeDefaultCustomCss\": false,\n \"subcategory\": \"\",\n \"layoutSections\": {},\n \"updated\": \"\",\n \"footerHtml\": \"\",\n \"widgets\": {},\n \"headHtml\": \"\",\n \"pageExpiryRedirectUrl\": \"\",\n \"abStatus\": \"\",\n \"useFeaturedImage\": false,\n \"abTestId\": \"\",\n \"featuredImageAltText\": \"\",\n \"contentGroupId\": \"\",\n \"pageExpiryEnabled\": false,\n \"templatePath\": \"\",\n \"url\": \"\",\n \"publicAccessRules\": [\n {}\n ],\n \"archivedAt\": \"\",\n \"themeSettingsValues\": {},\n \"pageExpiryDate\": 0,\n \"publicAccessRulesEnabled\": false,\n \"pageRedirected\": false,\n \"currentState\": \"\",\n \"categoryId\": 0,\n \"linkRelCanonicalUrl\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/cms/v3/pages/landing-pages') do |req|
req.headers['private-app-legacy'] = '{{apiKey}}'
req.body = "{\n \"publishDate\": \"\",\n \"language\": \"\",\n \"enableLayoutStylesheets\": false,\n \"metaDescription\": \"\",\n \"attachedStylesheets\": [\n {}\n ],\n \"password\": \"\",\n \"publishImmediately\": false,\n \"htmlTitle\": \"\",\n \"translations\": {},\n \"id\": \"\",\n \"state\": \"\",\n \"slug\": \"\",\n \"createdById\": \"\",\n \"currentlyPublished\": false,\n \"archivedInDashboard\": false,\n \"created\": \"\",\n \"contentTypeCategory\": \"\",\n \"mabExperimentId\": \"\",\n \"updatedById\": \"\",\n \"translatedFromId\": \"\",\n \"folderId\": \"\",\n \"widgetContainers\": {},\n \"pageExpiryRedirectId\": 0,\n \"dynamicPageDataSourceType\": 0,\n \"featuredImage\": \"\",\n \"authorName\": \"\",\n \"domain\": \"\",\n \"name\": \"\",\n \"dynamicPageHubDbTableId\": \"\",\n \"campaign\": \"\",\n \"dynamicPageDataSourceId\": \"\",\n \"enableDomainStylesheets\": false,\n \"includeDefaultCustomCss\": false,\n \"subcategory\": \"\",\n \"layoutSections\": {},\n \"updated\": \"\",\n \"footerHtml\": \"\",\n \"widgets\": {},\n \"headHtml\": \"\",\n \"pageExpiryRedirectUrl\": \"\",\n \"abStatus\": \"\",\n \"useFeaturedImage\": false,\n \"abTestId\": \"\",\n \"featuredImageAltText\": \"\",\n \"contentGroupId\": \"\",\n \"pageExpiryEnabled\": false,\n \"templatePath\": \"\",\n \"url\": \"\",\n \"publicAccessRules\": [\n {}\n ],\n \"archivedAt\": \"\",\n \"themeSettingsValues\": {},\n \"pageExpiryDate\": 0,\n \"publicAccessRulesEnabled\": false,\n \"pageRedirected\": false,\n \"currentState\": \"\",\n \"categoryId\": 0,\n \"linkRelCanonicalUrl\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/cms/v3/pages/landing-pages";
let payload = json!({
"publishDate": "",
"language": "",
"enableLayoutStylesheets": false,
"metaDescription": "",
"attachedStylesheets": (json!({})),
"password": "",
"publishImmediately": false,
"htmlTitle": "",
"translations": json!({}),
"id": "",
"state": "",
"slug": "",
"createdById": "",
"currentlyPublished": false,
"archivedInDashboard": false,
"created": "",
"contentTypeCategory": "",
"mabExperimentId": "",
"updatedById": "",
"translatedFromId": "",
"folderId": "",
"widgetContainers": json!({}),
"pageExpiryRedirectId": 0,
"dynamicPageDataSourceType": 0,
"featuredImage": "",
"authorName": "",
"domain": "",
"name": "",
"dynamicPageHubDbTableId": "",
"campaign": "",
"dynamicPageDataSourceId": "",
"enableDomainStylesheets": false,
"includeDefaultCustomCss": false,
"subcategory": "",
"layoutSections": json!({}),
"updated": "",
"footerHtml": "",
"widgets": json!({}),
"headHtml": "",
"pageExpiryRedirectUrl": "",
"abStatus": "",
"useFeaturedImage": false,
"abTestId": "",
"featuredImageAltText": "",
"contentGroupId": "",
"pageExpiryEnabled": false,
"templatePath": "",
"url": "",
"publicAccessRules": (json!({})),
"archivedAt": "",
"themeSettingsValues": json!({}),
"pageExpiryDate": 0,
"publicAccessRulesEnabled": false,
"pageRedirected": false,
"currentState": "",
"categoryId": 0,
"linkRelCanonicalUrl": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("private-app-legacy", "{{apiKey}}".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/cms/v3/pages/landing-pages \
--header 'content-type: application/json' \
--header 'private-app-legacy: {{apiKey}}' \
--data '{
"publishDate": "",
"language": "",
"enableLayoutStylesheets": false,
"metaDescription": "",
"attachedStylesheets": [
{}
],
"password": "",
"publishImmediately": false,
"htmlTitle": "",
"translations": {},
"id": "",
"state": "",
"slug": "",
"createdById": "",
"currentlyPublished": false,
"archivedInDashboard": false,
"created": "",
"contentTypeCategory": "",
"mabExperimentId": "",
"updatedById": "",
"translatedFromId": "",
"folderId": "",
"widgetContainers": {},
"pageExpiryRedirectId": 0,
"dynamicPageDataSourceType": 0,
"featuredImage": "",
"authorName": "",
"domain": "",
"name": "",
"dynamicPageHubDbTableId": "",
"campaign": "",
"dynamicPageDataSourceId": "",
"enableDomainStylesheets": false,
"includeDefaultCustomCss": false,
"subcategory": "",
"layoutSections": {},
"updated": "",
"footerHtml": "",
"widgets": {},
"headHtml": "",
"pageExpiryRedirectUrl": "",
"abStatus": "",
"useFeaturedImage": false,
"abTestId": "",
"featuredImageAltText": "",
"contentGroupId": "",
"pageExpiryEnabled": false,
"templatePath": "",
"url": "",
"publicAccessRules": [
{}
],
"archivedAt": "",
"themeSettingsValues": {},
"pageExpiryDate": 0,
"publicAccessRulesEnabled": false,
"pageRedirected": false,
"currentState": "",
"categoryId": 0,
"linkRelCanonicalUrl": ""
}'
echo '{
"publishDate": "",
"language": "",
"enableLayoutStylesheets": false,
"metaDescription": "",
"attachedStylesheets": [
{}
],
"password": "",
"publishImmediately": false,
"htmlTitle": "",
"translations": {},
"id": "",
"state": "",
"slug": "",
"createdById": "",
"currentlyPublished": false,
"archivedInDashboard": false,
"created": "",
"contentTypeCategory": "",
"mabExperimentId": "",
"updatedById": "",
"translatedFromId": "",
"folderId": "",
"widgetContainers": {},
"pageExpiryRedirectId": 0,
"dynamicPageDataSourceType": 0,
"featuredImage": "",
"authorName": "",
"domain": "",
"name": "",
"dynamicPageHubDbTableId": "",
"campaign": "",
"dynamicPageDataSourceId": "",
"enableDomainStylesheets": false,
"includeDefaultCustomCss": false,
"subcategory": "",
"layoutSections": {},
"updated": "",
"footerHtml": "",
"widgets": {},
"headHtml": "",
"pageExpiryRedirectUrl": "",
"abStatus": "",
"useFeaturedImage": false,
"abTestId": "",
"featuredImageAltText": "",
"contentGroupId": "",
"pageExpiryEnabled": false,
"templatePath": "",
"url": "",
"publicAccessRules": [
{}
],
"archivedAt": "",
"themeSettingsValues": {},
"pageExpiryDate": 0,
"publicAccessRulesEnabled": false,
"pageRedirected": false,
"currentState": "",
"categoryId": 0,
"linkRelCanonicalUrl": ""
}' | \
http POST {{baseUrl}}/cms/v3/pages/landing-pages \
content-type:application/json \
private-app-legacy:'{{apiKey}}'
wget --quiet \
--method POST \
--header 'private-app-legacy: {{apiKey}}' \
--header 'content-type: application/json' \
--body-data '{\n "publishDate": "",\n "language": "",\n "enableLayoutStylesheets": false,\n "metaDescription": "",\n "attachedStylesheets": [\n {}\n ],\n "password": "",\n "publishImmediately": false,\n "htmlTitle": "",\n "translations": {},\n "id": "",\n "state": "",\n "slug": "",\n "createdById": "",\n "currentlyPublished": false,\n "archivedInDashboard": false,\n "created": "",\n "contentTypeCategory": "",\n "mabExperimentId": "",\n "updatedById": "",\n "translatedFromId": "",\n "folderId": "",\n "widgetContainers": {},\n "pageExpiryRedirectId": 0,\n "dynamicPageDataSourceType": 0,\n "featuredImage": "",\n "authorName": "",\n "domain": "",\n "name": "",\n "dynamicPageHubDbTableId": "",\n "campaign": "",\n "dynamicPageDataSourceId": "",\n "enableDomainStylesheets": false,\n "includeDefaultCustomCss": false,\n "subcategory": "",\n "layoutSections": {},\n "updated": "",\n "footerHtml": "",\n "widgets": {},\n "headHtml": "",\n "pageExpiryRedirectUrl": "",\n "abStatus": "",\n "useFeaturedImage": false,\n "abTestId": "",\n "featuredImageAltText": "",\n "contentGroupId": "",\n "pageExpiryEnabled": false,\n "templatePath": "",\n "url": "",\n "publicAccessRules": [\n {}\n ],\n "archivedAt": "",\n "themeSettingsValues": {},\n "pageExpiryDate": 0,\n "publicAccessRulesEnabled": false,\n "pageRedirected": false,\n "currentState": "",\n "categoryId": 0,\n "linkRelCanonicalUrl": ""\n}' \
--output-document \
- {{baseUrl}}/cms/v3/pages/landing-pages
import Foundation
let headers = [
"private-app-legacy": "{{apiKey}}",
"content-type": "application/json"
]
let parameters = [
"publishDate": "",
"language": "",
"enableLayoutStylesheets": false,
"metaDescription": "",
"attachedStylesheets": [[]],
"password": "",
"publishImmediately": false,
"htmlTitle": "",
"translations": [],
"id": "",
"state": "",
"slug": "",
"createdById": "",
"currentlyPublished": false,
"archivedInDashboard": false,
"created": "",
"contentTypeCategory": "",
"mabExperimentId": "",
"updatedById": "",
"translatedFromId": "",
"folderId": "",
"widgetContainers": [],
"pageExpiryRedirectId": 0,
"dynamicPageDataSourceType": 0,
"featuredImage": "",
"authorName": "",
"domain": "",
"name": "",
"dynamicPageHubDbTableId": "",
"campaign": "",
"dynamicPageDataSourceId": "",
"enableDomainStylesheets": false,
"includeDefaultCustomCss": false,
"subcategory": "",
"layoutSections": [],
"updated": "",
"footerHtml": "",
"widgets": [],
"headHtml": "",
"pageExpiryRedirectUrl": "",
"abStatus": "",
"useFeaturedImage": false,
"abTestId": "",
"featuredImageAltText": "",
"contentGroupId": "",
"pageExpiryEnabled": false,
"templatePath": "",
"url": "",
"publicAccessRules": [[]],
"archivedAt": "",
"themeSettingsValues": [],
"pageExpiryDate": 0,
"publicAccessRulesEnabled": false,
"pageRedirected": false,
"currentState": "",
"categoryId": 0,
"linkRelCanonicalUrl": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/cms/v3/pages/landing-pages")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
*/*
RESPONSE BODY text
{
"message": "Invalid input (details will vary based on the error)",
"correlationId": "aeb5f871-7f07-4993-9211-075dc63e7cbf",
"category": "VALIDATION_ERROR",
"links": {
"knowledge-base": "https://www.hubspot.com/products/service/knowledge-base"
}
}
POST
Create a new language variation (POST)
{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/create-language-variation
HEADERS
private-app-legacy
{{apiKey}}
BODY json
{
"language": "",
"id": "",
"primaryLanguage": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/create-language-variation");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "private-app-legacy: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"language\": \"\",\n \"id\": \"\",\n \"primaryLanguage\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/create-language-variation" {:headers {:private-app-legacy "{{apiKey}}"}
:content-type :json
:form-params {:language ""
:id ""
:primaryLanguage ""}})
require "http/client"
url = "{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/create-language-variation"
headers = HTTP::Headers{
"private-app-legacy" => "{{apiKey}}"
"content-type" => "application/json"
}
reqBody = "{\n \"language\": \"\",\n \"id\": \"\",\n \"primaryLanguage\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/create-language-variation"),
Headers =
{
{ "private-app-legacy", "{{apiKey}}" },
},
Content = new StringContent("{\n \"language\": \"\",\n \"id\": \"\",\n \"primaryLanguage\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/create-language-variation");
var request = new RestRequest("", Method.Post);
request.AddHeader("private-app-legacy", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"language\": \"\",\n \"id\": \"\",\n \"primaryLanguage\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/create-language-variation"
payload := strings.NewReader("{\n \"language\": \"\",\n \"id\": \"\",\n \"primaryLanguage\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("private-app-legacy", "{{apiKey}}")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/cms/v3/pages/landing-pages/multi-language/create-language-variation HTTP/1.1
Private-App-Legacy: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 57
{
"language": "",
"id": "",
"primaryLanguage": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/create-language-variation")
.setHeader("private-app-legacy", "{{apiKey}}")
.setHeader("content-type", "application/json")
.setBody("{\n \"language\": \"\",\n \"id\": \"\",\n \"primaryLanguage\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/create-language-variation"))
.header("private-app-legacy", "{{apiKey}}")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"language\": \"\",\n \"id\": \"\",\n \"primaryLanguage\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"language\": \"\",\n \"id\": \"\",\n \"primaryLanguage\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/create-language-variation")
.post(body)
.addHeader("private-app-legacy", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/create-language-variation")
.header("private-app-legacy", "{{apiKey}}")
.header("content-type", "application/json")
.body("{\n \"language\": \"\",\n \"id\": \"\",\n \"primaryLanguage\": \"\"\n}")
.asString();
const data = JSON.stringify({
language: '',
id: '',
primaryLanguage: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/create-language-variation');
xhr.setRequestHeader('private-app-legacy', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/create-language-variation',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
data: {language: '', id: '', primaryLanguage: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/create-language-variation';
const options = {
method: 'POST',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
body: '{"language":"","id":"","primaryLanguage":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/create-language-variation',
method: 'POST',
headers: {
'private-app-legacy': '{{apiKey}}',
'content-type': 'application/json'
},
processData: false,
data: '{\n "language": "",\n "id": "",\n "primaryLanguage": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"language\": \"\",\n \"id\": \"\",\n \"primaryLanguage\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/create-language-variation")
.post(body)
.addHeader("private-app-legacy", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/cms/v3/pages/landing-pages/multi-language/create-language-variation',
headers: {
'private-app-legacy': '{{apiKey}}',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({language: '', id: '', primaryLanguage: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/create-language-variation',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
body: {language: '', id: '', primaryLanguage: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/create-language-variation');
req.headers({
'private-app-legacy': '{{apiKey}}',
'content-type': 'application/json'
});
req.type('json');
req.send({
language: '',
id: '',
primaryLanguage: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/create-language-variation',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
data: {language: '', id: '', primaryLanguage: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/create-language-variation';
const options = {
method: 'POST',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
body: '{"language":"","id":"","primaryLanguage":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"private-app-legacy": @"{{apiKey}}",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"language": @"",
@"id": @"",
@"primaryLanguage": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/create-language-variation"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/create-language-variation" in
let headers = Header.add_list (Header.init ()) [
("private-app-legacy", "{{apiKey}}");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"language\": \"\",\n \"id\": \"\",\n \"primaryLanguage\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/create-language-variation",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'language' => '',
'id' => '',
'primaryLanguage' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"private-app-legacy: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/create-language-variation', [
'body' => '{
"language": "",
"id": "",
"primaryLanguage": ""
}',
'headers' => [
'content-type' => 'application/json',
'private-app-legacy' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/create-language-variation');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'private-app-legacy' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'language' => '',
'id' => '',
'primaryLanguage' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'language' => '',
'id' => '',
'primaryLanguage' => ''
]));
$request->setRequestUrl('{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/create-language-variation');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'private-app-legacy' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("private-app-legacy", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/create-language-variation' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"language": "",
"id": "",
"primaryLanguage": ""
}'
$headers=@{}
$headers.Add("private-app-legacy", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/create-language-variation' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"language": "",
"id": "",
"primaryLanguage": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"language\": \"\",\n \"id\": \"\",\n \"primaryLanguage\": \"\"\n}"
headers = {
'private-app-legacy': "{{apiKey}}",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/cms/v3/pages/landing-pages/multi-language/create-language-variation", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/create-language-variation"
payload = {
"language": "",
"id": "",
"primaryLanguage": ""
}
headers = {
"private-app-legacy": "{{apiKey}}",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/create-language-variation"
payload <- "{\n \"language\": \"\",\n \"id\": \"\",\n \"primaryLanguage\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('private-app-legacy' = '{{apiKey}}'), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/create-language-variation")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["private-app-legacy"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n \"language\": \"\",\n \"id\": \"\",\n \"primaryLanguage\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/cms/v3/pages/landing-pages/multi-language/create-language-variation') do |req|
req.headers['private-app-legacy'] = '{{apiKey}}'
req.body = "{\n \"language\": \"\",\n \"id\": \"\",\n \"primaryLanguage\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/create-language-variation";
let payload = json!({
"language": "",
"id": "",
"primaryLanguage": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("private-app-legacy", "{{apiKey}}".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/cms/v3/pages/landing-pages/multi-language/create-language-variation \
--header 'content-type: application/json' \
--header 'private-app-legacy: {{apiKey}}' \
--data '{
"language": "",
"id": "",
"primaryLanguage": ""
}'
echo '{
"language": "",
"id": "",
"primaryLanguage": ""
}' | \
http POST {{baseUrl}}/cms/v3/pages/landing-pages/multi-language/create-language-variation \
content-type:application/json \
private-app-legacy:'{{apiKey}}'
wget --quiet \
--method POST \
--header 'private-app-legacy: {{apiKey}}' \
--header 'content-type: application/json' \
--body-data '{\n "language": "",\n "id": "",\n "primaryLanguage": ""\n}' \
--output-document \
- {{baseUrl}}/cms/v3/pages/landing-pages/multi-language/create-language-variation
import Foundation
let headers = [
"private-app-legacy": "{{apiKey}}",
"content-type": "application/json"
]
let parameters = [
"language": "",
"id": "",
"primaryLanguage": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/create-language-variation")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
*/*
RESPONSE BODY text
{
"message": "Invalid input (details will vary based on the error)",
"correlationId": "aeb5f871-7f07-4993-9211-075dc63e7cbf",
"category": "VALIDATION_ERROR",
"links": {
"knowledge-base": "https://www.hubspot.com/products/service/knowledge-base"
}
}
DELETE
Delete a Folder
{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId
HEADERS
private-app-legacy
{{apiKey}}
QUERY PARAMS
objectId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "private-app-legacy: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/delete "{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId" {:headers {:private-app-legacy "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId"
headers = HTTP::Headers{
"private-app-legacy" => "{{apiKey}}"
}
response = HTTP::Client.delete url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Delete,
RequestUri = new Uri("{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId"),
Headers =
{
{ "private-app-legacy", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId");
var request = new RestRequest("", Method.Delete);
request.AddHeader("private-app-legacy", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("private-app-legacy", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
DELETE /baseUrl/cms/v3/pages/landing-pages/folders/:objectId HTTP/1.1
Private-App-Legacy: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId")
.setHeader("private-app-legacy", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId"))
.header("private-app-legacy", "{{apiKey}}")
.method("DELETE", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId")
.delete(null)
.addHeader("private-app-legacy", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId")
.header("private-app-legacy", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('DELETE', '{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId');
xhr.setRequestHeader('private-app-legacy', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'DELETE',
url: '{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId',
headers: {'private-app-legacy': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId';
const options = {method: 'DELETE', headers: {'private-app-legacy': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId',
method: 'DELETE',
headers: {
'private-app-legacy': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId")
.delete(null)
.addHeader("private-app-legacy", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'DELETE',
hostname: 'example.com',
port: null,
path: '/baseUrl/cms/v3/pages/landing-pages/folders/:objectId',
headers: {
'private-app-legacy': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'DELETE',
url: '{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId',
headers: {'private-app-legacy': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('DELETE', '{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId');
req.headers({
'private-app-legacy': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'DELETE',
url: '{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId',
headers: {'private-app-legacy': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId';
const options = {method: 'DELETE', headers: {'private-app-legacy': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"private-app-legacy": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"DELETE"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId" in
let headers = Header.add (Header.init ()) "private-app-legacy" "{{apiKey}}" in
Client.call ~headers `DELETE uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"private-app-legacy: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('DELETE', '{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId', [
'headers' => [
'private-app-legacy' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId');
$request->setMethod(HTTP_METH_DELETE);
$request->setHeaders([
'private-app-legacy' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId');
$request->setRequestMethod('DELETE');
$request->setHeaders([
'private-app-legacy' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("private-app-legacy", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId' -Method DELETE -Headers $headers
$headers=@{}
$headers.Add("private-app-legacy", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId' -Method DELETE -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'private-app-legacy': "{{apiKey}}" }
conn.request("DELETE", "/baseUrl/cms/v3/pages/landing-pages/folders/:objectId", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId"
headers = {"private-app-legacy": "{{apiKey}}"}
response = requests.delete(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId"
response <- VERB("DELETE", url, add_headers('private-app-legacy' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["private-app-legacy"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.delete('/baseUrl/cms/v3/pages/landing-pages/folders/:objectId') do |req|
req.headers['private-app-legacy'] = '{{apiKey}}'
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("private-app-legacy", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("DELETE").unwrap(), url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request DELETE \
--url {{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId \
--header 'private-app-legacy: {{apiKey}}'
http DELETE {{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId \
private-app-legacy:'{{apiKey}}'
wget --quiet \
--method DELETE \
--header 'private-app-legacy: {{apiKey}}' \
--output-document \
- {{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId
import Foundation
let headers = ["private-app-legacy": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "DELETE"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
*/*
RESPONSE BODY text
{
"message": "Invalid input (details will vary based on the error)",
"correlationId": "aeb5f871-7f07-4993-9211-075dc63e7cbf",
"category": "VALIDATION_ERROR",
"links": {
"knowledge-base": "https://www.hubspot.com/products/service/knowledge-base"
}
}
DELETE
Delete a Landing Page
{{baseUrl}}/cms/v3/pages/landing-pages/:objectId
HEADERS
private-app-legacy
{{apiKey}}
QUERY PARAMS
objectId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/cms/v3/pages/landing-pages/:objectId");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "private-app-legacy: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/delete "{{baseUrl}}/cms/v3/pages/landing-pages/:objectId" {:headers {:private-app-legacy "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/cms/v3/pages/landing-pages/:objectId"
headers = HTTP::Headers{
"private-app-legacy" => "{{apiKey}}"
}
response = HTTP::Client.delete url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Delete,
RequestUri = new Uri("{{baseUrl}}/cms/v3/pages/landing-pages/:objectId"),
Headers =
{
{ "private-app-legacy", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/cms/v3/pages/landing-pages/:objectId");
var request = new RestRequest("", Method.Delete);
request.AddHeader("private-app-legacy", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/cms/v3/pages/landing-pages/:objectId"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("private-app-legacy", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
DELETE /baseUrl/cms/v3/pages/landing-pages/:objectId HTTP/1.1
Private-App-Legacy: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/cms/v3/pages/landing-pages/:objectId")
.setHeader("private-app-legacy", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/cms/v3/pages/landing-pages/:objectId"))
.header("private-app-legacy", "{{apiKey}}")
.method("DELETE", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/cms/v3/pages/landing-pages/:objectId")
.delete(null)
.addHeader("private-app-legacy", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/cms/v3/pages/landing-pages/:objectId")
.header("private-app-legacy", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('DELETE', '{{baseUrl}}/cms/v3/pages/landing-pages/:objectId');
xhr.setRequestHeader('private-app-legacy', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'DELETE',
url: '{{baseUrl}}/cms/v3/pages/landing-pages/:objectId',
headers: {'private-app-legacy': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/cms/v3/pages/landing-pages/:objectId';
const options = {method: 'DELETE', headers: {'private-app-legacy': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/cms/v3/pages/landing-pages/:objectId',
method: 'DELETE',
headers: {
'private-app-legacy': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/cms/v3/pages/landing-pages/:objectId")
.delete(null)
.addHeader("private-app-legacy", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'DELETE',
hostname: 'example.com',
port: null,
path: '/baseUrl/cms/v3/pages/landing-pages/:objectId',
headers: {
'private-app-legacy': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'DELETE',
url: '{{baseUrl}}/cms/v3/pages/landing-pages/:objectId',
headers: {'private-app-legacy': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('DELETE', '{{baseUrl}}/cms/v3/pages/landing-pages/:objectId');
req.headers({
'private-app-legacy': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'DELETE',
url: '{{baseUrl}}/cms/v3/pages/landing-pages/:objectId',
headers: {'private-app-legacy': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/cms/v3/pages/landing-pages/:objectId';
const options = {method: 'DELETE', headers: {'private-app-legacy': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"private-app-legacy": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/cms/v3/pages/landing-pages/:objectId"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"DELETE"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/cms/v3/pages/landing-pages/:objectId" in
let headers = Header.add (Header.init ()) "private-app-legacy" "{{apiKey}}" in
Client.call ~headers `DELETE uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/cms/v3/pages/landing-pages/:objectId",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"private-app-legacy: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('DELETE', '{{baseUrl}}/cms/v3/pages/landing-pages/:objectId', [
'headers' => [
'private-app-legacy' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/cms/v3/pages/landing-pages/:objectId');
$request->setMethod(HTTP_METH_DELETE);
$request->setHeaders([
'private-app-legacy' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/cms/v3/pages/landing-pages/:objectId');
$request->setRequestMethod('DELETE');
$request->setHeaders([
'private-app-legacy' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("private-app-legacy", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/cms/v3/pages/landing-pages/:objectId' -Method DELETE -Headers $headers
$headers=@{}
$headers.Add("private-app-legacy", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/cms/v3/pages/landing-pages/:objectId' -Method DELETE -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'private-app-legacy': "{{apiKey}}" }
conn.request("DELETE", "/baseUrl/cms/v3/pages/landing-pages/:objectId", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/cms/v3/pages/landing-pages/:objectId"
headers = {"private-app-legacy": "{{apiKey}}"}
response = requests.delete(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/cms/v3/pages/landing-pages/:objectId"
response <- VERB("DELETE", url, add_headers('private-app-legacy' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/cms/v3/pages/landing-pages/:objectId")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["private-app-legacy"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.delete('/baseUrl/cms/v3/pages/landing-pages/:objectId') do |req|
req.headers['private-app-legacy'] = '{{apiKey}}'
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/cms/v3/pages/landing-pages/:objectId";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("private-app-legacy", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("DELETE").unwrap(), url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request DELETE \
--url {{baseUrl}}/cms/v3/pages/landing-pages/:objectId \
--header 'private-app-legacy: {{apiKey}}'
http DELETE {{baseUrl}}/cms/v3/pages/landing-pages/:objectId \
private-app-legacy:'{{apiKey}}'
wget --quiet \
--method DELETE \
--header 'private-app-legacy: {{apiKey}}' \
--output-document \
- {{baseUrl}}/cms/v3/pages/landing-pages/:objectId
import Foundation
let headers = ["private-app-legacy": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/cms/v3/pages/landing-pages/:objectId")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "DELETE"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
*/*
RESPONSE BODY text
{
"message": "Invalid input (details will vary based on the error)",
"correlationId": "aeb5f871-7f07-4993-9211-075dc63e7cbf",
"category": "VALIDATION_ERROR",
"links": {
"knowledge-base": "https://www.hubspot.com/products/service/knowledge-base"
}
}
POST
Delete a batch of Folders
{{baseUrl}}/cms/v3/pages/landing-pages/folders/batch/archive
HEADERS
private-app-legacy
{{apiKey}}
BODY json
{
"inputs": []
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/cms/v3/pages/landing-pages/folders/batch/archive");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "private-app-legacy: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"inputs\": []\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/cms/v3/pages/landing-pages/folders/batch/archive" {:headers {:private-app-legacy "{{apiKey}}"}
:content-type :json
:form-params {:inputs []}})
require "http/client"
url = "{{baseUrl}}/cms/v3/pages/landing-pages/folders/batch/archive"
headers = HTTP::Headers{
"private-app-legacy" => "{{apiKey}}"
"content-type" => "application/json"
}
reqBody = "{\n \"inputs\": []\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/cms/v3/pages/landing-pages/folders/batch/archive"),
Headers =
{
{ "private-app-legacy", "{{apiKey}}" },
},
Content = new StringContent("{\n \"inputs\": []\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/cms/v3/pages/landing-pages/folders/batch/archive");
var request = new RestRequest("", Method.Post);
request.AddHeader("private-app-legacy", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"inputs\": []\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/cms/v3/pages/landing-pages/folders/batch/archive"
payload := strings.NewReader("{\n \"inputs\": []\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("private-app-legacy", "{{apiKey}}")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/cms/v3/pages/landing-pages/folders/batch/archive HTTP/1.1
Private-App-Legacy: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 18
{
"inputs": []
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/cms/v3/pages/landing-pages/folders/batch/archive")
.setHeader("private-app-legacy", "{{apiKey}}")
.setHeader("content-type", "application/json")
.setBody("{\n \"inputs\": []\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/cms/v3/pages/landing-pages/folders/batch/archive"))
.header("private-app-legacy", "{{apiKey}}")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"inputs\": []\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"inputs\": []\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/cms/v3/pages/landing-pages/folders/batch/archive")
.post(body)
.addHeader("private-app-legacy", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/cms/v3/pages/landing-pages/folders/batch/archive")
.header("private-app-legacy", "{{apiKey}}")
.header("content-type", "application/json")
.body("{\n \"inputs\": []\n}")
.asString();
const data = JSON.stringify({
inputs: []
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/cms/v3/pages/landing-pages/folders/batch/archive');
xhr.setRequestHeader('private-app-legacy', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/cms/v3/pages/landing-pages/folders/batch/archive',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
data: {inputs: []}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/cms/v3/pages/landing-pages/folders/batch/archive';
const options = {
method: 'POST',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
body: '{"inputs":[]}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/cms/v3/pages/landing-pages/folders/batch/archive',
method: 'POST',
headers: {
'private-app-legacy': '{{apiKey}}',
'content-type': 'application/json'
},
processData: false,
data: '{\n "inputs": []\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"inputs\": []\n}")
val request = Request.Builder()
.url("{{baseUrl}}/cms/v3/pages/landing-pages/folders/batch/archive")
.post(body)
.addHeader("private-app-legacy", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/cms/v3/pages/landing-pages/folders/batch/archive',
headers: {
'private-app-legacy': '{{apiKey}}',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({inputs: []}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/cms/v3/pages/landing-pages/folders/batch/archive',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
body: {inputs: []},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/cms/v3/pages/landing-pages/folders/batch/archive');
req.headers({
'private-app-legacy': '{{apiKey}}',
'content-type': 'application/json'
});
req.type('json');
req.send({
inputs: []
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/cms/v3/pages/landing-pages/folders/batch/archive',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
data: {inputs: []}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/cms/v3/pages/landing-pages/folders/batch/archive';
const options = {
method: 'POST',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
body: '{"inputs":[]}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"private-app-legacy": @"{{apiKey}}",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"inputs": @[ ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/cms/v3/pages/landing-pages/folders/batch/archive"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/cms/v3/pages/landing-pages/folders/batch/archive" in
let headers = Header.add_list (Header.init ()) [
("private-app-legacy", "{{apiKey}}");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"inputs\": []\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/cms/v3/pages/landing-pages/folders/batch/archive",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'inputs' => [
]
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"private-app-legacy: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/cms/v3/pages/landing-pages/folders/batch/archive', [
'body' => '{
"inputs": []
}',
'headers' => [
'content-type' => 'application/json',
'private-app-legacy' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/cms/v3/pages/landing-pages/folders/batch/archive');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'private-app-legacy' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'inputs' => [
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'inputs' => [
]
]));
$request->setRequestUrl('{{baseUrl}}/cms/v3/pages/landing-pages/folders/batch/archive');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'private-app-legacy' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("private-app-legacy", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/cms/v3/pages/landing-pages/folders/batch/archive' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"inputs": []
}'
$headers=@{}
$headers.Add("private-app-legacy", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/cms/v3/pages/landing-pages/folders/batch/archive' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"inputs": []
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"inputs\": []\n}"
headers = {
'private-app-legacy': "{{apiKey}}",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/cms/v3/pages/landing-pages/folders/batch/archive", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/cms/v3/pages/landing-pages/folders/batch/archive"
payload = { "inputs": [] }
headers = {
"private-app-legacy": "{{apiKey}}",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/cms/v3/pages/landing-pages/folders/batch/archive"
payload <- "{\n \"inputs\": []\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('private-app-legacy' = '{{apiKey}}'), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/cms/v3/pages/landing-pages/folders/batch/archive")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["private-app-legacy"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n \"inputs\": []\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/cms/v3/pages/landing-pages/folders/batch/archive') do |req|
req.headers['private-app-legacy'] = '{{apiKey}}'
req.body = "{\n \"inputs\": []\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/cms/v3/pages/landing-pages/folders/batch/archive";
let payload = json!({"inputs": ()});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("private-app-legacy", "{{apiKey}}".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/cms/v3/pages/landing-pages/folders/batch/archive \
--header 'content-type: application/json' \
--header 'private-app-legacy: {{apiKey}}' \
--data '{
"inputs": []
}'
echo '{
"inputs": []
}' | \
http POST {{baseUrl}}/cms/v3/pages/landing-pages/folders/batch/archive \
content-type:application/json \
private-app-legacy:'{{apiKey}}'
wget --quiet \
--method POST \
--header 'private-app-legacy: {{apiKey}}' \
--header 'content-type: application/json' \
--body-data '{\n "inputs": []\n}' \
--output-document \
- {{baseUrl}}/cms/v3/pages/landing-pages/folders/batch/archive
import Foundation
let headers = [
"private-app-legacy": "{{apiKey}}",
"content-type": "application/json"
]
let parameters = ["inputs": []] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/cms/v3/pages/landing-pages/folders/batch/archive")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
*/*
RESPONSE BODY text
{
"message": "Invalid input (details will vary based on the error)",
"correlationId": "aeb5f871-7f07-4993-9211-075dc63e7cbf",
"category": "VALIDATION_ERROR",
"links": {
"knowledge-base": "https://www.hubspot.com/products/service/knowledge-base"
}
}
POST
Delete a batch of Landing Pages
{{baseUrl}}/cms/v3/pages/landing-pages/batch/archive
HEADERS
private-app-legacy
{{apiKey}}
BODY json
{
"inputs": []
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/cms/v3/pages/landing-pages/batch/archive");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "private-app-legacy: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"inputs\": []\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/cms/v3/pages/landing-pages/batch/archive" {:headers {:private-app-legacy "{{apiKey}}"}
:content-type :json
:form-params {:inputs []}})
require "http/client"
url = "{{baseUrl}}/cms/v3/pages/landing-pages/batch/archive"
headers = HTTP::Headers{
"private-app-legacy" => "{{apiKey}}"
"content-type" => "application/json"
}
reqBody = "{\n \"inputs\": []\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/cms/v3/pages/landing-pages/batch/archive"),
Headers =
{
{ "private-app-legacy", "{{apiKey}}" },
},
Content = new StringContent("{\n \"inputs\": []\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/cms/v3/pages/landing-pages/batch/archive");
var request = new RestRequest("", Method.Post);
request.AddHeader("private-app-legacy", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"inputs\": []\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/cms/v3/pages/landing-pages/batch/archive"
payload := strings.NewReader("{\n \"inputs\": []\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("private-app-legacy", "{{apiKey}}")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/cms/v3/pages/landing-pages/batch/archive HTTP/1.1
Private-App-Legacy: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 18
{
"inputs": []
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/cms/v3/pages/landing-pages/batch/archive")
.setHeader("private-app-legacy", "{{apiKey}}")
.setHeader("content-type", "application/json")
.setBody("{\n \"inputs\": []\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/cms/v3/pages/landing-pages/batch/archive"))
.header("private-app-legacy", "{{apiKey}}")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"inputs\": []\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"inputs\": []\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/cms/v3/pages/landing-pages/batch/archive")
.post(body)
.addHeader("private-app-legacy", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/cms/v3/pages/landing-pages/batch/archive")
.header("private-app-legacy", "{{apiKey}}")
.header("content-type", "application/json")
.body("{\n \"inputs\": []\n}")
.asString();
const data = JSON.stringify({
inputs: []
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/cms/v3/pages/landing-pages/batch/archive');
xhr.setRequestHeader('private-app-legacy', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/cms/v3/pages/landing-pages/batch/archive',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
data: {inputs: []}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/cms/v3/pages/landing-pages/batch/archive';
const options = {
method: 'POST',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
body: '{"inputs":[]}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/cms/v3/pages/landing-pages/batch/archive',
method: 'POST',
headers: {
'private-app-legacy': '{{apiKey}}',
'content-type': 'application/json'
},
processData: false,
data: '{\n "inputs": []\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"inputs\": []\n}")
val request = Request.Builder()
.url("{{baseUrl}}/cms/v3/pages/landing-pages/batch/archive")
.post(body)
.addHeader("private-app-legacy", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/cms/v3/pages/landing-pages/batch/archive',
headers: {
'private-app-legacy': '{{apiKey}}',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({inputs: []}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/cms/v3/pages/landing-pages/batch/archive',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
body: {inputs: []},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/cms/v3/pages/landing-pages/batch/archive');
req.headers({
'private-app-legacy': '{{apiKey}}',
'content-type': 'application/json'
});
req.type('json');
req.send({
inputs: []
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/cms/v3/pages/landing-pages/batch/archive',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
data: {inputs: []}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/cms/v3/pages/landing-pages/batch/archive';
const options = {
method: 'POST',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
body: '{"inputs":[]}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"private-app-legacy": @"{{apiKey}}",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"inputs": @[ ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/cms/v3/pages/landing-pages/batch/archive"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/cms/v3/pages/landing-pages/batch/archive" in
let headers = Header.add_list (Header.init ()) [
("private-app-legacy", "{{apiKey}}");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"inputs\": []\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/cms/v3/pages/landing-pages/batch/archive",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'inputs' => [
]
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"private-app-legacy: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/cms/v3/pages/landing-pages/batch/archive', [
'body' => '{
"inputs": []
}',
'headers' => [
'content-type' => 'application/json',
'private-app-legacy' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/cms/v3/pages/landing-pages/batch/archive');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'private-app-legacy' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'inputs' => [
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'inputs' => [
]
]));
$request->setRequestUrl('{{baseUrl}}/cms/v3/pages/landing-pages/batch/archive');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'private-app-legacy' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("private-app-legacy", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/cms/v3/pages/landing-pages/batch/archive' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"inputs": []
}'
$headers=@{}
$headers.Add("private-app-legacy", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/cms/v3/pages/landing-pages/batch/archive' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"inputs": []
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"inputs\": []\n}"
headers = {
'private-app-legacy': "{{apiKey}}",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/cms/v3/pages/landing-pages/batch/archive", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/cms/v3/pages/landing-pages/batch/archive"
payload = { "inputs": [] }
headers = {
"private-app-legacy": "{{apiKey}}",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/cms/v3/pages/landing-pages/batch/archive"
payload <- "{\n \"inputs\": []\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('private-app-legacy' = '{{apiKey}}'), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/cms/v3/pages/landing-pages/batch/archive")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["private-app-legacy"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n \"inputs\": []\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/cms/v3/pages/landing-pages/batch/archive') do |req|
req.headers['private-app-legacy'] = '{{apiKey}}'
req.body = "{\n \"inputs\": []\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/cms/v3/pages/landing-pages/batch/archive";
let payload = json!({"inputs": ()});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("private-app-legacy", "{{apiKey}}".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/cms/v3/pages/landing-pages/batch/archive \
--header 'content-type: application/json' \
--header 'private-app-legacy: {{apiKey}}' \
--data '{
"inputs": []
}'
echo '{
"inputs": []
}' | \
http POST {{baseUrl}}/cms/v3/pages/landing-pages/batch/archive \
content-type:application/json \
private-app-legacy:'{{apiKey}}'
wget --quiet \
--method POST \
--header 'private-app-legacy: {{apiKey}}' \
--header 'content-type: application/json' \
--body-data '{\n "inputs": []\n}' \
--output-document \
- {{baseUrl}}/cms/v3/pages/landing-pages/batch/archive
import Foundation
let headers = [
"private-app-legacy": "{{apiKey}}",
"content-type": "application/json"
]
let parameters = ["inputs": []] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/cms/v3/pages/landing-pages/batch/archive")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
*/*
RESPONSE BODY text
{
"message": "Invalid input (details will vary based on the error)",
"correlationId": "aeb5f871-7f07-4993-9211-075dc63e7cbf",
"category": "VALIDATION_ERROR",
"links": {
"knowledge-base": "https://www.hubspot.com/products/service/knowledge-base"
}
}
POST
Detach a landing page from a multi-language group
{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/detach-from-lang-group
HEADERS
private-app-legacy
{{apiKey}}
BODY json
{
"id": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/detach-from-lang-group");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "private-app-legacy: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"id\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/detach-from-lang-group" {:headers {:private-app-legacy "{{apiKey}}"}
:content-type :json
:form-params {:id ""}})
require "http/client"
url = "{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/detach-from-lang-group"
headers = HTTP::Headers{
"private-app-legacy" => "{{apiKey}}"
"content-type" => "application/json"
}
reqBody = "{\n \"id\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/detach-from-lang-group"),
Headers =
{
{ "private-app-legacy", "{{apiKey}}" },
},
Content = new StringContent("{\n \"id\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/detach-from-lang-group");
var request = new RestRequest("", Method.Post);
request.AddHeader("private-app-legacy", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"id\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/detach-from-lang-group"
payload := strings.NewReader("{\n \"id\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("private-app-legacy", "{{apiKey}}")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/cms/v3/pages/landing-pages/multi-language/detach-from-lang-group HTTP/1.1
Private-App-Legacy: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 14
{
"id": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/detach-from-lang-group")
.setHeader("private-app-legacy", "{{apiKey}}")
.setHeader("content-type", "application/json")
.setBody("{\n \"id\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/detach-from-lang-group"))
.header("private-app-legacy", "{{apiKey}}")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"id\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"id\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/detach-from-lang-group")
.post(body)
.addHeader("private-app-legacy", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/detach-from-lang-group")
.header("private-app-legacy", "{{apiKey}}")
.header("content-type", "application/json")
.body("{\n \"id\": \"\"\n}")
.asString();
const data = JSON.stringify({
id: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/detach-from-lang-group');
xhr.setRequestHeader('private-app-legacy', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/detach-from-lang-group',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
data: {id: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/detach-from-lang-group';
const options = {
method: 'POST',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
body: '{"id":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/detach-from-lang-group',
method: 'POST',
headers: {
'private-app-legacy': '{{apiKey}}',
'content-type': 'application/json'
},
processData: false,
data: '{\n "id": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"id\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/detach-from-lang-group")
.post(body)
.addHeader("private-app-legacy", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/cms/v3/pages/landing-pages/multi-language/detach-from-lang-group',
headers: {
'private-app-legacy': '{{apiKey}}',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({id: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/detach-from-lang-group',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
body: {id: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/detach-from-lang-group');
req.headers({
'private-app-legacy': '{{apiKey}}',
'content-type': 'application/json'
});
req.type('json');
req.send({
id: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/detach-from-lang-group',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
data: {id: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/detach-from-lang-group';
const options = {
method: 'POST',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
body: '{"id":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"private-app-legacy": @"{{apiKey}}",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"id": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/detach-from-lang-group"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/detach-from-lang-group" in
let headers = Header.add_list (Header.init ()) [
("private-app-legacy", "{{apiKey}}");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"id\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/detach-from-lang-group",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'id' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"private-app-legacy: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/detach-from-lang-group', [
'body' => '{
"id": ""
}',
'headers' => [
'content-type' => 'application/json',
'private-app-legacy' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/detach-from-lang-group');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'private-app-legacy' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'id' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'id' => ''
]));
$request->setRequestUrl('{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/detach-from-lang-group');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'private-app-legacy' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("private-app-legacy", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/detach-from-lang-group' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"id": ""
}'
$headers=@{}
$headers.Add("private-app-legacy", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/detach-from-lang-group' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"id": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"id\": \"\"\n}"
headers = {
'private-app-legacy': "{{apiKey}}",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/cms/v3/pages/landing-pages/multi-language/detach-from-lang-group", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/detach-from-lang-group"
payload = { "id": "" }
headers = {
"private-app-legacy": "{{apiKey}}",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/detach-from-lang-group"
payload <- "{\n \"id\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('private-app-legacy' = '{{apiKey}}'), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/detach-from-lang-group")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["private-app-legacy"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n \"id\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/cms/v3/pages/landing-pages/multi-language/detach-from-lang-group') do |req|
req.headers['private-app-legacy'] = '{{apiKey}}'
req.body = "{\n \"id\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/detach-from-lang-group";
let payload = json!({"id": ""});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("private-app-legacy", "{{apiKey}}".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/cms/v3/pages/landing-pages/multi-language/detach-from-lang-group \
--header 'content-type: application/json' \
--header 'private-app-legacy: {{apiKey}}' \
--data '{
"id": ""
}'
echo '{
"id": ""
}' | \
http POST {{baseUrl}}/cms/v3/pages/landing-pages/multi-language/detach-from-lang-group \
content-type:application/json \
private-app-legacy:'{{apiKey}}'
wget --quiet \
--method POST \
--header 'private-app-legacy: {{apiKey}}' \
--header 'content-type: application/json' \
--body-data '{\n "id": ""\n}' \
--output-document \
- {{baseUrl}}/cms/v3/pages/landing-pages/multi-language/detach-from-lang-group
import Foundation
let headers = [
"private-app-legacy": "{{apiKey}}",
"content-type": "application/json"
]
let parameters = ["id": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/detach-from-lang-group")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
*/*
RESPONSE BODY text
{
"message": "Invalid input (details will vary based on the error)",
"correlationId": "aeb5f871-7f07-4993-9211-075dc63e7cbf",
"category": "VALIDATION_ERROR",
"links": {
"knowledge-base": "https://www.hubspot.com/products/service/knowledge-base"
}
}
POST
End an active A-B test (POST)
{{baseUrl}}/cms/v3/pages/landing-pages/ab-test/end
HEADERS
private-app-legacy
{{apiKey}}
BODY json
{
"winnerId": "",
"abTestId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/cms/v3/pages/landing-pages/ab-test/end");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "private-app-legacy: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"winnerId\": \"\",\n \"abTestId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/cms/v3/pages/landing-pages/ab-test/end" {:headers {:private-app-legacy "{{apiKey}}"}
:content-type :json
:form-params {:winnerId ""
:abTestId ""}})
require "http/client"
url = "{{baseUrl}}/cms/v3/pages/landing-pages/ab-test/end"
headers = HTTP::Headers{
"private-app-legacy" => "{{apiKey}}"
"content-type" => "application/json"
}
reqBody = "{\n \"winnerId\": \"\",\n \"abTestId\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/cms/v3/pages/landing-pages/ab-test/end"),
Headers =
{
{ "private-app-legacy", "{{apiKey}}" },
},
Content = new StringContent("{\n \"winnerId\": \"\",\n \"abTestId\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/cms/v3/pages/landing-pages/ab-test/end");
var request = new RestRequest("", Method.Post);
request.AddHeader("private-app-legacy", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"winnerId\": \"\",\n \"abTestId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/cms/v3/pages/landing-pages/ab-test/end"
payload := strings.NewReader("{\n \"winnerId\": \"\",\n \"abTestId\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("private-app-legacy", "{{apiKey}}")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/cms/v3/pages/landing-pages/ab-test/end HTTP/1.1
Private-App-Legacy: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 38
{
"winnerId": "",
"abTestId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/cms/v3/pages/landing-pages/ab-test/end")
.setHeader("private-app-legacy", "{{apiKey}}")
.setHeader("content-type", "application/json")
.setBody("{\n \"winnerId\": \"\",\n \"abTestId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/cms/v3/pages/landing-pages/ab-test/end"))
.header("private-app-legacy", "{{apiKey}}")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"winnerId\": \"\",\n \"abTestId\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"winnerId\": \"\",\n \"abTestId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/cms/v3/pages/landing-pages/ab-test/end")
.post(body)
.addHeader("private-app-legacy", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/cms/v3/pages/landing-pages/ab-test/end")
.header("private-app-legacy", "{{apiKey}}")
.header("content-type", "application/json")
.body("{\n \"winnerId\": \"\",\n \"abTestId\": \"\"\n}")
.asString();
const data = JSON.stringify({
winnerId: '',
abTestId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/cms/v3/pages/landing-pages/ab-test/end');
xhr.setRequestHeader('private-app-legacy', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/cms/v3/pages/landing-pages/ab-test/end',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
data: {winnerId: '', abTestId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/cms/v3/pages/landing-pages/ab-test/end';
const options = {
method: 'POST',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
body: '{"winnerId":"","abTestId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/cms/v3/pages/landing-pages/ab-test/end',
method: 'POST',
headers: {
'private-app-legacy': '{{apiKey}}',
'content-type': 'application/json'
},
processData: false,
data: '{\n "winnerId": "",\n "abTestId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"winnerId\": \"\",\n \"abTestId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/cms/v3/pages/landing-pages/ab-test/end")
.post(body)
.addHeader("private-app-legacy", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/cms/v3/pages/landing-pages/ab-test/end',
headers: {
'private-app-legacy': '{{apiKey}}',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({winnerId: '', abTestId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/cms/v3/pages/landing-pages/ab-test/end',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
body: {winnerId: '', abTestId: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/cms/v3/pages/landing-pages/ab-test/end');
req.headers({
'private-app-legacy': '{{apiKey}}',
'content-type': 'application/json'
});
req.type('json');
req.send({
winnerId: '',
abTestId: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/cms/v3/pages/landing-pages/ab-test/end',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
data: {winnerId: '', abTestId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/cms/v3/pages/landing-pages/ab-test/end';
const options = {
method: 'POST',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
body: '{"winnerId":"","abTestId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"private-app-legacy": @"{{apiKey}}",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"winnerId": @"",
@"abTestId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/cms/v3/pages/landing-pages/ab-test/end"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/cms/v3/pages/landing-pages/ab-test/end" in
let headers = Header.add_list (Header.init ()) [
("private-app-legacy", "{{apiKey}}");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"winnerId\": \"\",\n \"abTestId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/cms/v3/pages/landing-pages/ab-test/end",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'winnerId' => '',
'abTestId' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"private-app-legacy: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/cms/v3/pages/landing-pages/ab-test/end', [
'body' => '{
"winnerId": "",
"abTestId": ""
}',
'headers' => [
'content-type' => 'application/json',
'private-app-legacy' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/cms/v3/pages/landing-pages/ab-test/end');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'private-app-legacy' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'winnerId' => '',
'abTestId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'winnerId' => '',
'abTestId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/cms/v3/pages/landing-pages/ab-test/end');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'private-app-legacy' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("private-app-legacy", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/cms/v3/pages/landing-pages/ab-test/end' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"winnerId": "",
"abTestId": ""
}'
$headers=@{}
$headers.Add("private-app-legacy", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/cms/v3/pages/landing-pages/ab-test/end' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"winnerId": "",
"abTestId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"winnerId\": \"\",\n \"abTestId\": \"\"\n}"
headers = {
'private-app-legacy': "{{apiKey}}",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/cms/v3/pages/landing-pages/ab-test/end", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/cms/v3/pages/landing-pages/ab-test/end"
payload = {
"winnerId": "",
"abTestId": ""
}
headers = {
"private-app-legacy": "{{apiKey}}",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/cms/v3/pages/landing-pages/ab-test/end"
payload <- "{\n \"winnerId\": \"\",\n \"abTestId\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('private-app-legacy' = '{{apiKey}}'), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/cms/v3/pages/landing-pages/ab-test/end")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["private-app-legacy"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n \"winnerId\": \"\",\n \"abTestId\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/cms/v3/pages/landing-pages/ab-test/end') do |req|
req.headers['private-app-legacy'] = '{{apiKey}}'
req.body = "{\n \"winnerId\": \"\",\n \"abTestId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/cms/v3/pages/landing-pages/ab-test/end";
let payload = json!({
"winnerId": "",
"abTestId": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("private-app-legacy", "{{apiKey}}".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/cms/v3/pages/landing-pages/ab-test/end \
--header 'content-type: application/json' \
--header 'private-app-legacy: {{apiKey}}' \
--data '{
"winnerId": "",
"abTestId": ""
}'
echo '{
"winnerId": "",
"abTestId": ""
}' | \
http POST {{baseUrl}}/cms/v3/pages/landing-pages/ab-test/end \
content-type:application/json \
private-app-legacy:'{{apiKey}}'
wget --quiet \
--method POST \
--header 'private-app-legacy: {{apiKey}}' \
--header 'content-type: application/json' \
--body-data '{\n "winnerId": "",\n "abTestId": ""\n}' \
--output-document \
- {{baseUrl}}/cms/v3/pages/landing-pages/ab-test/end
import Foundation
let headers = [
"private-app-legacy": "{{apiKey}}",
"content-type": "application/json"
]
let parameters = [
"winnerId": "",
"abTestId": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/cms/v3/pages/landing-pages/ab-test/end")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
*/*
RESPONSE BODY text
{
"message": "Invalid input (details will vary based on the error)",
"correlationId": "aeb5f871-7f07-4993-9211-075dc63e7cbf",
"category": "VALIDATION_ERROR",
"links": {
"knowledge-base": "https://www.hubspot.com/products/service/knowledge-base"
}
}
GET
Get all Landing Page Folders
{{baseUrl}}/cms/v3/pages/landing-pages/folders
HEADERS
private-app-legacy
{{apiKey}}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/cms/v3/pages/landing-pages/folders");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "private-app-legacy: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/cms/v3/pages/landing-pages/folders" {:headers {:private-app-legacy "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/cms/v3/pages/landing-pages/folders"
headers = HTTP::Headers{
"private-app-legacy" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/cms/v3/pages/landing-pages/folders"),
Headers =
{
{ "private-app-legacy", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/cms/v3/pages/landing-pages/folders");
var request = new RestRequest("", Method.Get);
request.AddHeader("private-app-legacy", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/cms/v3/pages/landing-pages/folders"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("private-app-legacy", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/cms/v3/pages/landing-pages/folders HTTP/1.1
Private-App-Legacy: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/cms/v3/pages/landing-pages/folders")
.setHeader("private-app-legacy", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/cms/v3/pages/landing-pages/folders"))
.header("private-app-legacy", "{{apiKey}}")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/cms/v3/pages/landing-pages/folders")
.get()
.addHeader("private-app-legacy", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/cms/v3/pages/landing-pages/folders")
.header("private-app-legacy", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/cms/v3/pages/landing-pages/folders');
xhr.setRequestHeader('private-app-legacy', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/cms/v3/pages/landing-pages/folders',
headers: {'private-app-legacy': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/cms/v3/pages/landing-pages/folders';
const options = {method: 'GET', headers: {'private-app-legacy': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/cms/v3/pages/landing-pages/folders',
method: 'GET',
headers: {
'private-app-legacy': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/cms/v3/pages/landing-pages/folders")
.get()
.addHeader("private-app-legacy", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/cms/v3/pages/landing-pages/folders',
headers: {
'private-app-legacy': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/cms/v3/pages/landing-pages/folders',
headers: {'private-app-legacy': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/cms/v3/pages/landing-pages/folders');
req.headers({
'private-app-legacy': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/cms/v3/pages/landing-pages/folders',
headers: {'private-app-legacy': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/cms/v3/pages/landing-pages/folders';
const options = {method: 'GET', headers: {'private-app-legacy': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"private-app-legacy": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/cms/v3/pages/landing-pages/folders"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/cms/v3/pages/landing-pages/folders" in
let headers = Header.add (Header.init ()) "private-app-legacy" "{{apiKey}}" in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/cms/v3/pages/landing-pages/folders",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"private-app-legacy: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/cms/v3/pages/landing-pages/folders', [
'headers' => [
'private-app-legacy' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/cms/v3/pages/landing-pages/folders');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders([
'private-app-legacy' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/cms/v3/pages/landing-pages/folders');
$request->setRequestMethod('GET');
$request->setHeaders([
'private-app-legacy' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("private-app-legacy", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/cms/v3/pages/landing-pages/folders' -Method GET -Headers $headers
$headers=@{}
$headers.Add("private-app-legacy", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/cms/v3/pages/landing-pages/folders' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'private-app-legacy': "{{apiKey}}" }
conn.request("GET", "/baseUrl/cms/v3/pages/landing-pages/folders", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/cms/v3/pages/landing-pages/folders"
headers = {"private-app-legacy": "{{apiKey}}"}
response = requests.get(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/cms/v3/pages/landing-pages/folders"
response <- VERB("GET", url, add_headers('private-app-legacy' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/cms/v3/pages/landing-pages/folders")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["private-app-legacy"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/cms/v3/pages/landing-pages/folders') do |req|
req.headers['private-app-legacy'] = '{{apiKey}}'
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/cms/v3/pages/landing-pages/folders";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("private-app-legacy", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/cms/v3/pages/landing-pages/folders \
--header 'private-app-legacy: {{apiKey}}'
http GET {{baseUrl}}/cms/v3/pages/landing-pages/folders \
private-app-legacy:'{{apiKey}}'
wget --quiet \
--method GET \
--header 'private-app-legacy: {{apiKey}}' \
--output-document \
- {{baseUrl}}/cms/v3/pages/landing-pages/folders
import Foundation
let headers = ["private-app-legacy": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/cms/v3/pages/landing-pages/folders")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
*/*
RESPONSE BODY text
{
"message": "Invalid input (details will vary based on the error)",
"correlationId": "aeb5f871-7f07-4993-9211-075dc63e7cbf",
"category": "VALIDATION_ERROR",
"links": {
"knowledge-base": "https://www.hubspot.com/products/service/knowledge-base"
}
}
GET
Get all Landing Pages
{{baseUrl}}/cms/v3/pages/landing-pages
HEADERS
private-app-legacy
{{apiKey}}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/cms/v3/pages/landing-pages");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "private-app-legacy: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/cms/v3/pages/landing-pages" {:headers {:private-app-legacy "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/cms/v3/pages/landing-pages"
headers = HTTP::Headers{
"private-app-legacy" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/cms/v3/pages/landing-pages"),
Headers =
{
{ "private-app-legacy", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/cms/v3/pages/landing-pages");
var request = new RestRequest("", Method.Get);
request.AddHeader("private-app-legacy", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/cms/v3/pages/landing-pages"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("private-app-legacy", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/cms/v3/pages/landing-pages HTTP/1.1
Private-App-Legacy: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/cms/v3/pages/landing-pages")
.setHeader("private-app-legacy", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/cms/v3/pages/landing-pages"))
.header("private-app-legacy", "{{apiKey}}")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/cms/v3/pages/landing-pages")
.get()
.addHeader("private-app-legacy", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/cms/v3/pages/landing-pages")
.header("private-app-legacy", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/cms/v3/pages/landing-pages');
xhr.setRequestHeader('private-app-legacy', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/cms/v3/pages/landing-pages',
headers: {'private-app-legacy': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/cms/v3/pages/landing-pages';
const options = {method: 'GET', headers: {'private-app-legacy': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/cms/v3/pages/landing-pages',
method: 'GET',
headers: {
'private-app-legacy': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/cms/v3/pages/landing-pages")
.get()
.addHeader("private-app-legacy", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/cms/v3/pages/landing-pages',
headers: {
'private-app-legacy': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/cms/v3/pages/landing-pages',
headers: {'private-app-legacy': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/cms/v3/pages/landing-pages');
req.headers({
'private-app-legacy': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/cms/v3/pages/landing-pages',
headers: {'private-app-legacy': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/cms/v3/pages/landing-pages';
const options = {method: 'GET', headers: {'private-app-legacy': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"private-app-legacy": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/cms/v3/pages/landing-pages"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/cms/v3/pages/landing-pages" in
let headers = Header.add (Header.init ()) "private-app-legacy" "{{apiKey}}" in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/cms/v3/pages/landing-pages",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"private-app-legacy: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/cms/v3/pages/landing-pages', [
'headers' => [
'private-app-legacy' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/cms/v3/pages/landing-pages');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders([
'private-app-legacy' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/cms/v3/pages/landing-pages');
$request->setRequestMethod('GET');
$request->setHeaders([
'private-app-legacy' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("private-app-legacy", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/cms/v3/pages/landing-pages' -Method GET -Headers $headers
$headers=@{}
$headers.Add("private-app-legacy", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/cms/v3/pages/landing-pages' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'private-app-legacy': "{{apiKey}}" }
conn.request("GET", "/baseUrl/cms/v3/pages/landing-pages", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/cms/v3/pages/landing-pages"
headers = {"private-app-legacy": "{{apiKey}}"}
response = requests.get(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/cms/v3/pages/landing-pages"
response <- VERB("GET", url, add_headers('private-app-legacy' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/cms/v3/pages/landing-pages")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["private-app-legacy"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/cms/v3/pages/landing-pages') do |req|
req.headers['private-app-legacy'] = '{{apiKey}}'
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/cms/v3/pages/landing-pages";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("private-app-legacy", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/cms/v3/pages/landing-pages \
--header 'private-app-legacy: {{apiKey}}'
http GET {{baseUrl}}/cms/v3/pages/landing-pages \
private-app-legacy:'{{apiKey}}'
wget --quiet \
--method GET \
--header 'private-app-legacy: {{apiKey}}' \
--output-document \
- {{baseUrl}}/cms/v3/pages/landing-pages
import Foundation
let headers = ["private-app-legacy": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/cms/v3/pages/landing-pages")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
*/*
RESPONSE BODY text
{
"message": "Invalid input (details will vary based on the error)",
"correlationId": "aeb5f871-7f07-4993-9211-075dc63e7cbf",
"category": "VALIDATION_ERROR",
"links": {
"knowledge-base": "https://www.hubspot.com/products/service/knowledge-base"
}
}
POST
Push Landing Page draft edits live
{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/draft/push-live
HEADERS
private-app-legacy
{{apiKey}}
QUERY PARAMS
objectId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/draft/push-live");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "private-app-legacy: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/draft/push-live" {:headers {:private-app-legacy "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/draft/push-live"
headers = HTTP::Headers{
"private-app-legacy" => "{{apiKey}}"
}
response = HTTP::Client.post url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/draft/push-live"),
Headers =
{
{ "private-app-legacy", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/draft/push-live");
var request = new RestRequest("", Method.Post);
request.AddHeader("private-app-legacy", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/draft/push-live"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("private-app-legacy", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/cms/v3/pages/landing-pages/:objectId/draft/push-live HTTP/1.1
Private-App-Legacy: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/draft/push-live")
.setHeader("private-app-legacy", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/draft/push-live"))
.header("private-app-legacy", "{{apiKey}}")
.method("POST", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/draft/push-live")
.post(null)
.addHeader("private-app-legacy", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/draft/push-live")
.header("private-app-legacy", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/draft/push-live');
xhr.setRequestHeader('private-app-legacy', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/draft/push-live',
headers: {'private-app-legacy': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/draft/push-live';
const options = {method: 'POST', headers: {'private-app-legacy': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/draft/push-live',
method: 'POST',
headers: {
'private-app-legacy': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/draft/push-live")
.post(null)
.addHeader("private-app-legacy", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/cms/v3/pages/landing-pages/:objectId/draft/push-live',
headers: {
'private-app-legacy': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/draft/push-live',
headers: {'private-app-legacy': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/draft/push-live');
req.headers({
'private-app-legacy': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/draft/push-live',
headers: {'private-app-legacy': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/draft/push-live';
const options = {method: 'POST', headers: {'private-app-legacy': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"private-app-legacy": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/draft/push-live"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/draft/push-live" in
let headers = Header.add (Header.init ()) "private-app-legacy" "{{apiKey}}" in
Client.call ~headers `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/draft/push-live",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"private-app-legacy: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/draft/push-live', [
'headers' => [
'private-app-legacy' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/draft/push-live');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'private-app-legacy' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/draft/push-live');
$request->setRequestMethod('POST');
$request->setHeaders([
'private-app-legacy' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("private-app-legacy", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/draft/push-live' -Method POST -Headers $headers
$headers=@{}
$headers.Add("private-app-legacy", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/draft/push-live' -Method POST -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'private-app-legacy': "{{apiKey}}" }
conn.request("POST", "/baseUrl/cms/v3/pages/landing-pages/:objectId/draft/push-live", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/draft/push-live"
headers = {"private-app-legacy": "{{apiKey}}"}
response = requests.post(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/draft/push-live"
response <- VERB("POST", url, add_headers('private-app-legacy' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/draft/push-live")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["private-app-legacy"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.post('/baseUrl/cms/v3/pages/landing-pages/:objectId/draft/push-live') do |req|
req.headers['private-app-legacy'] = '{{apiKey}}'
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/draft/push-live";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("private-app-legacy", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/cms/v3/pages/landing-pages/:objectId/draft/push-live \
--header 'private-app-legacy: {{apiKey}}'
http POST {{baseUrl}}/cms/v3/pages/landing-pages/:objectId/draft/push-live \
private-app-legacy:'{{apiKey}}'
wget --quiet \
--method POST \
--header 'private-app-legacy: {{apiKey}}' \
--output-document \
- {{baseUrl}}/cms/v3/pages/landing-pages/:objectId/draft/push-live
import Foundation
let headers = ["private-app-legacy": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/draft/push-live")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
*/*
RESPONSE BODY text
{
"message": "Invalid input (details will vary based on the error)",
"correlationId": "aeb5f871-7f07-4993-9211-075dc63e7cbf",
"category": "VALIDATION_ERROR",
"links": {
"knowledge-base": "https://www.hubspot.com/products/service/knowledge-base"
}
}
POST
Rerun a previous A-B test (POST)
{{baseUrl}}/cms/v3/pages/landing-pages/ab-test/rerun
HEADERS
private-app-legacy
{{apiKey}}
BODY json
{
"variationId": "",
"abTestId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/cms/v3/pages/landing-pages/ab-test/rerun");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "private-app-legacy: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"variationId\": \"\",\n \"abTestId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/cms/v3/pages/landing-pages/ab-test/rerun" {:headers {:private-app-legacy "{{apiKey}}"}
:content-type :json
:form-params {:variationId ""
:abTestId ""}})
require "http/client"
url = "{{baseUrl}}/cms/v3/pages/landing-pages/ab-test/rerun"
headers = HTTP::Headers{
"private-app-legacy" => "{{apiKey}}"
"content-type" => "application/json"
}
reqBody = "{\n \"variationId\": \"\",\n \"abTestId\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/cms/v3/pages/landing-pages/ab-test/rerun"),
Headers =
{
{ "private-app-legacy", "{{apiKey}}" },
},
Content = new StringContent("{\n \"variationId\": \"\",\n \"abTestId\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/cms/v3/pages/landing-pages/ab-test/rerun");
var request = new RestRequest("", Method.Post);
request.AddHeader("private-app-legacy", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"variationId\": \"\",\n \"abTestId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/cms/v3/pages/landing-pages/ab-test/rerun"
payload := strings.NewReader("{\n \"variationId\": \"\",\n \"abTestId\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("private-app-legacy", "{{apiKey}}")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/cms/v3/pages/landing-pages/ab-test/rerun HTTP/1.1
Private-App-Legacy: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 41
{
"variationId": "",
"abTestId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/cms/v3/pages/landing-pages/ab-test/rerun")
.setHeader("private-app-legacy", "{{apiKey}}")
.setHeader("content-type", "application/json")
.setBody("{\n \"variationId\": \"\",\n \"abTestId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/cms/v3/pages/landing-pages/ab-test/rerun"))
.header("private-app-legacy", "{{apiKey}}")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"variationId\": \"\",\n \"abTestId\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"variationId\": \"\",\n \"abTestId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/cms/v3/pages/landing-pages/ab-test/rerun")
.post(body)
.addHeader("private-app-legacy", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/cms/v3/pages/landing-pages/ab-test/rerun")
.header("private-app-legacy", "{{apiKey}}")
.header("content-type", "application/json")
.body("{\n \"variationId\": \"\",\n \"abTestId\": \"\"\n}")
.asString();
const data = JSON.stringify({
variationId: '',
abTestId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/cms/v3/pages/landing-pages/ab-test/rerun');
xhr.setRequestHeader('private-app-legacy', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/cms/v3/pages/landing-pages/ab-test/rerun',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
data: {variationId: '', abTestId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/cms/v3/pages/landing-pages/ab-test/rerun';
const options = {
method: 'POST',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
body: '{"variationId":"","abTestId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/cms/v3/pages/landing-pages/ab-test/rerun',
method: 'POST',
headers: {
'private-app-legacy': '{{apiKey}}',
'content-type': 'application/json'
},
processData: false,
data: '{\n "variationId": "",\n "abTestId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"variationId\": \"\",\n \"abTestId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/cms/v3/pages/landing-pages/ab-test/rerun")
.post(body)
.addHeader("private-app-legacy", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/cms/v3/pages/landing-pages/ab-test/rerun',
headers: {
'private-app-legacy': '{{apiKey}}',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({variationId: '', abTestId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/cms/v3/pages/landing-pages/ab-test/rerun',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
body: {variationId: '', abTestId: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/cms/v3/pages/landing-pages/ab-test/rerun');
req.headers({
'private-app-legacy': '{{apiKey}}',
'content-type': 'application/json'
});
req.type('json');
req.send({
variationId: '',
abTestId: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/cms/v3/pages/landing-pages/ab-test/rerun',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
data: {variationId: '', abTestId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/cms/v3/pages/landing-pages/ab-test/rerun';
const options = {
method: 'POST',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
body: '{"variationId":"","abTestId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"private-app-legacy": @"{{apiKey}}",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"variationId": @"",
@"abTestId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/cms/v3/pages/landing-pages/ab-test/rerun"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/cms/v3/pages/landing-pages/ab-test/rerun" in
let headers = Header.add_list (Header.init ()) [
("private-app-legacy", "{{apiKey}}");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"variationId\": \"\",\n \"abTestId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/cms/v3/pages/landing-pages/ab-test/rerun",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'variationId' => '',
'abTestId' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"private-app-legacy: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/cms/v3/pages/landing-pages/ab-test/rerun', [
'body' => '{
"variationId": "",
"abTestId": ""
}',
'headers' => [
'content-type' => 'application/json',
'private-app-legacy' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/cms/v3/pages/landing-pages/ab-test/rerun');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'private-app-legacy' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'variationId' => '',
'abTestId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'variationId' => '',
'abTestId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/cms/v3/pages/landing-pages/ab-test/rerun');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'private-app-legacy' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("private-app-legacy", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/cms/v3/pages/landing-pages/ab-test/rerun' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"variationId": "",
"abTestId": ""
}'
$headers=@{}
$headers.Add("private-app-legacy", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/cms/v3/pages/landing-pages/ab-test/rerun' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"variationId": "",
"abTestId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"variationId\": \"\",\n \"abTestId\": \"\"\n}"
headers = {
'private-app-legacy': "{{apiKey}}",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/cms/v3/pages/landing-pages/ab-test/rerun", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/cms/v3/pages/landing-pages/ab-test/rerun"
payload = {
"variationId": "",
"abTestId": ""
}
headers = {
"private-app-legacy": "{{apiKey}}",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/cms/v3/pages/landing-pages/ab-test/rerun"
payload <- "{\n \"variationId\": \"\",\n \"abTestId\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('private-app-legacy' = '{{apiKey}}'), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/cms/v3/pages/landing-pages/ab-test/rerun")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["private-app-legacy"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n \"variationId\": \"\",\n \"abTestId\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/cms/v3/pages/landing-pages/ab-test/rerun') do |req|
req.headers['private-app-legacy'] = '{{apiKey}}'
req.body = "{\n \"variationId\": \"\",\n \"abTestId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/cms/v3/pages/landing-pages/ab-test/rerun";
let payload = json!({
"variationId": "",
"abTestId": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("private-app-legacy", "{{apiKey}}".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/cms/v3/pages/landing-pages/ab-test/rerun \
--header 'content-type: application/json' \
--header 'private-app-legacy: {{apiKey}}' \
--data '{
"variationId": "",
"abTestId": ""
}'
echo '{
"variationId": "",
"abTestId": ""
}' | \
http POST {{baseUrl}}/cms/v3/pages/landing-pages/ab-test/rerun \
content-type:application/json \
private-app-legacy:'{{apiKey}}'
wget --quiet \
--method POST \
--header 'private-app-legacy: {{apiKey}}' \
--header 'content-type: application/json' \
--body-data '{\n "variationId": "",\n "abTestId": ""\n}' \
--output-document \
- {{baseUrl}}/cms/v3/pages/landing-pages/ab-test/rerun
import Foundation
let headers = [
"private-app-legacy": "{{apiKey}}",
"content-type": "application/json"
]
let parameters = [
"variationId": "",
"abTestId": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/cms/v3/pages/landing-pages/ab-test/rerun")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
*/*
RESPONSE BODY text
{
"message": "Invalid input (details will vary based on the error)",
"correlationId": "aeb5f871-7f07-4993-9211-075dc63e7cbf",
"category": "VALIDATION_ERROR",
"links": {
"knowledge-base": "https://www.hubspot.com/products/service/knowledge-base"
}
}
POST
Reset the Landing Page draft to the live version
{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/draft/reset
HEADERS
private-app-legacy
{{apiKey}}
QUERY PARAMS
objectId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/draft/reset");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "private-app-legacy: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/draft/reset" {:headers {:private-app-legacy "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/draft/reset"
headers = HTTP::Headers{
"private-app-legacy" => "{{apiKey}}"
}
response = HTTP::Client.post url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/draft/reset"),
Headers =
{
{ "private-app-legacy", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/draft/reset");
var request = new RestRequest("", Method.Post);
request.AddHeader("private-app-legacy", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/draft/reset"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("private-app-legacy", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/cms/v3/pages/landing-pages/:objectId/draft/reset HTTP/1.1
Private-App-Legacy: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/draft/reset")
.setHeader("private-app-legacy", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/draft/reset"))
.header("private-app-legacy", "{{apiKey}}")
.method("POST", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/draft/reset")
.post(null)
.addHeader("private-app-legacy", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/draft/reset")
.header("private-app-legacy", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/draft/reset');
xhr.setRequestHeader('private-app-legacy', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/draft/reset',
headers: {'private-app-legacy': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/draft/reset';
const options = {method: 'POST', headers: {'private-app-legacy': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/draft/reset',
method: 'POST',
headers: {
'private-app-legacy': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/draft/reset")
.post(null)
.addHeader("private-app-legacy", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/cms/v3/pages/landing-pages/:objectId/draft/reset',
headers: {
'private-app-legacy': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/draft/reset',
headers: {'private-app-legacy': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/draft/reset');
req.headers({
'private-app-legacy': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/draft/reset',
headers: {'private-app-legacy': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/draft/reset';
const options = {method: 'POST', headers: {'private-app-legacy': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"private-app-legacy": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/draft/reset"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/draft/reset" in
let headers = Header.add (Header.init ()) "private-app-legacy" "{{apiKey}}" in
Client.call ~headers `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/draft/reset",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"private-app-legacy: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/draft/reset', [
'headers' => [
'private-app-legacy' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/draft/reset');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'private-app-legacy' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/draft/reset');
$request->setRequestMethod('POST');
$request->setHeaders([
'private-app-legacy' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("private-app-legacy", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/draft/reset' -Method POST -Headers $headers
$headers=@{}
$headers.Add("private-app-legacy", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/draft/reset' -Method POST -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'private-app-legacy': "{{apiKey}}" }
conn.request("POST", "/baseUrl/cms/v3/pages/landing-pages/:objectId/draft/reset", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/draft/reset"
headers = {"private-app-legacy": "{{apiKey}}"}
response = requests.post(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/draft/reset"
response <- VERB("POST", url, add_headers('private-app-legacy' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/draft/reset")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["private-app-legacy"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.post('/baseUrl/cms/v3/pages/landing-pages/:objectId/draft/reset') do |req|
req.headers['private-app-legacy'] = '{{apiKey}}'
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/draft/reset";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("private-app-legacy", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/cms/v3/pages/landing-pages/:objectId/draft/reset \
--header 'private-app-legacy: {{apiKey}}'
http POST {{baseUrl}}/cms/v3/pages/landing-pages/:objectId/draft/reset \
private-app-legacy:'{{apiKey}}'
wget --quiet \
--method POST \
--header 'private-app-legacy: {{apiKey}}' \
--output-document \
- {{baseUrl}}/cms/v3/pages/landing-pages/:objectId/draft/reset
import Foundation
let headers = ["private-app-legacy": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/draft/reset")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
*/*
RESPONSE BODY text
{
"message": "Invalid input (details will vary based on the error)",
"correlationId": "aeb5f871-7f07-4993-9211-075dc63e7cbf",
"category": "VALIDATION_ERROR",
"links": {
"knowledge-base": "https://www.hubspot.com/products/service/knowledge-base"
}
}
POST
Restore a previous version of a Folder
{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId/revisions/:revisionId/restore
HEADERS
private-app-legacy
{{apiKey}}
QUERY PARAMS
objectId
revisionId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId/revisions/:revisionId/restore");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "private-app-legacy: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId/revisions/:revisionId/restore" {:headers {:private-app-legacy "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId/revisions/:revisionId/restore"
headers = HTTP::Headers{
"private-app-legacy" => "{{apiKey}}"
}
response = HTTP::Client.post url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId/revisions/:revisionId/restore"),
Headers =
{
{ "private-app-legacy", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId/revisions/:revisionId/restore");
var request = new RestRequest("", Method.Post);
request.AddHeader("private-app-legacy", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId/revisions/:revisionId/restore"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("private-app-legacy", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/cms/v3/pages/landing-pages/folders/:objectId/revisions/:revisionId/restore HTTP/1.1
Private-App-Legacy: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId/revisions/:revisionId/restore")
.setHeader("private-app-legacy", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId/revisions/:revisionId/restore"))
.header("private-app-legacy", "{{apiKey}}")
.method("POST", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId/revisions/:revisionId/restore")
.post(null)
.addHeader("private-app-legacy", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId/revisions/:revisionId/restore")
.header("private-app-legacy", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId/revisions/:revisionId/restore');
xhr.setRequestHeader('private-app-legacy', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId/revisions/:revisionId/restore',
headers: {'private-app-legacy': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId/revisions/:revisionId/restore';
const options = {method: 'POST', headers: {'private-app-legacy': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId/revisions/:revisionId/restore',
method: 'POST',
headers: {
'private-app-legacy': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId/revisions/:revisionId/restore")
.post(null)
.addHeader("private-app-legacy", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/cms/v3/pages/landing-pages/folders/:objectId/revisions/:revisionId/restore',
headers: {
'private-app-legacy': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId/revisions/:revisionId/restore',
headers: {'private-app-legacy': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId/revisions/:revisionId/restore');
req.headers({
'private-app-legacy': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId/revisions/:revisionId/restore',
headers: {'private-app-legacy': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId/revisions/:revisionId/restore';
const options = {method: 'POST', headers: {'private-app-legacy': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"private-app-legacy": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId/revisions/:revisionId/restore"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId/revisions/:revisionId/restore" in
let headers = Header.add (Header.init ()) "private-app-legacy" "{{apiKey}}" in
Client.call ~headers `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId/revisions/:revisionId/restore",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"private-app-legacy: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId/revisions/:revisionId/restore', [
'headers' => [
'private-app-legacy' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId/revisions/:revisionId/restore');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'private-app-legacy' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId/revisions/:revisionId/restore');
$request->setRequestMethod('POST');
$request->setHeaders([
'private-app-legacy' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("private-app-legacy", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId/revisions/:revisionId/restore' -Method POST -Headers $headers
$headers=@{}
$headers.Add("private-app-legacy", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId/revisions/:revisionId/restore' -Method POST -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'private-app-legacy': "{{apiKey}}" }
conn.request("POST", "/baseUrl/cms/v3/pages/landing-pages/folders/:objectId/revisions/:revisionId/restore", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId/revisions/:revisionId/restore"
headers = {"private-app-legacy": "{{apiKey}}"}
response = requests.post(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId/revisions/:revisionId/restore"
response <- VERB("POST", url, add_headers('private-app-legacy' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId/revisions/:revisionId/restore")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["private-app-legacy"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.post('/baseUrl/cms/v3/pages/landing-pages/folders/:objectId/revisions/:revisionId/restore') do |req|
req.headers['private-app-legacy'] = '{{apiKey}}'
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId/revisions/:revisionId/restore";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("private-app-legacy", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId/revisions/:revisionId/restore \
--header 'private-app-legacy: {{apiKey}}'
http POST {{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId/revisions/:revisionId/restore \
private-app-legacy:'{{apiKey}}'
wget --quiet \
--method POST \
--header 'private-app-legacy: {{apiKey}}' \
--output-document \
- {{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId/revisions/:revisionId/restore
import Foundation
let headers = ["private-app-legacy": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId/revisions/:revisionId/restore")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
*/*
RESPONSE BODY text
{
"message": "Invalid input (details will vary based on the error)",
"correlationId": "aeb5f871-7f07-4993-9211-075dc63e7cbf",
"category": "VALIDATION_ERROR",
"links": {
"knowledge-base": "https://www.hubspot.com/products/service/knowledge-base"
}
}
POST
Restore a previous version of a Landing Page, to the draft version of the Landing Page
{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/revisions/:revisionId/restore-to-draft
HEADERS
private-app-legacy
{{apiKey}}
QUERY PARAMS
objectId
revisionId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/revisions/:revisionId/restore-to-draft");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "private-app-legacy: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/revisions/:revisionId/restore-to-draft" {:headers {:private-app-legacy "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/revisions/:revisionId/restore-to-draft"
headers = HTTP::Headers{
"private-app-legacy" => "{{apiKey}}"
}
response = HTTP::Client.post url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/revisions/:revisionId/restore-to-draft"),
Headers =
{
{ "private-app-legacy", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/revisions/:revisionId/restore-to-draft");
var request = new RestRequest("", Method.Post);
request.AddHeader("private-app-legacy", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/revisions/:revisionId/restore-to-draft"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("private-app-legacy", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/cms/v3/pages/landing-pages/:objectId/revisions/:revisionId/restore-to-draft HTTP/1.1
Private-App-Legacy: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/revisions/:revisionId/restore-to-draft")
.setHeader("private-app-legacy", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/revisions/:revisionId/restore-to-draft"))
.header("private-app-legacy", "{{apiKey}}")
.method("POST", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/revisions/:revisionId/restore-to-draft")
.post(null)
.addHeader("private-app-legacy", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/revisions/:revisionId/restore-to-draft")
.header("private-app-legacy", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/revisions/:revisionId/restore-to-draft');
xhr.setRequestHeader('private-app-legacy', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/revisions/:revisionId/restore-to-draft',
headers: {'private-app-legacy': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/revisions/:revisionId/restore-to-draft';
const options = {method: 'POST', headers: {'private-app-legacy': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/revisions/:revisionId/restore-to-draft',
method: 'POST',
headers: {
'private-app-legacy': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/revisions/:revisionId/restore-to-draft")
.post(null)
.addHeader("private-app-legacy", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/cms/v3/pages/landing-pages/:objectId/revisions/:revisionId/restore-to-draft',
headers: {
'private-app-legacy': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/revisions/:revisionId/restore-to-draft',
headers: {'private-app-legacy': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/revisions/:revisionId/restore-to-draft');
req.headers({
'private-app-legacy': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/revisions/:revisionId/restore-to-draft',
headers: {'private-app-legacy': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/revisions/:revisionId/restore-to-draft';
const options = {method: 'POST', headers: {'private-app-legacy': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"private-app-legacy": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/revisions/:revisionId/restore-to-draft"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/revisions/:revisionId/restore-to-draft" in
let headers = Header.add (Header.init ()) "private-app-legacy" "{{apiKey}}" in
Client.call ~headers `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/revisions/:revisionId/restore-to-draft",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"private-app-legacy: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/revisions/:revisionId/restore-to-draft', [
'headers' => [
'private-app-legacy' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/revisions/:revisionId/restore-to-draft');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'private-app-legacy' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/revisions/:revisionId/restore-to-draft');
$request->setRequestMethod('POST');
$request->setHeaders([
'private-app-legacy' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("private-app-legacy", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/revisions/:revisionId/restore-to-draft' -Method POST -Headers $headers
$headers=@{}
$headers.Add("private-app-legacy", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/revisions/:revisionId/restore-to-draft' -Method POST -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'private-app-legacy': "{{apiKey}}" }
conn.request("POST", "/baseUrl/cms/v3/pages/landing-pages/:objectId/revisions/:revisionId/restore-to-draft", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/revisions/:revisionId/restore-to-draft"
headers = {"private-app-legacy": "{{apiKey}}"}
response = requests.post(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/revisions/:revisionId/restore-to-draft"
response <- VERB("POST", url, add_headers('private-app-legacy' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/revisions/:revisionId/restore-to-draft")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["private-app-legacy"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.post('/baseUrl/cms/v3/pages/landing-pages/:objectId/revisions/:revisionId/restore-to-draft') do |req|
req.headers['private-app-legacy'] = '{{apiKey}}'
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/revisions/:revisionId/restore-to-draft";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("private-app-legacy", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/cms/v3/pages/landing-pages/:objectId/revisions/:revisionId/restore-to-draft \
--header 'private-app-legacy: {{apiKey}}'
http POST {{baseUrl}}/cms/v3/pages/landing-pages/:objectId/revisions/:revisionId/restore-to-draft \
private-app-legacy:'{{apiKey}}'
wget --quiet \
--method POST \
--header 'private-app-legacy: {{apiKey}}' \
--output-document \
- {{baseUrl}}/cms/v3/pages/landing-pages/:objectId/revisions/:revisionId/restore-to-draft
import Foundation
let headers = ["private-app-legacy": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/revisions/:revisionId/restore-to-draft")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
*/*
RESPONSE BODY text
{
"message": "Invalid input (details will vary based on the error)",
"correlationId": "aeb5f871-7f07-4993-9211-075dc63e7cbf",
"category": "VALIDATION_ERROR",
"links": {
"knowledge-base": "https://www.hubspot.com/products/service/knowledge-base"
}
}
POST
Restore a previous version of a Landing Page
{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/revisions/:revisionId/restore
HEADERS
private-app-legacy
{{apiKey}}
QUERY PARAMS
objectId
revisionId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/revisions/:revisionId/restore");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "private-app-legacy: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/revisions/:revisionId/restore" {:headers {:private-app-legacy "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/revisions/:revisionId/restore"
headers = HTTP::Headers{
"private-app-legacy" => "{{apiKey}}"
}
response = HTTP::Client.post url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/revisions/:revisionId/restore"),
Headers =
{
{ "private-app-legacy", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/revisions/:revisionId/restore");
var request = new RestRequest("", Method.Post);
request.AddHeader("private-app-legacy", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/revisions/:revisionId/restore"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("private-app-legacy", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/cms/v3/pages/landing-pages/:objectId/revisions/:revisionId/restore HTTP/1.1
Private-App-Legacy: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/revisions/:revisionId/restore")
.setHeader("private-app-legacy", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/revisions/:revisionId/restore"))
.header("private-app-legacy", "{{apiKey}}")
.method("POST", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/revisions/:revisionId/restore")
.post(null)
.addHeader("private-app-legacy", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/revisions/:revisionId/restore")
.header("private-app-legacy", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/revisions/:revisionId/restore');
xhr.setRequestHeader('private-app-legacy', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/revisions/:revisionId/restore',
headers: {'private-app-legacy': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/revisions/:revisionId/restore';
const options = {method: 'POST', headers: {'private-app-legacy': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/revisions/:revisionId/restore',
method: 'POST',
headers: {
'private-app-legacy': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/revisions/:revisionId/restore")
.post(null)
.addHeader("private-app-legacy", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/cms/v3/pages/landing-pages/:objectId/revisions/:revisionId/restore',
headers: {
'private-app-legacy': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/revisions/:revisionId/restore',
headers: {'private-app-legacy': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/revisions/:revisionId/restore');
req.headers({
'private-app-legacy': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/revisions/:revisionId/restore',
headers: {'private-app-legacy': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/revisions/:revisionId/restore';
const options = {method: 'POST', headers: {'private-app-legacy': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"private-app-legacy": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/revisions/:revisionId/restore"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/revisions/:revisionId/restore" in
let headers = Header.add (Header.init ()) "private-app-legacy" "{{apiKey}}" in
Client.call ~headers `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/revisions/:revisionId/restore",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"private-app-legacy: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/revisions/:revisionId/restore', [
'headers' => [
'private-app-legacy' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/revisions/:revisionId/restore');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'private-app-legacy' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/revisions/:revisionId/restore');
$request->setRequestMethod('POST');
$request->setHeaders([
'private-app-legacy' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("private-app-legacy", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/revisions/:revisionId/restore' -Method POST -Headers $headers
$headers=@{}
$headers.Add("private-app-legacy", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/revisions/:revisionId/restore' -Method POST -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'private-app-legacy': "{{apiKey}}" }
conn.request("POST", "/baseUrl/cms/v3/pages/landing-pages/:objectId/revisions/:revisionId/restore", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/revisions/:revisionId/restore"
headers = {"private-app-legacy": "{{apiKey}}"}
response = requests.post(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/revisions/:revisionId/restore"
response <- VERB("POST", url, add_headers('private-app-legacy' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/revisions/:revisionId/restore")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["private-app-legacy"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.post('/baseUrl/cms/v3/pages/landing-pages/:objectId/revisions/:revisionId/restore') do |req|
req.headers['private-app-legacy'] = '{{apiKey}}'
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/revisions/:revisionId/restore";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("private-app-legacy", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/cms/v3/pages/landing-pages/:objectId/revisions/:revisionId/restore \
--header 'private-app-legacy: {{apiKey}}'
http POST {{baseUrl}}/cms/v3/pages/landing-pages/:objectId/revisions/:revisionId/restore \
private-app-legacy:'{{apiKey}}'
wget --quiet \
--method POST \
--header 'private-app-legacy: {{apiKey}}' \
--output-document \
- {{baseUrl}}/cms/v3/pages/landing-pages/:objectId/revisions/:revisionId/restore
import Foundation
let headers = ["private-app-legacy": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/revisions/:revisionId/restore")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
*/*
RESPONSE BODY text
{
"message": "Invalid input (details will vary based on the error)",
"correlationId": "aeb5f871-7f07-4993-9211-075dc63e7cbf",
"category": "VALIDATION_ERROR",
"links": {
"knowledge-base": "https://www.hubspot.com/products/service/knowledge-base"
}
}
GET
Retrieve a Folder
{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId
HEADERS
private-app-legacy
{{apiKey}}
QUERY PARAMS
objectId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "private-app-legacy: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId" {:headers {:private-app-legacy "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId"
headers = HTTP::Headers{
"private-app-legacy" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId"),
Headers =
{
{ "private-app-legacy", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId");
var request = new RestRequest("", Method.Get);
request.AddHeader("private-app-legacy", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("private-app-legacy", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/cms/v3/pages/landing-pages/folders/:objectId HTTP/1.1
Private-App-Legacy: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId")
.setHeader("private-app-legacy", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId"))
.header("private-app-legacy", "{{apiKey}}")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId")
.get()
.addHeader("private-app-legacy", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId")
.header("private-app-legacy", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId');
xhr.setRequestHeader('private-app-legacy', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId',
headers: {'private-app-legacy': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId';
const options = {method: 'GET', headers: {'private-app-legacy': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId',
method: 'GET',
headers: {
'private-app-legacy': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId")
.get()
.addHeader("private-app-legacy", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/cms/v3/pages/landing-pages/folders/:objectId',
headers: {
'private-app-legacy': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId',
headers: {'private-app-legacy': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId');
req.headers({
'private-app-legacy': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId',
headers: {'private-app-legacy': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId';
const options = {method: 'GET', headers: {'private-app-legacy': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"private-app-legacy": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId" in
let headers = Header.add (Header.init ()) "private-app-legacy" "{{apiKey}}" in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"private-app-legacy: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId', [
'headers' => [
'private-app-legacy' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders([
'private-app-legacy' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId');
$request->setRequestMethod('GET');
$request->setHeaders([
'private-app-legacy' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("private-app-legacy", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId' -Method GET -Headers $headers
$headers=@{}
$headers.Add("private-app-legacy", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'private-app-legacy': "{{apiKey}}" }
conn.request("GET", "/baseUrl/cms/v3/pages/landing-pages/folders/:objectId", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId"
headers = {"private-app-legacy": "{{apiKey}}"}
response = requests.get(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId"
response <- VERB("GET", url, add_headers('private-app-legacy' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["private-app-legacy"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/cms/v3/pages/landing-pages/folders/:objectId') do |req|
req.headers['private-app-legacy'] = '{{apiKey}}'
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("private-app-legacy", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId \
--header 'private-app-legacy: {{apiKey}}'
http GET {{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId \
private-app-legacy:'{{apiKey}}'
wget --quiet \
--method GET \
--header 'private-app-legacy: {{apiKey}}' \
--output-document \
- {{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId
import Foundation
let headers = ["private-app-legacy": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
*/*
RESPONSE BODY text
{
"message": "Invalid input (details will vary based on the error)",
"correlationId": "aeb5f871-7f07-4993-9211-075dc63e7cbf",
"category": "VALIDATION_ERROR",
"links": {
"knowledge-base": "https://www.hubspot.com/products/service/knowledge-base"
}
}
GET
Retrieve a Landing Page
{{baseUrl}}/cms/v3/pages/landing-pages/:objectId
HEADERS
private-app-legacy
{{apiKey}}
QUERY PARAMS
objectId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/cms/v3/pages/landing-pages/:objectId");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "private-app-legacy: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/cms/v3/pages/landing-pages/:objectId" {:headers {:private-app-legacy "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/cms/v3/pages/landing-pages/:objectId"
headers = HTTP::Headers{
"private-app-legacy" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/cms/v3/pages/landing-pages/:objectId"),
Headers =
{
{ "private-app-legacy", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/cms/v3/pages/landing-pages/:objectId");
var request = new RestRequest("", Method.Get);
request.AddHeader("private-app-legacy", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/cms/v3/pages/landing-pages/:objectId"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("private-app-legacy", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/cms/v3/pages/landing-pages/:objectId HTTP/1.1
Private-App-Legacy: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/cms/v3/pages/landing-pages/:objectId")
.setHeader("private-app-legacy", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/cms/v3/pages/landing-pages/:objectId"))
.header("private-app-legacy", "{{apiKey}}")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/cms/v3/pages/landing-pages/:objectId")
.get()
.addHeader("private-app-legacy", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/cms/v3/pages/landing-pages/:objectId")
.header("private-app-legacy", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/cms/v3/pages/landing-pages/:objectId');
xhr.setRequestHeader('private-app-legacy', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/cms/v3/pages/landing-pages/:objectId',
headers: {'private-app-legacy': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/cms/v3/pages/landing-pages/:objectId';
const options = {method: 'GET', headers: {'private-app-legacy': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/cms/v3/pages/landing-pages/:objectId',
method: 'GET',
headers: {
'private-app-legacy': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/cms/v3/pages/landing-pages/:objectId")
.get()
.addHeader("private-app-legacy", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/cms/v3/pages/landing-pages/:objectId',
headers: {
'private-app-legacy': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/cms/v3/pages/landing-pages/:objectId',
headers: {'private-app-legacy': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/cms/v3/pages/landing-pages/:objectId');
req.headers({
'private-app-legacy': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/cms/v3/pages/landing-pages/:objectId',
headers: {'private-app-legacy': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/cms/v3/pages/landing-pages/:objectId';
const options = {method: 'GET', headers: {'private-app-legacy': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"private-app-legacy": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/cms/v3/pages/landing-pages/:objectId"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/cms/v3/pages/landing-pages/:objectId" in
let headers = Header.add (Header.init ()) "private-app-legacy" "{{apiKey}}" in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/cms/v3/pages/landing-pages/:objectId",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"private-app-legacy: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/cms/v3/pages/landing-pages/:objectId', [
'headers' => [
'private-app-legacy' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/cms/v3/pages/landing-pages/:objectId');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders([
'private-app-legacy' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/cms/v3/pages/landing-pages/:objectId');
$request->setRequestMethod('GET');
$request->setHeaders([
'private-app-legacy' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("private-app-legacy", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/cms/v3/pages/landing-pages/:objectId' -Method GET -Headers $headers
$headers=@{}
$headers.Add("private-app-legacy", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/cms/v3/pages/landing-pages/:objectId' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'private-app-legacy': "{{apiKey}}" }
conn.request("GET", "/baseUrl/cms/v3/pages/landing-pages/:objectId", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/cms/v3/pages/landing-pages/:objectId"
headers = {"private-app-legacy": "{{apiKey}}"}
response = requests.get(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/cms/v3/pages/landing-pages/:objectId"
response <- VERB("GET", url, add_headers('private-app-legacy' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/cms/v3/pages/landing-pages/:objectId")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["private-app-legacy"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/cms/v3/pages/landing-pages/:objectId') do |req|
req.headers['private-app-legacy'] = '{{apiKey}}'
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/cms/v3/pages/landing-pages/:objectId";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("private-app-legacy", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/cms/v3/pages/landing-pages/:objectId \
--header 'private-app-legacy: {{apiKey}}'
http GET {{baseUrl}}/cms/v3/pages/landing-pages/:objectId \
private-app-legacy:'{{apiKey}}'
wget --quiet \
--method GET \
--header 'private-app-legacy: {{apiKey}}' \
--output-document \
- {{baseUrl}}/cms/v3/pages/landing-pages/:objectId
import Foundation
let headers = ["private-app-legacy": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/cms/v3/pages/landing-pages/:objectId")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
*/*
RESPONSE BODY text
{
"message": "Invalid input (details will vary based on the error)",
"correlationId": "aeb5f871-7f07-4993-9211-075dc63e7cbf",
"category": "VALIDATION_ERROR",
"links": {
"knowledge-base": "https://www.hubspot.com/products/service/knowledge-base"
}
}
POST
Retrieve a batch of Folders
{{baseUrl}}/cms/v3/pages/landing-pages/folders/batch/read
HEADERS
private-app-legacy
{{apiKey}}
BODY json
{
"inputs": []
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/cms/v3/pages/landing-pages/folders/batch/read");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "private-app-legacy: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"inputs\": []\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/cms/v3/pages/landing-pages/folders/batch/read" {:headers {:private-app-legacy "{{apiKey}}"}
:content-type :json
:form-params {:inputs []}})
require "http/client"
url = "{{baseUrl}}/cms/v3/pages/landing-pages/folders/batch/read"
headers = HTTP::Headers{
"private-app-legacy" => "{{apiKey}}"
"content-type" => "application/json"
}
reqBody = "{\n \"inputs\": []\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/cms/v3/pages/landing-pages/folders/batch/read"),
Headers =
{
{ "private-app-legacy", "{{apiKey}}" },
},
Content = new StringContent("{\n \"inputs\": []\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/cms/v3/pages/landing-pages/folders/batch/read");
var request = new RestRequest("", Method.Post);
request.AddHeader("private-app-legacy", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"inputs\": []\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/cms/v3/pages/landing-pages/folders/batch/read"
payload := strings.NewReader("{\n \"inputs\": []\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("private-app-legacy", "{{apiKey}}")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/cms/v3/pages/landing-pages/folders/batch/read HTTP/1.1
Private-App-Legacy: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 18
{
"inputs": []
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/cms/v3/pages/landing-pages/folders/batch/read")
.setHeader("private-app-legacy", "{{apiKey}}")
.setHeader("content-type", "application/json")
.setBody("{\n \"inputs\": []\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/cms/v3/pages/landing-pages/folders/batch/read"))
.header("private-app-legacy", "{{apiKey}}")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"inputs\": []\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"inputs\": []\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/cms/v3/pages/landing-pages/folders/batch/read")
.post(body)
.addHeader("private-app-legacy", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/cms/v3/pages/landing-pages/folders/batch/read")
.header("private-app-legacy", "{{apiKey}}")
.header("content-type", "application/json")
.body("{\n \"inputs\": []\n}")
.asString();
const data = JSON.stringify({
inputs: []
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/cms/v3/pages/landing-pages/folders/batch/read');
xhr.setRequestHeader('private-app-legacy', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/cms/v3/pages/landing-pages/folders/batch/read',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
data: {inputs: []}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/cms/v3/pages/landing-pages/folders/batch/read';
const options = {
method: 'POST',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
body: '{"inputs":[]}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/cms/v3/pages/landing-pages/folders/batch/read',
method: 'POST',
headers: {
'private-app-legacy': '{{apiKey}}',
'content-type': 'application/json'
},
processData: false,
data: '{\n "inputs": []\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"inputs\": []\n}")
val request = Request.Builder()
.url("{{baseUrl}}/cms/v3/pages/landing-pages/folders/batch/read")
.post(body)
.addHeader("private-app-legacy", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/cms/v3/pages/landing-pages/folders/batch/read',
headers: {
'private-app-legacy': '{{apiKey}}',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({inputs: []}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/cms/v3/pages/landing-pages/folders/batch/read',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
body: {inputs: []},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/cms/v3/pages/landing-pages/folders/batch/read');
req.headers({
'private-app-legacy': '{{apiKey}}',
'content-type': 'application/json'
});
req.type('json');
req.send({
inputs: []
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/cms/v3/pages/landing-pages/folders/batch/read',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
data: {inputs: []}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/cms/v3/pages/landing-pages/folders/batch/read';
const options = {
method: 'POST',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
body: '{"inputs":[]}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"private-app-legacy": @"{{apiKey}}",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"inputs": @[ ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/cms/v3/pages/landing-pages/folders/batch/read"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/cms/v3/pages/landing-pages/folders/batch/read" in
let headers = Header.add_list (Header.init ()) [
("private-app-legacy", "{{apiKey}}");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"inputs\": []\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/cms/v3/pages/landing-pages/folders/batch/read",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'inputs' => [
]
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"private-app-legacy: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/cms/v3/pages/landing-pages/folders/batch/read', [
'body' => '{
"inputs": []
}',
'headers' => [
'content-type' => 'application/json',
'private-app-legacy' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/cms/v3/pages/landing-pages/folders/batch/read');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'private-app-legacy' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'inputs' => [
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'inputs' => [
]
]));
$request->setRequestUrl('{{baseUrl}}/cms/v3/pages/landing-pages/folders/batch/read');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'private-app-legacy' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("private-app-legacy", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/cms/v3/pages/landing-pages/folders/batch/read' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"inputs": []
}'
$headers=@{}
$headers.Add("private-app-legacy", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/cms/v3/pages/landing-pages/folders/batch/read' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"inputs": []
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"inputs\": []\n}"
headers = {
'private-app-legacy': "{{apiKey}}",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/cms/v3/pages/landing-pages/folders/batch/read", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/cms/v3/pages/landing-pages/folders/batch/read"
payload = { "inputs": [] }
headers = {
"private-app-legacy": "{{apiKey}}",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/cms/v3/pages/landing-pages/folders/batch/read"
payload <- "{\n \"inputs\": []\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('private-app-legacy' = '{{apiKey}}'), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/cms/v3/pages/landing-pages/folders/batch/read")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["private-app-legacy"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n \"inputs\": []\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/cms/v3/pages/landing-pages/folders/batch/read') do |req|
req.headers['private-app-legacy'] = '{{apiKey}}'
req.body = "{\n \"inputs\": []\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/cms/v3/pages/landing-pages/folders/batch/read";
let payload = json!({"inputs": ()});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("private-app-legacy", "{{apiKey}}".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/cms/v3/pages/landing-pages/folders/batch/read \
--header 'content-type: application/json' \
--header 'private-app-legacy: {{apiKey}}' \
--data '{
"inputs": []
}'
echo '{
"inputs": []
}' | \
http POST {{baseUrl}}/cms/v3/pages/landing-pages/folders/batch/read \
content-type:application/json \
private-app-legacy:'{{apiKey}}'
wget --quiet \
--method POST \
--header 'private-app-legacy: {{apiKey}}' \
--header 'content-type: application/json' \
--body-data '{\n "inputs": []\n}' \
--output-document \
- {{baseUrl}}/cms/v3/pages/landing-pages/folders/batch/read
import Foundation
let headers = [
"private-app-legacy": "{{apiKey}}",
"content-type": "application/json"
]
let parameters = ["inputs": []] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/cms/v3/pages/landing-pages/folders/batch/read")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
*/*
RESPONSE BODY text
{
"message": "Invalid input (details will vary based on the error)",
"correlationId": "aeb5f871-7f07-4993-9211-075dc63e7cbf",
"category": "VALIDATION_ERROR",
"links": {
"knowledge-base": "https://www.hubspot.com/products/service/knowledge-base"
}
}
POST
Retrieve a batch of Landing Pages
{{baseUrl}}/cms/v3/pages/landing-pages/batch/read
HEADERS
private-app-legacy
{{apiKey}}
BODY json
{
"inputs": []
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/cms/v3/pages/landing-pages/batch/read");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "private-app-legacy: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"inputs\": []\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/cms/v3/pages/landing-pages/batch/read" {:headers {:private-app-legacy "{{apiKey}}"}
:content-type :json
:form-params {:inputs []}})
require "http/client"
url = "{{baseUrl}}/cms/v3/pages/landing-pages/batch/read"
headers = HTTP::Headers{
"private-app-legacy" => "{{apiKey}}"
"content-type" => "application/json"
}
reqBody = "{\n \"inputs\": []\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/cms/v3/pages/landing-pages/batch/read"),
Headers =
{
{ "private-app-legacy", "{{apiKey}}" },
},
Content = new StringContent("{\n \"inputs\": []\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/cms/v3/pages/landing-pages/batch/read");
var request = new RestRequest("", Method.Post);
request.AddHeader("private-app-legacy", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"inputs\": []\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/cms/v3/pages/landing-pages/batch/read"
payload := strings.NewReader("{\n \"inputs\": []\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("private-app-legacy", "{{apiKey}}")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/cms/v3/pages/landing-pages/batch/read HTTP/1.1
Private-App-Legacy: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 18
{
"inputs": []
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/cms/v3/pages/landing-pages/batch/read")
.setHeader("private-app-legacy", "{{apiKey}}")
.setHeader("content-type", "application/json")
.setBody("{\n \"inputs\": []\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/cms/v3/pages/landing-pages/batch/read"))
.header("private-app-legacy", "{{apiKey}}")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"inputs\": []\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"inputs\": []\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/cms/v3/pages/landing-pages/batch/read")
.post(body)
.addHeader("private-app-legacy", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/cms/v3/pages/landing-pages/batch/read")
.header("private-app-legacy", "{{apiKey}}")
.header("content-type", "application/json")
.body("{\n \"inputs\": []\n}")
.asString();
const data = JSON.stringify({
inputs: []
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/cms/v3/pages/landing-pages/batch/read');
xhr.setRequestHeader('private-app-legacy', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/cms/v3/pages/landing-pages/batch/read',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
data: {inputs: []}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/cms/v3/pages/landing-pages/batch/read';
const options = {
method: 'POST',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
body: '{"inputs":[]}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/cms/v3/pages/landing-pages/batch/read',
method: 'POST',
headers: {
'private-app-legacy': '{{apiKey}}',
'content-type': 'application/json'
},
processData: false,
data: '{\n "inputs": []\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"inputs\": []\n}")
val request = Request.Builder()
.url("{{baseUrl}}/cms/v3/pages/landing-pages/batch/read")
.post(body)
.addHeader("private-app-legacy", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/cms/v3/pages/landing-pages/batch/read',
headers: {
'private-app-legacy': '{{apiKey}}',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({inputs: []}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/cms/v3/pages/landing-pages/batch/read',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
body: {inputs: []},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/cms/v3/pages/landing-pages/batch/read');
req.headers({
'private-app-legacy': '{{apiKey}}',
'content-type': 'application/json'
});
req.type('json');
req.send({
inputs: []
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/cms/v3/pages/landing-pages/batch/read',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
data: {inputs: []}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/cms/v3/pages/landing-pages/batch/read';
const options = {
method: 'POST',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
body: '{"inputs":[]}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"private-app-legacy": @"{{apiKey}}",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"inputs": @[ ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/cms/v3/pages/landing-pages/batch/read"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/cms/v3/pages/landing-pages/batch/read" in
let headers = Header.add_list (Header.init ()) [
("private-app-legacy", "{{apiKey}}");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"inputs\": []\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/cms/v3/pages/landing-pages/batch/read",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'inputs' => [
]
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"private-app-legacy: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/cms/v3/pages/landing-pages/batch/read', [
'body' => '{
"inputs": []
}',
'headers' => [
'content-type' => 'application/json',
'private-app-legacy' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/cms/v3/pages/landing-pages/batch/read');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'private-app-legacy' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'inputs' => [
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'inputs' => [
]
]));
$request->setRequestUrl('{{baseUrl}}/cms/v3/pages/landing-pages/batch/read');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'private-app-legacy' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("private-app-legacy", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/cms/v3/pages/landing-pages/batch/read' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"inputs": []
}'
$headers=@{}
$headers.Add("private-app-legacy", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/cms/v3/pages/landing-pages/batch/read' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"inputs": []
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"inputs\": []\n}"
headers = {
'private-app-legacy': "{{apiKey}}",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/cms/v3/pages/landing-pages/batch/read", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/cms/v3/pages/landing-pages/batch/read"
payload = { "inputs": [] }
headers = {
"private-app-legacy": "{{apiKey}}",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/cms/v3/pages/landing-pages/batch/read"
payload <- "{\n \"inputs\": []\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('private-app-legacy' = '{{apiKey}}'), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/cms/v3/pages/landing-pages/batch/read")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["private-app-legacy"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n \"inputs\": []\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/cms/v3/pages/landing-pages/batch/read') do |req|
req.headers['private-app-legacy'] = '{{apiKey}}'
req.body = "{\n \"inputs\": []\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/cms/v3/pages/landing-pages/batch/read";
let payload = json!({"inputs": ()});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("private-app-legacy", "{{apiKey}}".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/cms/v3/pages/landing-pages/batch/read \
--header 'content-type: application/json' \
--header 'private-app-legacy: {{apiKey}}' \
--data '{
"inputs": []
}'
echo '{
"inputs": []
}' | \
http POST {{baseUrl}}/cms/v3/pages/landing-pages/batch/read \
content-type:application/json \
private-app-legacy:'{{apiKey}}'
wget --quiet \
--method POST \
--header 'private-app-legacy: {{apiKey}}' \
--header 'content-type: application/json' \
--body-data '{\n "inputs": []\n}' \
--output-document \
- {{baseUrl}}/cms/v3/pages/landing-pages/batch/read
import Foundation
let headers = [
"private-app-legacy": "{{apiKey}}",
"content-type": "application/json"
]
let parameters = ["inputs": []] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/cms/v3/pages/landing-pages/batch/read")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
*/*
RESPONSE BODY text
{
"message": "Invalid input (details will vary based on the error)",
"correlationId": "aeb5f871-7f07-4993-9211-075dc63e7cbf",
"category": "VALIDATION_ERROR",
"links": {
"knowledge-base": "https://www.hubspot.com/products/service/knowledge-base"
}
}
GET
Retrieve the full draft version of the Landing Page
{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/draft
HEADERS
private-app-legacy
{{apiKey}}
QUERY PARAMS
objectId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/draft");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "private-app-legacy: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/draft" {:headers {:private-app-legacy "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/draft"
headers = HTTP::Headers{
"private-app-legacy" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/draft"),
Headers =
{
{ "private-app-legacy", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/draft");
var request = new RestRequest("", Method.Get);
request.AddHeader("private-app-legacy", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/draft"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("private-app-legacy", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/cms/v3/pages/landing-pages/:objectId/draft HTTP/1.1
Private-App-Legacy: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/draft")
.setHeader("private-app-legacy", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/draft"))
.header("private-app-legacy", "{{apiKey}}")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/draft")
.get()
.addHeader("private-app-legacy", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/draft")
.header("private-app-legacy", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/draft');
xhr.setRequestHeader('private-app-legacy', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/draft',
headers: {'private-app-legacy': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/draft';
const options = {method: 'GET', headers: {'private-app-legacy': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/draft',
method: 'GET',
headers: {
'private-app-legacy': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/draft")
.get()
.addHeader("private-app-legacy", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/cms/v3/pages/landing-pages/:objectId/draft',
headers: {
'private-app-legacy': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/draft',
headers: {'private-app-legacy': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/draft');
req.headers({
'private-app-legacy': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/draft',
headers: {'private-app-legacy': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/draft';
const options = {method: 'GET', headers: {'private-app-legacy': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"private-app-legacy": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/draft"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/draft" in
let headers = Header.add (Header.init ()) "private-app-legacy" "{{apiKey}}" in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/draft",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"private-app-legacy: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/draft', [
'headers' => [
'private-app-legacy' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/draft');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders([
'private-app-legacy' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/draft');
$request->setRequestMethod('GET');
$request->setHeaders([
'private-app-legacy' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("private-app-legacy", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/draft' -Method GET -Headers $headers
$headers=@{}
$headers.Add("private-app-legacy", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/draft' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'private-app-legacy': "{{apiKey}}" }
conn.request("GET", "/baseUrl/cms/v3/pages/landing-pages/:objectId/draft", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/draft"
headers = {"private-app-legacy": "{{apiKey}}"}
response = requests.get(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/draft"
response <- VERB("GET", url, add_headers('private-app-legacy' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/draft")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["private-app-legacy"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/cms/v3/pages/landing-pages/:objectId/draft') do |req|
req.headers['private-app-legacy'] = '{{apiKey}}'
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/draft";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("private-app-legacy", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/cms/v3/pages/landing-pages/:objectId/draft \
--header 'private-app-legacy: {{apiKey}}'
http GET {{baseUrl}}/cms/v3/pages/landing-pages/:objectId/draft \
private-app-legacy:'{{apiKey}}'
wget --quiet \
--method GET \
--header 'private-app-legacy: {{apiKey}}' \
--output-document \
- {{baseUrl}}/cms/v3/pages/landing-pages/:objectId/draft
import Foundation
let headers = ["private-app-legacy": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/draft")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
*/*
RESPONSE BODY text
{
"message": "Invalid input (details will vary based on the error)",
"correlationId": "aeb5f871-7f07-4993-9211-075dc63e7cbf",
"category": "VALIDATION_ERROR",
"links": {
"knowledge-base": "https://www.hubspot.com/products/service/knowledge-base"
}
}
GET
Retrieves a previous version of a Folder
{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId/revisions/:revisionId
HEADERS
private-app-legacy
{{apiKey}}
QUERY PARAMS
objectId
revisionId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId/revisions/:revisionId");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "private-app-legacy: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId/revisions/:revisionId" {:headers {:private-app-legacy "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId/revisions/:revisionId"
headers = HTTP::Headers{
"private-app-legacy" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId/revisions/:revisionId"),
Headers =
{
{ "private-app-legacy", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId/revisions/:revisionId");
var request = new RestRequest("", Method.Get);
request.AddHeader("private-app-legacy", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId/revisions/:revisionId"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("private-app-legacy", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/cms/v3/pages/landing-pages/folders/:objectId/revisions/:revisionId HTTP/1.1
Private-App-Legacy: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId/revisions/:revisionId")
.setHeader("private-app-legacy", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId/revisions/:revisionId"))
.header("private-app-legacy", "{{apiKey}}")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId/revisions/:revisionId")
.get()
.addHeader("private-app-legacy", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId/revisions/:revisionId")
.header("private-app-legacy", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId/revisions/:revisionId');
xhr.setRequestHeader('private-app-legacy', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId/revisions/:revisionId',
headers: {'private-app-legacy': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId/revisions/:revisionId';
const options = {method: 'GET', headers: {'private-app-legacy': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId/revisions/:revisionId',
method: 'GET',
headers: {
'private-app-legacy': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId/revisions/:revisionId")
.get()
.addHeader("private-app-legacy", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/cms/v3/pages/landing-pages/folders/:objectId/revisions/:revisionId',
headers: {
'private-app-legacy': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId/revisions/:revisionId',
headers: {'private-app-legacy': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId/revisions/:revisionId');
req.headers({
'private-app-legacy': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId/revisions/:revisionId',
headers: {'private-app-legacy': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId/revisions/:revisionId';
const options = {method: 'GET', headers: {'private-app-legacy': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"private-app-legacy": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId/revisions/:revisionId"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId/revisions/:revisionId" in
let headers = Header.add (Header.init ()) "private-app-legacy" "{{apiKey}}" in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId/revisions/:revisionId",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"private-app-legacy: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId/revisions/:revisionId', [
'headers' => [
'private-app-legacy' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId/revisions/:revisionId');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders([
'private-app-legacy' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId/revisions/:revisionId');
$request->setRequestMethod('GET');
$request->setHeaders([
'private-app-legacy' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("private-app-legacy", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId/revisions/:revisionId' -Method GET -Headers $headers
$headers=@{}
$headers.Add("private-app-legacy", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId/revisions/:revisionId' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'private-app-legacy': "{{apiKey}}" }
conn.request("GET", "/baseUrl/cms/v3/pages/landing-pages/folders/:objectId/revisions/:revisionId", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId/revisions/:revisionId"
headers = {"private-app-legacy": "{{apiKey}}"}
response = requests.get(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId/revisions/:revisionId"
response <- VERB("GET", url, add_headers('private-app-legacy' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId/revisions/:revisionId")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["private-app-legacy"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/cms/v3/pages/landing-pages/folders/:objectId/revisions/:revisionId') do |req|
req.headers['private-app-legacy'] = '{{apiKey}}'
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId/revisions/:revisionId";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("private-app-legacy", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId/revisions/:revisionId \
--header 'private-app-legacy: {{apiKey}}'
http GET {{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId/revisions/:revisionId \
private-app-legacy:'{{apiKey}}'
wget --quiet \
--method GET \
--header 'private-app-legacy: {{apiKey}}' \
--output-document \
- {{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId/revisions/:revisionId
import Foundation
let headers = ["private-app-legacy": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId/revisions/:revisionId")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
*/*
RESPONSE BODY text
{
"message": "Invalid input (details will vary based on the error)",
"correlationId": "aeb5f871-7f07-4993-9211-075dc63e7cbf",
"category": "VALIDATION_ERROR",
"links": {
"knowledge-base": "https://www.hubspot.com/products/service/knowledge-base"
}
}
GET
Retrieves a previous version of a Landing Page
{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/revisions/:revisionId
HEADERS
private-app-legacy
{{apiKey}}
QUERY PARAMS
objectId
revisionId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/revisions/:revisionId");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "private-app-legacy: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/revisions/:revisionId" {:headers {:private-app-legacy "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/revisions/:revisionId"
headers = HTTP::Headers{
"private-app-legacy" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/revisions/:revisionId"),
Headers =
{
{ "private-app-legacy", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/revisions/:revisionId");
var request = new RestRequest("", Method.Get);
request.AddHeader("private-app-legacy", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/revisions/:revisionId"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("private-app-legacy", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/cms/v3/pages/landing-pages/:objectId/revisions/:revisionId HTTP/1.1
Private-App-Legacy: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/revisions/:revisionId")
.setHeader("private-app-legacy", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/revisions/:revisionId"))
.header("private-app-legacy", "{{apiKey}}")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/revisions/:revisionId")
.get()
.addHeader("private-app-legacy", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/revisions/:revisionId")
.header("private-app-legacy", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/revisions/:revisionId');
xhr.setRequestHeader('private-app-legacy', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/revisions/:revisionId',
headers: {'private-app-legacy': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/revisions/:revisionId';
const options = {method: 'GET', headers: {'private-app-legacy': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/revisions/:revisionId',
method: 'GET',
headers: {
'private-app-legacy': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/revisions/:revisionId")
.get()
.addHeader("private-app-legacy", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/cms/v3/pages/landing-pages/:objectId/revisions/:revisionId',
headers: {
'private-app-legacy': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/revisions/:revisionId',
headers: {'private-app-legacy': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/revisions/:revisionId');
req.headers({
'private-app-legacy': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/revisions/:revisionId',
headers: {'private-app-legacy': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/revisions/:revisionId';
const options = {method: 'GET', headers: {'private-app-legacy': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"private-app-legacy": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/revisions/:revisionId"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/revisions/:revisionId" in
let headers = Header.add (Header.init ()) "private-app-legacy" "{{apiKey}}" in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/revisions/:revisionId",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"private-app-legacy: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/revisions/:revisionId', [
'headers' => [
'private-app-legacy' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/revisions/:revisionId');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders([
'private-app-legacy' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/revisions/:revisionId');
$request->setRequestMethod('GET');
$request->setHeaders([
'private-app-legacy' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("private-app-legacy", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/revisions/:revisionId' -Method GET -Headers $headers
$headers=@{}
$headers.Add("private-app-legacy", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/revisions/:revisionId' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'private-app-legacy': "{{apiKey}}" }
conn.request("GET", "/baseUrl/cms/v3/pages/landing-pages/:objectId/revisions/:revisionId", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/revisions/:revisionId"
headers = {"private-app-legacy": "{{apiKey}}"}
response = requests.get(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/revisions/:revisionId"
response <- VERB("GET", url, add_headers('private-app-legacy' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/revisions/:revisionId")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["private-app-legacy"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/cms/v3/pages/landing-pages/:objectId/revisions/:revisionId') do |req|
req.headers['private-app-legacy'] = '{{apiKey}}'
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/revisions/:revisionId";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("private-app-legacy", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/cms/v3/pages/landing-pages/:objectId/revisions/:revisionId \
--header 'private-app-legacy: {{apiKey}}'
http GET {{baseUrl}}/cms/v3/pages/landing-pages/:objectId/revisions/:revisionId \
private-app-legacy:'{{apiKey}}'
wget --quiet \
--method GET \
--header 'private-app-legacy: {{apiKey}}' \
--output-document \
- {{baseUrl}}/cms/v3/pages/landing-pages/:objectId/revisions/:revisionId
import Foundation
let headers = ["private-app-legacy": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/revisions/:revisionId")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
*/*
RESPONSE BODY text
{
"message": "Invalid input (details will vary based on the error)",
"correlationId": "aeb5f871-7f07-4993-9211-075dc63e7cbf",
"category": "VALIDATION_ERROR",
"links": {
"knowledge-base": "https://www.hubspot.com/products/service/knowledge-base"
}
}
GET
Retrieves all the previous versions of a Folder
{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId/revisions
HEADERS
private-app-legacy
{{apiKey}}
QUERY PARAMS
objectId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId/revisions");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "private-app-legacy: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId/revisions" {:headers {:private-app-legacy "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId/revisions"
headers = HTTP::Headers{
"private-app-legacy" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId/revisions"),
Headers =
{
{ "private-app-legacy", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId/revisions");
var request = new RestRequest("", Method.Get);
request.AddHeader("private-app-legacy", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId/revisions"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("private-app-legacy", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/cms/v3/pages/landing-pages/folders/:objectId/revisions HTTP/1.1
Private-App-Legacy: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId/revisions")
.setHeader("private-app-legacy", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId/revisions"))
.header("private-app-legacy", "{{apiKey}}")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId/revisions")
.get()
.addHeader("private-app-legacy", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId/revisions")
.header("private-app-legacy", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId/revisions');
xhr.setRequestHeader('private-app-legacy', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId/revisions',
headers: {'private-app-legacy': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId/revisions';
const options = {method: 'GET', headers: {'private-app-legacy': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId/revisions',
method: 'GET',
headers: {
'private-app-legacy': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId/revisions")
.get()
.addHeader("private-app-legacy", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/cms/v3/pages/landing-pages/folders/:objectId/revisions',
headers: {
'private-app-legacy': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId/revisions',
headers: {'private-app-legacy': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId/revisions');
req.headers({
'private-app-legacy': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId/revisions',
headers: {'private-app-legacy': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId/revisions';
const options = {method: 'GET', headers: {'private-app-legacy': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"private-app-legacy": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId/revisions"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId/revisions" in
let headers = Header.add (Header.init ()) "private-app-legacy" "{{apiKey}}" in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId/revisions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"private-app-legacy: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId/revisions', [
'headers' => [
'private-app-legacy' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId/revisions');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders([
'private-app-legacy' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId/revisions');
$request->setRequestMethod('GET');
$request->setHeaders([
'private-app-legacy' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("private-app-legacy", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId/revisions' -Method GET -Headers $headers
$headers=@{}
$headers.Add("private-app-legacy", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId/revisions' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'private-app-legacy': "{{apiKey}}" }
conn.request("GET", "/baseUrl/cms/v3/pages/landing-pages/folders/:objectId/revisions", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId/revisions"
headers = {"private-app-legacy": "{{apiKey}}"}
response = requests.get(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId/revisions"
response <- VERB("GET", url, add_headers('private-app-legacy' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId/revisions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["private-app-legacy"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/cms/v3/pages/landing-pages/folders/:objectId/revisions') do |req|
req.headers['private-app-legacy'] = '{{apiKey}}'
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId/revisions";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("private-app-legacy", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId/revisions \
--header 'private-app-legacy: {{apiKey}}'
http GET {{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId/revisions \
private-app-legacy:'{{apiKey}}'
wget --quiet \
--method GET \
--header 'private-app-legacy: {{apiKey}}' \
--output-document \
- {{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId/revisions
import Foundation
let headers = ["private-app-legacy": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId/revisions")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
*/*
RESPONSE BODY text
{
"message": "Invalid input (details will vary based on the error)",
"correlationId": "aeb5f871-7f07-4993-9211-075dc63e7cbf",
"category": "VALIDATION_ERROR",
"links": {
"knowledge-base": "https://www.hubspot.com/products/service/knowledge-base"
}
}
GET
Retrieves all the previous versions of a Landing Page
{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/revisions
HEADERS
private-app-legacy
{{apiKey}}
QUERY PARAMS
objectId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/revisions");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "private-app-legacy: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/revisions" {:headers {:private-app-legacy "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/revisions"
headers = HTTP::Headers{
"private-app-legacy" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/revisions"),
Headers =
{
{ "private-app-legacy", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/revisions");
var request = new RestRequest("", Method.Get);
request.AddHeader("private-app-legacy", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/revisions"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("private-app-legacy", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/cms/v3/pages/landing-pages/:objectId/revisions HTTP/1.1
Private-App-Legacy: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/revisions")
.setHeader("private-app-legacy", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/revisions"))
.header("private-app-legacy", "{{apiKey}}")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/revisions")
.get()
.addHeader("private-app-legacy", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/revisions")
.header("private-app-legacy", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/revisions');
xhr.setRequestHeader('private-app-legacy', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/revisions',
headers: {'private-app-legacy': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/revisions';
const options = {method: 'GET', headers: {'private-app-legacy': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/revisions',
method: 'GET',
headers: {
'private-app-legacy': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/revisions")
.get()
.addHeader("private-app-legacy", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/cms/v3/pages/landing-pages/:objectId/revisions',
headers: {
'private-app-legacy': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/revisions',
headers: {'private-app-legacy': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/revisions');
req.headers({
'private-app-legacy': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/revisions',
headers: {'private-app-legacy': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/revisions';
const options = {method: 'GET', headers: {'private-app-legacy': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"private-app-legacy": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/revisions"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/revisions" in
let headers = Header.add (Header.init ()) "private-app-legacy" "{{apiKey}}" in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/revisions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"private-app-legacy: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/revisions', [
'headers' => [
'private-app-legacy' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/revisions');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders([
'private-app-legacy' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/revisions');
$request->setRequestMethod('GET');
$request->setHeaders([
'private-app-legacy' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("private-app-legacy", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/revisions' -Method GET -Headers $headers
$headers=@{}
$headers.Add("private-app-legacy", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/revisions' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'private-app-legacy': "{{apiKey}}" }
conn.request("GET", "/baseUrl/cms/v3/pages/landing-pages/:objectId/revisions", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/revisions"
headers = {"private-app-legacy": "{{apiKey}}"}
response = requests.get(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/revisions"
response <- VERB("GET", url, add_headers('private-app-legacy' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/revisions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["private-app-legacy"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/cms/v3/pages/landing-pages/:objectId/revisions') do |req|
req.headers['private-app-legacy'] = '{{apiKey}}'
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/revisions";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("private-app-legacy", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/cms/v3/pages/landing-pages/:objectId/revisions \
--header 'private-app-legacy: {{apiKey}}'
http GET {{baseUrl}}/cms/v3/pages/landing-pages/:objectId/revisions \
private-app-legacy:'{{apiKey}}'
wget --quiet \
--method GET \
--header 'private-app-legacy: {{apiKey}}' \
--output-document \
- {{baseUrl}}/cms/v3/pages/landing-pages/:objectId/revisions
import Foundation
let headers = ["private-app-legacy": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/revisions")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
*/*
RESPONSE BODY text
{
"message": "Invalid input (details will vary based on the error)",
"correlationId": "aeb5f871-7f07-4993-9211-075dc63e7cbf",
"category": "VALIDATION_ERROR",
"links": {
"knowledge-base": "https://www.hubspot.com/products/service/knowledge-base"
}
}
POST
Schedule a Landing Page to be Published
{{baseUrl}}/cms/v3/pages/landing-pages/schedule
HEADERS
private-app-legacy
{{apiKey}}
BODY json
{
"publishDate": "",
"id": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/cms/v3/pages/landing-pages/schedule");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "private-app-legacy: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"publishDate\": \"\",\n \"id\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/cms/v3/pages/landing-pages/schedule" {:headers {:private-app-legacy "{{apiKey}}"}
:content-type :json
:form-params {:publishDate ""
:id ""}})
require "http/client"
url = "{{baseUrl}}/cms/v3/pages/landing-pages/schedule"
headers = HTTP::Headers{
"private-app-legacy" => "{{apiKey}}"
"content-type" => "application/json"
}
reqBody = "{\n \"publishDate\": \"\",\n \"id\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/cms/v3/pages/landing-pages/schedule"),
Headers =
{
{ "private-app-legacy", "{{apiKey}}" },
},
Content = new StringContent("{\n \"publishDate\": \"\",\n \"id\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/cms/v3/pages/landing-pages/schedule");
var request = new RestRequest("", Method.Post);
request.AddHeader("private-app-legacy", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"publishDate\": \"\",\n \"id\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/cms/v3/pages/landing-pages/schedule"
payload := strings.NewReader("{\n \"publishDate\": \"\",\n \"id\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("private-app-legacy", "{{apiKey}}")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/cms/v3/pages/landing-pages/schedule HTTP/1.1
Private-App-Legacy: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 35
{
"publishDate": "",
"id": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/cms/v3/pages/landing-pages/schedule")
.setHeader("private-app-legacy", "{{apiKey}}")
.setHeader("content-type", "application/json")
.setBody("{\n \"publishDate\": \"\",\n \"id\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/cms/v3/pages/landing-pages/schedule"))
.header("private-app-legacy", "{{apiKey}}")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"publishDate\": \"\",\n \"id\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"publishDate\": \"\",\n \"id\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/cms/v3/pages/landing-pages/schedule")
.post(body)
.addHeader("private-app-legacy", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/cms/v3/pages/landing-pages/schedule")
.header("private-app-legacy", "{{apiKey}}")
.header("content-type", "application/json")
.body("{\n \"publishDate\": \"\",\n \"id\": \"\"\n}")
.asString();
const data = JSON.stringify({
publishDate: '',
id: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/cms/v3/pages/landing-pages/schedule');
xhr.setRequestHeader('private-app-legacy', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/cms/v3/pages/landing-pages/schedule',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
data: {publishDate: '', id: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/cms/v3/pages/landing-pages/schedule';
const options = {
method: 'POST',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
body: '{"publishDate":"","id":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/cms/v3/pages/landing-pages/schedule',
method: 'POST',
headers: {
'private-app-legacy': '{{apiKey}}',
'content-type': 'application/json'
},
processData: false,
data: '{\n "publishDate": "",\n "id": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"publishDate\": \"\",\n \"id\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/cms/v3/pages/landing-pages/schedule")
.post(body)
.addHeader("private-app-legacy", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/cms/v3/pages/landing-pages/schedule',
headers: {
'private-app-legacy': '{{apiKey}}',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({publishDate: '', id: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/cms/v3/pages/landing-pages/schedule',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
body: {publishDate: '', id: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/cms/v3/pages/landing-pages/schedule');
req.headers({
'private-app-legacy': '{{apiKey}}',
'content-type': 'application/json'
});
req.type('json');
req.send({
publishDate: '',
id: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/cms/v3/pages/landing-pages/schedule',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
data: {publishDate: '', id: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/cms/v3/pages/landing-pages/schedule';
const options = {
method: 'POST',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
body: '{"publishDate":"","id":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"private-app-legacy": @"{{apiKey}}",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"publishDate": @"",
@"id": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/cms/v3/pages/landing-pages/schedule"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/cms/v3/pages/landing-pages/schedule" in
let headers = Header.add_list (Header.init ()) [
("private-app-legacy", "{{apiKey}}");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"publishDate\": \"\",\n \"id\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/cms/v3/pages/landing-pages/schedule",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'publishDate' => '',
'id' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"private-app-legacy: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/cms/v3/pages/landing-pages/schedule', [
'body' => '{
"publishDate": "",
"id": ""
}',
'headers' => [
'content-type' => 'application/json',
'private-app-legacy' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/cms/v3/pages/landing-pages/schedule');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'private-app-legacy' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'publishDate' => '',
'id' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'publishDate' => '',
'id' => ''
]));
$request->setRequestUrl('{{baseUrl}}/cms/v3/pages/landing-pages/schedule');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'private-app-legacy' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("private-app-legacy", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/cms/v3/pages/landing-pages/schedule' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"publishDate": "",
"id": ""
}'
$headers=@{}
$headers.Add("private-app-legacy", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/cms/v3/pages/landing-pages/schedule' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"publishDate": "",
"id": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"publishDate\": \"\",\n \"id\": \"\"\n}"
headers = {
'private-app-legacy': "{{apiKey}}",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/cms/v3/pages/landing-pages/schedule", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/cms/v3/pages/landing-pages/schedule"
payload = {
"publishDate": "",
"id": ""
}
headers = {
"private-app-legacy": "{{apiKey}}",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/cms/v3/pages/landing-pages/schedule"
payload <- "{\n \"publishDate\": \"\",\n \"id\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('private-app-legacy' = '{{apiKey}}'), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/cms/v3/pages/landing-pages/schedule")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["private-app-legacy"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n \"publishDate\": \"\",\n \"id\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/cms/v3/pages/landing-pages/schedule') do |req|
req.headers['private-app-legacy'] = '{{apiKey}}'
req.body = "{\n \"publishDate\": \"\",\n \"id\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/cms/v3/pages/landing-pages/schedule";
let payload = json!({
"publishDate": "",
"id": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("private-app-legacy", "{{apiKey}}".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/cms/v3/pages/landing-pages/schedule \
--header 'content-type: application/json' \
--header 'private-app-legacy: {{apiKey}}' \
--data '{
"publishDate": "",
"id": ""
}'
echo '{
"publishDate": "",
"id": ""
}' | \
http POST {{baseUrl}}/cms/v3/pages/landing-pages/schedule \
content-type:application/json \
private-app-legacy:'{{apiKey}}'
wget --quiet \
--method POST \
--header 'private-app-legacy: {{apiKey}}' \
--header 'content-type: application/json' \
--body-data '{\n "publishDate": "",\n "id": ""\n}' \
--output-document \
- {{baseUrl}}/cms/v3/pages/landing-pages/schedule
import Foundation
let headers = [
"private-app-legacy": "{{apiKey}}",
"content-type": "application/json"
]
let parameters = [
"publishDate": "",
"id": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/cms/v3/pages/landing-pages/schedule")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
*/*
RESPONSE BODY text
{
"message": "Invalid input (details will vary based on the error)",
"correlationId": "aeb5f871-7f07-4993-9211-075dc63e7cbf",
"category": "VALIDATION_ERROR",
"links": {
"knowledge-base": "https://www.hubspot.com/products/service/knowledge-base"
}
}
PUT
Set a new primary language (PUT)
{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/set-new-lang-primary
HEADERS
private-app-legacy
{{apiKey}}
BODY json
{
"id": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/set-new-lang-primary");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "private-app-legacy: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"id\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/set-new-lang-primary" {:headers {:private-app-legacy "{{apiKey}}"}
:content-type :json
:form-params {:id ""}})
require "http/client"
url = "{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/set-new-lang-primary"
headers = HTTP::Headers{
"private-app-legacy" => "{{apiKey}}"
"content-type" => "application/json"
}
reqBody = "{\n \"id\": \"\"\n}"
response = HTTP::Client.put url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Put,
RequestUri = new Uri("{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/set-new-lang-primary"),
Headers =
{
{ "private-app-legacy", "{{apiKey}}" },
},
Content = new StringContent("{\n \"id\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/set-new-lang-primary");
var request = new RestRequest("", Method.Put);
request.AddHeader("private-app-legacy", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"id\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/set-new-lang-primary"
payload := strings.NewReader("{\n \"id\": \"\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("private-app-legacy", "{{apiKey}}")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PUT /baseUrl/cms/v3/pages/landing-pages/multi-language/set-new-lang-primary HTTP/1.1
Private-App-Legacy: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 14
{
"id": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/set-new-lang-primary")
.setHeader("private-app-legacy", "{{apiKey}}")
.setHeader("content-type", "application/json")
.setBody("{\n \"id\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/set-new-lang-primary"))
.header("private-app-legacy", "{{apiKey}}")
.header("content-type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString("{\n \"id\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"id\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/set-new-lang-primary")
.put(body)
.addHeader("private-app-legacy", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/set-new-lang-primary")
.header("private-app-legacy", "{{apiKey}}")
.header("content-type", "application/json")
.body("{\n \"id\": \"\"\n}")
.asString();
const data = JSON.stringify({
id: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/set-new-lang-primary');
xhr.setRequestHeader('private-app-legacy', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/set-new-lang-primary',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
data: {id: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/set-new-lang-primary';
const options = {
method: 'PUT',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
body: '{"id":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/set-new-lang-primary',
method: 'PUT',
headers: {
'private-app-legacy': '{{apiKey}}',
'content-type': 'application/json'
},
processData: false,
data: '{\n "id": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"id\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/set-new-lang-primary")
.put(body)
.addHeader("private-app-legacy", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PUT',
hostname: 'example.com',
port: null,
path: '/baseUrl/cms/v3/pages/landing-pages/multi-language/set-new-lang-primary',
headers: {
'private-app-legacy': '{{apiKey}}',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({id: ''}));
req.end();
const request = require('request');
const options = {
method: 'PUT',
url: '{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/set-new-lang-primary',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
body: {id: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PUT', '{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/set-new-lang-primary');
req.headers({
'private-app-legacy': '{{apiKey}}',
'content-type': 'application/json'
});
req.type('json');
req.send({
id: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'PUT',
url: '{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/set-new-lang-primary',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
data: {id: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/set-new-lang-primary';
const options = {
method: 'PUT',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
body: '{"id":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"private-app-legacy": @"{{apiKey}}",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"id": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/set-new-lang-primary"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PUT"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/set-new-lang-primary" in
let headers = Header.add_list (Header.init ()) [
("private-app-legacy", "{{apiKey}}");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"id\": \"\"\n}" in
Client.call ~headers ~body `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/set-new-lang-primary",
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([
'id' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"private-app-legacy: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('PUT', '{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/set-new-lang-primary', [
'body' => '{
"id": ""
}',
'headers' => [
'content-type' => 'application/json',
'private-app-legacy' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/set-new-lang-primary');
$request->setMethod(HTTP_METH_PUT);
$request->setHeaders([
'private-app-legacy' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'id' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'id' => ''
]));
$request->setRequestUrl('{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/set-new-lang-primary');
$request->setRequestMethod('PUT');
$request->setBody($body);
$request->setHeaders([
'private-app-legacy' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("private-app-legacy", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/set-new-lang-primary' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"id": ""
}'
$headers=@{}
$headers.Add("private-app-legacy", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/set-new-lang-primary' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"id": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"id\": \"\"\n}"
headers = {
'private-app-legacy': "{{apiKey}}",
'content-type': "application/json"
}
conn.request("PUT", "/baseUrl/cms/v3/pages/landing-pages/multi-language/set-new-lang-primary", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/set-new-lang-primary"
payload = { "id": "" }
headers = {
"private-app-legacy": "{{apiKey}}",
"content-type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/set-new-lang-primary"
payload <- "{\n \"id\": \"\"\n}"
encode <- "json"
response <- VERB("PUT", url, body = payload, add_headers('private-app-legacy' = '{{apiKey}}'), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/set-new-lang-primary")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["private-app-legacy"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n \"id\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.put('/baseUrl/cms/v3/pages/landing-pages/multi-language/set-new-lang-primary') do |req|
req.headers['private-app-legacy'] = '{{apiKey}}'
req.body = "{\n \"id\": \"\"\n}"
end
puts response.status
puts response.body
use std::str::FromStr;
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/set-new-lang-primary";
let payload = json!({"id": ""});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("private-app-legacy", "{{apiKey}}".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PUT").unwrap(), url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PUT \
--url {{baseUrl}}/cms/v3/pages/landing-pages/multi-language/set-new-lang-primary \
--header 'content-type: application/json' \
--header 'private-app-legacy: {{apiKey}}' \
--data '{
"id": ""
}'
echo '{
"id": ""
}' | \
http PUT {{baseUrl}}/cms/v3/pages/landing-pages/multi-language/set-new-lang-primary \
content-type:application/json \
private-app-legacy:'{{apiKey}}'
wget --quiet \
--method PUT \
--header 'private-app-legacy: {{apiKey}}' \
--header 'content-type: application/json' \
--body-data '{\n "id": ""\n}' \
--output-document \
- {{baseUrl}}/cms/v3/pages/landing-pages/multi-language/set-new-lang-primary
import Foundation
let headers = [
"private-app-legacy": "{{apiKey}}",
"content-type": "application/json"
]
let parameters = ["id": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/set-new-lang-primary")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
*/*
RESPONSE BODY text
{
"message": "Invalid input (details will vary based on the error)",
"correlationId": "aeb5f871-7f07-4993-9211-075dc63e7cbf",
"category": "VALIDATION_ERROR",
"links": {
"knowledge-base": "https://www.hubspot.com/products/service/knowledge-base"
}
}
PATCH
Update a Folder
{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId
HEADERS
private-app-legacy
{{apiKey}}
QUERY PARAMS
objectId
BODY json
{
"deletedAt": "",
"parentFolderId": 0,
"created": "",
"name": "",
"id": "",
"category": 0,
"updated": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PATCH");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "private-app-legacy: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"deletedAt\": \"\",\n \"parentFolderId\": 0,\n \"created\": \"\",\n \"name\": \"\",\n \"id\": \"\",\n \"category\": 0,\n \"updated\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/patch "{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId" {:headers {:private-app-legacy "{{apiKey}}"}
:content-type :json
:form-params {:deletedAt ""
:parentFolderId 0
:created ""
:name ""
:id ""
:category 0
:updated ""}})
require "http/client"
url = "{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId"
headers = HTTP::Headers{
"private-app-legacy" => "{{apiKey}}"
"content-type" => "application/json"
}
reqBody = "{\n \"deletedAt\": \"\",\n \"parentFolderId\": 0,\n \"created\": \"\",\n \"name\": \"\",\n \"id\": \"\",\n \"category\": 0,\n \"updated\": \"\"\n}"
response = HTTP::Client.patch url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Patch,
RequestUri = new Uri("{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId"),
Headers =
{
{ "private-app-legacy", "{{apiKey}}" },
},
Content = new StringContent("{\n \"deletedAt\": \"\",\n \"parentFolderId\": 0,\n \"created\": \"\",\n \"name\": \"\",\n \"id\": \"\",\n \"category\": 0,\n \"updated\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId");
var request = new RestRequest("", Method.Patch);
request.AddHeader("private-app-legacy", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"deletedAt\": \"\",\n \"parentFolderId\": 0,\n \"created\": \"\",\n \"name\": \"\",\n \"id\": \"\",\n \"category\": 0,\n \"updated\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId"
payload := strings.NewReader("{\n \"deletedAt\": \"\",\n \"parentFolderId\": 0,\n \"created\": \"\",\n \"name\": \"\",\n \"id\": \"\",\n \"category\": 0,\n \"updated\": \"\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("private-app-legacy", "{{apiKey}}")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PATCH /baseUrl/cms/v3/pages/landing-pages/folders/:objectId HTTP/1.1
Private-App-Legacy: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 121
{
"deletedAt": "",
"parentFolderId": 0,
"created": "",
"name": "",
"id": "",
"category": 0,
"updated": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PATCH", "{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId")
.setHeader("private-app-legacy", "{{apiKey}}")
.setHeader("content-type", "application/json")
.setBody("{\n \"deletedAt\": \"\",\n \"parentFolderId\": 0,\n \"created\": \"\",\n \"name\": \"\",\n \"id\": \"\",\n \"category\": 0,\n \"updated\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId"))
.header("private-app-legacy", "{{apiKey}}")
.header("content-type", "application/json")
.method("PATCH", HttpRequest.BodyPublishers.ofString("{\n \"deletedAt\": \"\",\n \"parentFolderId\": 0,\n \"created\": \"\",\n \"name\": \"\",\n \"id\": \"\",\n \"category\": 0,\n \"updated\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"deletedAt\": \"\",\n \"parentFolderId\": 0,\n \"created\": \"\",\n \"name\": \"\",\n \"id\": \"\",\n \"category\": 0,\n \"updated\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId")
.patch(body)
.addHeader("private-app-legacy", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.patch("{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId")
.header("private-app-legacy", "{{apiKey}}")
.header("content-type", "application/json")
.body("{\n \"deletedAt\": \"\",\n \"parentFolderId\": 0,\n \"created\": \"\",\n \"name\": \"\",\n \"id\": \"\",\n \"category\": 0,\n \"updated\": \"\"\n}")
.asString();
const data = JSON.stringify({
deletedAt: '',
parentFolderId: 0,
created: '',
name: '',
id: '',
category: 0,
updated: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PATCH', '{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId');
xhr.setRequestHeader('private-app-legacy', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PATCH',
url: '{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
data: {
deletedAt: '',
parentFolderId: 0,
created: '',
name: '',
id: '',
category: 0,
updated: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId';
const options = {
method: 'PATCH',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
body: '{"deletedAt":"","parentFolderId":0,"created":"","name":"","id":"","category":0,"updated":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId',
method: 'PATCH',
headers: {
'private-app-legacy': '{{apiKey}}',
'content-type': 'application/json'
},
processData: false,
data: '{\n "deletedAt": "",\n "parentFolderId": 0,\n "created": "",\n "name": "",\n "id": "",\n "category": 0,\n "updated": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"deletedAt\": \"\",\n \"parentFolderId\": 0,\n \"created\": \"\",\n \"name\": \"\",\n \"id\": \"\",\n \"category\": 0,\n \"updated\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId")
.patch(body)
.addHeader("private-app-legacy", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PATCH',
hostname: 'example.com',
port: null,
path: '/baseUrl/cms/v3/pages/landing-pages/folders/:objectId',
headers: {
'private-app-legacy': '{{apiKey}}',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
deletedAt: '',
parentFolderId: 0,
created: '',
name: '',
id: '',
category: 0,
updated: ''
}));
req.end();
const request = require('request');
const options = {
method: 'PATCH',
url: '{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
body: {
deletedAt: '',
parentFolderId: 0,
created: '',
name: '',
id: '',
category: 0,
updated: ''
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PATCH', '{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId');
req.headers({
'private-app-legacy': '{{apiKey}}',
'content-type': 'application/json'
});
req.type('json');
req.send({
deletedAt: '',
parentFolderId: 0,
created: '',
name: '',
id: '',
category: 0,
updated: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'PATCH',
url: '{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
data: {
deletedAt: '',
parentFolderId: 0,
created: '',
name: '',
id: '',
category: 0,
updated: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId';
const options = {
method: 'PATCH',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
body: '{"deletedAt":"","parentFolderId":0,"created":"","name":"","id":"","category":0,"updated":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"private-app-legacy": @"{{apiKey}}",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"deletedAt": @"",
@"parentFolderId": @0,
@"created": @"",
@"name": @"",
@"id": @"",
@"category": @0,
@"updated": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PATCH"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId" in
let headers = Header.add_list (Header.init ()) [
("private-app-legacy", "{{apiKey}}");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"deletedAt\": \"\",\n \"parentFolderId\": 0,\n \"created\": \"\",\n \"name\": \"\",\n \"id\": \"\",\n \"category\": 0,\n \"updated\": \"\"\n}" in
Client.call ~headers ~body `PATCH uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'deletedAt' => '',
'parentFolderId' => 0,
'created' => '',
'name' => '',
'id' => '',
'category' => 0,
'updated' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"private-app-legacy: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('PATCH', '{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId', [
'body' => '{
"deletedAt": "",
"parentFolderId": 0,
"created": "",
"name": "",
"id": "",
"category": 0,
"updated": ""
}',
'headers' => [
'content-type' => 'application/json',
'private-app-legacy' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId');
$request->setMethod(HttpRequest::HTTP_METH_PATCH);
$request->setHeaders([
'private-app-legacy' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'deletedAt' => '',
'parentFolderId' => 0,
'created' => '',
'name' => '',
'id' => '',
'category' => 0,
'updated' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'deletedAt' => '',
'parentFolderId' => 0,
'created' => '',
'name' => '',
'id' => '',
'category' => 0,
'updated' => ''
]));
$request->setRequestUrl('{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId');
$request->setRequestMethod('PATCH');
$request->setBody($body);
$request->setHeaders([
'private-app-legacy' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("private-app-legacy", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId' -Method PATCH -Headers $headers -ContentType 'application/json' -Body '{
"deletedAt": "",
"parentFolderId": 0,
"created": "",
"name": "",
"id": "",
"category": 0,
"updated": ""
}'
$headers=@{}
$headers.Add("private-app-legacy", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId' -Method PATCH -Headers $headers -ContentType 'application/json' -Body '{
"deletedAt": "",
"parentFolderId": 0,
"created": "",
"name": "",
"id": "",
"category": 0,
"updated": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"deletedAt\": \"\",\n \"parentFolderId\": 0,\n \"created\": \"\",\n \"name\": \"\",\n \"id\": \"\",\n \"category\": 0,\n \"updated\": \"\"\n}"
headers = {
'private-app-legacy': "{{apiKey}}",
'content-type': "application/json"
}
conn.request("PATCH", "/baseUrl/cms/v3/pages/landing-pages/folders/:objectId", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId"
payload = {
"deletedAt": "",
"parentFolderId": 0,
"created": "",
"name": "",
"id": "",
"category": 0,
"updated": ""
}
headers = {
"private-app-legacy": "{{apiKey}}",
"content-type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId"
payload <- "{\n \"deletedAt\": \"\",\n \"parentFolderId\": 0,\n \"created\": \"\",\n \"name\": \"\",\n \"id\": \"\",\n \"category\": 0,\n \"updated\": \"\"\n}"
encode <- "json"
response <- VERB("PATCH", url, body = payload, add_headers('private-app-legacy' = '{{apiKey}}'), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["private-app-legacy"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n \"deletedAt\": \"\",\n \"parentFolderId\": 0,\n \"created\": \"\",\n \"name\": \"\",\n \"id\": \"\",\n \"category\": 0,\n \"updated\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.patch('/baseUrl/cms/v3/pages/landing-pages/folders/:objectId') do |req|
req.headers['private-app-legacy'] = '{{apiKey}}'
req.body = "{\n \"deletedAt\": \"\",\n \"parentFolderId\": 0,\n \"created\": \"\",\n \"name\": \"\",\n \"id\": \"\",\n \"category\": 0,\n \"updated\": \"\"\n}"
end
puts response.status
puts response.body
use std::str::FromStr;
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId";
let payload = json!({
"deletedAt": "",
"parentFolderId": 0,
"created": "",
"name": "",
"id": "",
"category": 0,
"updated": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("private-app-legacy", "{{apiKey}}".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PATCH").unwrap(), url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PATCH \
--url {{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId \
--header 'content-type: application/json' \
--header 'private-app-legacy: {{apiKey}}' \
--data '{
"deletedAt": "",
"parentFolderId": 0,
"created": "",
"name": "",
"id": "",
"category": 0,
"updated": ""
}'
echo '{
"deletedAt": "",
"parentFolderId": 0,
"created": "",
"name": "",
"id": "",
"category": 0,
"updated": ""
}' | \
http PATCH {{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId \
content-type:application/json \
private-app-legacy:'{{apiKey}}'
wget --quiet \
--method PATCH \
--header 'private-app-legacy: {{apiKey}}' \
--header 'content-type: application/json' \
--body-data '{\n "deletedAt": "",\n "parentFolderId": 0,\n "created": "",\n "name": "",\n "id": "",\n "category": 0,\n "updated": ""\n}' \
--output-document \
- {{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId
import Foundation
let headers = [
"private-app-legacy": "{{apiKey}}",
"content-type": "application/json"
]
let parameters = [
"deletedAt": "",
"parentFolderId": 0,
"created": "",
"name": "",
"id": "",
"category": 0,
"updated": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/cms/v3/pages/landing-pages/folders/:objectId")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PATCH"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
*/*
RESPONSE BODY text
{
"message": "Invalid input (details will vary based on the error)",
"correlationId": "aeb5f871-7f07-4993-9211-075dc63e7cbf",
"category": "VALIDATION_ERROR",
"links": {
"knowledge-base": "https://www.hubspot.com/products/service/knowledge-base"
}
}
PATCH
Update a Landing Page draft
{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/draft
HEADERS
private-app-legacy
{{apiKey}}
QUERY PARAMS
objectId
BODY json
{
"publishDate": "",
"language": "",
"enableLayoutStylesheets": false,
"metaDescription": "",
"attachedStylesheets": [
{}
],
"password": "",
"publishImmediately": false,
"htmlTitle": "",
"translations": {},
"id": "",
"state": "",
"slug": "",
"createdById": "",
"currentlyPublished": false,
"archivedInDashboard": false,
"created": "",
"contentTypeCategory": "",
"mabExperimentId": "",
"updatedById": "",
"translatedFromId": "",
"folderId": "",
"widgetContainers": {},
"pageExpiryRedirectId": 0,
"dynamicPageDataSourceType": 0,
"featuredImage": "",
"authorName": "",
"domain": "",
"name": "",
"dynamicPageHubDbTableId": "",
"campaign": "",
"dynamicPageDataSourceId": "",
"enableDomainStylesheets": false,
"includeDefaultCustomCss": false,
"subcategory": "",
"layoutSections": {},
"updated": "",
"footerHtml": "",
"widgets": {},
"headHtml": "",
"pageExpiryRedirectUrl": "",
"abStatus": "",
"useFeaturedImage": false,
"abTestId": "",
"featuredImageAltText": "",
"contentGroupId": "",
"pageExpiryEnabled": false,
"templatePath": "",
"url": "",
"publicAccessRules": [
{}
],
"archivedAt": "",
"themeSettingsValues": {},
"pageExpiryDate": 0,
"publicAccessRulesEnabled": false,
"pageRedirected": false,
"currentState": "",
"categoryId": 0,
"linkRelCanonicalUrl": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PATCH");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/draft");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "private-app-legacy: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"publishDate\": \"\",\n \"language\": \"\",\n \"enableLayoutStylesheets\": false,\n \"metaDescription\": \"\",\n \"attachedStylesheets\": [\n {}\n ],\n \"password\": \"\",\n \"publishImmediately\": false,\n \"htmlTitle\": \"\",\n \"translations\": {},\n \"id\": \"\",\n \"state\": \"\",\n \"slug\": \"\",\n \"createdById\": \"\",\n \"currentlyPublished\": false,\n \"archivedInDashboard\": false,\n \"created\": \"\",\n \"contentTypeCategory\": \"\",\n \"mabExperimentId\": \"\",\n \"updatedById\": \"\",\n \"translatedFromId\": \"\",\n \"folderId\": \"\",\n \"widgetContainers\": {},\n \"pageExpiryRedirectId\": 0,\n \"dynamicPageDataSourceType\": 0,\n \"featuredImage\": \"\",\n \"authorName\": \"\",\n \"domain\": \"\",\n \"name\": \"\",\n \"dynamicPageHubDbTableId\": \"\",\n \"campaign\": \"\",\n \"dynamicPageDataSourceId\": \"\",\n \"enableDomainStylesheets\": false,\n \"includeDefaultCustomCss\": false,\n \"subcategory\": \"\",\n \"layoutSections\": {},\n \"updated\": \"\",\n \"footerHtml\": \"\",\n \"widgets\": {},\n \"headHtml\": \"\",\n \"pageExpiryRedirectUrl\": \"\",\n \"abStatus\": \"\",\n \"useFeaturedImage\": false,\n \"abTestId\": \"\",\n \"featuredImageAltText\": \"\",\n \"contentGroupId\": \"\",\n \"pageExpiryEnabled\": false,\n \"templatePath\": \"\",\n \"url\": \"\",\n \"publicAccessRules\": [\n {}\n ],\n \"archivedAt\": \"\",\n \"themeSettingsValues\": {},\n \"pageExpiryDate\": 0,\n \"publicAccessRulesEnabled\": false,\n \"pageRedirected\": false,\n \"currentState\": \"\",\n \"categoryId\": 0,\n \"linkRelCanonicalUrl\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/patch "{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/draft" {:headers {:private-app-legacy "{{apiKey}}"}
:content-type :json
:form-params {:publishDate ""
:language ""
:enableLayoutStylesheets false
:metaDescription ""
:attachedStylesheets [{}]
:password ""
:publishImmediately false
:htmlTitle ""
:translations {}
:id ""
:state ""
:slug ""
:createdById ""
:currentlyPublished false
:archivedInDashboard false
:created ""
:contentTypeCategory ""
:mabExperimentId ""
:updatedById ""
:translatedFromId ""
:folderId ""
:widgetContainers {}
:pageExpiryRedirectId 0
:dynamicPageDataSourceType 0
:featuredImage ""
:authorName ""
:domain ""
:name ""
:dynamicPageHubDbTableId ""
:campaign ""
:dynamicPageDataSourceId ""
:enableDomainStylesheets false
:includeDefaultCustomCss false
:subcategory ""
:layoutSections {}
:updated ""
:footerHtml ""
:widgets {}
:headHtml ""
:pageExpiryRedirectUrl ""
:abStatus ""
:useFeaturedImage false
:abTestId ""
:featuredImageAltText ""
:contentGroupId ""
:pageExpiryEnabled false
:templatePath ""
:url ""
:publicAccessRules [{}]
:archivedAt ""
:themeSettingsValues {}
:pageExpiryDate 0
:publicAccessRulesEnabled false
:pageRedirected false
:currentState ""
:categoryId 0
:linkRelCanonicalUrl ""}})
require "http/client"
url = "{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/draft"
headers = HTTP::Headers{
"private-app-legacy" => "{{apiKey}}"
"content-type" => "application/json"
}
reqBody = "{\n \"publishDate\": \"\",\n \"language\": \"\",\n \"enableLayoutStylesheets\": false,\n \"metaDescription\": \"\",\n \"attachedStylesheets\": [\n {}\n ],\n \"password\": \"\",\n \"publishImmediately\": false,\n \"htmlTitle\": \"\",\n \"translations\": {},\n \"id\": \"\",\n \"state\": \"\",\n \"slug\": \"\",\n \"createdById\": \"\",\n \"currentlyPublished\": false,\n \"archivedInDashboard\": false,\n \"created\": \"\",\n \"contentTypeCategory\": \"\",\n \"mabExperimentId\": \"\",\n \"updatedById\": \"\",\n \"translatedFromId\": \"\",\n \"folderId\": \"\",\n \"widgetContainers\": {},\n \"pageExpiryRedirectId\": 0,\n \"dynamicPageDataSourceType\": 0,\n \"featuredImage\": \"\",\n \"authorName\": \"\",\n \"domain\": \"\",\n \"name\": \"\",\n \"dynamicPageHubDbTableId\": \"\",\n \"campaign\": \"\",\n \"dynamicPageDataSourceId\": \"\",\n \"enableDomainStylesheets\": false,\n \"includeDefaultCustomCss\": false,\n \"subcategory\": \"\",\n \"layoutSections\": {},\n \"updated\": \"\",\n \"footerHtml\": \"\",\n \"widgets\": {},\n \"headHtml\": \"\",\n \"pageExpiryRedirectUrl\": \"\",\n \"abStatus\": \"\",\n \"useFeaturedImage\": false,\n \"abTestId\": \"\",\n \"featuredImageAltText\": \"\",\n \"contentGroupId\": \"\",\n \"pageExpiryEnabled\": false,\n \"templatePath\": \"\",\n \"url\": \"\",\n \"publicAccessRules\": [\n {}\n ],\n \"archivedAt\": \"\",\n \"themeSettingsValues\": {},\n \"pageExpiryDate\": 0,\n \"publicAccessRulesEnabled\": false,\n \"pageRedirected\": false,\n \"currentState\": \"\",\n \"categoryId\": 0,\n \"linkRelCanonicalUrl\": \"\"\n}"
response = HTTP::Client.patch url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Patch,
RequestUri = new Uri("{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/draft"),
Headers =
{
{ "private-app-legacy", "{{apiKey}}" },
},
Content = new StringContent("{\n \"publishDate\": \"\",\n \"language\": \"\",\n \"enableLayoutStylesheets\": false,\n \"metaDescription\": \"\",\n \"attachedStylesheets\": [\n {}\n ],\n \"password\": \"\",\n \"publishImmediately\": false,\n \"htmlTitle\": \"\",\n \"translations\": {},\n \"id\": \"\",\n \"state\": \"\",\n \"slug\": \"\",\n \"createdById\": \"\",\n \"currentlyPublished\": false,\n \"archivedInDashboard\": false,\n \"created\": \"\",\n \"contentTypeCategory\": \"\",\n \"mabExperimentId\": \"\",\n \"updatedById\": \"\",\n \"translatedFromId\": \"\",\n \"folderId\": \"\",\n \"widgetContainers\": {},\n \"pageExpiryRedirectId\": 0,\n \"dynamicPageDataSourceType\": 0,\n \"featuredImage\": \"\",\n \"authorName\": \"\",\n \"domain\": \"\",\n \"name\": \"\",\n \"dynamicPageHubDbTableId\": \"\",\n \"campaign\": \"\",\n \"dynamicPageDataSourceId\": \"\",\n \"enableDomainStylesheets\": false,\n \"includeDefaultCustomCss\": false,\n \"subcategory\": \"\",\n \"layoutSections\": {},\n \"updated\": \"\",\n \"footerHtml\": \"\",\n \"widgets\": {},\n \"headHtml\": \"\",\n \"pageExpiryRedirectUrl\": \"\",\n \"abStatus\": \"\",\n \"useFeaturedImage\": false,\n \"abTestId\": \"\",\n \"featuredImageAltText\": \"\",\n \"contentGroupId\": \"\",\n \"pageExpiryEnabled\": false,\n \"templatePath\": \"\",\n \"url\": \"\",\n \"publicAccessRules\": [\n {}\n ],\n \"archivedAt\": \"\",\n \"themeSettingsValues\": {},\n \"pageExpiryDate\": 0,\n \"publicAccessRulesEnabled\": false,\n \"pageRedirected\": false,\n \"currentState\": \"\",\n \"categoryId\": 0,\n \"linkRelCanonicalUrl\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/draft");
var request = new RestRequest("", Method.Patch);
request.AddHeader("private-app-legacy", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"publishDate\": \"\",\n \"language\": \"\",\n \"enableLayoutStylesheets\": false,\n \"metaDescription\": \"\",\n \"attachedStylesheets\": [\n {}\n ],\n \"password\": \"\",\n \"publishImmediately\": false,\n \"htmlTitle\": \"\",\n \"translations\": {},\n \"id\": \"\",\n \"state\": \"\",\n \"slug\": \"\",\n \"createdById\": \"\",\n \"currentlyPublished\": false,\n \"archivedInDashboard\": false,\n \"created\": \"\",\n \"contentTypeCategory\": \"\",\n \"mabExperimentId\": \"\",\n \"updatedById\": \"\",\n \"translatedFromId\": \"\",\n \"folderId\": \"\",\n \"widgetContainers\": {},\n \"pageExpiryRedirectId\": 0,\n \"dynamicPageDataSourceType\": 0,\n \"featuredImage\": \"\",\n \"authorName\": \"\",\n \"domain\": \"\",\n \"name\": \"\",\n \"dynamicPageHubDbTableId\": \"\",\n \"campaign\": \"\",\n \"dynamicPageDataSourceId\": \"\",\n \"enableDomainStylesheets\": false,\n \"includeDefaultCustomCss\": false,\n \"subcategory\": \"\",\n \"layoutSections\": {},\n \"updated\": \"\",\n \"footerHtml\": \"\",\n \"widgets\": {},\n \"headHtml\": \"\",\n \"pageExpiryRedirectUrl\": \"\",\n \"abStatus\": \"\",\n \"useFeaturedImage\": false,\n \"abTestId\": \"\",\n \"featuredImageAltText\": \"\",\n \"contentGroupId\": \"\",\n \"pageExpiryEnabled\": false,\n \"templatePath\": \"\",\n \"url\": \"\",\n \"publicAccessRules\": [\n {}\n ],\n \"archivedAt\": \"\",\n \"themeSettingsValues\": {},\n \"pageExpiryDate\": 0,\n \"publicAccessRulesEnabled\": false,\n \"pageRedirected\": false,\n \"currentState\": \"\",\n \"categoryId\": 0,\n \"linkRelCanonicalUrl\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/draft"
payload := strings.NewReader("{\n \"publishDate\": \"\",\n \"language\": \"\",\n \"enableLayoutStylesheets\": false,\n \"metaDescription\": \"\",\n \"attachedStylesheets\": [\n {}\n ],\n \"password\": \"\",\n \"publishImmediately\": false,\n \"htmlTitle\": \"\",\n \"translations\": {},\n \"id\": \"\",\n \"state\": \"\",\n \"slug\": \"\",\n \"createdById\": \"\",\n \"currentlyPublished\": false,\n \"archivedInDashboard\": false,\n \"created\": \"\",\n \"contentTypeCategory\": \"\",\n \"mabExperimentId\": \"\",\n \"updatedById\": \"\",\n \"translatedFromId\": \"\",\n \"folderId\": \"\",\n \"widgetContainers\": {},\n \"pageExpiryRedirectId\": 0,\n \"dynamicPageDataSourceType\": 0,\n \"featuredImage\": \"\",\n \"authorName\": \"\",\n \"domain\": \"\",\n \"name\": \"\",\n \"dynamicPageHubDbTableId\": \"\",\n \"campaign\": \"\",\n \"dynamicPageDataSourceId\": \"\",\n \"enableDomainStylesheets\": false,\n \"includeDefaultCustomCss\": false,\n \"subcategory\": \"\",\n \"layoutSections\": {},\n \"updated\": \"\",\n \"footerHtml\": \"\",\n \"widgets\": {},\n \"headHtml\": \"\",\n \"pageExpiryRedirectUrl\": \"\",\n \"abStatus\": \"\",\n \"useFeaturedImage\": false,\n \"abTestId\": \"\",\n \"featuredImageAltText\": \"\",\n \"contentGroupId\": \"\",\n \"pageExpiryEnabled\": false,\n \"templatePath\": \"\",\n \"url\": \"\",\n \"publicAccessRules\": [\n {}\n ],\n \"archivedAt\": \"\",\n \"themeSettingsValues\": {},\n \"pageExpiryDate\": 0,\n \"publicAccessRulesEnabled\": false,\n \"pageRedirected\": false,\n \"currentState\": \"\",\n \"categoryId\": 0,\n \"linkRelCanonicalUrl\": \"\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("private-app-legacy", "{{apiKey}}")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PATCH /baseUrl/cms/v3/pages/landing-pages/:objectId/draft HTTP/1.1
Private-App-Legacy: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 1385
{
"publishDate": "",
"language": "",
"enableLayoutStylesheets": false,
"metaDescription": "",
"attachedStylesheets": [
{}
],
"password": "",
"publishImmediately": false,
"htmlTitle": "",
"translations": {},
"id": "",
"state": "",
"slug": "",
"createdById": "",
"currentlyPublished": false,
"archivedInDashboard": false,
"created": "",
"contentTypeCategory": "",
"mabExperimentId": "",
"updatedById": "",
"translatedFromId": "",
"folderId": "",
"widgetContainers": {},
"pageExpiryRedirectId": 0,
"dynamicPageDataSourceType": 0,
"featuredImage": "",
"authorName": "",
"domain": "",
"name": "",
"dynamicPageHubDbTableId": "",
"campaign": "",
"dynamicPageDataSourceId": "",
"enableDomainStylesheets": false,
"includeDefaultCustomCss": false,
"subcategory": "",
"layoutSections": {},
"updated": "",
"footerHtml": "",
"widgets": {},
"headHtml": "",
"pageExpiryRedirectUrl": "",
"abStatus": "",
"useFeaturedImage": false,
"abTestId": "",
"featuredImageAltText": "",
"contentGroupId": "",
"pageExpiryEnabled": false,
"templatePath": "",
"url": "",
"publicAccessRules": [
{}
],
"archivedAt": "",
"themeSettingsValues": {},
"pageExpiryDate": 0,
"publicAccessRulesEnabled": false,
"pageRedirected": false,
"currentState": "",
"categoryId": 0,
"linkRelCanonicalUrl": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PATCH", "{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/draft")
.setHeader("private-app-legacy", "{{apiKey}}")
.setHeader("content-type", "application/json")
.setBody("{\n \"publishDate\": \"\",\n \"language\": \"\",\n \"enableLayoutStylesheets\": false,\n \"metaDescription\": \"\",\n \"attachedStylesheets\": [\n {}\n ],\n \"password\": \"\",\n \"publishImmediately\": false,\n \"htmlTitle\": \"\",\n \"translations\": {},\n \"id\": \"\",\n \"state\": \"\",\n \"slug\": \"\",\n \"createdById\": \"\",\n \"currentlyPublished\": false,\n \"archivedInDashboard\": false,\n \"created\": \"\",\n \"contentTypeCategory\": \"\",\n \"mabExperimentId\": \"\",\n \"updatedById\": \"\",\n \"translatedFromId\": \"\",\n \"folderId\": \"\",\n \"widgetContainers\": {},\n \"pageExpiryRedirectId\": 0,\n \"dynamicPageDataSourceType\": 0,\n \"featuredImage\": \"\",\n \"authorName\": \"\",\n \"domain\": \"\",\n \"name\": \"\",\n \"dynamicPageHubDbTableId\": \"\",\n \"campaign\": \"\",\n \"dynamicPageDataSourceId\": \"\",\n \"enableDomainStylesheets\": false,\n \"includeDefaultCustomCss\": false,\n \"subcategory\": \"\",\n \"layoutSections\": {},\n \"updated\": \"\",\n \"footerHtml\": \"\",\n \"widgets\": {},\n \"headHtml\": \"\",\n \"pageExpiryRedirectUrl\": \"\",\n \"abStatus\": \"\",\n \"useFeaturedImage\": false,\n \"abTestId\": \"\",\n \"featuredImageAltText\": \"\",\n \"contentGroupId\": \"\",\n \"pageExpiryEnabled\": false,\n \"templatePath\": \"\",\n \"url\": \"\",\n \"publicAccessRules\": [\n {}\n ],\n \"archivedAt\": \"\",\n \"themeSettingsValues\": {},\n \"pageExpiryDate\": 0,\n \"publicAccessRulesEnabled\": false,\n \"pageRedirected\": false,\n \"currentState\": \"\",\n \"categoryId\": 0,\n \"linkRelCanonicalUrl\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/draft"))
.header("private-app-legacy", "{{apiKey}}")
.header("content-type", "application/json")
.method("PATCH", HttpRequest.BodyPublishers.ofString("{\n \"publishDate\": \"\",\n \"language\": \"\",\n \"enableLayoutStylesheets\": false,\n \"metaDescription\": \"\",\n \"attachedStylesheets\": [\n {}\n ],\n \"password\": \"\",\n \"publishImmediately\": false,\n \"htmlTitle\": \"\",\n \"translations\": {},\n \"id\": \"\",\n \"state\": \"\",\n \"slug\": \"\",\n \"createdById\": \"\",\n \"currentlyPublished\": false,\n \"archivedInDashboard\": false,\n \"created\": \"\",\n \"contentTypeCategory\": \"\",\n \"mabExperimentId\": \"\",\n \"updatedById\": \"\",\n \"translatedFromId\": \"\",\n \"folderId\": \"\",\n \"widgetContainers\": {},\n \"pageExpiryRedirectId\": 0,\n \"dynamicPageDataSourceType\": 0,\n \"featuredImage\": \"\",\n \"authorName\": \"\",\n \"domain\": \"\",\n \"name\": \"\",\n \"dynamicPageHubDbTableId\": \"\",\n \"campaign\": \"\",\n \"dynamicPageDataSourceId\": \"\",\n \"enableDomainStylesheets\": false,\n \"includeDefaultCustomCss\": false,\n \"subcategory\": \"\",\n \"layoutSections\": {},\n \"updated\": \"\",\n \"footerHtml\": \"\",\n \"widgets\": {},\n \"headHtml\": \"\",\n \"pageExpiryRedirectUrl\": \"\",\n \"abStatus\": \"\",\n \"useFeaturedImage\": false,\n \"abTestId\": \"\",\n \"featuredImageAltText\": \"\",\n \"contentGroupId\": \"\",\n \"pageExpiryEnabled\": false,\n \"templatePath\": \"\",\n \"url\": \"\",\n \"publicAccessRules\": [\n {}\n ],\n \"archivedAt\": \"\",\n \"themeSettingsValues\": {},\n \"pageExpiryDate\": 0,\n \"publicAccessRulesEnabled\": false,\n \"pageRedirected\": false,\n \"currentState\": \"\",\n \"categoryId\": 0,\n \"linkRelCanonicalUrl\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"publishDate\": \"\",\n \"language\": \"\",\n \"enableLayoutStylesheets\": false,\n \"metaDescription\": \"\",\n \"attachedStylesheets\": [\n {}\n ],\n \"password\": \"\",\n \"publishImmediately\": false,\n \"htmlTitle\": \"\",\n \"translations\": {},\n \"id\": \"\",\n \"state\": \"\",\n \"slug\": \"\",\n \"createdById\": \"\",\n \"currentlyPublished\": false,\n \"archivedInDashboard\": false,\n \"created\": \"\",\n \"contentTypeCategory\": \"\",\n \"mabExperimentId\": \"\",\n \"updatedById\": \"\",\n \"translatedFromId\": \"\",\n \"folderId\": \"\",\n \"widgetContainers\": {},\n \"pageExpiryRedirectId\": 0,\n \"dynamicPageDataSourceType\": 0,\n \"featuredImage\": \"\",\n \"authorName\": \"\",\n \"domain\": \"\",\n \"name\": \"\",\n \"dynamicPageHubDbTableId\": \"\",\n \"campaign\": \"\",\n \"dynamicPageDataSourceId\": \"\",\n \"enableDomainStylesheets\": false,\n \"includeDefaultCustomCss\": false,\n \"subcategory\": \"\",\n \"layoutSections\": {},\n \"updated\": \"\",\n \"footerHtml\": \"\",\n \"widgets\": {},\n \"headHtml\": \"\",\n \"pageExpiryRedirectUrl\": \"\",\n \"abStatus\": \"\",\n \"useFeaturedImage\": false,\n \"abTestId\": \"\",\n \"featuredImageAltText\": \"\",\n \"contentGroupId\": \"\",\n \"pageExpiryEnabled\": false,\n \"templatePath\": \"\",\n \"url\": \"\",\n \"publicAccessRules\": [\n {}\n ],\n \"archivedAt\": \"\",\n \"themeSettingsValues\": {},\n \"pageExpiryDate\": 0,\n \"publicAccessRulesEnabled\": false,\n \"pageRedirected\": false,\n \"currentState\": \"\",\n \"categoryId\": 0,\n \"linkRelCanonicalUrl\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/draft")
.patch(body)
.addHeader("private-app-legacy", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.patch("{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/draft")
.header("private-app-legacy", "{{apiKey}}")
.header("content-type", "application/json")
.body("{\n \"publishDate\": \"\",\n \"language\": \"\",\n \"enableLayoutStylesheets\": false,\n \"metaDescription\": \"\",\n \"attachedStylesheets\": [\n {}\n ],\n \"password\": \"\",\n \"publishImmediately\": false,\n \"htmlTitle\": \"\",\n \"translations\": {},\n \"id\": \"\",\n \"state\": \"\",\n \"slug\": \"\",\n \"createdById\": \"\",\n \"currentlyPublished\": false,\n \"archivedInDashboard\": false,\n \"created\": \"\",\n \"contentTypeCategory\": \"\",\n \"mabExperimentId\": \"\",\n \"updatedById\": \"\",\n \"translatedFromId\": \"\",\n \"folderId\": \"\",\n \"widgetContainers\": {},\n \"pageExpiryRedirectId\": 0,\n \"dynamicPageDataSourceType\": 0,\n \"featuredImage\": \"\",\n \"authorName\": \"\",\n \"domain\": \"\",\n \"name\": \"\",\n \"dynamicPageHubDbTableId\": \"\",\n \"campaign\": \"\",\n \"dynamicPageDataSourceId\": \"\",\n \"enableDomainStylesheets\": false,\n \"includeDefaultCustomCss\": false,\n \"subcategory\": \"\",\n \"layoutSections\": {},\n \"updated\": \"\",\n \"footerHtml\": \"\",\n \"widgets\": {},\n \"headHtml\": \"\",\n \"pageExpiryRedirectUrl\": \"\",\n \"abStatus\": \"\",\n \"useFeaturedImage\": false,\n \"abTestId\": \"\",\n \"featuredImageAltText\": \"\",\n \"contentGroupId\": \"\",\n \"pageExpiryEnabled\": false,\n \"templatePath\": \"\",\n \"url\": \"\",\n \"publicAccessRules\": [\n {}\n ],\n \"archivedAt\": \"\",\n \"themeSettingsValues\": {},\n \"pageExpiryDate\": 0,\n \"publicAccessRulesEnabled\": false,\n \"pageRedirected\": false,\n \"currentState\": \"\",\n \"categoryId\": 0,\n \"linkRelCanonicalUrl\": \"\"\n}")
.asString();
const data = JSON.stringify({
publishDate: '',
language: '',
enableLayoutStylesheets: false,
metaDescription: '',
attachedStylesheets: [
{}
],
password: '',
publishImmediately: false,
htmlTitle: '',
translations: {},
id: '',
state: '',
slug: '',
createdById: '',
currentlyPublished: false,
archivedInDashboard: false,
created: '',
contentTypeCategory: '',
mabExperimentId: '',
updatedById: '',
translatedFromId: '',
folderId: '',
widgetContainers: {},
pageExpiryRedirectId: 0,
dynamicPageDataSourceType: 0,
featuredImage: '',
authorName: '',
domain: '',
name: '',
dynamicPageHubDbTableId: '',
campaign: '',
dynamicPageDataSourceId: '',
enableDomainStylesheets: false,
includeDefaultCustomCss: false,
subcategory: '',
layoutSections: {},
updated: '',
footerHtml: '',
widgets: {},
headHtml: '',
pageExpiryRedirectUrl: '',
abStatus: '',
useFeaturedImage: false,
abTestId: '',
featuredImageAltText: '',
contentGroupId: '',
pageExpiryEnabled: false,
templatePath: '',
url: '',
publicAccessRules: [
{}
],
archivedAt: '',
themeSettingsValues: {},
pageExpiryDate: 0,
publicAccessRulesEnabled: false,
pageRedirected: false,
currentState: '',
categoryId: 0,
linkRelCanonicalUrl: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PATCH', '{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/draft');
xhr.setRequestHeader('private-app-legacy', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PATCH',
url: '{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/draft',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
data: {
publishDate: '',
language: '',
enableLayoutStylesheets: false,
metaDescription: '',
attachedStylesheets: [{}],
password: '',
publishImmediately: false,
htmlTitle: '',
translations: {},
id: '',
state: '',
slug: '',
createdById: '',
currentlyPublished: false,
archivedInDashboard: false,
created: '',
contentTypeCategory: '',
mabExperimentId: '',
updatedById: '',
translatedFromId: '',
folderId: '',
widgetContainers: {},
pageExpiryRedirectId: 0,
dynamicPageDataSourceType: 0,
featuredImage: '',
authorName: '',
domain: '',
name: '',
dynamicPageHubDbTableId: '',
campaign: '',
dynamicPageDataSourceId: '',
enableDomainStylesheets: false,
includeDefaultCustomCss: false,
subcategory: '',
layoutSections: {},
updated: '',
footerHtml: '',
widgets: {},
headHtml: '',
pageExpiryRedirectUrl: '',
abStatus: '',
useFeaturedImage: false,
abTestId: '',
featuredImageAltText: '',
contentGroupId: '',
pageExpiryEnabled: false,
templatePath: '',
url: '',
publicAccessRules: [{}],
archivedAt: '',
themeSettingsValues: {},
pageExpiryDate: 0,
publicAccessRulesEnabled: false,
pageRedirected: false,
currentState: '',
categoryId: 0,
linkRelCanonicalUrl: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/draft';
const options = {
method: 'PATCH',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
body: '{"publishDate":"","language":"","enableLayoutStylesheets":false,"metaDescription":"","attachedStylesheets":[{}],"password":"","publishImmediately":false,"htmlTitle":"","translations":{},"id":"","state":"","slug":"","createdById":"","currentlyPublished":false,"archivedInDashboard":false,"created":"","contentTypeCategory":"","mabExperimentId":"","updatedById":"","translatedFromId":"","folderId":"","widgetContainers":{},"pageExpiryRedirectId":0,"dynamicPageDataSourceType":0,"featuredImage":"","authorName":"","domain":"","name":"","dynamicPageHubDbTableId":"","campaign":"","dynamicPageDataSourceId":"","enableDomainStylesheets":false,"includeDefaultCustomCss":false,"subcategory":"","layoutSections":{},"updated":"","footerHtml":"","widgets":{},"headHtml":"","pageExpiryRedirectUrl":"","abStatus":"","useFeaturedImage":false,"abTestId":"","featuredImageAltText":"","contentGroupId":"","pageExpiryEnabled":false,"templatePath":"","url":"","publicAccessRules":[{}],"archivedAt":"","themeSettingsValues":{},"pageExpiryDate":0,"publicAccessRulesEnabled":false,"pageRedirected":false,"currentState":"","categoryId":0,"linkRelCanonicalUrl":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/draft',
method: 'PATCH',
headers: {
'private-app-legacy': '{{apiKey}}',
'content-type': 'application/json'
},
processData: false,
data: '{\n "publishDate": "",\n "language": "",\n "enableLayoutStylesheets": false,\n "metaDescription": "",\n "attachedStylesheets": [\n {}\n ],\n "password": "",\n "publishImmediately": false,\n "htmlTitle": "",\n "translations": {},\n "id": "",\n "state": "",\n "slug": "",\n "createdById": "",\n "currentlyPublished": false,\n "archivedInDashboard": false,\n "created": "",\n "contentTypeCategory": "",\n "mabExperimentId": "",\n "updatedById": "",\n "translatedFromId": "",\n "folderId": "",\n "widgetContainers": {},\n "pageExpiryRedirectId": 0,\n "dynamicPageDataSourceType": 0,\n "featuredImage": "",\n "authorName": "",\n "domain": "",\n "name": "",\n "dynamicPageHubDbTableId": "",\n "campaign": "",\n "dynamicPageDataSourceId": "",\n "enableDomainStylesheets": false,\n "includeDefaultCustomCss": false,\n "subcategory": "",\n "layoutSections": {},\n "updated": "",\n "footerHtml": "",\n "widgets": {},\n "headHtml": "",\n "pageExpiryRedirectUrl": "",\n "abStatus": "",\n "useFeaturedImage": false,\n "abTestId": "",\n "featuredImageAltText": "",\n "contentGroupId": "",\n "pageExpiryEnabled": false,\n "templatePath": "",\n "url": "",\n "publicAccessRules": [\n {}\n ],\n "archivedAt": "",\n "themeSettingsValues": {},\n "pageExpiryDate": 0,\n "publicAccessRulesEnabled": false,\n "pageRedirected": false,\n "currentState": "",\n "categoryId": 0,\n "linkRelCanonicalUrl": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"publishDate\": \"\",\n \"language\": \"\",\n \"enableLayoutStylesheets\": false,\n \"metaDescription\": \"\",\n \"attachedStylesheets\": [\n {}\n ],\n \"password\": \"\",\n \"publishImmediately\": false,\n \"htmlTitle\": \"\",\n \"translations\": {},\n \"id\": \"\",\n \"state\": \"\",\n \"slug\": \"\",\n \"createdById\": \"\",\n \"currentlyPublished\": false,\n \"archivedInDashboard\": false,\n \"created\": \"\",\n \"contentTypeCategory\": \"\",\n \"mabExperimentId\": \"\",\n \"updatedById\": \"\",\n \"translatedFromId\": \"\",\n \"folderId\": \"\",\n \"widgetContainers\": {},\n \"pageExpiryRedirectId\": 0,\n \"dynamicPageDataSourceType\": 0,\n \"featuredImage\": \"\",\n \"authorName\": \"\",\n \"domain\": \"\",\n \"name\": \"\",\n \"dynamicPageHubDbTableId\": \"\",\n \"campaign\": \"\",\n \"dynamicPageDataSourceId\": \"\",\n \"enableDomainStylesheets\": false,\n \"includeDefaultCustomCss\": false,\n \"subcategory\": \"\",\n \"layoutSections\": {},\n \"updated\": \"\",\n \"footerHtml\": \"\",\n \"widgets\": {},\n \"headHtml\": \"\",\n \"pageExpiryRedirectUrl\": \"\",\n \"abStatus\": \"\",\n \"useFeaturedImage\": false,\n \"abTestId\": \"\",\n \"featuredImageAltText\": \"\",\n \"contentGroupId\": \"\",\n \"pageExpiryEnabled\": false,\n \"templatePath\": \"\",\n \"url\": \"\",\n \"publicAccessRules\": [\n {}\n ],\n \"archivedAt\": \"\",\n \"themeSettingsValues\": {},\n \"pageExpiryDate\": 0,\n \"publicAccessRulesEnabled\": false,\n \"pageRedirected\": false,\n \"currentState\": \"\",\n \"categoryId\": 0,\n \"linkRelCanonicalUrl\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/draft")
.patch(body)
.addHeader("private-app-legacy", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PATCH',
hostname: 'example.com',
port: null,
path: '/baseUrl/cms/v3/pages/landing-pages/:objectId/draft',
headers: {
'private-app-legacy': '{{apiKey}}',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
publishDate: '',
language: '',
enableLayoutStylesheets: false,
metaDescription: '',
attachedStylesheets: [{}],
password: '',
publishImmediately: false,
htmlTitle: '',
translations: {},
id: '',
state: '',
slug: '',
createdById: '',
currentlyPublished: false,
archivedInDashboard: false,
created: '',
contentTypeCategory: '',
mabExperimentId: '',
updatedById: '',
translatedFromId: '',
folderId: '',
widgetContainers: {},
pageExpiryRedirectId: 0,
dynamicPageDataSourceType: 0,
featuredImage: '',
authorName: '',
domain: '',
name: '',
dynamicPageHubDbTableId: '',
campaign: '',
dynamicPageDataSourceId: '',
enableDomainStylesheets: false,
includeDefaultCustomCss: false,
subcategory: '',
layoutSections: {},
updated: '',
footerHtml: '',
widgets: {},
headHtml: '',
pageExpiryRedirectUrl: '',
abStatus: '',
useFeaturedImage: false,
abTestId: '',
featuredImageAltText: '',
contentGroupId: '',
pageExpiryEnabled: false,
templatePath: '',
url: '',
publicAccessRules: [{}],
archivedAt: '',
themeSettingsValues: {},
pageExpiryDate: 0,
publicAccessRulesEnabled: false,
pageRedirected: false,
currentState: '',
categoryId: 0,
linkRelCanonicalUrl: ''
}));
req.end();
const request = require('request');
const options = {
method: 'PATCH',
url: '{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/draft',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
body: {
publishDate: '',
language: '',
enableLayoutStylesheets: false,
metaDescription: '',
attachedStylesheets: [{}],
password: '',
publishImmediately: false,
htmlTitle: '',
translations: {},
id: '',
state: '',
slug: '',
createdById: '',
currentlyPublished: false,
archivedInDashboard: false,
created: '',
contentTypeCategory: '',
mabExperimentId: '',
updatedById: '',
translatedFromId: '',
folderId: '',
widgetContainers: {},
pageExpiryRedirectId: 0,
dynamicPageDataSourceType: 0,
featuredImage: '',
authorName: '',
domain: '',
name: '',
dynamicPageHubDbTableId: '',
campaign: '',
dynamicPageDataSourceId: '',
enableDomainStylesheets: false,
includeDefaultCustomCss: false,
subcategory: '',
layoutSections: {},
updated: '',
footerHtml: '',
widgets: {},
headHtml: '',
pageExpiryRedirectUrl: '',
abStatus: '',
useFeaturedImage: false,
abTestId: '',
featuredImageAltText: '',
contentGroupId: '',
pageExpiryEnabled: false,
templatePath: '',
url: '',
publicAccessRules: [{}],
archivedAt: '',
themeSettingsValues: {},
pageExpiryDate: 0,
publicAccessRulesEnabled: false,
pageRedirected: false,
currentState: '',
categoryId: 0,
linkRelCanonicalUrl: ''
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PATCH', '{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/draft');
req.headers({
'private-app-legacy': '{{apiKey}}',
'content-type': 'application/json'
});
req.type('json');
req.send({
publishDate: '',
language: '',
enableLayoutStylesheets: false,
metaDescription: '',
attachedStylesheets: [
{}
],
password: '',
publishImmediately: false,
htmlTitle: '',
translations: {},
id: '',
state: '',
slug: '',
createdById: '',
currentlyPublished: false,
archivedInDashboard: false,
created: '',
contentTypeCategory: '',
mabExperimentId: '',
updatedById: '',
translatedFromId: '',
folderId: '',
widgetContainers: {},
pageExpiryRedirectId: 0,
dynamicPageDataSourceType: 0,
featuredImage: '',
authorName: '',
domain: '',
name: '',
dynamicPageHubDbTableId: '',
campaign: '',
dynamicPageDataSourceId: '',
enableDomainStylesheets: false,
includeDefaultCustomCss: false,
subcategory: '',
layoutSections: {},
updated: '',
footerHtml: '',
widgets: {},
headHtml: '',
pageExpiryRedirectUrl: '',
abStatus: '',
useFeaturedImage: false,
abTestId: '',
featuredImageAltText: '',
contentGroupId: '',
pageExpiryEnabled: false,
templatePath: '',
url: '',
publicAccessRules: [
{}
],
archivedAt: '',
themeSettingsValues: {},
pageExpiryDate: 0,
publicAccessRulesEnabled: false,
pageRedirected: false,
currentState: '',
categoryId: 0,
linkRelCanonicalUrl: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'PATCH',
url: '{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/draft',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
data: {
publishDate: '',
language: '',
enableLayoutStylesheets: false,
metaDescription: '',
attachedStylesheets: [{}],
password: '',
publishImmediately: false,
htmlTitle: '',
translations: {},
id: '',
state: '',
slug: '',
createdById: '',
currentlyPublished: false,
archivedInDashboard: false,
created: '',
contentTypeCategory: '',
mabExperimentId: '',
updatedById: '',
translatedFromId: '',
folderId: '',
widgetContainers: {},
pageExpiryRedirectId: 0,
dynamicPageDataSourceType: 0,
featuredImage: '',
authorName: '',
domain: '',
name: '',
dynamicPageHubDbTableId: '',
campaign: '',
dynamicPageDataSourceId: '',
enableDomainStylesheets: false,
includeDefaultCustomCss: false,
subcategory: '',
layoutSections: {},
updated: '',
footerHtml: '',
widgets: {},
headHtml: '',
pageExpiryRedirectUrl: '',
abStatus: '',
useFeaturedImage: false,
abTestId: '',
featuredImageAltText: '',
contentGroupId: '',
pageExpiryEnabled: false,
templatePath: '',
url: '',
publicAccessRules: [{}],
archivedAt: '',
themeSettingsValues: {},
pageExpiryDate: 0,
publicAccessRulesEnabled: false,
pageRedirected: false,
currentState: '',
categoryId: 0,
linkRelCanonicalUrl: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/draft';
const options = {
method: 'PATCH',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
body: '{"publishDate":"","language":"","enableLayoutStylesheets":false,"metaDescription":"","attachedStylesheets":[{}],"password":"","publishImmediately":false,"htmlTitle":"","translations":{},"id":"","state":"","slug":"","createdById":"","currentlyPublished":false,"archivedInDashboard":false,"created":"","contentTypeCategory":"","mabExperimentId":"","updatedById":"","translatedFromId":"","folderId":"","widgetContainers":{},"pageExpiryRedirectId":0,"dynamicPageDataSourceType":0,"featuredImage":"","authorName":"","domain":"","name":"","dynamicPageHubDbTableId":"","campaign":"","dynamicPageDataSourceId":"","enableDomainStylesheets":false,"includeDefaultCustomCss":false,"subcategory":"","layoutSections":{},"updated":"","footerHtml":"","widgets":{},"headHtml":"","pageExpiryRedirectUrl":"","abStatus":"","useFeaturedImage":false,"abTestId":"","featuredImageAltText":"","contentGroupId":"","pageExpiryEnabled":false,"templatePath":"","url":"","publicAccessRules":[{}],"archivedAt":"","themeSettingsValues":{},"pageExpiryDate":0,"publicAccessRulesEnabled":false,"pageRedirected":false,"currentState":"","categoryId":0,"linkRelCanonicalUrl":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"private-app-legacy": @"{{apiKey}}",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"publishDate": @"",
@"language": @"",
@"enableLayoutStylesheets": @NO,
@"metaDescription": @"",
@"attachedStylesheets": @[ @{ } ],
@"password": @"",
@"publishImmediately": @NO,
@"htmlTitle": @"",
@"translations": @{ },
@"id": @"",
@"state": @"",
@"slug": @"",
@"createdById": @"",
@"currentlyPublished": @NO,
@"archivedInDashboard": @NO,
@"created": @"",
@"contentTypeCategory": @"",
@"mabExperimentId": @"",
@"updatedById": @"",
@"translatedFromId": @"",
@"folderId": @"",
@"widgetContainers": @{ },
@"pageExpiryRedirectId": @0,
@"dynamicPageDataSourceType": @0,
@"featuredImage": @"",
@"authorName": @"",
@"domain": @"",
@"name": @"",
@"dynamicPageHubDbTableId": @"",
@"campaign": @"",
@"dynamicPageDataSourceId": @"",
@"enableDomainStylesheets": @NO,
@"includeDefaultCustomCss": @NO,
@"subcategory": @"",
@"layoutSections": @{ },
@"updated": @"",
@"footerHtml": @"",
@"widgets": @{ },
@"headHtml": @"",
@"pageExpiryRedirectUrl": @"",
@"abStatus": @"",
@"useFeaturedImage": @NO,
@"abTestId": @"",
@"featuredImageAltText": @"",
@"contentGroupId": @"",
@"pageExpiryEnabled": @NO,
@"templatePath": @"",
@"url": @"",
@"publicAccessRules": @[ @{ } ],
@"archivedAt": @"",
@"themeSettingsValues": @{ },
@"pageExpiryDate": @0,
@"publicAccessRulesEnabled": @NO,
@"pageRedirected": @NO,
@"currentState": @"",
@"categoryId": @0,
@"linkRelCanonicalUrl": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/draft"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PATCH"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/draft" in
let headers = Header.add_list (Header.init ()) [
("private-app-legacy", "{{apiKey}}");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"publishDate\": \"\",\n \"language\": \"\",\n \"enableLayoutStylesheets\": false,\n \"metaDescription\": \"\",\n \"attachedStylesheets\": [\n {}\n ],\n \"password\": \"\",\n \"publishImmediately\": false,\n \"htmlTitle\": \"\",\n \"translations\": {},\n \"id\": \"\",\n \"state\": \"\",\n \"slug\": \"\",\n \"createdById\": \"\",\n \"currentlyPublished\": false,\n \"archivedInDashboard\": false,\n \"created\": \"\",\n \"contentTypeCategory\": \"\",\n \"mabExperimentId\": \"\",\n \"updatedById\": \"\",\n \"translatedFromId\": \"\",\n \"folderId\": \"\",\n \"widgetContainers\": {},\n \"pageExpiryRedirectId\": 0,\n \"dynamicPageDataSourceType\": 0,\n \"featuredImage\": \"\",\n \"authorName\": \"\",\n \"domain\": \"\",\n \"name\": \"\",\n \"dynamicPageHubDbTableId\": \"\",\n \"campaign\": \"\",\n \"dynamicPageDataSourceId\": \"\",\n \"enableDomainStylesheets\": false,\n \"includeDefaultCustomCss\": false,\n \"subcategory\": \"\",\n \"layoutSections\": {},\n \"updated\": \"\",\n \"footerHtml\": \"\",\n \"widgets\": {},\n \"headHtml\": \"\",\n \"pageExpiryRedirectUrl\": \"\",\n \"abStatus\": \"\",\n \"useFeaturedImage\": false,\n \"abTestId\": \"\",\n \"featuredImageAltText\": \"\",\n \"contentGroupId\": \"\",\n \"pageExpiryEnabled\": false,\n \"templatePath\": \"\",\n \"url\": \"\",\n \"publicAccessRules\": [\n {}\n ],\n \"archivedAt\": \"\",\n \"themeSettingsValues\": {},\n \"pageExpiryDate\": 0,\n \"publicAccessRulesEnabled\": false,\n \"pageRedirected\": false,\n \"currentState\": \"\",\n \"categoryId\": 0,\n \"linkRelCanonicalUrl\": \"\"\n}" in
Client.call ~headers ~body `PATCH uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/draft",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'publishDate' => '',
'language' => '',
'enableLayoutStylesheets' => null,
'metaDescription' => '',
'attachedStylesheets' => [
[
]
],
'password' => '',
'publishImmediately' => null,
'htmlTitle' => '',
'translations' => [
],
'id' => '',
'state' => '',
'slug' => '',
'createdById' => '',
'currentlyPublished' => null,
'archivedInDashboard' => null,
'created' => '',
'contentTypeCategory' => '',
'mabExperimentId' => '',
'updatedById' => '',
'translatedFromId' => '',
'folderId' => '',
'widgetContainers' => [
],
'pageExpiryRedirectId' => 0,
'dynamicPageDataSourceType' => 0,
'featuredImage' => '',
'authorName' => '',
'domain' => '',
'name' => '',
'dynamicPageHubDbTableId' => '',
'campaign' => '',
'dynamicPageDataSourceId' => '',
'enableDomainStylesheets' => null,
'includeDefaultCustomCss' => null,
'subcategory' => '',
'layoutSections' => [
],
'updated' => '',
'footerHtml' => '',
'widgets' => [
],
'headHtml' => '',
'pageExpiryRedirectUrl' => '',
'abStatus' => '',
'useFeaturedImage' => null,
'abTestId' => '',
'featuredImageAltText' => '',
'contentGroupId' => '',
'pageExpiryEnabled' => null,
'templatePath' => '',
'url' => '',
'publicAccessRules' => [
[
]
],
'archivedAt' => '',
'themeSettingsValues' => [
],
'pageExpiryDate' => 0,
'publicAccessRulesEnabled' => null,
'pageRedirected' => null,
'currentState' => '',
'categoryId' => 0,
'linkRelCanonicalUrl' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"private-app-legacy: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('PATCH', '{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/draft', [
'body' => '{
"publishDate": "",
"language": "",
"enableLayoutStylesheets": false,
"metaDescription": "",
"attachedStylesheets": [
{}
],
"password": "",
"publishImmediately": false,
"htmlTitle": "",
"translations": {},
"id": "",
"state": "",
"slug": "",
"createdById": "",
"currentlyPublished": false,
"archivedInDashboard": false,
"created": "",
"contentTypeCategory": "",
"mabExperimentId": "",
"updatedById": "",
"translatedFromId": "",
"folderId": "",
"widgetContainers": {},
"pageExpiryRedirectId": 0,
"dynamicPageDataSourceType": 0,
"featuredImage": "",
"authorName": "",
"domain": "",
"name": "",
"dynamicPageHubDbTableId": "",
"campaign": "",
"dynamicPageDataSourceId": "",
"enableDomainStylesheets": false,
"includeDefaultCustomCss": false,
"subcategory": "",
"layoutSections": {},
"updated": "",
"footerHtml": "",
"widgets": {},
"headHtml": "",
"pageExpiryRedirectUrl": "",
"abStatus": "",
"useFeaturedImage": false,
"abTestId": "",
"featuredImageAltText": "",
"contentGroupId": "",
"pageExpiryEnabled": false,
"templatePath": "",
"url": "",
"publicAccessRules": [
{}
],
"archivedAt": "",
"themeSettingsValues": {},
"pageExpiryDate": 0,
"publicAccessRulesEnabled": false,
"pageRedirected": false,
"currentState": "",
"categoryId": 0,
"linkRelCanonicalUrl": ""
}',
'headers' => [
'content-type' => 'application/json',
'private-app-legacy' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/draft');
$request->setMethod(HttpRequest::HTTP_METH_PATCH);
$request->setHeaders([
'private-app-legacy' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'publishDate' => '',
'language' => '',
'enableLayoutStylesheets' => null,
'metaDescription' => '',
'attachedStylesheets' => [
[
]
],
'password' => '',
'publishImmediately' => null,
'htmlTitle' => '',
'translations' => [
],
'id' => '',
'state' => '',
'slug' => '',
'createdById' => '',
'currentlyPublished' => null,
'archivedInDashboard' => null,
'created' => '',
'contentTypeCategory' => '',
'mabExperimentId' => '',
'updatedById' => '',
'translatedFromId' => '',
'folderId' => '',
'widgetContainers' => [
],
'pageExpiryRedirectId' => 0,
'dynamicPageDataSourceType' => 0,
'featuredImage' => '',
'authorName' => '',
'domain' => '',
'name' => '',
'dynamicPageHubDbTableId' => '',
'campaign' => '',
'dynamicPageDataSourceId' => '',
'enableDomainStylesheets' => null,
'includeDefaultCustomCss' => null,
'subcategory' => '',
'layoutSections' => [
],
'updated' => '',
'footerHtml' => '',
'widgets' => [
],
'headHtml' => '',
'pageExpiryRedirectUrl' => '',
'abStatus' => '',
'useFeaturedImage' => null,
'abTestId' => '',
'featuredImageAltText' => '',
'contentGroupId' => '',
'pageExpiryEnabled' => null,
'templatePath' => '',
'url' => '',
'publicAccessRules' => [
[
]
],
'archivedAt' => '',
'themeSettingsValues' => [
],
'pageExpiryDate' => 0,
'publicAccessRulesEnabled' => null,
'pageRedirected' => null,
'currentState' => '',
'categoryId' => 0,
'linkRelCanonicalUrl' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'publishDate' => '',
'language' => '',
'enableLayoutStylesheets' => null,
'metaDescription' => '',
'attachedStylesheets' => [
[
]
],
'password' => '',
'publishImmediately' => null,
'htmlTitle' => '',
'translations' => [
],
'id' => '',
'state' => '',
'slug' => '',
'createdById' => '',
'currentlyPublished' => null,
'archivedInDashboard' => null,
'created' => '',
'contentTypeCategory' => '',
'mabExperimentId' => '',
'updatedById' => '',
'translatedFromId' => '',
'folderId' => '',
'widgetContainers' => [
],
'pageExpiryRedirectId' => 0,
'dynamicPageDataSourceType' => 0,
'featuredImage' => '',
'authorName' => '',
'domain' => '',
'name' => '',
'dynamicPageHubDbTableId' => '',
'campaign' => '',
'dynamicPageDataSourceId' => '',
'enableDomainStylesheets' => null,
'includeDefaultCustomCss' => null,
'subcategory' => '',
'layoutSections' => [
],
'updated' => '',
'footerHtml' => '',
'widgets' => [
],
'headHtml' => '',
'pageExpiryRedirectUrl' => '',
'abStatus' => '',
'useFeaturedImage' => null,
'abTestId' => '',
'featuredImageAltText' => '',
'contentGroupId' => '',
'pageExpiryEnabled' => null,
'templatePath' => '',
'url' => '',
'publicAccessRules' => [
[
]
],
'archivedAt' => '',
'themeSettingsValues' => [
],
'pageExpiryDate' => 0,
'publicAccessRulesEnabled' => null,
'pageRedirected' => null,
'currentState' => '',
'categoryId' => 0,
'linkRelCanonicalUrl' => ''
]));
$request->setRequestUrl('{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/draft');
$request->setRequestMethod('PATCH');
$request->setBody($body);
$request->setHeaders([
'private-app-legacy' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("private-app-legacy", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/draft' -Method PATCH -Headers $headers -ContentType 'application/json' -Body '{
"publishDate": "",
"language": "",
"enableLayoutStylesheets": false,
"metaDescription": "",
"attachedStylesheets": [
{}
],
"password": "",
"publishImmediately": false,
"htmlTitle": "",
"translations": {},
"id": "",
"state": "",
"slug": "",
"createdById": "",
"currentlyPublished": false,
"archivedInDashboard": false,
"created": "",
"contentTypeCategory": "",
"mabExperimentId": "",
"updatedById": "",
"translatedFromId": "",
"folderId": "",
"widgetContainers": {},
"pageExpiryRedirectId": 0,
"dynamicPageDataSourceType": 0,
"featuredImage": "",
"authorName": "",
"domain": "",
"name": "",
"dynamicPageHubDbTableId": "",
"campaign": "",
"dynamicPageDataSourceId": "",
"enableDomainStylesheets": false,
"includeDefaultCustomCss": false,
"subcategory": "",
"layoutSections": {},
"updated": "",
"footerHtml": "",
"widgets": {},
"headHtml": "",
"pageExpiryRedirectUrl": "",
"abStatus": "",
"useFeaturedImage": false,
"abTestId": "",
"featuredImageAltText": "",
"contentGroupId": "",
"pageExpiryEnabled": false,
"templatePath": "",
"url": "",
"publicAccessRules": [
{}
],
"archivedAt": "",
"themeSettingsValues": {},
"pageExpiryDate": 0,
"publicAccessRulesEnabled": false,
"pageRedirected": false,
"currentState": "",
"categoryId": 0,
"linkRelCanonicalUrl": ""
}'
$headers=@{}
$headers.Add("private-app-legacy", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/draft' -Method PATCH -Headers $headers -ContentType 'application/json' -Body '{
"publishDate": "",
"language": "",
"enableLayoutStylesheets": false,
"metaDescription": "",
"attachedStylesheets": [
{}
],
"password": "",
"publishImmediately": false,
"htmlTitle": "",
"translations": {},
"id": "",
"state": "",
"slug": "",
"createdById": "",
"currentlyPublished": false,
"archivedInDashboard": false,
"created": "",
"contentTypeCategory": "",
"mabExperimentId": "",
"updatedById": "",
"translatedFromId": "",
"folderId": "",
"widgetContainers": {},
"pageExpiryRedirectId": 0,
"dynamicPageDataSourceType": 0,
"featuredImage": "",
"authorName": "",
"domain": "",
"name": "",
"dynamicPageHubDbTableId": "",
"campaign": "",
"dynamicPageDataSourceId": "",
"enableDomainStylesheets": false,
"includeDefaultCustomCss": false,
"subcategory": "",
"layoutSections": {},
"updated": "",
"footerHtml": "",
"widgets": {},
"headHtml": "",
"pageExpiryRedirectUrl": "",
"abStatus": "",
"useFeaturedImage": false,
"abTestId": "",
"featuredImageAltText": "",
"contentGroupId": "",
"pageExpiryEnabled": false,
"templatePath": "",
"url": "",
"publicAccessRules": [
{}
],
"archivedAt": "",
"themeSettingsValues": {},
"pageExpiryDate": 0,
"publicAccessRulesEnabled": false,
"pageRedirected": false,
"currentState": "",
"categoryId": 0,
"linkRelCanonicalUrl": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"publishDate\": \"\",\n \"language\": \"\",\n \"enableLayoutStylesheets\": false,\n \"metaDescription\": \"\",\n \"attachedStylesheets\": [\n {}\n ],\n \"password\": \"\",\n \"publishImmediately\": false,\n \"htmlTitle\": \"\",\n \"translations\": {},\n \"id\": \"\",\n \"state\": \"\",\n \"slug\": \"\",\n \"createdById\": \"\",\n \"currentlyPublished\": false,\n \"archivedInDashboard\": false,\n \"created\": \"\",\n \"contentTypeCategory\": \"\",\n \"mabExperimentId\": \"\",\n \"updatedById\": \"\",\n \"translatedFromId\": \"\",\n \"folderId\": \"\",\n \"widgetContainers\": {},\n \"pageExpiryRedirectId\": 0,\n \"dynamicPageDataSourceType\": 0,\n \"featuredImage\": \"\",\n \"authorName\": \"\",\n \"domain\": \"\",\n \"name\": \"\",\n \"dynamicPageHubDbTableId\": \"\",\n \"campaign\": \"\",\n \"dynamicPageDataSourceId\": \"\",\n \"enableDomainStylesheets\": false,\n \"includeDefaultCustomCss\": false,\n \"subcategory\": \"\",\n \"layoutSections\": {},\n \"updated\": \"\",\n \"footerHtml\": \"\",\n \"widgets\": {},\n \"headHtml\": \"\",\n \"pageExpiryRedirectUrl\": \"\",\n \"abStatus\": \"\",\n \"useFeaturedImage\": false,\n \"abTestId\": \"\",\n \"featuredImageAltText\": \"\",\n \"contentGroupId\": \"\",\n \"pageExpiryEnabled\": false,\n \"templatePath\": \"\",\n \"url\": \"\",\n \"publicAccessRules\": [\n {}\n ],\n \"archivedAt\": \"\",\n \"themeSettingsValues\": {},\n \"pageExpiryDate\": 0,\n \"publicAccessRulesEnabled\": false,\n \"pageRedirected\": false,\n \"currentState\": \"\",\n \"categoryId\": 0,\n \"linkRelCanonicalUrl\": \"\"\n}"
headers = {
'private-app-legacy': "{{apiKey}}",
'content-type': "application/json"
}
conn.request("PATCH", "/baseUrl/cms/v3/pages/landing-pages/:objectId/draft", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/draft"
payload = {
"publishDate": "",
"language": "",
"enableLayoutStylesheets": False,
"metaDescription": "",
"attachedStylesheets": [{}],
"password": "",
"publishImmediately": False,
"htmlTitle": "",
"translations": {},
"id": "",
"state": "",
"slug": "",
"createdById": "",
"currentlyPublished": False,
"archivedInDashboard": False,
"created": "",
"contentTypeCategory": "",
"mabExperimentId": "",
"updatedById": "",
"translatedFromId": "",
"folderId": "",
"widgetContainers": {},
"pageExpiryRedirectId": 0,
"dynamicPageDataSourceType": 0,
"featuredImage": "",
"authorName": "",
"domain": "",
"name": "",
"dynamicPageHubDbTableId": "",
"campaign": "",
"dynamicPageDataSourceId": "",
"enableDomainStylesheets": False,
"includeDefaultCustomCss": False,
"subcategory": "",
"layoutSections": {},
"updated": "",
"footerHtml": "",
"widgets": {},
"headHtml": "",
"pageExpiryRedirectUrl": "",
"abStatus": "",
"useFeaturedImage": False,
"abTestId": "",
"featuredImageAltText": "",
"contentGroupId": "",
"pageExpiryEnabled": False,
"templatePath": "",
"url": "",
"publicAccessRules": [{}],
"archivedAt": "",
"themeSettingsValues": {},
"pageExpiryDate": 0,
"publicAccessRulesEnabled": False,
"pageRedirected": False,
"currentState": "",
"categoryId": 0,
"linkRelCanonicalUrl": ""
}
headers = {
"private-app-legacy": "{{apiKey}}",
"content-type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/draft"
payload <- "{\n \"publishDate\": \"\",\n \"language\": \"\",\n \"enableLayoutStylesheets\": false,\n \"metaDescription\": \"\",\n \"attachedStylesheets\": [\n {}\n ],\n \"password\": \"\",\n \"publishImmediately\": false,\n \"htmlTitle\": \"\",\n \"translations\": {},\n \"id\": \"\",\n \"state\": \"\",\n \"slug\": \"\",\n \"createdById\": \"\",\n \"currentlyPublished\": false,\n \"archivedInDashboard\": false,\n \"created\": \"\",\n \"contentTypeCategory\": \"\",\n \"mabExperimentId\": \"\",\n \"updatedById\": \"\",\n \"translatedFromId\": \"\",\n \"folderId\": \"\",\n \"widgetContainers\": {},\n \"pageExpiryRedirectId\": 0,\n \"dynamicPageDataSourceType\": 0,\n \"featuredImage\": \"\",\n \"authorName\": \"\",\n \"domain\": \"\",\n \"name\": \"\",\n \"dynamicPageHubDbTableId\": \"\",\n \"campaign\": \"\",\n \"dynamicPageDataSourceId\": \"\",\n \"enableDomainStylesheets\": false,\n \"includeDefaultCustomCss\": false,\n \"subcategory\": \"\",\n \"layoutSections\": {},\n \"updated\": \"\",\n \"footerHtml\": \"\",\n \"widgets\": {},\n \"headHtml\": \"\",\n \"pageExpiryRedirectUrl\": \"\",\n \"abStatus\": \"\",\n \"useFeaturedImage\": false,\n \"abTestId\": \"\",\n \"featuredImageAltText\": \"\",\n \"contentGroupId\": \"\",\n \"pageExpiryEnabled\": false,\n \"templatePath\": \"\",\n \"url\": \"\",\n \"publicAccessRules\": [\n {}\n ],\n \"archivedAt\": \"\",\n \"themeSettingsValues\": {},\n \"pageExpiryDate\": 0,\n \"publicAccessRulesEnabled\": false,\n \"pageRedirected\": false,\n \"currentState\": \"\",\n \"categoryId\": 0,\n \"linkRelCanonicalUrl\": \"\"\n}"
encode <- "json"
response <- VERB("PATCH", url, body = payload, add_headers('private-app-legacy' = '{{apiKey}}'), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/draft")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["private-app-legacy"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n \"publishDate\": \"\",\n \"language\": \"\",\n \"enableLayoutStylesheets\": false,\n \"metaDescription\": \"\",\n \"attachedStylesheets\": [\n {}\n ],\n \"password\": \"\",\n \"publishImmediately\": false,\n \"htmlTitle\": \"\",\n \"translations\": {},\n \"id\": \"\",\n \"state\": \"\",\n \"slug\": \"\",\n \"createdById\": \"\",\n \"currentlyPublished\": false,\n \"archivedInDashboard\": false,\n \"created\": \"\",\n \"contentTypeCategory\": \"\",\n \"mabExperimentId\": \"\",\n \"updatedById\": \"\",\n \"translatedFromId\": \"\",\n \"folderId\": \"\",\n \"widgetContainers\": {},\n \"pageExpiryRedirectId\": 0,\n \"dynamicPageDataSourceType\": 0,\n \"featuredImage\": \"\",\n \"authorName\": \"\",\n \"domain\": \"\",\n \"name\": \"\",\n \"dynamicPageHubDbTableId\": \"\",\n \"campaign\": \"\",\n \"dynamicPageDataSourceId\": \"\",\n \"enableDomainStylesheets\": false,\n \"includeDefaultCustomCss\": false,\n \"subcategory\": \"\",\n \"layoutSections\": {},\n \"updated\": \"\",\n \"footerHtml\": \"\",\n \"widgets\": {},\n \"headHtml\": \"\",\n \"pageExpiryRedirectUrl\": \"\",\n \"abStatus\": \"\",\n \"useFeaturedImage\": false,\n \"abTestId\": \"\",\n \"featuredImageAltText\": \"\",\n \"contentGroupId\": \"\",\n \"pageExpiryEnabled\": false,\n \"templatePath\": \"\",\n \"url\": \"\",\n \"publicAccessRules\": [\n {}\n ],\n \"archivedAt\": \"\",\n \"themeSettingsValues\": {},\n \"pageExpiryDate\": 0,\n \"publicAccessRulesEnabled\": false,\n \"pageRedirected\": false,\n \"currentState\": \"\",\n \"categoryId\": 0,\n \"linkRelCanonicalUrl\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.patch('/baseUrl/cms/v3/pages/landing-pages/:objectId/draft') do |req|
req.headers['private-app-legacy'] = '{{apiKey}}'
req.body = "{\n \"publishDate\": \"\",\n \"language\": \"\",\n \"enableLayoutStylesheets\": false,\n \"metaDescription\": \"\",\n \"attachedStylesheets\": [\n {}\n ],\n \"password\": \"\",\n \"publishImmediately\": false,\n \"htmlTitle\": \"\",\n \"translations\": {},\n \"id\": \"\",\n \"state\": \"\",\n \"slug\": \"\",\n \"createdById\": \"\",\n \"currentlyPublished\": false,\n \"archivedInDashboard\": false,\n \"created\": \"\",\n \"contentTypeCategory\": \"\",\n \"mabExperimentId\": \"\",\n \"updatedById\": \"\",\n \"translatedFromId\": \"\",\n \"folderId\": \"\",\n \"widgetContainers\": {},\n \"pageExpiryRedirectId\": 0,\n \"dynamicPageDataSourceType\": 0,\n \"featuredImage\": \"\",\n \"authorName\": \"\",\n \"domain\": \"\",\n \"name\": \"\",\n \"dynamicPageHubDbTableId\": \"\",\n \"campaign\": \"\",\n \"dynamicPageDataSourceId\": \"\",\n \"enableDomainStylesheets\": false,\n \"includeDefaultCustomCss\": false,\n \"subcategory\": \"\",\n \"layoutSections\": {},\n \"updated\": \"\",\n \"footerHtml\": \"\",\n \"widgets\": {},\n \"headHtml\": \"\",\n \"pageExpiryRedirectUrl\": \"\",\n \"abStatus\": \"\",\n \"useFeaturedImage\": false,\n \"abTestId\": \"\",\n \"featuredImageAltText\": \"\",\n \"contentGroupId\": \"\",\n \"pageExpiryEnabled\": false,\n \"templatePath\": \"\",\n \"url\": \"\",\n \"publicAccessRules\": [\n {}\n ],\n \"archivedAt\": \"\",\n \"themeSettingsValues\": {},\n \"pageExpiryDate\": 0,\n \"publicAccessRulesEnabled\": false,\n \"pageRedirected\": false,\n \"currentState\": \"\",\n \"categoryId\": 0,\n \"linkRelCanonicalUrl\": \"\"\n}"
end
puts response.status
puts response.body
use std::str::FromStr;
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/draft";
let payload = json!({
"publishDate": "",
"language": "",
"enableLayoutStylesheets": false,
"metaDescription": "",
"attachedStylesheets": (json!({})),
"password": "",
"publishImmediately": false,
"htmlTitle": "",
"translations": json!({}),
"id": "",
"state": "",
"slug": "",
"createdById": "",
"currentlyPublished": false,
"archivedInDashboard": false,
"created": "",
"contentTypeCategory": "",
"mabExperimentId": "",
"updatedById": "",
"translatedFromId": "",
"folderId": "",
"widgetContainers": json!({}),
"pageExpiryRedirectId": 0,
"dynamicPageDataSourceType": 0,
"featuredImage": "",
"authorName": "",
"domain": "",
"name": "",
"dynamicPageHubDbTableId": "",
"campaign": "",
"dynamicPageDataSourceId": "",
"enableDomainStylesheets": false,
"includeDefaultCustomCss": false,
"subcategory": "",
"layoutSections": json!({}),
"updated": "",
"footerHtml": "",
"widgets": json!({}),
"headHtml": "",
"pageExpiryRedirectUrl": "",
"abStatus": "",
"useFeaturedImage": false,
"abTestId": "",
"featuredImageAltText": "",
"contentGroupId": "",
"pageExpiryEnabled": false,
"templatePath": "",
"url": "",
"publicAccessRules": (json!({})),
"archivedAt": "",
"themeSettingsValues": json!({}),
"pageExpiryDate": 0,
"publicAccessRulesEnabled": false,
"pageRedirected": false,
"currentState": "",
"categoryId": 0,
"linkRelCanonicalUrl": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("private-app-legacy", "{{apiKey}}".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PATCH").unwrap(), url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PATCH \
--url {{baseUrl}}/cms/v3/pages/landing-pages/:objectId/draft \
--header 'content-type: application/json' \
--header 'private-app-legacy: {{apiKey}}' \
--data '{
"publishDate": "",
"language": "",
"enableLayoutStylesheets": false,
"metaDescription": "",
"attachedStylesheets": [
{}
],
"password": "",
"publishImmediately": false,
"htmlTitle": "",
"translations": {},
"id": "",
"state": "",
"slug": "",
"createdById": "",
"currentlyPublished": false,
"archivedInDashboard": false,
"created": "",
"contentTypeCategory": "",
"mabExperimentId": "",
"updatedById": "",
"translatedFromId": "",
"folderId": "",
"widgetContainers": {},
"pageExpiryRedirectId": 0,
"dynamicPageDataSourceType": 0,
"featuredImage": "",
"authorName": "",
"domain": "",
"name": "",
"dynamicPageHubDbTableId": "",
"campaign": "",
"dynamicPageDataSourceId": "",
"enableDomainStylesheets": false,
"includeDefaultCustomCss": false,
"subcategory": "",
"layoutSections": {},
"updated": "",
"footerHtml": "",
"widgets": {},
"headHtml": "",
"pageExpiryRedirectUrl": "",
"abStatus": "",
"useFeaturedImage": false,
"abTestId": "",
"featuredImageAltText": "",
"contentGroupId": "",
"pageExpiryEnabled": false,
"templatePath": "",
"url": "",
"publicAccessRules": [
{}
],
"archivedAt": "",
"themeSettingsValues": {},
"pageExpiryDate": 0,
"publicAccessRulesEnabled": false,
"pageRedirected": false,
"currentState": "",
"categoryId": 0,
"linkRelCanonicalUrl": ""
}'
echo '{
"publishDate": "",
"language": "",
"enableLayoutStylesheets": false,
"metaDescription": "",
"attachedStylesheets": [
{}
],
"password": "",
"publishImmediately": false,
"htmlTitle": "",
"translations": {},
"id": "",
"state": "",
"slug": "",
"createdById": "",
"currentlyPublished": false,
"archivedInDashboard": false,
"created": "",
"contentTypeCategory": "",
"mabExperimentId": "",
"updatedById": "",
"translatedFromId": "",
"folderId": "",
"widgetContainers": {},
"pageExpiryRedirectId": 0,
"dynamicPageDataSourceType": 0,
"featuredImage": "",
"authorName": "",
"domain": "",
"name": "",
"dynamicPageHubDbTableId": "",
"campaign": "",
"dynamicPageDataSourceId": "",
"enableDomainStylesheets": false,
"includeDefaultCustomCss": false,
"subcategory": "",
"layoutSections": {},
"updated": "",
"footerHtml": "",
"widgets": {},
"headHtml": "",
"pageExpiryRedirectUrl": "",
"abStatus": "",
"useFeaturedImage": false,
"abTestId": "",
"featuredImageAltText": "",
"contentGroupId": "",
"pageExpiryEnabled": false,
"templatePath": "",
"url": "",
"publicAccessRules": [
{}
],
"archivedAt": "",
"themeSettingsValues": {},
"pageExpiryDate": 0,
"publicAccessRulesEnabled": false,
"pageRedirected": false,
"currentState": "",
"categoryId": 0,
"linkRelCanonicalUrl": ""
}' | \
http PATCH {{baseUrl}}/cms/v3/pages/landing-pages/:objectId/draft \
content-type:application/json \
private-app-legacy:'{{apiKey}}'
wget --quiet \
--method PATCH \
--header 'private-app-legacy: {{apiKey}}' \
--header 'content-type: application/json' \
--body-data '{\n "publishDate": "",\n "language": "",\n "enableLayoutStylesheets": false,\n "metaDescription": "",\n "attachedStylesheets": [\n {}\n ],\n "password": "",\n "publishImmediately": false,\n "htmlTitle": "",\n "translations": {},\n "id": "",\n "state": "",\n "slug": "",\n "createdById": "",\n "currentlyPublished": false,\n "archivedInDashboard": false,\n "created": "",\n "contentTypeCategory": "",\n "mabExperimentId": "",\n "updatedById": "",\n "translatedFromId": "",\n "folderId": "",\n "widgetContainers": {},\n "pageExpiryRedirectId": 0,\n "dynamicPageDataSourceType": 0,\n "featuredImage": "",\n "authorName": "",\n "domain": "",\n "name": "",\n "dynamicPageHubDbTableId": "",\n "campaign": "",\n "dynamicPageDataSourceId": "",\n "enableDomainStylesheets": false,\n "includeDefaultCustomCss": false,\n "subcategory": "",\n "layoutSections": {},\n "updated": "",\n "footerHtml": "",\n "widgets": {},\n "headHtml": "",\n "pageExpiryRedirectUrl": "",\n "abStatus": "",\n "useFeaturedImage": false,\n "abTestId": "",\n "featuredImageAltText": "",\n "contentGroupId": "",\n "pageExpiryEnabled": false,\n "templatePath": "",\n "url": "",\n "publicAccessRules": [\n {}\n ],\n "archivedAt": "",\n "themeSettingsValues": {},\n "pageExpiryDate": 0,\n "publicAccessRulesEnabled": false,\n "pageRedirected": false,\n "currentState": "",\n "categoryId": 0,\n "linkRelCanonicalUrl": ""\n}' \
--output-document \
- {{baseUrl}}/cms/v3/pages/landing-pages/:objectId/draft
import Foundation
let headers = [
"private-app-legacy": "{{apiKey}}",
"content-type": "application/json"
]
let parameters = [
"publishDate": "",
"language": "",
"enableLayoutStylesheets": false,
"metaDescription": "",
"attachedStylesheets": [[]],
"password": "",
"publishImmediately": false,
"htmlTitle": "",
"translations": [],
"id": "",
"state": "",
"slug": "",
"createdById": "",
"currentlyPublished": false,
"archivedInDashboard": false,
"created": "",
"contentTypeCategory": "",
"mabExperimentId": "",
"updatedById": "",
"translatedFromId": "",
"folderId": "",
"widgetContainers": [],
"pageExpiryRedirectId": 0,
"dynamicPageDataSourceType": 0,
"featuredImage": "",
"authorName": "",
"domain": "",
"name": "",
"dynamicPageHubDbTableId": "",
"campaign": "",
"dynamicPageDataSourceId": "",
"enableDomainStylesheets": false,
"includeDefaultCustomCss": false,
"subcategory": "",
"layoutSections": [],
"updated": "",
"footerHtml": "",
"widgets": [],
"headHtml": "",
"pageExpiryRedirectUrl": "",
"abStatus": "",
"useFeaturedImage": false,
"abTestId": "",
"featuredImageAltText": "",
"contentGroupId": "",
"pageExpiryEnabled": false,
"templatePath": "",
"url": "",
"publicAccessRules": [[]],
"archivedAt": "",
"themeSettingsValues": [],
"pageExpiryDate": 0,
"publicAccessRulesEnabled": false,
"pageRedirected": false,
"currentState": "",
"categoryId": 0,
"linkRelCanonicalUrl": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/cms/v3/pages/landing-pages/:objectId/draft")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PATCH"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
*/*
RESPONSE BODY text
{
"message": "Invalid input (details will vary based on the error)",
"correlationId": "aeb5f871-7f07-4993-9211-075dc63e7cbf",
"category": "VALIDATION_ERROR",
"links": {
"knowledge-base": "https://www.hubspot.com/products/service/knowledge-base"
}
}
PATCH
Update a Landing Page
{{baseUrl}}/cms/v3/pages/landing-pages/:objectId
HEADERS
private-app-legacy
{{apiKey}}
QUERY PARAMS
objectId
BODY json
{
"publishDate": "",
"language": "",
"enableLayoutStylesheets": false,
"metaDescription": "",
"attachedStylesheets": [
{}
],
"password": "",
"publishImmediately": false,
"htmlTitle": "",
"translations": {},
"id": "",
"state": "",
"slug": "",
"createdById": "",
"currentlyPublished": false,
"archivedInDashboard": false,
"created": "",
"contentTypeCategory": "",
"mabExperimentId": "",
"updatedById": "",
"translatedFromId": "",
"folderId": "",
"widgetContainers": {},
"pageExpiryRedirectId": 0,
"dynamicPageDataSourceType": 0,
"featuredImage": "",
"authorName": "",
"domain": "",
"name": "",
"dynamicPageHubDbTableId": "",
"campaign": "",
"dynamicPageDataSourceId": "",
"enableDomainStylesheets": false,
"includeDefaultCustomCss": false,
"subcategory": "",
"layoutSections": {},
"updated": "",
"footerHtml": "",
"widgets": {},
"headHtml": "",
"pageExpiryRedirectUrl": "",
"abStatus": "",
"useFeaturedImage": false,
"abTestId": "",
"featuredImageAltText": "",
"contentGroupId": "",
"pageExpiryEnabled": false,
"templatePath": "",
"url": "",
"publicAccessRules": [
{}
],
"archivedAt": "",
"themeSettingsValues": {},
"pageExpiryDate": 0,
"publicAccessRulesEnabled": false,
"pageRedirected": false,
"currentState": "",
"categoryId": 0,
"linkRelCanonicalUrl": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PATCH");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/cms/v3/pages/landing-pages/:objectId");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "private-app-legacy: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"publishDate\": \"\",\n \"language\": \"\",\n \"enableLayoutStylesheets\": false,\n \"metaDescription\": \"\",\n \"attachedStylesheets\": [\n {}\n ],\n \"password\": \"\",\n \"publishImmediately\": false,\n \"htmlTitle\": \"\",\n \"translations\": {},\n \"id\": \"\",\n \"state\": \"\",\n \"slug\": \"\",\n \"createdById\": \"\",\n \"currentlyPublished\": false,\n \"archivedInDashboard\": false,\n \"created\": \"\",\n \"contentTypeCategory\": \"\",\n \"mabExperimentId\": \"\",\n \"updatedById\": \"\",\n \"translatedFromId\": \"\",\n \"folderId\": \"\",\n \"widgetContainers\": {},\n \"pageExpiryRedirectId\": 0,\n \"dynamicPageDataSourceType\": 0,\n \"featuredImage\": \"\",\n \"authorName\": \"\",\n \"domain\": \"\",\n \"name\": \"\",\n \"dynamicPageHubDbTableId\": \"\",\n \"campaign\": \"\",\n \"dynamicPageDataSourceId\": \"\",\n \"enableDomainStylesheets\": false,\n \"includeDefaultCustomCss\": false,\n \"subcategory\": \"\",\n \"layoutSections\": {},\n \"updated\": \"\",\n \"footerHtml\": \"\",\n \"widgets\": {},\n \"headHtml\": \"\",\n \"pageExpiryRedirectUrl\": \"\",\n \"abStatus\": \"\",\n \"useFeaturedImage\": false,\n \"abTestId\": \"\",\n \"featuredImageAltText\": \"\",\n \"contentGroupId\": \"\",\n \"pageExpiryEnabled\": false,\n \"templatePath\": \"\",\n \"url\": \"\",\n \"publicAccessRules\": [\n {}\n ],\n \"archivedAt\": \"\",\n \"themeSettingsValues\": {},\n \"pageExpiryDate\": 0,\n \"publicAccessRulesEnabled\": false,\n \"pageRedirected\": false,\n \"currentState\": \"\",\n \"categoryId\": 0,\n \"linkRelCanonicalUrl\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/patch "{{baseUrl}}/cms/v3/pages/landing-pages/:objectId" {:headers {:private-app-legacy "{{apiKey}}"}
:content-type :json
:form-params {:publishDate ""
:language ""
:enableLayoutStylesheets false
:metaDescription ""
:attachedStylesheets [{}]
:password ""
:publishImmediately false
:htmlTitle ""
:translations {}
:id ""
:state ""
:slug ""
:createdById ""
:currentlyPublished false
:archivedInDashboard false
:created ""
:contentTypeCategory ""
:mabExperimentId ""
:updatedById ""
:translatedFromId ""
:folderId ""
:widgetContainers {}
:pageExpiryRedirectId 0
:dynamicPageDataSourceType 0
:featuredImage ""
:authorName ""
:domain ""
:name ""
:dynamicPageHubDbTableId ""
:campaign ""
:dynamicPageDataSourceId ""
:enableDomainStylesheets false
:includeDefaultCustomCss false
:subcategory ""
:layoutSections {}
:updated ""
:footerHtml ""
:widgets {}
:headHtml ""
:pageExpiryRedirectUrl ""
:abStatus ""
:useFeaturedImage false
:abTestId ""
:featuredImageAltText ""
:contentGroupId ""
:pageExpiryEnabled false
:templatePath ""
:url ""
:publicAccessRules [{}]
:archivedAt ""
:themeSettingsValues {}
:pageExpiryDate 0
:publicAccessRulesEnabled false
:pageRedirected false
:currentState ""
:categoryId 0
:linkRelCanonicalUrl ""}})
require "http/client"
url = "{{baseUrl}}/cms/v3/pages/landing-pages/:objectId"
headers = HTTP::Headers{
"private-app-legacy" => "{{apiKey}}"
"content-type" => "application/json"
}
reqBody = "{\n \"publishDate\": \"\",\n \"language\": \"\",\n \"enableLayoutStylesheets\": false,\n \"metaDescription\": \"\",\n \"attachedStylesheets\": [\n {}\n ],\n \"password\": \"\",\n \"publishImmediately\": false,\n \"htmlTitle\": \"\",\n \"translations\": {},\n \"id\": \"\",\n \"state\": \"\",\n \"slug\": \"\",\n \"createdById\": \"\",\n \"currentlyPublished\": false,\n \"archivedInDashboard\": false,\n \"created\": \"\",\n \"contentTypeCategory\": \"\",\n \"mabExperimentId\": \"\",\n \"updatedById\": \"\",\n \"translatedFromId\": \"\",\n \"folderId\": \"\",\n \"widgetContainers\": {},\n \"pageExpiryRedirectId\": 0,\n \"dynamicPageDataSourceType\": 0,\n \"featuredImage\": \"\",\n \"authorName\": \"\",\n \"domain\": \"\",\n \"name\": \"\",\n \"dynamicPageHubDbTableId\": \"\",\n \"campaign\": \"\",\n \"dynamicPageDataSourceId\": \"\",\n \"enableDomainStylesheets\": false,\n \"includeDefaultCustomCss\": false,\n \"subcategory\": \"\",\n \"layoutSections\": {},\n \"updated\": \"\",\n \"footerHtml\": \"\",\n \"widgets\": {},\n \"headHtml\": \"\",\n \"pageExpiryRedirectUrl\": \"\",\n \"abStatus\": \"\",\n \"useFeaturedImage\": false,\n \"abTestId\": \"\",\n \"featuredImageAltText\": \"\",\n \"contentGroupId\": \"\",\n \"pageExpiryEnabled\": false,\n \"templatePath\": \"\",\n \"url\": \"\",\n \"publicAccessRules\": [\n {}\n ],\n \"archivedAt\": \"\",\n \"themeSettingsValues\": {},\n \"pageExpiryDate\": 0,\n \"publicAccessRulesEnabled\": false,\n \"pageRedirected\": false,\n \"currentState\": \"\",\n \"categoryId\": 0,\n \"linkRelCanonicalUrl\": \"\"\n}"
response = HTTP::Client.patch url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Patch,
RequestUri = new Uri("{{baseUrl}}/cms/v3/pages/landing-pages/:objectId"),
Headers =
{
{ "private-app-legacy", "{{apiKey}}" },
},
Content = new StringContent("{\n \"publishDate\": \"\",\n \"language\": \"\",\n \"enableLayoutStylesheets\": false,\n \"metaDescription\": \"\",\n \"attachedStylesheets\": [\n {}\n ],\n \"password\": \"\",\n \"publishImmediately\": false,\n \"htmlTitle\": \"\",\n \"translations\": {},\n \"id\": \"\",\n \"state\": \"\",\n \"slug\": \"\",\n \"createdById\": \"\",\n \"currentlyPublished\": false,\n \"archivedInDashboard\": false,\n \"created\": \"\",\n \"contentTypeCategory\": \"\",\n \"mabExperimentId\": \"\",\n \"updatedById\": \"\",\n \"translatedFromId\": \"\",\n \"folderId\": \"\",\n \"widgetContainers\": {},\n \"pageExpiryRedirectId\": 0,\n \"dynamicPageDataSourceType\": 0,\n \"featuredImage\": \"\",\n \"authorName\": \"\",\n \"domain\": \"\",\n \"name\": \"\",\n \"dynamicPageHubDbTableId\": \"\",\n \"campaign\": \"\",\n \"dynamicPageDataSourceId\": \"\",\n \"enableDomainStylesheets\": false,\n \"includeDefaultCustomCss\": false,\n \"subcategory\": \"\",\n \"layoutSections\": {},\n \"updated\": \"\",\n \"footerHtml\": \"\",\n \"widgets\": {},\n \"headHtml\": \"\",\n \"pageExpiryRedirectUrl\": \"\",\n \"abStatus\": \"\",\n \"useFeaturedImage\": false,\n \"abTestId\": \"\",\n \"featuredImageAltText\": \"\",\n \"contentGroupId\": \"\",\n \"pageExpiryEnabled\": false,\n \"templatePath\": \"\",\n \"url\": \"\",\n \"publicAccessRules\": [\n {}\n ],\n \"archivedAt\": \"\",\n \"themeSettingsValues\": {},\n \"pageExpiryDate\": 0,\n \"publicAccessRulesEnabled\": false,\n \"pageRedirected\": false,\n \"currentState\": \"\",\n \"categoryId\": 0,\n \"linkRelCanonicalUrl\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/cms/v3/pages/landing-pages/:objectId");
var request = new RestRequest("", Method.Patch);
request.AddHeader("private-app-legacy", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"publishDate\": \"\",\n \"language\": \"\",\n \"enableLayoutStylesheets\": false,\n \"metaDescription\": \"\",\n \"attachedStylesheets\": [\n {}\n ],\n \"password\": \"\",\n \"publishImmediately\": false,\n \"htmlTitle\": \"\",\n \"translations\": {},\n \"id\": \"\",\n \"state\": \"\",\n \"slug\": \"\",\n \"createdById\": \"\",\n \"currentlyPublished\": false,\n \"archivedInDashboard\": false,\n \"created\": \"\",\n \"contentTypeCategory\": \"\",\n \"mabExperimentId\": \"\",\n \"updatedById\": \"\",\n \"translatedFromId\": \"\",\n \"folderId\": \"\",\n \"widgetContainers\": {},\n \"pageExpiryRedirectId\": 0,\n \"dynamicPageDataSourceType\": 0,\n \"featuredImage\": \"\",\n \"authorName\": \"\",\n \"domain\": \"\",\n \"name\": \"\",\n \"dynamicPageHubDbTableId\": \"\",\n \"campaign\": \"\",\n \"dynamicPageDataSourceId\": \"\",\n \"enableDomainStylesheets\": false,\n \"includeDefaultCustomCss\": false,\n \"subcategory\": \"\",\n \"layoutSections\": {},\n \"updated\": \"\",\n \"footerHtml\": \"\",\n \"widgets\": {},\n \"headHtml\": \"\",\n \"pageExpiryRedirectUrl\": \"\",\n \"abStatus\": \"\",\n \"useFeaturedImage\": false,\n \"abTestId\": \"\",\n \"featuredImageAltText\": \"\",\n \"contentGroupId\": \"\",\n \"pageExpiryEnabled\": false,\n \"templatePath\": \"\",\n \"url\": \"\",\n \"publicAccessRules\": [\n {}\n ],\n \"archivedAt\": \"\",\n \"themeSettingsValues\": {},\n \"pageExpiryDate\": 0,\n \"publicAccessRulesEnabled\": false,\n \"pageRedirected\": false,\n \"currentState\": \"\",\n \"categoryId\": 0,\n \"linkRelCanonicalUrl\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/cms/v3/pages/landing-pages/:objectId"
payload := strings.NewReader("{\n \"publishDate\": \"\",\n \"language\": \"\",\n \"enableLayoutStylesheets\": false,\n \"metaDescription\": \"\",\n \"attachedStylesheets\": [\n {}\n ],\n \"password\": \"\",\n \"publishImmediately\": false,\n \"htmlTitle\": \"\",\n \"translations\": {},\n \"id\": \"\",\n \"state\": \"\",\n \"slug\": \"\",\n \"createdById\": \"\",\n \"currentlyPublished\": false,\n \"archivedInDashboard\": false,\n \"created\": \"\",\n \"contentTypeCategory\": \"\",\n \"mabExperimentId\": \"\",\n \"updatedById\": \"\",\n \"translatedFromId\": \"\",\n \"folderId\": \"\",\n \"widgetContainers\": {},\n \"pageExpiryRedirectId\": 0,\n \"dynamicPageDataSourceType\": 0,\n \"featuredImage\": \"\",\n \"authorName\": \"\",\n \"domain\": \"\",\n \"name\": \"\",\n \"dynamicPageHubDbTableId\": \"\",\n \"campaign\": \"\",\n \"dynamicPageDataSourceId\": \"\",\n \"enableDomainStylesheets\": false,\n \"includeDefaultCustomCss\": false,\n \"subcategory\": \"\",\n \"layoutSections\": {},\n \"updated\": \"\",\n \"footerHtml\": \"\",\n \"widgets\": {},\n \"headHtml\": \"\",\n \"pageExpiryRedirectUrl\": \"\",\n \"abStatus\": \"\",\n \"useFeaturedImage\": false,\n \"abTestId\": \"\",\n \"featuredImageAltText\": \"\",\n \"contentGroupId\": \"\",\n \"pageExpiryEnabled\": false,\n \"templatePath\": \"\",\n \"url\": \"\",\n \"publicAccessRules\": [\n {}\n ],\n \"archivedAt\": \"\",\n \"themeSettingsValues\": {},\n \"pageExpiryDate\": 0,\n \"publicAccessRulesEnabled\": false,\n \"pageRedirected\": false,\n \"currentState\": \"\",\n \"categoryId\": 0,\n \"linkRelCanonicalUrl\": \"\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("private-app-legacy", "{{apiKey}}")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PATCH /baseUrl/cms/v3/pages/landing-pages/:objectId HTTP/1.1
Private-App-Legacy: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 1385
{
"publishDate": "",
"language": "",
"enableLayoutStylesheets": false,
"metaDescription": "",
"attachedStylesheets": [
{}
],
"password": "",
"publishImmediately": false,
"htmlTitle": "",
"translations": {},
"id": "",
"state": "",
"slug": "",
"createdById": "",
"currentlyPublished": false,
"archivedInDashboard": false,
"created": "",
"contentTypeCategory": "",
"mabExperimentId": "",
"updatedById": "",
"translatedFromId": "",
"folderId": "",
"widgetContainers": {},
"pageExpiryRedirectId": 0,
"dynamicPageDataSourceType": 0,
"featuredImage": "",
"authorName": "",
"domain": "",
"name": "",
"dynamicPageHubDbTableId": "",
"campaign": "",
"dynamicPageDataSourceId": "",
"enableDomainStylesheets": false,
"includeDefaultCustomCss": false,
"subcategory": "",
"layoutSections": {},
"updated": "",
"footerHtml": "",
"widgets": {},
"headHtml": "",
"pageExpiryRedirectUrl": "",
"abStatus": "",
"useFeaturedImage": false,
"abTestId": "",
"featuredImageAltText": "",
"contentGroupId": "",
"pageExpiryEnabled": false,
"templatePath": "",
"url": "",
"publicAccessRules": [
{}
],
"archivedAt": "",
"themeSettingsValues": {},
"pageExpiryDate": 0,
"publicAccessRulesEnabled": false,
"pageRedirected": false,
"currentState": "",
"categoryId": 0,
"linkRelCanonicalUrl": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PATCH", "{{baseUrl}}/cms/v3/pages/landing-pages/:objectId")
.setHeader("private-app-legacy", "{{apiKey}}")
.setHeader("content-type", "application/json")
.setBody("{\n \"publishDate\": \"\",\n \"language\": \"\",\n \"enableLayoutStylesheets\": false,\n \"metaDescription\": \"\",\n \"attachedStylesheets\": [\n {}\n ],\n \"password\": \"\",\n \"publishImmediately\": false,\n \"htmlTitle\": \"\",\n \"translations\": {},\n \"id\": \"\",\n \"state\": \"\",\n \"slug\": \"\",\n \"createdById\": \"\",\n \"currentlyPublished\": false,\n \"archivedInDashboard\": false,\n \"created\": \"\",\n \"contentTypeCategory\": \"\",\n \"mabExperimentId\": \"\",\n \"updatedById\": \"\",\n \"translatedFromId\": \"\",\n \"folderId\": \"\",\n \"widgetContainers\": {},\n \"pageExpiryRedirectId\": 0,\n \"dynamicPageDataSourceType\": 0,\n \"featuredImage\": \"\",\n \"authorName\": \"\",\n \"domain\": \"\",\n \"name\": \"\",\n \"dynamicPageHubDbTableId\": \"\",\n \"campaign\": \"\",\n \"dynamicPageDataSourceId\": \"\",\n \"enableDomainStylesheets\": false,\n \"includeDefaultCustomCss\": false,\n \"subcategory\": \"\",\n \"layoutSections\": {},\n \"updated\": \"\",\n \"footerHtml\": \"\",\n \"widgets\": {},\n \"headHtml\": \"\",\n \"pageExpiryRedirectUrl\": \"\",\n \"abStatus\": \"\",\n \"useFeaturedImage\": false,\n \"abTestId\": \"\",\n \"featuredImageAltText\": \"\",\n \"contentGroupId\": \"\",\n \"pageExpiryEnabled\": false,\n \"templatePath\": \"\",\n \"url\": \"\",\n \"publicAccessRules\": [\n {}\n ],\n \"archivedAt\": \"\",\n \"themeSettingsValues\": {},\n \"pageExpiryDate\": 0,\n \"publicAccessRulesEnabled\": false,\n \"pageRedirected\": false,\n \"currentState\": \"\",\n \"categoryId\": 0,\n \"linkRelCanonicalUrl\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/cms/v3/pages/landing-pages/:objectId"))
.header("private-app-legacy", "{{apiKey}}")
.header("content-type", "application/json")
.method("PATCH", HttpRequest.BodyPublishers.ofString("{\n \"publishDate\": \"\",\n \"language\": \"\",\n \"enableLayoutStylesheets\": false,\n \"metaDescription\": \"\",\n \"attachedStylesheets\": [\n {}\n ],\n \"password\": \"\",\n \"publishImmediately\": false,\n \"htmlTitle\": \"\",\n \"translations\": {},\n \"id\": \"\",\n \"state\": \"\",\n \"slug\": \"\",\n \"createdById\": \"\",\n \"currentlyPublished\": false,\n \"archivedInDashboard\": false,\n \"created\": \"\",\n \"contentTypeCategory\": \"\",\n \"mabExperimentId\": \"\",\n \"updatedById\": \"\",\n \"translatedFromId\": \"\",\n \"folderId\": \"\",\n \"widgetContainers\": {},\n \"pageExpiryRedirectId\": 0,\n \"dynamicPageDataSourceType\": 0,\n \"featuredImage\": \"\",\n \"authorName\": \"\",\n \"domain\": \"\",\n \"name\": \"\",\n \"dynamicPageHubDbTableId\": \"\",\n \"campaign\": \"\",\n \"dynamicPageDataSourceId\": \"\",\n \"enableDomainStylesheets\": false,\n \"includeDefaultCustomCss\": false,\n \"subcategory\": \"\",\n \"layoutSections\": {},\n \"updated\": \"\",\n \"footerHtml\": \"\",\n \"widgets\": {},\n \"headHtml\": \"\",\n \"pageExpiryRedirectUrl\": \"\",\n \"abStatus\": \"\",\n \"useFeaturedImage\": false,\n \"abTestId\": \"\",\n \"featuredImageAltText\": \"\",\n \"contentGroupId\": \"\",\n \"pageExpiryEnabled\": false,\n \"templatePath\": \"\",\n \"url\": \"\",\n \"publicAccessRules\": [\n {}\n ],\n \"archivedAt\": \"\",\n \"themeSettingsValues\": {},\n \"pageExpiryDate\": 0,\n \"publicAccessRulesEnabled\": false,\n \"pageRedirected\": false,\n \"currentState\": \"\",\n \"categoryId\": 0,\n \"linkRelCanonicalUrl\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"publishDate\": \"\",\n \"language\": \"\",\n \"enableLayoutStylesheets\": false,\n \"metaDescription\": \"\",\n \"attachedStylesheets\": [\n {}\n ],\n \"password\": \"\",\n \"publishImmediately\": false,\n \"htmlTitle\": \"\",\n \"translations\": {},\n \"id\": \"\",\n \"state\": \"\",\n \"slug\": \"\",\n \"createdById\": \"\",\n \"currentlyPublished\": false,\n \"archivedInDashboard\": false,\n \"created\": \"\",\n \"contentTypeCategory\": \"\",\n \"mabExperimentId\": \"\",\n \"updatedById\": \"\",\n \"translatedFromId\": \"\",\n \"folderId\": \"\",\n \"widgetContainers\": {},\n \"pageExpiryRedirectId\": 0,\n \"dynamicPageDataSourceType\": 0,\n \"featuredImage\": \"\",\n \"authorName\": \"\",\n \"domain\": \"\",\n \"name\": \"\",\n \"dynamicPageHubDbTableId\": \"\",\n \"campaign\": \"\",\n \"dynamicPageDataSourceId\": \"\",\n \"enableDomainStylesheets\": false,\n \"includeDefaultCustomCss\": false,\n \"subcategory\": \"\",\n \"layoutSections\": {},\n \"updated\": \"\",\n \"footerHtml\": \"\",\n \"widgets\": {},\n \"headHtml\": \"\",\n \"pageExpiryRedirectUrl\": \"\",\n \"abStatus\": \"\",\n \"useFeaturedImage\": false,\n \"abTestId\": \"\",\n \"featuredImageAltText\": \"\",\n \"contentGroupId\": \"\",\n \"pageExpiryEnabled\": false,\n \"templatePath\": \"\",\n \"url\": \"\",\n \"publicAccessRules\": [\n {}\n ],\n \"archivedAt\": \"\",\n \"themeSettingsValues\": {},\n \"pageExpiryDate\": 0,\n \"publicAccessRulesEnabled\": false,\n \"pageRedirected\": false,\n \"currentState\": \"\",\n \"categoryId\": 0,\n \"linkRelCanonicalUrl\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/cms/v3/pages/landing-pages/:objectId")
.patch(body)
.addHeader("private-app-legacy", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.patch("{{baseUrl}}/cms/v3/pages/landing-pages/:objectId")
.header("private-app-legacy", "{{apiKey}}")
.header("content-type", "application/json")
.body("{\n \"publishDate\": \"\",\n \"language\": \"\",\n \"enableLayoutStylesheets\": false,\n \"metaDescription\": \"\",\n \"attachedStylesheets\": [\n {}\n ],\n \"password\": \"\",\n \"publishImmediately\": false,\n \"htmlTitle\": \"\",\n \"translations\": {},\n \"id\": \"\",\n \"state\": \"\",\n \"slug\": \"\",\n \"createdById\": \"\",\n \"currentlyPublished\": false,\n \"archivedInDashboard\": false,\n \"created\": \"\",\n \"contentTypeCategory\": \"\",\n \"mabExperimentId\": \"\",\n \"updatedById\": \"\",\n \"translatedFromId\": \"\",\n \"folderId\": \"\",\n \"widgetContainers\": {},\n \"pageExpiryRedirectId\": 0,\n \"dynamicPageDataSourceType\": 0,\n \"featuredImage\": \"\",\n \"authorName\": \"\",\n \"domain\": \"\",\n \"name\": \"\",\n \"dynamicPageHubDbTableId\": \"\",\n \"campaign\": \"\",\n \"dynamicPageDataSourceId\": \"\",\n \"enableDomainStylesheets\": false,\n \"includeDefaultCustomCss\": false,\n \"subcategory\": \"\",\n \"layoutSections\": {},\n \"updated\": \"\",\n \"footerHtml\": \"\",\n \"widgets\": {},\n \"headHtml\": \"\",\n \"pageExpiryRedirectUrl\": \"\",\n \"abStatus\": \"\",\n \"useFeaturedImage\": false,\n \"abTestId\": \"\",\n \"featuredImageAltText\": \"\",\n \"contentGroupId\": \"\",\n \"pageExpiryEnabled\": false,\n \"templatePath\": \"\",\n \"url\": \"\",\n \"publicAccessRules\": [\n {}\n ],\n \"archivedAt\": \"\",\n \"themeSettingsValues\": {},\n \"pageExpiryDate\": 0,\n \"publicAccessRulesEnabled\": false,\n \"pageRedirected\": false,\n \"currentState\": \"\",\n \"categoryId\": 0,\n \"linkRelCanonicalUrl\": \"\"\n}")
.asString();
const data = JSON.stringify({
publishDate: '',
language: '',
enableLayoutStylesheets: false,
metaDescription: '',
attachedStylesheets: [
{}
],
password: '',
publishImmediately: false,
htmlTitle: '',
translations: {},
id: '',
state: '',
slug: '',
createdById: '',
currentlyPublished: false,
archivedInDashboard: false,
created: '',
contentTypeCategory: '',
mabExperimentId: '',
updatedById: '',
translatedFromId: '',
folderId: '',
widgetContainers: {},
pageExpiryRedirectId: 0,
dynamicPageDataSourceType: 0,
featuredImage: '',
authorName: '',
domain: '',
name: '',
dynamicPageHubDbTableId: '',
campaign: '',
dynamicPageDataSourceId: '',
enableDomainStylesheets: false,
includeDefaultCustomCss: false,
subcategory: '',
layoutSections: {},
updated: '',
footerHtml: '',
widgets: {},
headHtml: '',
pageExpiryRedirectUrl: '',
abStatus: '',
useFeaturedImage: false,
abTestId: '',
featuredImageAltText: '',
contentGroupId: '',
pageExpiryEnabled: false,
templatePath: '',
url: '',
publicAccessRules: [
{}
],
archivedAt: '',
themeSettingsValues: {},
pageExpiryDate: 0,
publicAccessRulesEnabled: false,
pageRedirected: false,
currentState: '',
categoryId: 0,
linkRelCanonicalUrl: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PATCH', '{{baseUrl}}/cms/v3/pages/landing-pages/:objectId');
xhr.setRequestHeader('private-app-legacy', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PATCH',
url: '{{baseUrl}}/cms/v3/pages/landing-pages/:objectId',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
data: {
publishDate: '',
language: '',
enableLayoutStylesheets: false,
metaDescription: '',
attachedStylesheets: [{}],
password: '',
publishImmediately: false,
htmlTitle: '',
translations: {},
id: '',
state: '',
slug: '',
createdById: '',
currentlyPublished: false,
archivedInDashboard: false,
created: '',
contentTypeCategory: '',
mabExperimentId: '',
updatedById: '',
translatedFromId: '',
folderId: '',
widgetContainers: {},
pageExpiryRedirectId: 0,
dynamicPageDataSourceType: 0,
featuredImage: '',
authorName: '',
domain: '',
name: '',
dynamicPageHubDbTableId: '',
campaign: '',
dynamicPageDataSourceId: '',
enableDomainStylesheets: false,
includeDefaultCustomCss: false,
subcategory: '',
layoutSections: {},
updated: '',
footerHtml: '',
widgets: {},
headHtml: '',
pageExpiryRedirectUrl: '',
abStatus: '',
useFeaturedImage: false,
abTestId: '',
featuredImageAltText: '',
contentGroupId: '',
pageExpiryEnabled: false,
templatePath: '',
url: '',
publicAccessRules: [{}],
archivedAt: '',
themeSettingsValues: {},
pageExpiryDate: 0,
publicAccessRulesEnabled: false,
pageRedirected: false,
currentState: '',
categoryId: 0,
linkRelCanonicalUrl: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/cms/v3/pages/landing-pages/:objectId';
const options = {
method: 'PATCH',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
body: '{"publishDate":"","language":"","enableLayoutStylesheets":false,"metaDescription":"","attachedStylesheets":[{}],"password":"","publishImmediately":false,"htmlTitle":"","translations":{},"id":"","state":"","slug":"","createdById":"","currentlyPublished":false,"archivedInDashboard":false,"created":"","contentTypeCategory":"","mabExperimentId":"","updatedById":"","translatedFromId":"","folderId":"","widgetContainers":{},"pageExpiryRedirectId":0,"dynamicPageDataSourceType":0,"featuredImage":"","authorName":"","domain":"","name":"","dynamicPageHubDbTableId":"","campaign":"","dynamicPageDataSourceId":"","enableDomainStylesheets":false,"includeDefaultCustomCss":false,"subcategory":"","layoutSections":{},"updated":"","footerHtml":"","widgets":{},"headHtml":"","pageExpiryRedirectUrl":"","abStatus":"","useFeaturedImage":false,"abTestId":"","featuredImageAltText":"","contentGroupId":"","pageExpiryEnabled":false,"templatePath":"","url":"","publicAccessRules":[{}],"archivedAt":"","themeSettingsValues":{},"pageExpiryDate":0,"publicAccessRulesEnabled":false,"pageRedirected":false,"currentState":"","categoryId":0,"linkRelCanonicalUrl":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/cms/v3/pages/landing-pages/:objectId',
method: 'PATCH',
headers: {
'private-app-legacy': '{{apiKey}}',
'content-type': 'application/json'
},
processData: false,
data: '{\n "publishDate": "",\n "language": "",\n "enableLayoutStylesheets": false,\n "metaDescription": "",\n "attachedStylesheets": [\n {}\n ],\n "password": "",\n "publishImmediately": false,\n "htmlTitle": "",\n "translations": {},\n "id": "",\n "state": "",\n "slug": "",\n "createdById": "",\n "currentlyPublished": false,\n "archivedInDashboard": false,\n "created": "",\n "contentTypeCategory": "",\n "mabExperimentId": "",\n "updatedById": "",\n "translatedFromId": "",\n "folderId": "",\n "widgetContainers": {},\n "pageExpiryRedirectId": 0,\n "dynamicPageDataSourceType": 0,\n "featuredImage": "",\n "authorName": "",\n "domain": "",\n "name": "",\n "dynamicPageHubDbTableId": "",\n "campaign": "",\n "dynamicPageDataSourceId": "",\n "enableDomainStylesheets": false,\n "includeDefaultCustomCss": false,\n "subcategory": "",\n "layoutSections": {},\n "updated": "",\n "footerHtml": "",\n "widgets": {},\n "headHtml": "",\n "pageExpiryRedirectUrl": "",\n "abStatus": "",\n "useFeaturedImage": false,\n "abTestId": "",\n "featuredImageAltText": "",\n "contentGroupId": "",\n "pageExpiryEnabled": false,\n "templatePath": "",\n "url": "",\n "publicAccessRules": [\n {}\n ],\n "archivedAt": "",\n "themeSettingsValues": {},\n "pageExpiryDate": 0,\n "publicAccessRulesEnabled": false,\n "pageRedirected": false,\n "currentState": "",\n "categoryId": 0,\n "linkRelCanonicalUrl": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"publishDate\": \"\",\n \"language\": \"\",\n \"enableLayoutStylesheets\": false,\n \"metaDescription\": \"\",\n \"attachedStylesheets\": [\n {}\n ],\n \"password\": \"\",\n \"publishImmediately\": false,\n \"htmlTitle\": \"\",\n \"translations\": {},\n \"id\": \"\",\n \"state\": \"\",\n \"slug\": \"\",\n \"createdById\": \"\",\n \"currentlyPublished\": false,\n \"archivedInDashboard\": false,\n \"created\": \"\",\n \"contentTypeCategory\": \"\",\n \"mabExperimentId\": \"\",\n \"updatedById\": \"\",\n \"translatedFromId\": \"\",\n \"folderId\": \"\",\n \"widgetContainers\": {},\n \"pageExpiryRedirectId\": 0,\n \"dynamicPageDataSourceType\": 0,\n \"featuredImage\": \"\",\n \"authorName\": \"\",\n \"domain\": \"\",\n \"name\": \"\",\n \"dynamicPageHubDbTableId\": \"\",\n \"campaign\": \"\",\n \"dynamicPageDataSourceId\": \"\",\n \"enableDomainStylesheets\": false,\n \"includeDefaultCustomCss\": false,\n \"subcategory\": \"\",\n \"layoutSections\": {},\n \"updated\": \"\",\n \"footerHtml\": \"\",\n \"widgets\": {},\n \"headHtml\": \"\",\n \"pageExpiryRedirectUrl\": \"\",\n \"abStatus\": \"\",\n \"useFeaturedImage\": false,\n \"abTestId\": \"\",\n \"featuredImageAltText\": \"\",\n \"contentGroupId\": \"\",\n \"pageExpiryEnabled\": false,\n \"templatePath\": \"\",\n \"url\": \"\",\n \"publicAccessRules\": [\n {}\n ],\n \"archivedAt\": \"\",\n \"themeSettingsValues\": {},\n \"pageExpiryDate\": 0,\n \"publicAccessRulesEnabled\": false,\n \"pageRedirected\": false,\n \"currentState\": \"\",\n \"categoryId\": 0,\n \"linkRelCanonicalUrl\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/cms/v3/pages/landing-pages/:objectId")
.patch(body)
.addHeader("private-app-legacy", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PATCH',
hostname: 'example.com',
port: null,
path: '/baseUrl/cms/v3/pages/landing-pages/:objectId',
headers: {
'private-app-legacy': '{{apiKey}}',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
publishDate: '',
language: '',
enableLayoutStylesheets: false,
metaDescription: '',
attachedStylesheets: [{}],
password: '',
publishImmediately: false,
htmlTitle: '',
translations: {},
id: '',
state: '',
slug: '',
createdById: '',
currentlyPublished: false,
archivedInDashboard: false,
created: '',
contentTypeCategory: '',
mabExperimentId: '',
updatedById: '',
translatedFromId: '',
folderId: '',
widgetContainers: {},
pageExpiryRedirectId: 0,
dynamicPageDataSourceType: 0,
featuredImage: '',
authorName: '',
domain: '',
name: '',
dynamicPageHubDbTableId: '',
campaign: '',
dynamicPageDataSourceId: '',
enableDomainStylesheets: false,
includeDefaultCustomCss: false,
subcategory: '',
layoutSections: {},
updated: '',
footerHtml: '',
widgets: {},
headHtml: '',
pageExpiryRedirectUrl: '',
abStatus: '',
useFeaturedImage: false,
abTestId: '',
featuredImageAltText: '',
contentGroupId: '',
pageExpiryEnabled: false,
templatePath: '',
url: '',
publicAccessRules: [{}],
archivedAt: '',
themeSettingsValues: {},
pageExpiryDate: 0,
publicAccessRulesEnabled: false,
pageRedirected: false,
currentState: '',
categoryId: 0,
linkRelCanonicalUrl: ''
}));
req.end();
const request = require('request');
const options = {
method: 'PATCH',
url: '{{baseUrl}}/cms/v3/pages/landing-pages/:objectId',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
body: {
publishDate: '',
language: '',
enableLayoutStylesheets: false,
metaDescription: '',
attachedStylesheets: [{}],
password: '',
publishImmediately: false,
htmlTitle: '',
translations: {},
id: '',
state: '',
slug: '',
createdById: '',
currentlyPublished: false,
archivedInDashboard: false,
created: '',
contentTypeCategory: '',
mabExperimentId: '',
updatedById: '',
translatedFromId: '',
folderId: '',
widgetContainers: {},
pageExpiryRedirectId: 0,
dynamicPageDataSourceType: 0,
featuredImage: '',
authorName: '',
domain: '',
name: '',
dynamicPageHubDbTableId: '',
campaign: '',
dynamicPageDataSourceId: '',
enableDomainStylesheets: false,
includeDefaultCustomCss: false,
subcategory: '',
layoutSections: {},
updated: '',
footerHtml: '',
widgets: {},
headHtml: '',
pageExpiryRedirectUrl: '',
abStatus: '',
useFeaturedImage: false,
abTestId: '',
featuredImageAltText: '',
contentGroupId: '',
pageExpiryEnabled: false,
templatePath: '',
url: '',
publicAccessRules: [{}],
archivedAt: '',
themeSettingsValues: {},
pageExpiryDate: 0,
publicAccessRulesEnabled: false,
pageRedirected: false,
currentState: '',
categoryId: 0,
linkRelCanonicalUrl: ''
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PATCH', '{{baseUrl}}/cms/v3/pages/landing-pages/:objectId');
req.headers({
'private-app-legacy': '{{apiKey}}',
'content-type': 'application/json'
});
req.type('json');
req.send({
publishDate: '',
language: '',
enableLayoutStylesheets: false,
metaDescription: '',
attachedStylesheets: [
{}
],
password: '',
publishImmediately: false,
htmlTitle: '',
translations: {},
id: '',
state: '',
slug: '',
createdById: '',
currentlyPublished: false,
archivedInDashboard: false,
created: '',
contentTypeCategory: '',
mabExperimentId: '',
updatedById: '',
translatedFromId: '',
folderId: '',
widgetContainers: {},
pageExpiryRedirectId: 0,
dynamicPageDataSourceType: 0,
featuredImage: '',
authorName: '',
domain: '',
name: '',
dynamicPageHubDbTableId: '',
campaign: '',
dynamicPageDataSourceId: '',
enableDomainStylesheets: false,
includeDefaultCustomCss: false,
subcategory: '',
layoutSections: {},
updated: '',
footerHtml: '',
widgets: {},
headHtml: '',
pageExpiryRedirectUrl: '',
abStatus: '',
useFeaturedImage: false,
abTestId: '',
featuredImageAltText: '',
contentGroupId: '',
pageExpiryEnabled: false,
templatePath: '',
url: '',
publicAccessRules: [
{}
],
archivedAt: '',
themeSettingsValues: {},
pageExpiryDate: 0,
publicAccessRulesEnabled: false,
pageRedirected: false,
currentState: '',
categoryId: 0,
linkRelCanonicalUrl: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'PATCH',
url: '{{baseUrl}}/cms/v3/pages/landing-pages/:objectId',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
data: {
publishDate: '',
language: '',
enableLayoutStylesheets: false,
metaDescription: '',
attachedStylesheets: [{}],
password: '',
publishImmediately: false,
htmlTitle: '',
translations: {},
id: '',
state: '',
slug: '',
createdById: '',
currentlyPublished: false,
archivedInDashboard: false,
created: '',
contentTypeCategory: '',
mabExperimentId: '',
updatedById: '',
translatedFromId: '',
folderId: '',
widgetContainers: {},
pageExpiryRedirectId: 0,
dynamicPageDataSourceType: 0,
featuredImage: '',
authorName: '',
domain: '',
name: '',
dynamicPageHubDbTableId: '',
campaign: '',
dynamicPageDataSourceId: '',
enableDomainStylesheets: false,
includeDefaultCustomCss: false,
subcategory: '',
layoutSections: {},
updated: '',
footerHtml: '',
widgets: {},
headHtml: '',
pageExpiryRedirectUrl: '',
abStatus: '',
useFeaturedImage: false,
abTestId: '',
featuredImageAltText: '',
contentGroupId: '',
pageExpiryEnabled: false,
templatePath: '',
url: '',
publicAccessRules: [{}],
archivedAt: '',
themeSettingsValues: {},
pageExpiryDate: 0,
publicAccessRulesEnabled: false,
pageRedirected: false,
currentState: '',
categoryId: 0,
linkRelCanonicalUrl: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/cms/v3/pages/landing-pages/:objectId';
const options = {
method: 'PATCH',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
body: '{"publishDate":"","language":"","enableLayoutStylesheets":false,"metaDescription":"","attachedStylesheets":[{}],"password":"","publishImmediately":false,"htmlTitle":"","translations":{},"id":"","state":"","slug":"","createdById":"","currentlyPublished":false,"archivedInDashboard":false,"created":"","contentTypeCategory":"","mabExperimentId":"","updatedById":"","translatedFromId":"","folderId":"","widgetContainers":{},"pageExpiryRedirectId":0,"dynamicPageDataSourceType":0,"featuredImage":"","authorName":"","domain":"","name":"","dynamicPageHubDbTableId":"","campaign":"","dynamicPageDataSourceId":"","enableDomainStylesheets":false,"includeDefaultCustomCss":false,"subcategory":"","layoutSections":{},"updated":"","footerHtml":"","widgets":{},"headHtml":"","pageExpiryRedirectUrl":"","abStatus":"","useFeaturedImage":false,"abTestId":"","featuredImageAltText":"","contentGroupId":"","pageExpiryEnabled":false,"templatePath":"","url":"","publicAccessRules":[{}],"archivedAt":"","themeSettingsValues":{},"pageExpiryDate":0,"publicAccessRulesEnabled":false,"pageRedirected":false,"currentState":"","categoryId":0,"linkRelCanonicalUrl":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"private-app-legacy": @"{{apiKey}}",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"publishDate": @"",
@"language": @"",
@"enableLayoutStylesheets": @NO,
@"metaDescription": @"",
@"attachedStylesheets": @[ @{ } ],
@"password": @"",
@"publishImmediately": @NO,
@"htmlTitle": @"",
@"translations": @{ },
@"id": @"",
@"state": @"",
@"slug": @"",
@"createdById": @"",
@"currentlyPublished": @NO,
@"archivedInDashboard": @NO,
@"created": @"",
@"contentTypeCategory": @"",
@"mabExperimentId": @"",
@"updatedById": @"",
@"translatedFromId": @"",
@"folderId": @"",
@"widgetContainers": @{ },
@"pageExpiryRedirectId": @0,
@"dynamicPageDataSourceType": @0,
@"featuredImage": @"",
@"authorName": @"",
@"domain": @"",
@"name": @"",
@"dynamicPageHubDbTableId": @"",
@"campaign": @"",
@"dynamicPageDataSourceId": @"",
@"enableDomainStylesheets": @NO,
@"includeDefaultCustomCss": @NO,
@"subcategory": @"",
@"layoutSections": @{ },
@"updated": @"",
@"footerHtml": @"",
@"widgets": @{ },
@"headHtml": @"",
@"pageExpiryRedirectUrl": @"",
@"abStatus": @"",
@"useFeaturedImage": @NO,
@"abTestId": @"",
@"featuredImageAltText": @"",
@"contentGroupId": @"",
@"pageExpiryEnabled": @NO,
@"templatePath": @"",
@"url": @"",
@"publicAccessRules": @[ @{ } ],
@"archivedAt": @"",
@"themeSettingsValues": @{ },
@"pageExpiryDate": @0,
@"publicAccessRulesEnabled": @NO,
@"pageRedirected": @NO,
@"currentState": @"",
@"categoryId": @0,
@"linkRelCanonicalUrl": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/cms/v3/pages/landing-pages/:objectId"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PATCH"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/cms/v3/pages/landing-pages/:objectId" in
let headers = Header.add_list (Header.init ()) [
("private-app-legacy", "{{apiKey}}");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"publishDate\": \"\",\n \"language\": \"\",\n \"enableLayoutStylesheets\": false,\n \"metaDescription\": \"\",\n \"attachedStylesheets\": [\n {}\n ],\n \"password\": \"\",\n \"publishImmediately\": false,\n \"htmlTitle\": \"\",\n \"translations\": {},\n \"id\": \"\",\n \"state\": \"\",\n \"slug\": \"\",\n \"createdById\": \"\",\n \"currentlyPublished\": false,\n \"archivedInDashboard\": false,\n \"created\": \"\",\n \"contentTypeCategory\": \"\",\n \"mabExperimentId\": \"\",\n \"updatedById\": \"\",\n \"translatedFromId\": \"\",\n \"folderId\": \"\",\n \"widgetContainers\": {},\n \"pageExpiryRedirectId\": 0,\n \"dynamicPageDataSourceType\": 0,\n \"featuredImage\": \"\",\n \"authorName\": \"\",\n \"domain\": \"\",\n \"name\": \"\",\n \"dynamicPageHubDbTableId\": \"\",\n \"campaign\": \"\",\n \"dynamicPageDataSourceId\": \"\",\n \"enableDomainStylesheets\": false,\n \"includeDefaultCustomCss\": false,\n \"subcategory\": \"\",\n \"layoutSections\": {},\n \"updated\": \"\",\n \"footerHtml\": \"\",\n \"widgets\": {},\n \"headHtml\": \"\",\n \"pageExpiryRedirectUrl\": \"\",\n \"abStatus\": \"\",\n \"useFeaturedImage\": false,\n \"abTestId\": \"\",\n \"featuredImageAltText\": \"\",\n \"contentGroupId\": \"\",\n \"pageExpiryEnabled\": false,\n \"templatePath\": \"\",\n \"url\": \"\",\n \"publicAccessRules\": [\n {}\n ],\n \"archivedAt\": \"\",\n \"themeSettingsValues\": {},\n \"pageExpiryDate\": 0,\n \"publicAccessRulesEnabled\": false,\n \"pageRedirected\": false,\n \"currentState\": \"\",\n \"categoryId\": 0,\n \"linkRelCanonicalUrl\": \"\"\n}" in
Client.call ~headers ~body `PATCH uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/cms/v3/pages/landing-pages/:objectId",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'publishDate' => '',
'language' => '',
'enableLayoutStylesheets' => null,
'metaDescription' => '',
'attachedStylesheets' => [
[
]
],
'password' => '',
'publishImmediately' => null,
'htmlTitle' => '',
'translations' => [
],
'id' => '',
'state' => '',
'slug' => '',
'createdById' => '',
'currentlyPublished' => null,
'archivedInDashboard' => null,
'created' => '',
'contentTypeCategory' => '',
'mabExperimentId' => '',
'updatedById' => '',
'translatedFromId' => '',
'folderId' => '',
'widgetContainers' => [
],
'pageExpiryRedirectId' => 0,
'dynamicPageDataSourceType' => 0,
'featuredImage' => '',
'authorName' => '',
'domain' => '',
'name' => '',
'dynamicPageHubDbTableId' => '',
'campaign' => '',
'dynamicPageDataSourceId' => '',
'enableDomainStylesheets' => null,
'includeDefaultCustomCss' => null,
'subcategory' => '',
'layoutSections' => [
],
'updated' => '',
'footerHtml' => '',
'widgets' => [
],
'headHtml' => '',
'pageExpiryRedirectUrl' => '',
'abStatus' => '',
'useFeaturedImage' => null,
'abTestId' => '',
'featuredImageAltText' => '',
'contentGroupId' => '',
'pageExpiryEnabled' => null,
'templatePath' => '',
'url' => '',
'publicAccessRules' => [
[
]
],
'archivedAt' => '',
'themeSettingsValues' => [
],
'pageExpiryDate' => 0,
'publicAccessRulesEnabled' => null,
'pageRedirected' => null,
'currentState' => '',
'categoryId' => 0,
'linkRelCanonicalUrl' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"private-app-legacy: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('PATCH', '{{baseUrl}}/cms/v3/pages/landing-pages/:objectId', [
'body' => '{
"publishDate": "",
"language": "",
"enableLayoutStylesheets": false,
"metaDescription": "",
"attachedStylesheets": [
{}
],
"password": "",
"publishImmediately": false,
"htmlTitle": "",
"translations": {},
"id": "",
"state": "",
"slug": "",
"createdById": "",
"currentlyPublished": false,
"archivedInDashboard": false,
"created": "",
"contentTypeCategory": "",
"mabExperimentId": "",
"updatedById": "",
"translatedFromId": "",
"folderId": "",
"widgetContainers": {},
"pageExpiryRedirectId": 0,
"dynamicPageDataSourceType": 0,
"featuredImage": "",
"authorName": "",
"domain": "",
"name": "",
"dynamicPageHubDbTableId": "",
"campaign": "",
"dynamicPageDataSourceId": "",
"enableDomainStylesheets": false,
"includeDefaultCustomCss": false,
"subcategory": "",
"layoutSections": {},
"updated": "",
"footerHtml": "",
"widgets": {},
"headHtml": "",
"pageExpiryRedirectUrl": "",
"abStatus": "",
"useFeaturedImage": false,
"abTestId": "",
"featuredImageAltText": "",
"contentGroupId": "",
"pageExpiryEnabled": false,
"templatePath": "",
"url": "",
"publicAccessRules": [
{}
],
"archivedAt": "",
"themeSettingsValues": {},
"pageExpiryDate": 0,
"publicAccessRulesEnabled": false,
"pageRedirected": false,
"currentState": "",
"categoryId": 0,
"linkRelCanonicalUrl": ""
}',
'headers' => [
'content-type' => 'application/json',
'private-app-legacy' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/cms/v3/pages/landing-pages/:objectId');
$request->setMethod(HttpRequest::HTTP_METH_PATCH);
$request->setHeaders([
'private-app-legacy' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'publishDate' => '',
'language' => '',
'enableLayoutStylesheets' => null,
'metaDescription' => '',
'attachedStylesheets' => [
[
]
],
'password' => '',
'publishImmediately' => null,
'htmlTitle' => '',
'translations' => [
],
'id' => '',
'state' => '',
'slug' => '',
'createdById' => '',
'currentlyPublished' => null,
'archivedInDashboard' => null,
'created' => '',
'contentTypeCategory' => '',
'mabExperimentId' => '',
'updatedById' => '',
'translatedFromId' => '',
'folderId' => '',
'widgetContainers' => [
],
'pageExpiryRedirectId' => 0,
'dynamicPageDataSourceType' => 0,
'featuredImage' => '',
'authorName' => '',
'domain' => '',
'name' => '',
'dynamicPageHubDbTableId' => '',
'campaign' => '',
'dynamicPageDataSourceId' => '',
'enableDomainStylesheets' => null,
'includeDefaultCustomCss' => null,
'subcategory' => '',
'layoutSections' => [
],
'updated' => '',
'footerHtml' => '',
'widgets' => [
],
'headHtml' => '',
'pageExpiryRedirectUrl' => '',
'abStatus' => '',
'useFeaturedImage' => null,
'abTestId' => '',
'featuredImageAltText' => '',
'contentGroupId' => '',
'pageExpiryEnabled' => null,
'templatePath' => '',
'url' => '',
'publicAccessRules' => [
[
]
],
'archivedAt' => '',
'themeSettingsValues' => [
],
'pageExpiryDate' => 0,
'publicAccessRulesEnabled' => null,
'pageRedirected' => null,
'currentState' => '',
'categoryId' => 0,
'linkRelCanonicalUrl' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'publishDate' => '',
'language' => '',
'enableLayoutStylesheets' => null,
'metaDescription' => '',
'attachedStylesheets' => [
[
]
],
'password' => '',
'publishImmediately' => null,
'htmlTitle' => '',
'translations' => [
],
'id' => '',
'state' => '',
'slug' => '',
'createdById' => '',
'currentlyPublished' => null,
'archivedInDashboard' => null,
'created' => '',
'contentTypeCategory' => '',
'mabExperimentId' => '',
'updatedById' => '',
'translatedFromId' => '',
'folderId' => '',
'widgetContainers' => [
],
'pageExpiryRedirectId' => 0,
'dynamicPageDataSourceType' => 0,
'featuredImage' => '',
'authorName' => '',
'domain' => '',
'name' => '',
'dynamicPageHubDbTableId' => '',
'campaign' => '',
'dynamicPageDataSourceId' => '',
'enableDomainStylesheets' => null,
'includeDefaultCustomCss' => null,
'subcategory' => '',
'layoutSections' => [
],
'updated' => '',
'footerHtml' => '',
'widgets' => [
],
'headHtml' => '',
'pageExpiryRedirectUrl' => '',
'abStatus' => '',
'useFeaturedImage' => null,
'abTestId' => '',
'featuredImageAltText' => '',
'contentGroupId' => '',
'pageExpiryEnabled' => null,
'templatePath' => '',
'url' => '',
'publicAccessRules' => [
[
]
],
'archivedAt' => '',
'themeSettingsValues' => [
],
'pageExpiryDate' => 0,
'publicAccessRulesEnabled' => null,
'pageRedirected' => null,
'currentState' => '',
'categoryId' => 0,
'linkRelCanonicalUrl' => ''
]));
$request->setRequestUrl('{{baseUrl}}/cms/v3/pages/landing-pages/:objectId');
$request->setRequestMethod('PATCH');
$request->setBody($body);
$request->setHeaders([
'private-app-legacy' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("private-app-legacy", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/cms/v3/pages/landing-pages/:objectId' -Method PATCH -Headers $headers -ContentType 'application/json' -Body '{
"publishDate": "",
"language": "",
"enableLayoutStylesheets": false,
"metaDescription": "",
"attachedStylesheets": [
{}
],
"password": "",
"publishImmediately": false,
"htmlTitle": "",
"translations": {},
"id": "",
"state": "",
"slug": "",
"createdById": "",
"currentlyPublished": false,
"archivedInDashboard": false,
"created": "",
"contentTypeCategory": "",
"mabExperimentId": "",
"updatedById": "",
"translatedFromId": "",
"folderId": "",
"widgetContainers": {},
"pageExpiryRedirectId": 0,
"dynamicPageDataSourceType": 0,
"featuredImage": "",
"authorName": "",
"domain": "",
"name": "",
"dynamicPageHubDbTableId": "",
"campaign": "",
"dynamicPageDataSourceId": "",
"enableDomainStylesheets": false,
"includeDefaultCustomCss": false,
"subcategory": "",
"layoutSections": {},
"updated": "",
"footerHtml": "",
"widgets": {},
"headHtml": "",
"pageExpiryRedirectUrl": "",
"abStatus": "",
"useFeaturedImage": false,
"abTestId": "",
"featuredImageAltText": "",
"contentGroupId": "",
"pageExpiryEnabled": false,
"templatePath": "",
"url": "",
"publicAccessRules": [
{}
],
"archivedAt": "",
"themeSettingsValues": {},
"pageExpiryDate": 0,
"publicAccessRulesEnabled": false,
"pageRedirected": false,
"currentState": "",
"categoryId": 0,
"linkRelCanonicalUrl": ""
}'
$headers=@{}
$headers.Add("private-app-legacy", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/cms/v3/pages/landing-pages/:objectId' -Method PATCH -Headers $headers -ContentType 'application/json' -Body '{
"publishDate": "",
"language": "",
"enableLayoutStylesheets": false,
"metaDescription": "",
"attachedStylesheets": [
{}
],
"password": "",
"publishImmediately": false,
"htmlTitle": "",
"translations": {},
"id": "",
"state": "",
"slug": "",
"createdById": "",
"currentlyPublished": false,
"archivedInDashboard": false,
"created": "",
"contentTypeCategory": "",
"mabExperimentId": "",
"updatedById": "",
"translatedFromId": "",
"folderId": "",
"widgetContainers": {},
"pageExpiryRedirectId": 0,
"dynamicPageDataSourceType": 0,
"featuredImage": "",
"authorName": "",
"domain": "",
"name": "",
"dynamicPageHubDbTableId": "",
"campaign": "",
"dynamicPageDataSourceId": "",
"enableDomainStylesheets": false,
"includeDefaultCustomCss": false,
"subcategory": "",
"layoutSections": {},
"updated": "",
"footerHtml": "",
"widgets": {},
"headHtml": "",
"pageExpiryRedirectUrl": "",
"abStatus": "",
"useFeaturedImage": false,
"abTestId": "",
"featuredImageAltText": "",
"contentGroupId": "",
"pageExpiryEnabled": false,
"templatePath": "",
"url": "",
"publicAccessRules": [
{}
],
"archivedAt": "",
"themeSettingsValues": {},
"pageExpiryDate": 0,
"publicAccessRulesEnabled": false,
"pageRedirected": false,
"currentState": "",
"categoryId": 0,
"linkRelCanonicalUrl": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"publishDate\": \"\",\n \"language\": \"\",\n \"enableLayoutStylesheets\": false,\n \"metaDescription\": \"\",\n \"attachedStylesheets\": [\n {}\n ],\n \"password\": \"\",\n \"publishImmediately\": false,\n \"htmlTitle\": \"\",\n \"translations\": {},\n \"id\": \"\",\n \"state\": \"\",\n \"slug\": \"\",\n \"createdById\": \"\",\n \"currentlyPublished\": false,\n \"archivedInDashboard\": false,\n \"created\": \"\",\n \"contentTypeCategory\": \"\",\n \"mabExperimentId\": \"\",\n \"updatedById\": \"\",\n \"translatedFromId\": \"\",\n \"folderId\": \"\",\n \"widgetContainers\": {},\n \"pageExpiryRedirectId\": 0,\n \"dynamicPageDataSourceType\": 0,\n \"featuredImage\": \"\",\n \"authorName\": \"\",\n \"domain\": \"\",\n \"name\": \"\",\n \"dynamicPageHubDbTableId\": \"\",\n \"campaign\": \"\",\n \"dynamicPageDataSourceId\": \"\",\n \"enableDomainStylesheets\": false,\n \"includeDefaultCustomCss\": false,\n \"subcategory\": \"\",\n \"layoutSections\": {},\n \"updated\": \"\",\n \"footerHtml\": \"\",\n \"widgets\": {},\n \"headHtml\": \"\",\n \"pageExpiryRedirectUrl\": \"\",\n \"abStatus\": \"\",\n \"useFeaturedImage\": false,\n \"abTestId\": \"\",\n \"featuredImageAltText\": \"\",\n \"contentGroupId\": \"\",\n \"pageExpiryEnabled\": false,\n \"templatePath\": \"\",\n \"url\": \"\",\n \"publicAccessRules\": [\n {}\n ],\n \"archivedAt\": \"\",\n \"themeSettingsValues\": {},\n \"pageExpiryDate\": 0,\n \"publicAccessRulesEnabled\": false,\n \"pageRedirected\": false,\n \"currentState\": \"\",\n \"categoryId\": 0,\n \"linkRelCanonicalUrl\": \"\"\n}"
headers = {
'private-app-legacy': "{{apiKey}}",
'content-type': "application/json"
}
conn.request("PATCH", "/baseUrl/cms/v3/pages/landing-pages/:objectId", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/cms/v3/pages/landing-pages/:objectId"
payload = {
"publishDate": "",
"language": "",
"enableLayoutStylesheets": False,
"metaDescription": "",
"attachedStylesheets": [{}],
"password": "",
"publishImmediately": False,
"htmlTitle": "",
"translations": {},
"id": "",
"state": "",
"slug": "",
"createdById": "",
"currentlyPublished": False,
"archivedInDashboard": False,
"created": "",
"contentTypeCategory": "",
"mabExperimentId": "",
"updatedById": "",
"translatedFromId": "",
"folderId": "",
"widgetContainers": {},
"pageExpiryRedirectId": 0,
"dynamicPageDataSourceType": 0,
"featuredImage": "",
"authorName": "",
"domain": "",
"name": "",
"dynamicPageHubDbTableId": "",
"campaign": "",
"dynamicPageDataSourceId": "",
"enableDomainStylesheets": False,
"includeDefaultCustomCss": False,
"subcategory": "",
"layoutSections": {},
"updated": "",
"footerHtml": "",
"widgets": {},
"headHtml": "",
"pageExpiryRedirectUrl": "",
"abStatus": "",
"useFeaturedImage": False,
"abTestId": "",
"featuredImageAltText": "",
"contentGroupId": "",
"pageExpiryEnabled": False,
"templatePath": "",
"url": "",
"publicAccessRules": [{}],
"archivedAt": "",
"themeSettingsValues": {},
"pageExpiryDate": 0,
"publicAccessRulesEnabled": False,
"pageRedirected": False,
"currentState": "",
"categoryId": 0,
"linkRelCanonicalUrl": ""
}
headers = {
"private-app-legacy": "{{apiKey}}",
"content-type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/cms/v3/pages/landing-pages/:objectId"
payload <- "{\n \"publishDate\": \"\",\n \"language\": \"\",\n \"enableLayoutStylesheets\": false,\n \"metaDescription\": \"\",\n \"attachedStylesheets\": [\n {}\n ],\n \"password\": \"\",\n \"publishImmediately\": false,\n \"htmlTitle\": \"\",\n \"translations\": {},\n \"id\": \"\",\n \"state\": \"\",\n \"slug\": \"\",\n \"createdById\": \"\",\n \"currentlyPublished\": false,\n \"archivedInDashboard\": false,\n \"created\": \"\",\n \"contentTypeCategory\": \"\",\n \"mabExperimentId\": \"\",\n \"updatedById\": \"\",\n \"translatedFromId\": \"\",\n \"folderId\": \"\",\n \"widgetContainers\": {},\n \"pageExpiryRedirectId\": 0,\n \"dynamicPageDataSourceType\": 0,\n \"featuredImage\": \"\",\n \"authorName\": \"\",\n \"domain\": \"\",\n \"name\": \"\",\n \"dynamicPageHubDbTableId\": \"\",\n \"campaign\": \"\",\n \"dynamicPageDataSourceId\": \"\",\n \"enableDomainStylesheets\": false,\n \"includeDefaultCustomCss\": false,\n \"subcategory\": \"\",\n \"layoutSections\": {},\n \"updated\": \"\",\n \"footerHtml\": \"\",\n \"widgets\": {},\n \"headHtml\": \"\",\n \"pageExpiryRedirectUrl\": \"\",\n \"abStatus\": \"\",\n \"useFeaturedImage\": false,\n \"abTestId\": \"\",\n \"featuredImageAltText\": \"\",\n \"contentGroupId\": \"\",\n \"pageExpiryEnabled\": false,\n \"templatePath\": \"\",\n \"url\": \"\",\n \"publicAccessRules\": [\n {}\n ],\n \"archivedAt\": \"\",\n \"themeSettingsValues\": {},\n \"pageExpiryDate\": 0,\n \"publicAccessRulesEnabled\": false,\n \"pageRedirected\": false,\n \"currentState\": \"\",\n \"categoryId\": 0,\n \"linkRelCanonicalUrl\": \"\"\n}"
encode <- "json"
response <- VERB("PATCH", url, body = payload, add_headers('private-app-legacy' = '{{apiKey}}'), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/cms/v3/pages/landing-pages/:objectId")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["private-app-legacy"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n \"publishDate\": \"\",\n \"language\": \"\",\n \"enableLayoutStylesheets\": false,\n \"metaDescription\": \"\",\n \"attachedStylesheets\": [\n {}\n ],\n \"password\": \"\",\n \"publishImmediately\": false,\n \"htmlTitle\": \"\",\n \"translations\": {},\n \"id\": \"\",\n \"state\": \"\",\n \"slug\": \"\",\n \"createdById\": \"\",\n \"currentlyPublished\": false,\n \"archivedInDashboard\": false,\n \"created\": \"\",\n \"contentTypeCategory\": \"\",\n \"mabExperimentId\": \"\",\n \"updatedById\": \"\",\n \"translatedFromId\": \"\",\n \"folderId\": \"\",\n \"widgetContainers\": {},\n \"pageExpiryRedirectId\": 0,\n \"dynamicPageDataSourceType\": 0,\n \"featuredImage\": \"\",\n \"authorName\": \"\",\n \"domain\": \"\",\n \"name\": \"\",\n \"dynamicPageHubDbTableId\": \"\",\n \"campaign\": \"\",\n \"dynamicPageDataSourceId\": \"\",\n \"enableDomainStylesheets\": false,\n \"includeDefaultCustomCss\": false,\n \"subcategory\": \"\",\n \"layoutSections\": {},\n \"updated\": \"\",\n \"footerHtml\": \"\",\n \"widgets\": {},\n \"headHtml\": \"\",\n \"pageExpiryRedirectUrl\": \"\",\n \"abStatus\": \"\",\n \"useFeaturedImage\": false,\n \"abTestId\": \"\",\n \"featuredImageAltText\": \"\",\n \"contentGroupId\": \"\",\n \"pageExpiryEnabled\": false,\n \"templatePath\": \"\",\n \"url\": \"\",\n \"publicAccessRules\": [\n {}\n ],\n \"archivedAt\": \"\",\n \"themeSettingsValues\": {},\n \"pageExpiryDate\": 0,\n \"publicAccessRulesEnabled\": false,\n \"pageRedirected\": false,\n \"currentState\": \"\",\n \"categoryId\": 0,\n \"linkRelCanonicalUrl\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.patch('/baseUrl/cms/v3/pages/landing-pages/:objectId') do |req|
req.headers['private-app-legacy'] = '{{apiKey}}'
req.body = "{\n \"publishDate\": \"\",\n \"language\": \"\",\n \"enableLayoutStylesheets\": false,\n \"metaDescription\": \"\",\n \"attachedStylesheets\": [\n {}\n ],\n \"password\": \"\",\n \"publishImmediately\": false,\n \"htmlTitle\": \"\",\n \"translations\": {},\n \"id\": \"\",\n \"state\": \"\",\n \"slug\": \"\",\n \"createdById\": \"\",\n \"currentlyPublished\": false,\n \"archivedInDashboard\": false,\n \"created\": \"\",\n \"contentTypeCategory\": \"\",\n \"mabExperimentId\": \"\",\n \"updatedById\": \"\",\n \"translatedFromId\": \"\",\n \"folderId\": \"\",\n \"widgetContainers\": {},\n \"pageExpiryRedirectId\": 0,\n \"dynamicPageDataSourceType\": 0,\n \"featuredImage\": \"\",\n \"authorName\": \"\",\n \"domain\": \"\",\n \"name\": \"\",\n \"dynamicPageHubDbTableId\": \"\",\n \"campaign\": \"\",\n \"dynamicPageDataSourceId\": \"\",\n \"enableDomainStylesheets\": false,\n \"includeDefaultCustomCss\": false,\n \"subcategory\": \"\",\n \"layoutSections\": {},\n \"updated\": \"\",\n \"footerHtml\": \"\",\n \"widgets\": {},\n \"headHtml\": \"\",\n \"pageExpiryRedirectUrl\": \"\",\n \"abStatus\": \"\",\n \"useFeaturedImage\": false,\n \"abTestId\": \"\",\n \"featuredImageAltText\": \"\",\n \"contentGroupId\": \"\",\n \"pageExpiryEnabled\": false,\n \"templatePath\": \"\",\n \"url\": \"\",\n \"publicAccessRules\": [\n {}\n ],\n \"archivedAt\": \"\",\n \"themeSettingsValues\": {},\n \"pageExpiryDate\": 0,\n \"publicAccessRulesEnabled\": false,\n \"pageRedirected\": false,\n \"currentState\": \"\",\n \"categoryId\": 0,\n \"linkRelCanonicalUrl\": \"\"\n}"
end
puts response.status
puts response.body
use std::str::FromStr;
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/cms/v3/pages/landing-pages/:objectId";
let payload = json!({
"publishDate": "",
"language": "",
"enableLayoutStylesheets": false,
"metaDescription": "",
"attachedStylesheets": (json!({})),
"password": "",
"publishImmediately": false,
"htmlTitle": "",
"translations": json!({}),
"id": "",
"state": "",
"slug": "",
"createdById": "",
"currentlyPublished": false,
"archivedInDashboard": false,
"created": "",
"contentTypeCategory": "",
"mabExperimentId": "",
"updatedById": "",
"translatedFromId": "",
"folderId": "",
"widgetContainers": json!({}),
"pageExpiryRedirectId": 0,
"dynamicPageDataSourceType": 0,
"featuredImage": "",
"authorName": "",
"domain": "",
"name": "",
"dynamicPageHubDbTableId": "",
"campaign": "",
"dynamicPageDataSourceId": "",
"enableDomainStylesheets": false,
"includeDefaultCustomCss": false,
"subcategory": "",
"layoutSections": json!({}),
"updated": "",
"footerHtml": "",
"widgets": json!({}),
"headHtml": "",
"pageExpiryRedirectUrl": "",
"abStatus": "",
"useFeaturedImage": false,
"abTestId": "",
"featuredImageAltText": "",
"contentGroupId": "",
"pageExpiryEnabled": false,
"templatePath": "",
"url": "",
"publicAccessRules": (json!({})),
"archivedAt": "",
"themeSettingsValues": json!({}),
"pageExpiryDate": 0,
"publicAccessRulesEnabled": false,
"pageRedirected": false,
"currentState": "",
"categoryId": 0,
"linkRelCanonicalUrl": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("private-app-legacy", "{{apiKey}}".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PATCH").unwrap(), url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PATCH \
--url {{baseUrl}}/cms/v3/pages/landing-pages/:objectId \
--header 'content-type: application/json' \
--header 'private-app-legacy: {{apiKey}}' \
--data '{
"publishDate": "",
"language": "",
"enableLayoutStylesheets": false,
"metaDescription": "",
"attachedStylesheets": [
{}
],
"password": "",
"publishImmediately": false,
"htmlTitle": "",
"translations": {},
"id": "",
"state": "",
"slug": "",
"createdById": "",
"currentlyPublished": false,
"archivedInDashboard": false,
"created": "",
"contentTypeCategory": "",
"mabExperimentId": "",
"updatedById": "",
"translatedFromId": "",
"folderId": "",
"widgetContainers": {},
"pageExpiryRedirectId": 0,
"dynamicPageDataSourceType": 0,
"featuredImage": "",
"authorName": "",
"domain": "",
"name": "",
"dynamicPageHubDbTableId": "",
"campaign": "",
"dynamicPageDataSourceId": "",
"enableDomainStylesheets": false,
"includeDefaultCustomCss": false,
"subcategory": "",
"layoutSections": {},
"updated": "",
"footerHtml": "",
"widgets": {},
"headHtml": "",
"pageExpiryRedirectUrl": "",
"abStatus": "",
"useFeaturedImage": false,
"abTestId": "",
"featuredImageAltText": "",
"contentGroupId": "",
"pageExpiryEnabled": false,
"templatePath": "",
"url": "",
"publicAccessRules": [
{}
],
"archivedAt": "",
"themeSettingsValues": {},
"pageExpiryDate": 0,
"publicAccessRulesEnabled": false,
"pageRedirected": false,
"currentState": "",
"categoryId": 0,
"linkRelCanonicalUrl": ""
}'
echo '{
"publishDate": "",
"language": "",
"enableLayoutStylesheets": false,
"metaDescription": "",
"attachedStylesheets": [
{}
],
"password": "",
"publishImmediately": false,
"htmlTitle": "",
"translations": {},
"id": "",
"state": "",
"slug": "",
"createdById": "",
"currentlyPublished": false,
"archivedInDashboard": false,
"created": "",
"contentTypeCategory": "",
"mabExperimentId": "",
"updatedById": "",
"translatedFromId": "",
"folderId": "",
"widgetContainers": {},
"pageExpiryRedirectId": 0,
"dynamicPageDataSourceType": 0,
"featuredImage": "",
"authorName": "",
"domain": "",
"name": "",
"dynamicPageHubDbTableId": "",
"campaign": "",
"dynamicPageDataSourceId": "",
"enableDomainStylesheets": false,
"includeDefaultCustomCss": false,
"subcategory": "",
"layoutSections": {},
"updated": "",
"footerHtml": "",
"widgets": {},
"headHtml": "",
"pageExpiryRedirectUrl": "",
"abStatus": "",
"useFeaturedImage": false,
"abTestId": "",
"featuredImageAltText": "",
"contentGroupId": "",
"pageExpiryEnabled": false,
"templatePath": "",
"url": "",
"publicAccessRules": [
{}
],
"archivedAt": "",
"themeSettingsValues": {},
"pageExpiryDate": 0,
"publicAccessRulesEnabled": false,
"pageRedirected": false,
"currentState": "",
"categoryId": 0,
"linkRelCanonicalUrl": ""
}' | \
http PATCH {{baseUrl}}/cms/v3/pages/landing-pages/:objectId \
content-type:application/json \
private-app-legacy:'{{apiKey}}'
wget --quiet \
--method PATCH \
--header 'private-app-legacy: {{apiKey}}' \
--header 'content-type: application/json' \
--body-data '{\n "publishDate": "",\n "language": "",\n "enableLayoutStylesheets": false,\n "metaDescription": "",\n "attachedStylesheets": [\n {}\n ],\n "password": "",\n "publishImmediately": false,\n "htmlTitle": "",\n "translations": {},\n "id": "",\n "state": "",\n "slug": "",\n "createdById": "",\n "currentlyPublished": false,\n "archivedInDashboard": false,\n "created": "",\n "contentTypeCategory": "",\n "mabExperimentId": "",\n "updatedById": "",\n "translatedFromId": "",\n "folderId": "",\n "widgetContainers": {},\n "pageExpiryRedirectId": 0,\n "dynamicPageDataSourceType": 0,\n "featuredImage": "",\n "authorName": "",\n "domain": "",\n "name": "",\n "dynamicPageHubDbTableId": "",\n "campaign": "",\n "dynamicPageDataSourceId": "",\n "enableDomainStylesheets": false,\n "includeDefaultCustomCss": false,\n "subcategory": "",\n "layoutSections": {},\n "updated": "",\n "footerHtml": "",\n "widgets": {},\n "headHtml": "",\n "pageExpiryRedirectUrl": "",\n "abStatus": "",\n "useFeaturedImage": false,\n "abTestId": "",\n "featuredImageAltText": "",\n "contentGroupId": "",\n "pageExpiryEnabled": false,\n "templatePath": "",\n "url": "",\n "publicAccessRules": [\n {}\n ],\n "archivedAt": "",\n "themeSettingsValues": {},\n "pageExpiryDate": 0,\n "publicAccessRulesEnabled": false,\n "pageRedirected": false,\n "currentState": "",\n "categoryId": 0,\n "linkRelCanonicalUrl": ""\n}' \
--output-document \
- {{baseUrl}}/cms/v3/pages/landing-pages/:objectId
import Foundation
let headers = [
"private-app-legacy": "{{apiKey}}",
"content-type": "application/json"
]
let parameters = [
"publishDate": "",
"language": "",
"enableLayoutStylesheets": false,
"metaDescription": "",
"attachedStylesheets": [[]],
"password": "",
"publishImmediately": false,
"htmlTitle": "",
"translations": [],
"id": "",
"state": "",
"slug": "",
"createdById": "",
"currentlyPublished": false,
"archivedInDashboard": false,
"created": "",
"contentTypeCategory": "",
"mabExperimentId": "",
"updatedById": "",
"translatedFromId": "",
"folderId": "",
"widgetContainers": [],
"pageExpiryRedirectId": 0,
"dynamicPageDataSourceType": 0,
"featuredImage": "",
"authorName": "",
"domain": "",
"name": "",
"dynamicPageHubDbTableId": "",
"campaign": "",
"dynamicPageDataSourceId": "",
"enableDomainStylesheets": false,
"includeDefaultCustomCss": false,
"subcategory": "",
"layoutSections": [],
"updated": "",
"footerHtml": "",
"widgets": [],
"headHtml": "",
"pageExpiryRedirectUrl": "",
"abStatus": "",
"useFeaturedImage": false,
"abTestId": "",
"featuredImageAltText": "",
"contentGroupId": "",
"pageExpiryEnabled": false,
"templatePath": "",
"url": "",
"publicAccessRules": [[]],
"archivedAt": "",
"themeSettingsValues": [],
"pageExpiryDate": 0,
"publicAccessRulesEnabled": false,
"pageRedirected": false,
"currentState": "",
"categoryId": 0,
"linkRelCanonicalUrl": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/cms/v3/pages/landing-pages/:objectId")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PATCH"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
*/*
RESPONSE BODY text
{
"message": "Invalid input (details will vary based on the error)",
"correlationId": "aeb5f871-7f07-4993-9211-075dc63e7cbf",
"category": "VALIDATION_ERROR",
"links": {
"knowledge-base": "https://www.hubspot.com/products/service/knowledge-base"
}
}
POST
Update a batch of Folders
{{baseUrl}}/cms/v3/pages/landing-pages/folders/batch/update
HEADERS
private-app-legacy
{{apiKey}}
BODY json
{
"inputs": [
{}
]
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/cms/v3/pages/landing-pages/folders/batch/update");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "private-app-legacy: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"inputs\": [\n {}\n ]\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/cms/v3/pages/landing-pages/folders/batch/update" {:headers {:private-app-legacy "{{apiKey}}"}
:content-type :json
:form-params {:inputs [{}]}})
require "http/client"
url = "{{baseUrl}}/cms/v3/pages/landing-pages/folders/batch/update"
headers = HTTP::Headers{
"private-app-legacy" => "{{apiKey}}"
"content-type" => "application/json"
}
reqBody = "{\n \"inputs\": [\n {}\n ]\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/cms/v3/pages/landing-pages/folders/batch/update"),
Headers =
{
{ "private-app-legacy", "{{apiKey}}" },
},
Content = new StringContent("{\n \"inputs\": [\n {}\n ]\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/cms/v3/pages/landing-pages/folders/batch/update");
var request = new RestRequest("", Method.Post);
request.AddHeader("private-app-legacy", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"inputs\": [\n {}\n ]\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/cms/v3/pages/landing-pages/folders/batch/update"
payload := strings.NewReader("{\n \"inputs\": [\n {}\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("private-app-legacy", "{{apiKey}}")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/cms/v3/pages/landing-pages/folders/batch/update HTTP/1.1
Private-App-Legacy: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 28
{
"inputs": [
{}
]
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/cms/v3/pages/landing-pages/folders/batch/update")
.setHeader("private-app-legacy", "{{apiKey}}")
.setHeader("content-type", "application/json")
.setBody("{\n \"inputs\": [\n {}\n ]\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/cms/v3/pages/landing-pages/folders/batch/update"))
.header("private-app-legacy", "{{apiKey}}")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"inputs\": [\n {}\n ]\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"inputs\": [\n {}\n ]\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/cms/v3/pages/landing-pages/folders/batch/update")
.post(body)
.addHeader("private-app-legacy", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/cms/v3/pages/landing-pages/folders/batch/update")
.header("private-app-legacy", "{{apiKey}}")
.header("content-type", "application/json")
.body("{\n \"inputs\": [\n {}\n ]\n}")
.asString();
const data = JSON.stringify({
inputs: [
{}
]
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/cms/v3/pages/landing-pages/folders/batch/update');
xhr.setRequestHeader('private-app-legacy', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/cms/v3/pages/landing-pages/folders/batch/update',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
data: {inputs: [{}]}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/cms/v3/pages/landing-pages/folders/batch/update';
const options = {
method: 'POST',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
body: '{"inputs":[{}]}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/cms/v3/pages/landing-pages/folders/batch/update',
method: 'POST',
headers: {
'private-app-legacy': '{{apiKey}}',
'content-type': 'application/json'
},
processData: false,
data: '{\n "inputs": [\n {}\n ]\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"inputs\": [\n {}\n ]\n}")
val request = Request.Builder()
.url("{{baseUrl}}/cms/v3/pages/landing-pages/folders/batch/update")
.post(body)
.addHeader("private-app-legacy", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/cms/v3/pages/landing-pages/folders/batch/update',
headers: {
'private-app-legacy': '{{apiKey}}',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({inputs: [{}]}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/cms/v3/pages/landing-pages/folders/batch/update',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
body: {inputs: [{}]},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/cms/v3/pages/landing-pages/folders/batch/update');
req.headers({
'private-app-legacy': '{{apiKey}}',
'content-type': 'application/json'
});
req.type('json');
req.send({
inputs: [
{}
]
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/cms/v3/pages/landing-pages/folders/batch/update',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
data: {inputs: [{}]}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/cms/v3/pages/landing-pages/folders/batch/update';
const options = {
method: 'POST',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
body: '{"inputs":[{}]}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"private-app-legacy": @"{{apiKey}}",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"inputs": @[ @{ } ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/cms/v3/pages/landing-pages/folders/batch/update"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/cms/v3/pages/landing-pages/folders/batch/update" in
let headers = Header.add_list (Header.init ()) [
("private-app-legacy", "{{apiKey}}");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"inputs\": [\n {}\n ]\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/cms/v3/pages/landing-pages/folders/batch/update",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'inputs' => [
[
]
]
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"private-app-legacy: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/cms/v3/pages/landing-pages/folders/batch/update', [
'body' => '{
"inputs": [
{}
]
}',
'headers' => [
'content-type' => 'application/json',
'private-app-legacy' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/cms/v3/pages/landing-pages/folders/batch/update');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'private-app-legacy' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'inputs' => [
[
]
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'inputs' => [
[
]
]
]));
$request->setRequestUrl('{{baseUrl}}/cms/v3/pages/landing-pages/folders/batch/update');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'private-app-legacy' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("private-app-legacy", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/cms/v3/pages/landing-pages/folders/batch/update' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"inputs": [
{}
]
}'
$headers=@{}
$headers.Add("private-app-legacy", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/cms/v3/pages/landing-pages/folders/batch/update' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"inputs": [
{}
]
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"inputs\": [\n {}\n ]\n}"
headers = {
'private-app-legacy': "{{apiKey}}",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/cms/v3/pages/landing-pages/folders/batch/update", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/cms/v3/pages/landing-pages/folders/batch/update"
payload = { "inputs": [{}] }
headers = {
"private-app-legacy": "{{apiKey}}",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/cms/v3/pages/landing-pages/folders/batch/update"
payload <- "{\n \"inputs\": [\n {}\n ]\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('private-app-legacy' = '{{apiKey}}'), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/cms/v3/pages/landing-pages/folders/batch/update")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["private-app-legacy"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n \"inputs\": [\n {}\n ]\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/cms/v3/pages/landing-pages/folders/batch/update') do |req|
req.headers['private-app-legacy'] = '{{apiKey}}'
req.body = "{\n \"inputs\": [\n {}\n ]\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/cms/v3/pages/landing-pages/folders/batch/update";
let payload = json!({"inputs": (json!({}))});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("private-app-legacy", "{{apiKey}}".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/cms/v3/pages/landing-pages/folders/batch/update \
--header 'content-type: application/json' \
--header 'private-app-legacy: {{apiKey}}' \
--data '{
"inputs": [
{}
]
}'
echo '{
"inputs": [
{}
]
}' | \
http POST {{baseUrl}}/cms/v3/pages/landing-pages/folders/batch/update \
content-type:application/json \
private-app-legacy:'{{apiKey}}'
wget --quiet \
--method POST \
--header 'private-app-legacy: {{apiKey}}' \
--header 'content-type: application/json' \
--body-data '{\n "inputs": [\n {}\n ]\n}' \
--output-document \
- {{baseUrl}}/cms/v3/pages/landing-pages/folders/batch/update
import Foundation
let headers = [
"private-app-legacy": "{{apiKey}}",
"content-type": "application/json"
]
let parameters = ["inputs": [[]]] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/cms/v3/pages/landing-pages/folders/batch/update")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
*/*
RESPONSE BODY text
{
"message": "Invalid input (details will vary based on the error)",
"correlationId": "aeb5f871-7f07-4993-9211-075dc63e7cbf",
"category": "VALIDATION_ERROR",
"links": {
"knowledge-base": "https://www.hubspot.com/products/service/knowledge-base"
}
}
POST
Update a batch of Landing Pages
{{baseUrl}}/cms/v3/pages/landing-pages/batch/update
HEADERS
private-app-legacy
{{apiKey}}
BODY json
{
"inputs": [
{}
]
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/cms/v3/pages/landing-pages/batch/update");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "private-app-legacy: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"inputs\": [\n {}\n ]\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/cms/v3/pages/landing-pages/batch/update" {:headers {:private-app-legacy "{{apiKey}}"}
:content-type :json
:form-params {:inputs [{}]}})
require "http/client"
url = "{{baseUrl}}/cms/v3/pages/landing-pages/batch/update"
headers = HTTP::Headers{
"private-app-legacy" => "{{apiKey}}"
"content-type" => "application/json"
}
reqBody = "{\n \"inputs\": [\n {}\n ]\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/cms/v3/pages/landing-pages/batch/update"),
Headers =
{
{ "private-app-legacy", "{{apiKey}}" },
},
Content = new StringContent("{\n \"inputs\": [\n {}\n ]\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/cms/v3/pages/landing-pages/batch/update");
var request = new RestRequest("", Method.Post);
request.AddHeader("private-app-legacy", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"inputs\": [\n {}\n ]\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/cms/v3/pages/landing-pages/batch/update"
payload := strings.NewReader("{\n \"inputs\": [\n {}\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("private-app-legacy", "{{apiKey}}")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/cms/v3/pages/landing-pages/batch/update HTTP/1.1
Private-App-Legacy: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 28
{
"inputs": [
{}
]
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/cms/v3/pages/landing-pages/batch/update")
.setHeader("private-app-legacy", "{{apiKey}}")
.setHeader("content-type", "application/json")
.setBody("{\n \"inputs\": [\n {}\n ]\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/cms/v3/pages/landing-pages/batch/update"))
.header("private-app-legacy", "{{apiKey}}")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"inputs\": [\n {}\n ]\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"inputs\": [\n {}\n ]\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/cms/v3/pages/landing-pages/batch/update")
.post(body)
.addHeader("private-app-legacy", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/cms/v3/pages/landing-pages/batch/update")
.header("private-app-legacy", "{{apiKey}}")
.header("content-type", "application/json")
.body("{\n \"inputs\": [\n {}\n ]\n}")
.asString();
const data = JSON.stringify({
inputs: [
{}
]
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/cms/v3/pages/landing-pages/batch/update');
xhr.setRequestHeader('private-app-legacy', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/cms/v3/pages/landing-pages/batch/update',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
data: {inputs: [{}]}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/cms/v3/pages/landing-pages/batch/update';
const options = {
method: 'POST',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
body: '{"inputs":[{}]}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/cms/v3/pages/landing-pages/batch/update',
method: 'POST',
headers: {
'private-app-legacy': '{{apiKey}}',
'content-type': 'application/json'
},
processData: false,
data: '{\n "inputs": [\n {}\n ]\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"inputs\": [\n {}\n ]\n}")
val request = Request.Builder()
.url("{{baseUrl}}/cms/v3/pages/landing-pages/batch/update")
.post(body)
.addHeader("private-app-legacy", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/cms/v3/pages/landing-pages/batch/update',
headers: {
'private-app-legacy': '{{apiKey}}',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({inputs: [{}]}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/cms/v3/pages/landing-pages/batch/update',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
body: {inputs: [{}]},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/cms/v3/pages/landing-pages/batch/update');
req.headers({
'private-app-legacy': '{{apiKey}}',
'content-type': 'application/json'
});
req.type('json');
req.send({
inputs: [
{}
]
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/cms/v3/pages/landing-pages/batch/update',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
data: {inputs: [{}]}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/cms/v3/pages/landing-pages/batch/update';
const options = {
method: 'POST',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
body: '{"inputs":[{}]}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"private-app-legacy": @"{{apiKey}}",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"inputs": @[ @{ } ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/cms/v3/pages/landing-pages/batch/update"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/cms/v3/pages/landing-pages/batch/update" in
let headers = Header.add_list (Header.init ()) [
("private-app-legacy", "{{apiKey}}");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"inputs\": [\n {}\n ]\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/cms/v3/pages/landing-pages/batch/update",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'inputs' => [
[
]
]
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"private-app-legacy: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/cms/v3/pages/landing-pages/batch/update', [
'body' => '{
"inputs": [
{}
]
}',
'headers' => [
'content-type' => 'application/json',
'private-app-legacy' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/cms/v3/pages/landing-pages/batch/update');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'private-app-legacy' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'inputs' => [
[
]
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'inputs' => [
[
]
]
]));
$request->setRequestUrl('{{baseUrl}}/cms/v3/pages/landing-pages/batch/update');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'private-app-legacy' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("private-app-legacy", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/cms/v3/pages/landing-pages/batch/update' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"inputs": [
{}
]
}'
$headers=@{}
$headers.Add("private-app-legacy", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/cms/v3/pages/landing-pages/batch/update' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"inputs": [
{}
]
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"inputs\": [\n {}\n ]\n}"
headers = {
'private-app-legacy': "{{apiKey}}",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/cms/v3/pages/landing-pages/batch/update", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/cms/v3/pages/landing-pages/batch/update"
payload = { "inputs": [{}] }
headers = {
"private-app-legacy": "{{apiKey}}",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/cms/v3/pages/landing-pages/batch/update"
payload <- "{\n \"inputs\": [\n {}\n ]\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('private-app-legacy' = '{{apiKey}}'), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/cms/v3/pages/landing-pages/batch/update")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["private-app-legacy"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n \"inputs\": [\n {}\n ]\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/cms/v3/pages/landing-pages/batch/update') do |req|
req.headers['private-app-legacy'] = '{{apiKey}}'
req.body = "{\n \"inputs\": [\n {}\n ]\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/cms/v3/pages/landing-pages/batch/update";
let payload = json!({"inputs": (json!({}))});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("private-app-legacy", "{{apiKey}}".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/cms/v3/pages/landing-pages/batch/update \
--header 'content-type: application/json' \
--header 'private-app-legacy: {{apiKey}}' \
--data '{
"inputs": [
{}
]
}'
echo '{
"inputs": [
{}
]
}' | \
http POST {{baseUrl}}/cms/v3/pages/landing-pages/batch/update \
content-type:application/json \
private-app-legacy:'{{apiKey}}'
wget --quiet \
--method POST \
--header 'private-app-legacy: {{apiKey}}' \
--header 'content-type: application/json' \
--body-data '{\n "inputs": [\n {}\n ]\n}' \
--output-document \
- {{baseUrl}}/cms/v3/pages/landing-pages/batch/update
import Foundation
let headers = [
"private-app-legacy": "{{apiKey}}",
"content-type": "application/json"
]
let parameters = ["inputs": [[]]] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/cms/v3/pages/landing-pages/batch/update")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
*/*
RESPONSE BODY text
{
"message": "Invalid input (details will vary based on the error)",
"correlationId": "aeb5f871-7f07-4993-9211-075dc63e7cbf",
"category": "VALIDATION_ERROR",
"links": {
"knowledge-base": "https://www.hubspot.com/products/service/knowledge-base"
}
}
POST
Update languages of multi-language group (POST)
{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/update-languages
HEADERS
private-app-legacy
{{apiKey}}
BODY json
{
"languages": {},
"primaryId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/update-languages");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "private-app-legacy: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"languages\": {},\n \"primaryId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/update-languages" {:headers {:private-app-legacy "{{apiKey}}"}
:content-type :json
:form-params {:languages {}
:primaryId ""}})
require "http/client"
url = "{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/update-languages"
headers = HTTP::Headers{
"private-app-legacy" => "{{apiKey}}"
"content-type" => "application/json"
}
reqBody = "{\n \"languages\": {},\n \"primaryId\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/update-languages"),
Headers =
{
{ "private-app-legacy", "{{apiKey}}" },
},
Content = new StringContent("{\n \"languages\": {},\n \"primaryId\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/update-languages");
var request = new RestRequest("", Method.Post);
request.AddHeader("private-app-legacy", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"languages\": {},\n \"primaryId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/update-languages"
payload := strings.NewReader("{\n \"languages\": {},\n \"primaryId\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("private-app-legacy", "{{apiKey}}")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/cms/v3/pages/landing-pages/multi-language/update-languages HTTP/1.1
Private-App-Legacy: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 40
{
"languages": {},
"primaryId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/update-languages")
.setHeader("private-app-legacy", "{{apiKey}}")
.setHeader("content-type", "application/json")
.setBody("{\n \"languages\": {},\n \"primaryId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/update-languages"))
.header("private-app-legacy", "{{apiKey}}")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"languages\": {},\n \"primaryId\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"languages\": {},\n \"primaryId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/update-languages")
.post(body)
.addHeader("private-app-legacy", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/update-languages")
.header("private-app-legacy", "{{apiKey}}")
.header("content-type", "application/json")
.body("{\n \"languages\": {},\n \"primaryId\": \"\"\n}")
.asString();
const data = JSON.stringify({
languages: {},
primaryId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/update-languages');
xhr.setRequestHeader('private-app-legacy', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/update-languages',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
data: {languages: {}, primaryId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/update-languages';
const options = {
method: 'POST',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
body: '{"languages":{},"primaryId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/update-languages',
method: 'POST',
headers: {
'private-app-legacy': '{{apiKey}}',
'content-type': 'application/json'
},
processData: false,
data: '{\n "languages": {},\n "primaryId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"languages\": {},\n \"primaryId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/update-languages")
.post(body)
.addHeader("private-app-legacy", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/cms/v3/pages/landing-pages/multi-language/update-languages',
headers: {
'private-app-legacy': '{{apiKey}}',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({languages: {}, primaryId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/update-languages',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
body: {languages: {}, primaryId: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/update-languages');
req.headers({
'private-app-legacy': '{{apiKey}}',
'content-type': 'application/json'
});
req.type('json');
req.send({
languages: {},
primaryId: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/update-languages',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
data: {languages: {}, primaryId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/update-languages';
const options = {
method: 'POST',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
body: '{"languages":{},"primaryId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"private-app-legacy": @"{{apiKey}}",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"languages": @{ },
@"primaryId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/update-languages"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/update-languages" in
let headers = Header.add_list (Header.init ()) [
("private-app-legacy", "{{apiKey}}");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"languages\": {},\n \"primaryId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/update-languages",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'languages' => [
],
'primaryId' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"private-app-legacy: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/update-languages', [
'body' => '{
"languages": {},
"primaryId": ""
}',
'headers' => [
'content-type' => 'application/json',
'private-app-legacy' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/update-languages');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'private-app-legacy' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'languages' => [
],
'primaryId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'languages' => [
],
'primaryId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/update-languages');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'private-app-legacy' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("private-app-legacy", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/update-languages' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"languages": {},
"primaryId": ""
}'
$headers=@{}
$headers.Add("private-app-legacy", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/update-languages' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"languages": {},
"primaryId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"languages\": {},\n \"primaryId\": \"\"\n}"
headers = {
'private-app-legacy': "{{apiKey}}",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/cms/v3/pages/landing-pages/multi-language/update-languages", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/update-languages"
payload = {
"languages": {},
"primaryId": ""
}
headers = {
"private-app-legacy": "{{apiKey}}",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/update-languages"
payload <- "{\n \"languages\": {},\n \"primaryId\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('private-app-legacy' = '{{apiKey}}'), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/update-languages")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["private-app-legacy"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n \"languages\": {},\n \"primaryId\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/cms/v3/pages/landing-pages/multi-language/update-languages') do |req|
req.headers['private-app-legacy'] = '{{apiKey}}'
req.body = "{\n \"languages\": {},\n \"primaryId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/update-languages";
let payload = json!({
"languages": json!({}),
"primaryId": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("private-app-legacy", "{{apiKey}}".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/cms/v3/pages/landing-pages/multi-language/update-languages \
--header 'content-type: application/json' \
--header 'private-app-legacy: {{apiKey}}' \
--data '{
"languages": {},
"primaryId": ""
}'
echo '{
"languages": {},
"primaryId": ""
}' | \
http POST {{baseUrl}}/cms/v3/pages/landing-pages/multi-language/update-languages \
content-type:application/json \
private-app-legacy:'{{apiKey}}'
wget --quiet \
--method POST \
--header 'private-app-legacy: {{apiKey}}' \
--header 'content-type: application/json' \
--body-data '{\n "languages": {},\n "primaryId": ""\n}' \
--output-document \
- {{baseUrl}}/cms/v3/pages/landing-pages/multi-language/update-languages
import Foundation
let headers = [
"private-app-legacy": "{{apiKey}}",
"content-type": "application/json"
]
let parameters = [
"languages": [],
"primaryId": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/cms/v3/pages/landing-pages/multi-language/update-languages")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
*/*
RESPONSE BODY text
{
"message": "Invalid input (details will vary based on the error)",
"correlationId": "aeb5f871-7f07-4993-9211-075dc63e7cbf",
"category": "VALIDATION_ERROR",
"links": {
"knowledge-base": "https://www.hubspot.com/products/service/knowledge-base"
}
}
POST
Attach a site page to a multi-language group
{{baseUrl}}/cms/v3/pages/site-pages/multi-language/attach-to-lang-group
HEADERS
private-app-legacy
{{apiKey}}
BODY json
{
"language": "",
"id": "",
"primaryId": "",
"primaryLanguage": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/cms/v3/pages/site-pages/multi-language/attach-to-lang-group");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "private-app-legacy: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"language\": \"\",\n \"id\": \"\",\n \"primaryId\": \"\",\n \"primaryLanguage\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/cms/v3/pages/site-pages/multi-language/attach-to-lang-group" {:headers {:private-app-legacy "{{apiKey}}"}
:content-type :json
:form-params {:language ""
:id ""
:primaryId ""
:primaryLanguage ""}})
require "http/client"
url = "{{baseUrl}}/cms/v3/pages/site-pages/multi-language/attach-to-lang-group"
headers = HTTP::Headers{
"private-app-legacy" => "{{apiKey}}"
"content-type" => "application/json"
}
reqBody = "{\n \"language\": \"\",\n \"id\": \"\",\n \"primaryId\": \"\",\n \"primaryLanguage\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/cms/v3/pages/site-pages/multi-language/attach-to-lang-group"),
Headers =
{
{ "private-app-legacy", "{{apiKey}}" },
},
Content = new StringContent("{\n \"language\": \"\",\n \"id\": \"\",\n \"primaryId\": \"\",\n \"primaryLanguage\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/cms/v3/pages/site-pages/multi-language/attach-to-lang-group");
var request = new RestRequest("", Method.Post);
request.AddHeader("private-app-legacy", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"language\": \"\",\n \"id\": \"\",\n \"primaryId\": \"\",\n \"primaryLanguage\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/cms/v3/pages/site-pages/multi-language/attach-to-lang-group"
payload := strings.NewReader("{\n \"language\": \"\",\n \"id\": \"\",\n \"primaryId\": \"\",\n \"primaryLanguage\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("private-app-legacy", "{{apiKey}}")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/cms/v3/pages/site-pages/multi-language/attach-to-lang-group HTTP/1.1
Private-App-Legacy: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 76
{
"language": "",
"id": "",
"primaryId": "",
"primaryLanguage": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/cms/v3/pages/site-pages/multi-language/attach-to-lang-group")
.setHeader("private-app-legacy", "{{apiKey}}")
.setHeader("content-type", "application/json")
.setBody("{\n \"language\": \"\",\n \"id\": \"\",\n \"primaryId\": \"\",\n \"primaryLanguage\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/cms/v3/pages/site-pages/multi-language/attach-to-lang-group"))
.header("private-app-legacy", "{{apiKey}}")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"language\": \"\",\n \"id\": \"\",\n \"primaryId\": \"\",\n \"primaryLanguage\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"language\": \"\",\n \"id\": \"\",\n \"primaryId\": \"\",\n \"primaryLanguage\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/cms/v3/pages/site-pages/multi-language/attach-to-lang-group")
.post(body)
.addHeader("private-app-legacy", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/cms/v3/pages/site-pages/multi-language/attach-to-lang-group")
.header("private-app-legacy", "{{apiKey}}")
.header("content-type", "application/json")
.body("{\n \"language\": \"\",\n \"id\": \"\",\n \"primaryId\": \"\",\n \"primaryLanguage\": \"\"\n}")
.asString();
const data = JSON.stringify({
language: '',
id: '',
primaryId: '',
primaryLanguage: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/cms/v3/pages/site-pages/multi-language/attach-to-lang-group');
xhr.setRequestHeader('private-app-legacy', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/cms/v3/pages/site-pages/multi-language/attach-to-lang-group',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
data: {language: '', id: '', primaryId: '', primaryLanguage: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/cms/v3/pages/site-pages/multi-language/attach-to-lang-group';
const options = {
method: 'POST',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
body: '{"language":"","id":"","primaryId":"","primaryLanguage":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/cms/v3/pages/site-pages/multi-language/attach-to-lang-group',
method: 'POST',
headers: {
'private-app-legacy': '{{apiKey}}',
'content-type': 'application/json'
},
processData: false,
data: '{\n "language": "",\n "id": "",\n "primaryId": "",\n "primaryLanguage": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"language\": \"\",\n \"id\": \"\",\n \"primaryId\": \"\",\n \"primaryLanguage\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/cms/v3/pages/site-pages/multi-language/attach-to-lang-group")
.post(body)
.addHeader("private-app-legacy", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/cms/v3/pages/site-pages/multi-language/attach-to-lang-group',
headers: {
'private-app-legacy': '{{apiKey}}',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({language: '', id: '', primaryId: '', primaryLanguage: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/cms/v3/pages/site-pages/multi-language/attach-to-lang-group',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
body: {language: '', id: '', primaryId: '', primaryLanguage: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/cms/v3/pages/site-pages/multi-language/attach-to-lang-group');
req.headers({
'private-app-legacy': '{{apiKey}}',
'content-type': 'application/json'
});
req.type('json');
req.send({
language: '',
id: '',
primaryId: '',
primaryLanguage: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/cms/v3/pages/site-pages/multi-language/attach-to-lang-group',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
data: {language: '', id: '', primaryId: '', primaryLanguage: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/cms/v3/pages/site-pages/multi-language/attach-to-lang-group';
const options = {
method: 'POST',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
body: '{"language":"","id":"","primaryId":"","primaryLanguage":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"private-app-legacy": @"{{apiKey}}",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"language": @"",
@"id": @"",
@"primaryId": @"",
@"primaryLanguage": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/cms/v3/pages/site-pages/multi-language/attach-to-lang-group"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/cms/v3/pages/site-pages/multi-language/attach-to-lang-group" in
let headers = Header.add_list (Header.init ()) [
("private-app-legacy", "{{apiKey}}");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"language\": \"\",\n \"id\": \"\",\n \"primaryId\": \"\",\n \"primaryLanguage\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/cms/v3/pages/site-pages/multi-language/attach-to-lang-group",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'language' => '',
'id' => '',
'primaryId' => '',
'primaryLanguage' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"private-app-legacy: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/cms/v3/pages/site-pages/multi-language/attach-to-lang-group', [
'body' => '{
"language": "",
"id": "",
"primaryId": "",
"primaryLanguage": ""
}',
'headers' => [
'content-type' => 'application/json',
'private-app-legacy' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/cms/v3/pages/site-pages/multi-language/attach-to-lang-group');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'private-app-legacy' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'language' => '',
'id' => '',
'primaryId' => '',
'primaryLanguage' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'language' => '',
'id' => '',
'primaryId' => '',
'primaryLanguage' => ''
]));
$request->setRequestUrl('{{baseUrl}}/cms/v3/pages/site-pages/multi-language/attach-to-lang-group');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'private-app-legacy' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("private-app-legacy", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/cms/v3/pages/site-pages/multi-language/attach-to-lang-group' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"language": "",
"id": "",
"primaryId": "",
"primaryLanguage": ""
}'
$headers=@{}
$headers.Add("private-app-legacy", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/cms/v3/pages/site-pages/multi-language/attach-to-lang-group' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"language": "",
"id": "",
"primaryId": "",
"primaryLanguage": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"language\": \"\",\n \"id\": \"\",\n \"primaryId\": \"\",\n \"primaryLanguage\": \"\"\n}"
headers = {
'private-app-legacy': "{{apiKey}}",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/cms/v3/pages/site-pages/multi-language/attach-to-lang-group", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/cms/v3/pages/site-pages/multi-language/attach-to-lang-group"
payload = {
"language": "",
"id": "",
"primaryId": "",
"primaryLanguage": ""
}
headers = {
"private-app-legacy": "{{apiKey}}",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/cms/v3/pages/site-pages/multi-language/attach-to-lang-group"
payload <- "{\n \"language\": \"\",\n \"id\": \"\",\n \"primaryId\": \"\",\n \"primaryLanguage\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('private-app-legacy' = '{{apiKey}}'), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/cms/v3/pages/site-pages/multi-language/attach-to-lang-group")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["private-app-legacy"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n \"language\": \"\",\n \"id\": \"\",\n \"primaryId\": \"\",\n \"primaryLanguage\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/cms/v3/pages/site-pages/multi-language/attach-to-lang-group') do |req|
req.headers['private-app-legacy'] = '{{apiKey}}'
req.body = "{\n \"language\": \"\",\n \"id\": \"\",\n \"primaryId\": \"\",\n \"primaryLanguage\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/cms/v3/pages/site-pages/multi-language/attach-to-lang-group";
let payload = json!({
"language": "",
"id": "",
"primaryId": "",
"primaryLanguage": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("private-app-legacy", "{{apiKey}}".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/cms/v3/pages/site-pages/multi-language/attach-to-lang-group \
--header 'content-type: application/json' \
--header 'private-app-legacy: {{apiKey}}' \
--data '{
"language": "",
"id": "",
"primaryId": "",
"primaryLanguage": ""
}'
echo '{
"language": "",
"id": "",
"primaryId": "",
"primaryLanguage": ""
}' | \
http POST {{baseUrl}}/cms/v3/pages/site-pages/multi-language/attach-to-lang-group \
content-type:application/json \
private-app-legacy:'{{apiKey}}'
wget --quiet \
--method POST \
--header 'private-app-legacy: {{apiKey}}' \
--header 'content-type: application/json' \
--body-data '{\n "language": "",\n "id": "",\n "primaryId": "",\n "primaryLanguage": ""\n}' \
--output-document \
- {{baseUrl}}/cms/v3/pages/site-pages/multi-language/attach-to-lang-group
import Foundation
let headers = [
"private-app-legacy": "{{apiKey}}",
"content-type": "application/json"
]
let parameters = [
"language": "",
"id": "",
"primaryId": "",
"primaryLanguage": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/cms/v3/pages/site-pages/multi-language/attach-to-lang-group")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
*/*
RESPONSE BODY text
{
"message": "Invalid input (details will vary based on the error)",
"correlationId": "aeb5f871-7f07-4993-9211-075dc63e7cbf",
"category": "VALIDATION_ERROR",
"links": {
"knowledge-base": "https://www.hubspot.com/products/service/knowledge-base"
}
}
POST
Clone a Site Page
{{baseUrl}}/cms/v3/pages/site-pages/clone
HEADERS
private-app-legacy
{{apiKey}}
BODY json
{
"cloneName": "",
"id": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/cms/v3/pages/site-pages/clone");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "private-app-legacy: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"cloneName\": \"\",\n \"id\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/cms/v3/pages/site-pages/clone" {:headers {:private-app-legacy "{{apiKey}}"}
:content-type :json
:form-params {:cloneName ""
:id ""}})
require "http/client"
url = "{{baseUrl}}/cms/v3/pages/site-pages/clone"
headers = HTTP::Headers{
"private-app-legacy" => "{{apiKey}}"
"content-type" => "application/json"
}
reqBody = "{\n \"cloneName\": \"\",\n \"id\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/cms/v3/pages/site-pages/clone"),
Headers =
{
{ "private-app-legacy", "{{apiKey}}" },
},
Content = new StringContent("{\n \"cloneName\": \"\",\n \"id\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/cms/v3/pages/site-pages/clone");
var request = new RestRequest("", Method.Post);
request.AddHeader("private-app-legacy", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"cloneName\": \"\",\n \"id\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/cms/v3/pages/site-pages/clone"
payload := strings.NewReader("{\n \"cloneName\": \"\",\n \"id\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("private-app-legacy", "{{apiKey}}")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/cms/v3/pages/site-pages/clone HTTP/1.1
Private-App-Legacy: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 33
{
"cloneName": "",
"id": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/cms/v3/pages/site-pages/clone")
.setHeader("private-app-legacy", "{{apiKey}}")
.setHeader("content-type", "application/json")
.setBody("{\n \"cloneName\": \"\",\n \"id\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/cms/v3/pages/site-pages/clone"))
.header("private-app-legacy", "{{apiKey}}")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"cloneName\": \"\",\n \"id\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"cloneName\": \"\",\n \"id\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/cms/v3/pages/site-pages/clone")
.post(body)
.addHeader("private-app-legacy", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/cms/v3/pages/site-pages/clone")
.header("private-app-legacy", "{{apiKey}}")
.header("content-type", "application/json")
.body("{\n \"cloneName\": \"\",\n \"id\": \"\"\n}")
.asString();
const data = JSON.stringify({
cloneName: '',
id: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/cms/v3/pages/site-pages/clone');
xhr.setRequestHeader('private-app-legacy', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/cms/v3/pages/site-pages/clone',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
data: {cloneName: '', id: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/cms/v3/pages/site-pages/clone';
const options = {
method: 'POST',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
body: '{"cloneName":"","id":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/cms/v3/pages/site-pages/clone',
method: 'POST',
headers: {
'private-app-legacy': '{{apiKey}}',
'content-type': 'application/json'
},
processData: false,
data: '{\n "cloneName": "",\n "id": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"cloneName\": \"\",\n \"id\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/cms/v3/pages/site-pages/clone")
.post(body)
.addHeader("private-app-legacy", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/cms/v3/pages/site-pages/clone',
headers: {
'private-app-legacy': '{{apiKey}}',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({cloneName: '', id: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/cms/v3/pages/site-pages/clone',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
body: {cloneName: '', id: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/cms/v3/pages/site-pages/clone');
req.headers({
'private-app-legacy': '{{apiKey}}',
'content-type': 'application/json'
});
req.type('json');
req.send({
cloneName: '',
id: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/cms/v3/pages/site-pages/clone',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
data: {cloneName: '', id: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/cms/v3/pages/site-pages/clone';
const options = {
method: 'POST',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
body: '{"cloneName":"","id":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"private-app-legacy": @"{{apiKey}}",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"cloneName": @"",
@"id": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/cms/v3/pages/site-pages/clone"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/cms/v3/pages/site-pages/clone" in
let headers = Header.add_list (Header.init ()) [
("private-app-legacy", "{{apiKey}}");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"cloneName\": \"\",\n \"id\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/cms/v3/pages/site-pages/clone",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'cloneName' => '',
'id' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"private-app-legacy: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/cms/v3/pages/site-pages/clone', [
'body' => '{
"cloneName": "",
"id": ""
}',
'headers' => [
'content-type' => 'application/json',
'private-app-legacy' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/cms/v3/pages/site-pages/clone');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'private-app-legacy' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'cloneName' => '',
'id' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'cloneName' => '',
'id' => ''
]));
$request->setRequestUrl('{{baseUrl}}/cms/v3/pages/site-pages/clone');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'private-app-legacy' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("private-app-legacy", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/cms/v3/pages/site-pages/clone' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"cloneName": "",
"id": ""
}'
$headers=@{}
$headers.Add("private-app-legacy", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/cms/v3/pages/site-pages/clone' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"cloneName": "",
"id": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"cloneName\": \"\",\n \"id\": \"\"\n}"
headers = {
'private-app-legacy': "{{apiKey}}",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/cms/v3/pages/site-pages/clone", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/cms/v3/pages/site-pages/clone"
payload = {
"cloneName": "",
"id": ""
}
headers = {
"private-app-legacy": "{{apiKey}}",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/cms/v3/pages/site-pages/clone"
payload <- "{\n \"cloneName\": \"\",\n \"id\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('private-app-legacy' = '{{apiKey}}'), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/cms/v3/pages/site-pages/clone")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["private-app-legacy"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n \"cloneName\": \"\",\n \"id\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/cms/v3/pages/site-pages/clone') do |req|
req.headers['private-app-legacy'] = '{{apiKey}}'
req.body = "{\n \"cloneName\": \"\",\n \"id\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/cms/v3/pages/site-pages/clone";
let payload = json!({
"cloneName": "",
"id": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("private-app-legacy", "{{apiKey}}".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/cms/v3/pages/site-pages/clone \
--header 'content-type: application/json' \
--header 'private-app-legacy: {{apiKey}}' \
--data '{
"cloneName": "",
"id": ""
}'
echo '{
"cloneName": "",
"id": ""
}' | \
http POST {{baseUrl}}/cms/v3/pages/site-pages/clone \
content-type:application/json \
private-app-legacy:'{{apiKey}}'
wget --quiet \
--method POST \
--header 'private-app-legacy: {{apiKey}}' \
--header 'content-type: application/json' \
--body-data '{\n "cloneName": "",\n "id": ""\n}' \
--output-document \
- {{baseUrl}}/cms/v3/pages/site-pages/clone
import Foundation
let headers = [
"private-app-legacy": "{{apiKey}}",
"content-type": "application/json"
]
let parameters = [
"cloneName": "",
"id": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/cms/v3/pages/site-pages/clone")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
*/*
RESPONSE BODY text
{
"message": "Invalid input (details will vary based on the error)",
"correlationId": "aeb5f871-7f07-4993-9211-075dc63e7cbf",
"category": "VALIDATION_ERROR",
"links": {
"knowledge-base": "https://www.hubspot.com/products/service/knowledge-base"
}
}
POST
Create a batch of Site Pages
{{baseUrl}}/cms/v3/pages/site-pages/batch/create
HEADERS
private-app-legacy
{{apiKey}}
BODY json
{
"inputs": [
{
"publishDate": "",
"language": "",
"enableLayoutStylesheets": false,
"metaDescription": "",
"attachedStylesheets": [
{}
],
"password": "",
"publishImmediately": false,
"htmlTitle": "",
"translations": {},
"id": "",
"state": "",
"slug": "",
"createdById": "",
"currentlyPublished": false,
"archivedInDashboard": false,
"created": "",
"contentTypeCategory": "",
"mabExperimentId": "",
"updatedById": "",
"translatedFromId": "",
"folderId": "",
"widgetContainers": {},
"pageExpiryRedirectId": 0,
"dynamicPageDataSourceType": 0,
"featuredImage": "",
"authorName": "",
"domain": "",
"name": "",
"dynamicPageHubDbTableId": "",
"campaign": "",
"dynamicPageDataSourceId": "",
"enableDomainStylesheets": false,
"includeDefaultCustomCss": false,
"subcategory": "",
"layoutSections": {},
"updated": "",
"footerHtml": "",
"widgets": {},
"headHtml": "",
"pageExpiryRedirectUrl": "",
"abStatus": "",
"useFeaturedImage": false,
"abTestId": "",
"featuredImageAltText": "",
"contentGroupId": "",
"pageExpiryEnabled": false,
"templatePath": "",
"url": "",
"publicAccessRules": [
{}
],
"archivedAt": "",
"themeSettingsValues": {},
"pageExpiryDate": 0,
"publicAccessRulesEnabled": false,
"pageRedirected": false,
"currentState": "",
"categoryId": 0,
"linkRelCanonicalUrl": ""
}
]
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/cms/v3/pages/site-pages/batch/create");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "private-app-legacy: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"inputs\": [\n {\n \"publishDate\": \"\",\n \"language\": \"\",\n \"enableLayoutStylesheets\": false,\n \"metaDescription\": \"\",\n \"attachedStylesheets\": [\n {}\n ],\n \"password\": \"\",\n \"publishImmediately\": false,\n \"htmlTitle\": \"\",\n \"translations\": {},\n \"id\": \"\",\n \"state\": \"\",\n \"slug\": \"\",\n \"createdById\": \"\",\n \"currentlyPublished\": false,\n \"archivedInDashboard\": false,\n \"created\": \"\",\n \"contentTypeCategory\": \"\",\n \"mabExperimentId\": \"\",\n \"updatedById\": \"\",\n \"translatedFromId\": \"\",\n \"folderId\": \"\",\n \"widgetContainers\": {},\n \"pageExpiryRedirectId\": 0,\n \"dynamicPageDataSourceType\": 0,\n \"featuredImage\": \"\",\n \"authorName\": \"\",\n \"domain\": \"\",\n \"name\": \"\",\n \"dynamicPageHubDbTableId\": \"\",\n \"campaign\": \"\",\n \"dynamicPageDataSourceId\": \"\",\n \"enableDomainStylesheets\": false,\n \"includeDefaultCustomCss\": false,\n \"subcategory\": \"\",\n \"layoutSections\": {},\n \"updated\": \"\",\n \"footerHtml\": \"\",\n \"widgets\": {},\n \"headHtml\": \"\",\n \"pageExpiryRedirectUrl\": \"\",\n \"abStatus\": \"\",\n \"useFeaturedImage\": false,\n \"abTestId\": \"\",\n \"featuredImageAltText\": \"\",\n \"contentGroupId\": \"\",\n \"pageExpiryEnabled\": false,\n \"templatePath\": \"\",\n \"url\": \"\",\n \"publicAccessRules\": [\n {}\n ],\n \"archivedAt\": \"\",\n \"themeSettingsValues\": {},\n \"pageExpiryDate\": 0,\n \"publicAccessRulesEnabled\": false,\n \"pageRedirected\": false,\n \"currentState\": \"\",\n \"categoryId\": 0,\n \"linkRelCanonicalUrl\": \"\"\n }\n ]\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/cms/v3/pages/site-pages/batch/create" {:headers {:private-app-legacy "{{apiKey}}"}
:content-type :json
:form-params {:inputs [{:publishDate ""
:language ""
:enableLayoutStylesheets false
:metaDescription ""
:attachedStylesheets [{}]
:password ""
:publishImmediately false
:htmlTitle ""
:translations {}
:id ""
:state ""
:slug ""
:createdById ""
:currentlyPublished false
:archivedInDashboard false
:created ""
:contentTypeCategory ""
:mabExperimentId ""
:updatedById ""
:translatedFromId ""
:folderId ""
:widgetContainers {}
:pageExpiryRedirectId 0
:dynamicPageDataSourceType 0
:featuredImage ""
:authorName ""
:domain ""
:name ""
:dynamicPageHubDbTableId ""
:campaign ""
:dynamicPageDataSourceId ""
:enableDomainStylesheets false
:includeDefaultCustomCss false
:subcategory ""
:layoutSections {}
:updated ""
:footerHtml ""
:widgets {}
:headHtml ""
:pageExpiryRedirectUrl ""
:abStatus ""
:useFeaturedImage false
:abTestId ""
:featuredImageAltText ""
:contentGroupId ""
:pageExpiryEnabled false
:templatePath ""
:url ""
:publicAccessRules [{}]
:archivedAt ""
:themeSettingsValues {}
:pageExpiryDate 0
:publicAccessRulesEnabled false
:pageRedirected false
:currentState ""
:categoryId 0
:linkRelCanonicalUrl ""}]}})
require "http/client"
url = "{{baseUrl}}/cms/v3/pages/site-pages/batch/create"
headers = HTTP::Headers{
"private-app-legacy" => "{{apiKey}}"
"content-type" => "application/json"
}
reqBody = "{\n \"inputs\": [\n {\n \"publishDate\": \"\",\n \"language\": \"\",\n \"enableLayoutStylesheets\": false,\n \"metaDescription\": \"\",\n \"attachedStylesheets\": [\n {}\n ],\n \"password\": \"\",\n \"publishImmediately\": false,\n \"htmlTitle\": \"\",\n \"translations\": {},\n \"id\": \"\",\n \"state\": \"\",\n \"slug\": \"\",\n \"createdById\": \"\",\n \"currentlyPublished\": false,\n \"archivedInDashboard\": false,\n \"created\": \"\",\n \"contentTypeCategory\": \"\",\n \"mabExperimentId\": \"\",\n \"updatedById\": \"\",\n \"translatedFromId\": \"\",\n \"folderId\": \"\",\n \"widgetContainers\": {},\n \"pageExpiryRedirectId\": 0,\n \"dynamicPageDataSourceType\": 0,\n \"featuredImage\": \"\",\n \"authorName\": \"\",\n \"domain\": \"\",\n \"name\": \"\",\n \"dynamicPageHubDbTableId\": \"\",\n \"campaign\": \"\",\n \"dynamicPageDataSourceId\": \"\",\n \"enableDomainStylesheets\": false,\n \"includeDefaultCustomCss\": false,\n \"subcategory\": \"\",\n \"layoutSections\": {},\n \"updated\": \"\",\n \"footerHtml\": \"\",\n \"widgets\": {},\n \"headHtml\": \"\",\n \"pageExpiryRedirectUrl\": \"\",\n \"abStatus\": \"\",\n \"useFeaturedImage\": false,\n \"abTestId\": \"\",\n \"featuredImageAltText\": \"\",\n \"contentGroupId\": \"\",\n \"pageExpiryEnabled\": false,\n \"templatePath\": \"\",\n \"url\": \"\",\n \"publicAccessRules\": [\n {}\n ],\n \"archivedAt\": \"\",\n \"themeSettingsValues\": {},\n \"pageExpiryDate\": 0,\n \"publicAccessRulesEnabled\": false,\n \"pageRedirected\": false,\n \"currentState\": \"\",\n \"categoryId\": 0,\n \"linkRelCanonicalUrl\": \"\"\n }\n ]\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/cms/v3/pages/site-pages/batch/create"),
Headers =
{
{ "private-app-legacy", "{{apiKey}}" },
},
Content = new StringContent("{\n \"inputs\": [\n {\n \"publishDate\": \"\",\n \"language\": \"\",\n \"enableLayoutStylesheets\": false,\n \"metaDescription\": \"\",\n \"attachedStylesheets\": [\n {}\n ],\n \"password\": \"\",\n \"publishImmediately\": false,\n \"htmlTitle\": \"\",\n \"translations\": {},\n \"id\": \"\",\n \"state\": \"\",\n \"slug\": \"\",\n \"createdById\": \"\",\n \"currentlyPublished\": false,\n \"archivedInDashboard\": false,\n \"created\": \"\",\n \"contentTypeCategory\": \"\",\n \"mabExperimentId\": \"\",\n \"updatedById\": \"\",\n \"translatedFromId\": \"\",\n \"folderId\": \"\",\n \"widgetContainers\": {},\n \"pageExpiryRedirectId\": 0,\n \"dynamicPageDataSourceType\": 0,\n \"featuredImage\": \"\",\n \"authorName\": \"\",\n \"domain\": \"\",\n \"name\": \"\",\n \"dynamicPageHubDbTableId\": \"\",\n \"campaign\": \"\",\n \"dynamicPageDataSourceId\": \"\",\n \"enableDomainStylesheets\": false,\n \"includeDefaultCustomCss\": false,\n \"subcategory\": \"\",\n \"layoutSections\": {},\n \"updated\": \"\",\n \"footerHtml\": \"\",\n \"widgets\": {},\n \"headHtml\": \"\",\n \"pageExpiryRedirectUrl\": \"\",\n \"abStatus\": \"\",\n \"useFeaturedImage\": false,\n \"abTestId\": \"\",\n \"featuredImageAltText\": \"\",\n \"contentGroupId\": \"\",\n \"pageExpiryEnabled\": false,\n \"templatePath\": \"\",\n \"url\": \"\",\n \"publicAccessRules\": [\n {}\n ],\n \"archivedAt\": \"\",\n \"themeSettingsValues\": {},\n \"pageExpiryDate\": 0,\n \"publicAccessRulesEnabled\": false,\n \"pageRedirected\": false,\n \"currentState\": \"\",\n \"categoryId\": 0,\n \"linkRelCanonicalUrl\": \"\"\n }\n ]\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/cms/v3/pages/site-pages/batch/create");
var request = new RestRequest("", Method.Post);
request.AddHeader("private-app-legacy", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"inputs\": [\n {\n \"publishDate\": \"\",\n \"language\": \"\",\n \"enableLayoutStylesheets\": false,\n \"metaDescription\": \"\",\n \"attachedStylesheets\": [\n {}\n ],\n \"password\": \"\",\n \"publishImmediately\": false,\n \"htmlTitle\": \"\",\n \"translations\": {},\n \"id\": \"\",\n \"state\": \"\",\n \"slug\": \"\",\n \"createdById\": \"\",\n \"currentlyPublished\": false,\n \"archivedInDashboard\": false,\n \"created\": \"\",\n \"contentTypeCategory\": \"\",\n \"mabExperimentId\": \"\",\n \"updatedById\": \"\",\n \"translatedFromId\": \"\",\n \"folderId\": \"\",\n \"widgetContainers\": {},\n \"pageExpiryRedirectId\": 0,\n \"dynamicPageDataSourceType\": 0,\n \"featuredImage\": \"\",\n \"authorName\": \"\",\n \"domain\": \"\",\n \"name\": \"\",\n \"dynamicPageHubDbTableId\": \"\",\n \"campaign\": \"\",\n \"dynamicPageDataSourceId\": \"\",\n \"enableDomainStylesheets\": false,\n \"includeDefaultCustomCss\": false,\n \"subcategory\": \"\",\n \"layoutSections\": {},\n \"updated\": \"\",\n \"footerHtml\": \"\",\n \"widgets\": {},\n \"headHtml\": \"\",\n \"pageExpiryRedirectUrl\": \"\",\n \"abStatus\": \"\",\n \"useFeaturedImage\": false,\n \"abTestId\": \"\",\n \"featuredImageAltText\": \"\",\n \"contentGroupId\": \"\",\n \"pageExpiryEnabled\": false,\n \"templatePath\": \"\",\n \"url\": \"\",\n \"publicAccessRules\": [\n {}\n ],\n \"archivedAt\": \"\",\n \"themeSettingsValues\": {},\n \"pageExpiryDate\": 0,\n \"publicAccessRulesEnabled\": false,\n \"pageRedirected\": false,\n \"currentState\": \"\",\n \"categoryId\": 0,\n \"linkRelCanonicalUrl\": \"\"\n }\n ]\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/cms/v3/pages/site-pages/batch/create"
payload := strings.NewReader("{\n \"inputs\": [\n {\n \"publishDate\": \"\",\n \"language\": \"\",\n \"enableLayoutStylesheets\": false,\n \"metaDescription\": \"\",\n \"attachedStylesheets\": [\n {}\n ],\n \"password\": \"\",\n \"publishImmediately\": false,\n \"htmlTitle\": \"\",\n \"translations\": {},\n \"id\": \"\",\n \"state\": \"\",\n \"slug\": \"\",\n \"createdById\": \"\",\n \"currentlyPublished\": false,\n \"archivedInDashboard\": false,\n \"created\": \"\",\n \"contentTypeCategory\": \"\",\n \"mabExperimentId\": \"\",\n \"updatedById\": \"\",\n \"translatedFromId\": \"\",\n \"folderId\": \"\",\n \"widgetContainers\": {},\n \"pageExpiryRedirectId\": 0,\n \"dynamicPageDataSourceType\": 0,\n \"featuredImage\": \"\",\n \"authorName\": \"\",\n \"domain\": \"\",\n \"name\": \"\",\n \"dynamicPageHubDbTableId\": \"\",\n \"campaign\": \"\",\n \"dynamicPageDataSourceId\": \"\",\n \"enableDomainStylesheets\": false,\n \"includeDefaultCustomCss\": false,\n \"subcategory\": \"\",\n \"layoutSections\": {},\n \"updated\": \"\",\n \"footerHtml\": \"\",\n \"widgets\": {},\n \"headHtml\": \"\",\n \"pageExpiryRedirectUrl\": \"\",\n \"abStatus\": \"\",\n \"useFeaturedImage\": false,\n \"abTestId\": \"\",\n \"featuredImageAltText\": \"\",\n \"contentGroupId\": \"\",\n \"pageExpiryEnabled\": false,\n \"templatePath\": \"\",\n \"url\": \"\",\n \"publicAccessRules\": [\n {}\n ],\n \"archivedAt\": \"\",\n \"themeSettingsValues\": {},\n \"pageExpiryDate\": 0,\n \"publicAccessRulesEnabled\": false,\n \"pageRedirected\": false,\n \"currentState\": \"\",\n \"categoryId\": 0,\n \"linkRelCanonicalUrl\": \"\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("private-app-legacy", "{{apiKey}}")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/cms/v3/pages/site-pages/batch/create HTTP/1.1
Private-App-Legacy: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 1659
{
"inputs": [
{
"publishDate": "",
"language": "",
"enableLayoutStylesheets": false,
"metaDescription": "",
"attachedStylesheets": [
{}
],
"password": "",
"publishImmediately": false,
"htmlTitle": "",
"translations": {},
"id": "",
"state": "",
"slug": "",
"createdById": "",
"currentlyPublished": false,
"archivedInDashboard": false,
"created": "",
"contentTypeCategory": "",
"mabExperimentId": "",
"updatedById": "",
"translatedFromId": "",
"folderId": "",
"widgetContainers": {},
"pageExpiryRedirectId": 0,
"dynamicPageDataSourceType": 0,
"featuredImage": "",
"authorName": "",
"domain": "",
"name": "",
"dynamicPageHubDbTableId": "",
"campaign": "",
"dynamicPageDataSourceId": "",
"enableDomainStylesheets": false,
"includeDefaultCustomCss": false,
"subcategory": "",
"layoutSections": {},
"updated": "",
"footerHtml": "",
"widgets": {},
"headHtml": "",
"pageExpiryRedirectUrl": "",
"abStatus": "",
"useFeaturedImage": false,
"abTestId": "",
"featuredImageAltText": "",
"contentGroupId": "",
"pageExpiryEnabled": false,
"templatePath": "",
"url": "",
"publicAccessRules": [
{}
],
"archivedAt": "",
"themeSettingsValues": {},
"pageExpiryDate": 0,
"publicAccessRulesEnabled": false,
"pageRedirected": false,
"currentState": "",
"categoryId": 0,
"linkRelCanonicalUrl": ""
}
]
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/cms/v3/pages/site-pages/batch/create")
.setHeader("private-app-legacy", "{{apiKey}}")
.setHeader("content-type", "application/json")
.setBody("{\n \"inputs\": [\n {\n \"publishDate\": \"\",\n \"language\": \"\",\n \"enableLayoutStylesheets\": false,\n \"metaDescription\": \"\",\n \"attachedStylesheets\": [\n {}\n ],\n \"password\": \"\",\n \"publishImmediately\": false,\n \"htmlTitle\": \"\",\n \"translations\": {},\n \"id\": \"\",\n \"state\": \"\",\n \"slug\": \"\",\n \"createdById\": \"\",\n \"currentlyPublished\": false,\n \"archivedInDashboard\": false,\n \"created\": \"\",\n \"contentTypeCategory\": \"\",\n \"mabExperimentId\": \"\",\n \"updatedById\": \"\",\n \"translatedFromId\": \"\",\n \"folderId\": \"\",\n \"widgetContainers\": {},\n \"pageExpiryRedirectId\": 0,\n \"dynamicPageDataSourceType\": 0,\n \"featuredImage\": \"\",\n \"authorName\": \"\",\n \"domain\": \"\",\n \"name\": \"\",\n \"dynamicPageHubDbTableId\": \"\",\n \"campaign\": \"\",\n \"dynamicPageDataSourceId\": \"\",\n \"enableDomainStylesheets\": false,\n \"includeDefaultCustomCss\": false,\n \"subcategory\": \"\",\n \"layoutSections\": {},\n \"updated\": \"\",\n \"footerHtml\": \"\",\n \"widgets\": {},\n \"headHtml\": \"\",\n \"pageExpiryRedirectUrl\": \"\",\n \"abStatus\": \"\",\n \"useFeaturedImage\": false,\n \"abTestId\": \"\",\n \"featuredImageAltText\": \"\",\n \"contentGroupId\": \"\",\n \"pageExpiryEnabled\": false,\n \"templatePath\": \"\",\n \"url\": \"\",\n \"publicAccessRules\": [\n {}\n ],\n \"archivedAt\": \"\",\n \"themeSettingsValues\": {},\n \"pageExpiryDate\": 0,\n \"publicAccessRulesEnabled\": false,\n \"pageRedirected\": false,\n \"currentState\": \"\",\n \"categoryId\": 0,\n \"linkRelCanonicalUrl\": \"\"\n }\n ]\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/cms/v3/pages/site-pages/batch/create"))
.header("private-app-legacy", "{{apiKey}}")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"inputs\": [\n {\n \"publishDate\": \"\",\n \"language\": \"\",\n \"enableLayoutStylesheets\": false,\n \"metaDescription\": \"\",\n \"attachedStylesheets\": [\n {}\n ],\n \"password\": \"\",\n \"publishImmediately\": false,\n \"htmlTitle\": \"\",\n \"translations\": {},\n \"id\": \"\",\n \"state\": \"\",\n \"slug\": \"\",\n \"createdById\": \"\",\n \"currentlyPublished\": false,\n \"archivedInDashboard\": false,\n \"created\": \"\",\n \"contentTypeCategory\": \"\",\n \"mabExperimentId\": \"\",\n \"updatedById\": \"\",\n \"translatedFromId\": \"\",\n \"folderId\": \"\",\n \"widgetContainers\": {},\n \"pageExpiryRedirectId\": 0,\n \"dynamicPageDataSourceType\": 0,\n \"featuredImage\": \"\",\n \"authorName\": \"\",\n \"domain\": \"\",\n \"name\": \"\",\n \"dynamicPageHubDbTableId\": \"\",\n \"campaign\": \"\",\n \"dynamicPageDataSourceId\": \"\",\n \"enableDomainStylesheets\": false,\n \"includeDefaultCustomCss\": false,\n \"subcategory\": \"\",\n \"layoutSections\": {},\n \"updated\": \"\",\n \"footerHtml\": \"\",\n \"widgets\": {},\n \"headHtml\": \"\",\n \"pageExpiryRedirectUrl\": \"\",\n \"abStatus\": \"\",\n \"useFeaturedImage\": false,\n \"abTestId\": \"\",\n \"featuredImageAltText\": \"\",\n \"contentGroupId\": \"\",\n \"pageExpiryEnabled\": false,\n \"templatePath\": \"\",\n \"url\": \"\",\n \"publicAccessRules\": [\n {}\n ],\n \"archivedAt\": \"\",\n \"themeSettingsValues\": {},\n \"pageExpiryDate\": 0,\n \"publicAccessRulesEnabled\": false,\n \"pageRedirected\": false,\n \"currentState\": \"\",\n \"categoryId\": 0,\n \"linkRelCanonicalUrl\": \"\"\n }\n ]\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"inputs\": [\n {\n \"publishDate\": \"\",\n \"language\": \"\",\n \"enableLayoutStylesheets\": false,\n \"metaDescription\": \"\",\n \"attachedStylesheets\": [\n {}\n ],\n \"password\": \"\",\n \"publishImmediately\": false,\n \"htmlTitle\": \"\",\n \"translations\": {},\n \"id\": \"\",\n \"state\": \"\",\n \"slug\": \"\",\n \"createdById\": \"\",\n \"currentlyPublished\": false,\n \"archivedInDashboard\": false,\n \"created\": \"\",\n \"contentTypeCategory\": \"\",\n \"mabExperimentId\": \"\",\n \"updatedById\": \"\",\n \"translatedFromId\": \"\",\n \"folderId\": \"\",\n \"widgetContainers\": {},\n \"pageExpiryRedirectId\": 0,\n \"dynamicPageDataSourceType\": 0,\n \"featuredImage\": \"\",\n \"authorName\": \"\",\n \"domain\": \"\",\n \"name\": \"\",\n \"dynamicPageHubDbTableId\": \"\",\n \"campaign\": \"\",\n \"dynamicPageDataSourceId\": \"\",\n \"enableDomainStylesheets\": false,\n \"includeDefaultCustomCss\": false,\n \"subcategory\": \"\",\n \"layoutSections\": {},\n \"updated\": \"\",\n \"footerHtml\": \"\",\n \"widgets\": {},\n \"headHtml\": \"\",\n \"pageExpiryRedirectUrl\": \"\",\n \"abStatus\": \"\",\n \"useFeaturedImage\": false,\n \"abTestId\": \"\",\n \"featuredImageAltText\": \"\",\n \"contentGroupId\": \"\",\n \"pageExpiryEnabled\": false,\n \"templatePath\": \"\",\n \"url\": \"\",\n \"publicAccessRules\": [\n {}\n ],\n \"archivedAt\": \"\",\n \"themeSettingsValues\": {},\n \"pageExpiryDate\": 0,\n \"publicAccessRulesEnabled\": false,\n \"pageRedirected\": false,\n \"currentState\": \"\",\n \"categoryId\": 0,\n \"linkRelCanonicalUrl\": \"\"\n }\n ]\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/cms/v3/pages/site-pages/batch/create")
.post(body)
.addHeader("private-app-legacy", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/cms/v3/pages/site-pages/batch/create")
.header("private-app-legacy", "{{apiKey}}")
.header("content-type", "application/json")
.body("{\n \"inputs\": [\n {\n \"publishDate\": \"\",\n \"language\": \"\",\n \"enableLayoutStylesheets\": false,\n \"metaDescription\": \"\",\n \"attachedStylesheets\": [\n {}\n ],\n \"password\": \"\",\n \"publishImmediately\": false,\n \"htmlTitle\": \"\",\n \"translations\": {},\n \"id\": \"\",\n \"state\": \"\",\n \"slug\": \"\",\n \"createdById\": \"\",\n \"currentlyPublished\": false,\n \"archivedInDashboard\": false,\n \"created\": \"\",\n \"contentTypeCategory\": \"\",\n \"mabExperimentId\": \"\",\n \"updatedById\": \"\",\n \"translatedFromId\": \"\",\n \"folderId\": \"\",\n \"widgetContainers\": {},\n \"pageExpiryRedirectId\": 0,\n \"dynamicPageDataSourceType\": 0,\n \"featuredImage\": \"\",\n \"authorName\": \"\",\n \"domain\": \"\",\n \"name\": \"\",\n \"dynamicPageHubDbTableId\": \"\",\n \"campaign\": \"\",\n \"dynamicPageDataSourceId\": \"\",\n \"enableDomainStylesheets\": false,\n \"includeDefaultCustomCss\": false,\n \"subcategory\": \"\",\n \"layoutSections\": {},\n \"updated\": \"\",\n \"footerHtml\": \"\",\n \"widgets\": {},\n \"headHtml\": \"\",\n \"pageExpiryRedirectUrl\": \"\",\n \"abStatus\": \"\",\n \"useFeaturedImage\": false,\n \"abTestId\": \"\",\n \"featuredImageAltText\": \"\",\n \"contentGroupId\": \"\",\n \"pageExpiryEnabled\": false,\n \"templatePath\": \"\",\n \"url\": \"\",\n \"publicAccessRules\": [\n {}\n ],\n \"archivedAt\": \"\",\n \"themeSettingsValues\": {},\n \"pageExpiryDate\": 0,\n \"publicAccessRulesEnabled\": false,\n \"pageRedirected\": false,\n \"currentState\": \"\",\n \"categoryId\": 0,\n \"linkRelCanonicalUrl\": \"\"\n }\n ]\n}")
.asString();
const data = JSON.stringify({
inputs: [
{
publishDate: '',
language: '',
enableLayoutStylesheets: false,
metaDescription: '',
attachedStylesheets: [
{}
],
password: '',
publishImmediately: false,
htmlTitle: '',
translations: {},
id: '',
state: '',
slug: '',
createdById: '',
currentlyPublished: false,
archivedInDashboard: false,
created: '',
contentTypeCategory: '',
mabExperimentId: '',
updatedById: '',
translatedFromId: '',
folderId: '',
widgetContainers: {},
pageExpiryRedirectId: 0,
dynamicPageDataSourceType: 0,
featuredImage: '',
authorName: '',
domain: '',
name: '',
dynamicPageHubDbTableId: '',
campaign: '',
dynamicPageDataSourceId: '',
enableDomainStylesheets: false,
includeDefaultCustomCss: false,
subcategory: '',
layoutSections: {},
updated: '',
footerHtml: '',
widgets: {},
headHtml: '',
pageExpiryRedirectUrl: '',
abStatus: '',
useFeaturedImage: false,
abTestId: '',
featuredImageAltText: '',
contentGroupId: '',
pageExpiryEnabled: false,
templatePath: '',
url: '',
publicAccessRules: [
{}
],
archivedAt: '',
themeSettingsValues: {},
pageExpiryDate: 0,
publicAccessRulesEnabled: false,
pageRedirected: false,
currentState: '',
categoryId: 0,
linkRelCanonicalUrl: ''
}
]
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/cms/v3/pages/site-pages/batch/create');
xhr.setRequestHeader('private-app-legacy', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/cms/v3/pages/site-pages/batch/create',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
data: {
inputs: [
{
publishDate: '',
language: '',
enableLayoutStylesheets: false,
metaDescription: '',
attachedStylesheets: [{}],
password: '',
publishImmediately: false,
htmlTitle: '',
translations: {},
id: '',
state: '',
slug: '',
createdById: '',
currentlyPublished: false,
archivedInDashboard: false,
created: '',
contentTypeCategory: '',
mabExperimentId: '',
updatedById: '',
translatedFromId: '',
folderId: '',
widgetContainers: {},
pageExpiryRedirectId: 0,
dynamicPageDataSourceType: 0,
featuredImage: '',
authorName: '',
domain: '',
name: '',
dynamicPageHubDbTableId: '',
campaign: '',
dynamicPageDataSourceId: '',
enableDomainStylesheets: false,
includeDefaultCustomCss: false,
subcategory: '',
layoutSections: {},
updated: '',
footerHtml: '',
widgets: {},
headHtml: '',
pageExpiryRedirectUrl: '',
abStatus: '',
useFeaturedImage: false,
abTestId: '',
featuredImageAltText: '',
contentGroupId: '',
pageExpiryEnabled: false,
templatePath: '',
url: '',
publicAccessRules: [{}],
archivedAt: '',
themeSettingsValues: {},
pageExpiryDate: 0,
publicAccessRulesEnabled: false,
pageRedirected: false,
currentState: '',
categoryId: 0,
linkRelCanonicalUrl: ''
}
]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/cms/v3/pages/site-pages/batch/create';
const options = {
method: 'POST',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
body: '{"inputs":[{"publishDate":"","language":"","enableLayoutStylesheets":false,"metaDescription":"","attachedStylesheets":[{}],"password":"","publishImmediately":false,"htmlTitle":"","translations":{},"id":"","state":"","slug":"","createdById":"","currentlyPublished":false,"archivedInDashboard":false,"created":"","contentTypeCategory":"","mabExperimentId":"","updatedById":"","translatedFromId":"","folderId":"","widgetContainers":{},"pageExpiryRedirectId":0,"dynamicPageDataSourceType":0,"featuredImage":"","authorName":"","domain":"","name":"","dynamicPageHubDbTableId":"","campaign":"","dynamicPageDataSourceId":"","enableDomainStylesheets":false,"includeDefaultCustomCss":false,"subcategory":"","layoutSections":{},"updated":"","footerHtml":"","widgets":{},"headHtml":"","pageExpiryRedirectUrl":"","abStatus":"","useFeaturedImage":false,"abTestId":"","featuredImageAltText":"","contentGroupId":"","pageExpiryEnabled":false,"templatePath":"","url":"","publicAccessRules":[{}],"archivedAt":"","themeSettingsValues":{},"pageExpiryDate":0,"publicAccessRulesEnabled":false,"pageRedirected":false,"currentState":"","categoryId":0,"linkRelCanonicalUrl":""}]}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/cms/v3/pages/site-pages/batch/create',
method: 'POST',
headers: {
'private-app-legacy': '{{apiKey}}',
'content-type': 'application/json'
},
processData: false,
data: '{\n "inputs": [\n {\n "publishDate": "",\n "language": "",\n "enableLayoutStylesheets": false,\n "metaDescription": "",\n "attachedStylesheets": [\n {}\n ],\n "password": "",\n "publishImmediately": false,\n "htmlTitle": "",\n "translations": {},\n "id": "",\n "state": "",\n "slug": "",\n "createdById": "",\n "currentlyPublished": false,\n "archivedInDashboard": false,\n "created": "",\n "contentTypeCategory": "",\n "mabExperimentId": "",\n "updatedById": "",\n "translatedFromId": "",\n "folderId": "",\n "widgetContainers": {},\n "pageExpiryRedirectId": 0,\n "dynamicPageDataSourceType": 0,\n "featuredImage": "",\n "authorName": "",\n "domain": "",\n "name": "",\n "dynamicPageHubDbTableId": "",\n "campaign": "",\n "dynamicPageDataSourceId": "",\n "enableDomainStylesheets": false,\n "includeDefaultCustomCss": false,\n "subcategory": "",\n "layoutSections": {},\n "updated": "",\n "footerHtml": "",\n "widgets": {},\n "headHtml": "",\n "pageExpiryRedirectUrl": "",\n "abStatus": "",\n "useFeaturedImage": false,\n "abTestId": "",\n "featuredImageAltText": "",\n "contentGroupId": "",\n "pageExpiryEnabled": false,\n "templatePath": "",\n "url": "",\n "publicAccessRules": [\n {}\n ],\n "archivedAt": "",\n "themeSettingsValues": {},\n "pageExpiryDate": 0,\n "publicAccessRulesEnabled": false,\n "pageRedirected": false,\n "currentState": "",\n "categoryId": 0,\n "linkRelCanonicalUrl": ""\n }\n ]\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"inputs\": [\n {\n \"publishDate\": \"\",\n \"language\": \"\",\n \"enableLayoutStylesheets\": false,\n \"metaDescription\": \"\",\n \"attachedStylesheets\": [\n {}\n ],\n \"password\": \"\",\n \"publishImmediately\": false,\n \"htmlTitle\": \"\",\n \"translations\": {},\n \"id\": \"\",\n \"state\": \"\",\n \"slug\": \"\",\n \"createdById\": \"\",\n \"currentlyPublished\": false,\n \"archivedInDashboard\": false,\n \"created\": \"\",\n \"contentTypeCategory\": \"\",\n \"mabExperimentId\": \"\",\n \"updatedById\": \"\",\n \"translatedFromId\": \"\",\n \"folderId\": \"\",\n \"widgetContainers\": {},\n \"pageExpiryRedirectId\": 0,\n \"dynamicPageDataSourceType\": 0,\n \"featuredImage\": \"\",\n \"authorName\": \"\",\n \"domain\": \"\",\n \"name\": \"\",\n \"dynamicPageHubDbTableId\": \"\",\n \"campaign\": \"\",\n \"dynamicPageDataSourceId\": \"\",\n \"enableDomainStylesheets\": false,\n \"includeDefaultCustomCss\": false,\n \"subcategory\": \"\",\n \"layoutSections\": {},\n \"updated\": \"\",\n \"footerHtml\": \"\",\n \"widgets\": {},\n \"headHtml\": \"\",\n \"pageExpiryRedirectUrl\": \"\",\n \"abStatus\": \"\",\n \"useFeaturedImage\": false,\n \"abTestId\": \"\",\n \"featuredImageAltText\": \"\",\n \"contentGroupId\": \"\",\n \"pageExpiryEnabled\": false,\n \"templatePath\": \"\",\n \"url\": \"\",\n \"publicAccessRules\": [\n {}\n ],\n \"archivedAt\": \"\",\n \"themeSettingsValues\": {},\n \"pageExpiryDate\": 0,\n \"publicAccessRulesEnabled\": false,\n \"pageRedirected\": false,\n \"currentState\": \"\",\n \"categoryId\": 0,\n \"linkRelCanonicalUrl\": \"\"\n }\n ]\n}")
val request = Request.Builder()
.url("{{baseUrl}}/cms/v3/pages/site-pages/batch/create")
.post(body)
.addHeader("private-app-legacy", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/cms/v3/pages/site-pages/batch/create',
headers: {
'private-app-legacy': '{{apiKey}}',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
inputs: [
{
publishDate: '',
language: '',
enableLayoutStylesheets: false,
metaDescription: '',
attachedStylesheets: [{}],
password: '',
publishImmediately: false,
htmlTitle: '',
translations: {},
id: '',
state: '',
slug: '',
createdById: '',
currentlyPublished: false,
archivedInDashboard: false,
created: '',
contentTypeCategory: '',
mabExperimentId: '',
updatedById: '',
translatedFromId: '',
folderId: '',
widgetContainers: {},
pageExpiryRedirectId: 0,
dynamicPageDataSourceType: 0,
featuredImage: '',
authorName: '',
domain: '',
name: '',
dynamicPageHubDbTableId: '',
campaign: '',
dynamicPageDataSourceId: '',
enableDomainStylesheets: false,
includeDefaultCustomCss: false,
subcategory: '',
layoutSections: {},
updated: '',
footerHtml: '',
widgets: {},
headHtml: '',
pageExpiryRedirectUrl: '',
abStatus: '',
useFeaturedImage: false,
abTestId: '',
featuredImageAltText: '',
contentGroupId: '',
pageExpiryEnabled: false,
templatePath: '',
url: '',
publicAccessRules: [{}],
archivedAt: '',
themeSettingsValues: {},
pageExpiryDate: 0,
publicAccessRulesEnabled: false,
pageRedirected: false,
currentState: '',
categoryId: 0,
linkRelCanonicalUrl: ''
}
]
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/cms/v3/pages/site-pages/batch/create',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
body: {
inputs: [
{
publishDate: '',
language: '',
enableLayoutStylesheets: false,
metaDescription: '',
attachedStylesheets: [{}],
password: '',
publishImmediately: false,
htmlTitle: '',
translations: {},
id: '',
state: '',
slug: '',
createdById: '',
currentlyPublished: false,
archivedInDashboard: false,
created: '',
contentTypeCategory: '',
mabExperimentId: '',
updatedById: '',
translatedFromId: '',
folderId: '',
widgetContainers: {},
pageExpiryRedirectId: 0,
dynamicPageDataSourceType: 0,
featuredImage: '',
authorName: '',
domain: '',
name: '',
dynamicPageHubDbTableId: '',
campaign: '',
dynamicPageDataSourceId: '',
enableDomainStylesheets: false,
includeDefaultCustomCss: false,
subcategory: '',
layoutSections: {},
updated: '',
footerHtml: '',
widgets: {},
headHtml: '',
pageExpiryRedirectUrl: '',
abStatus: '',
useFeaturedImage: false,
abTestId: '',
featuredImageAltText: '',
contentGroupId: '',
pageExpiryEnabled: false,
templatePath: '',
url: '',
publicAccessRules: [{}],
archivedAt: '',
themeSettingsValues: {},
pageExpiryDate: 0,
publicAccessRulesEnabled: false,
pageRedirected: false,
currentState: '',
categoryId: 0,
linkRelCanonicalUrl: ''
}
]
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/cms/v3/pages/site-pages/batch/create');
req.headers({
'private-app-legacy': '{{apiKey}}',
'content-type': 'application/json'
});
req.type('json');
req.send({
inputs: [
{
publishDate: '',
language: '',
enableLayoutStylesheets: false,
metaDescription: '',
attachedStylesheets: [
{}
],
password: '',
publishImmediately: false,
htmlTitle: '',
translations: {},
id: '',
state: '',
slug: '',
createdById: '',
currentlyPublished: false,
archivedInDashboard: false,
created: '',
contentTypeCategory: '',
mabExperimentId: '',
updatedById: '',
translatedFromId: '',
folderId: '',
widgetContainers: {},
pageExpiryRedirectId: 0,
dynamicPageDataSourceType: 0,
featuredImage: '',
authorName: '',
domain: '',
name: '',
dynamicPageHubDbTableId: '',
campaign: '',
dynamicPageDataSourceId: '',
enableDomainStylesheets: false,
includeDefaultCustomCss: false,
subcategory: '',
layoutSections: {},
updated: '',
footerHtml: '',
widgets: {},
headHtml: '',
pageExpiryRedirectUrl: '',
abStatus: '',
useFeaturedImage: false,
abTestId: '',
featuredImageAltText: '',
contentGroupId: '',
pageExpiryEnabled: false,
templatePath: '',
url: '',
publicAccessRules: [
{}
],
archivedAt: '',
themeSettingsValues: {},
pageExpiryDate: 0,
publicAccessRulesEnabled: false,
pageRedirected: false,
currentState: '',
categoryId: 0,
linkRelCanonicalUrl: ''
}
]
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/cms/v3/pages/site-pages/batch/create',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
data: {
inputs: [
{
publishDate: '',
language: '',
enableLayoutStylesheets: false,
metaDescription: '',
attachedStylesheets: [{}],
password: '',
publishImmediately: false,
htmlTitle: '',
translations: {},
id: '',
state: '',
slug: '',
createdById: '',
currentlyPublished: false,
archivedInDashboard: false,
created: '',
contentTypeCategory: '',
mabExperimentId: '',
updatedById: '',
translatedFromId: '',
folderId: '',
widgetContainers: {},
pageExpiryRedirectId: 0,
dynamicPageDataSourceType: 0,
featuredImage: '',
authorName: '',
domain: '',
name: '',
dynamicPageHubDbTableId: '',
campaign: '',
dynamicPageDataSourceId: '',
enableDomainStylesheets: false,
includeDefaultCustomCss: false,
subcategory: '',
layoutSections: {},
updated: '',
footerHtml: '',
widgets: {},
headHtml: '',
pageExpiryRedirectUrl: '',
abStatus: '',
useFeaturedImage: false,
abTestId: '',
featuredImageAltText: '',
contentGroupId: '',
pageExpiryEnabled: false,
templatePath: '',
url: '',
publicAccessRules: [{}],
archivedAt: '',
themeSettingsValues: {},
pageExpiryDate: 0,
publicAccessRulesEnabled: false,
pageRedirected: false,
currentState: '',
categoryId: 0,
linkRelCanonicalUrl: ''
}
]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/cms/v3/pages/site-pages/batch/create';
const options = {
method: 'POST',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
body: '{"inputs":[{"publishDate":"","language":"","enableLayoutStylesheets":false,"metaDescription":"","attachedStylesheets":[{}],"password":"","publishImmediately":false,"htmlTitle":"","translations":{},"id":"","state":"","slug":"","createdById":"","currentlyPublished":false,"archivedInDashboard":false,"created":"","contentTypeCategory":"","mabExperimentId":"","updatedById":"","translatedFromId":"","folderId":"","widgetContainers":{},"pageExpiryRedirectId":0,"dynamicPageDataSourceType":0,"featuredImage":"","authorName":"","domain":"","name":"","dynamicPageHubDbTableId":"","campaign":"","dynamicPageDataSourceId":"","enableDomainStylesheets":false,"includeDefaultCustomCss":false,"subcategory":"","layoutSections":{},"updated":"","footerHtml":"","widgets":{},"headHtml":"","pageExpiryRedirectUrl":"","abStatus":"","useFeaturedImage":false,"abTestId":"","featuredImageAltText":"","contentGroupId":"","pageExpiryEnabled":false,"templatePath":"","url":"","publicAccessRules":[{}],"archivedAt":"","themeSettingsValues":{},"pageExpiryDate":0,"publicAccessRulesEnabled":false,"pageRedirected":false,"currentState":"","categoryId":0,"linkRelCanonicalUrl":""}]}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"private-app-legacy": @"{{apiKey}}",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"inputs": @[ @{ @"publishDate": @"", @"language": @"", @"enableLayoutStylesheets": @NO, @"metaDescription": @"", @"attachedStylesheets": @[ @{ } ], @"password": @"", @"publishImmediately": @NO, @"htmlTitle": @"", @"translations": @{ }, @"id": @"", @"state": @"", @"slug": @"", @"createdById": @"", @"currentlyPublished": @NO, @"archivedInDashboard": @NO, @"created": @"", @"contentTypeCategory": @"", @"mabExperimentId": @"", @"updatedById": @"", @"translatedFromId": @"", @"folderId": @"", @"widgetContainers": @{ }, @"pageExpiryRedirectId": @0, @"dynamicPageDataSourceType": @0, @"featuredImage": @"", @"authorName": @"", @"domain": @"", @"name": @"", @"dynamicPageHubDbTableId": @"", @"campaign": @"", @"dynamicPageDataSourceId": @"", @"enableDomainStylesheets": @NO, @"includeDefaultCustomCss": @NO, @"subcategory": @"", @"layoutSections": @{ }, @"updated": @"", @"footerHtml": @"", @"widgets": @{ }, @"headHtml": @"", @"pageExpiryRedirectUrl": @"", @"abStatus": @"", @"useFeaturedImage": @NO, @"abTestId": @"", @"featuredImageAltText": @"", @"contentGroupId": @"", @"pageExpiryEnabled": @NO, @"templatePath": @"", @"url": @"", @"publicAccessRules": @[ @{ } ], @"archivedAt": @"", @"themeSettingsValues": @{ }, @"pageExpiryDate": @0, @"publicAccessRulesEnabled": @NO, @"pageRedirected": @NO, @"currentState": @"", @"categoryId": @0, @"linkRelCanonicalUrl": @"" } ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/cms/v3/pages/site-pages/batch/create"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/cms/v3/pages/site-pages/batch/create" in
let headers = Header.add_list (Header.init ()) [
("private-app-legacy", "{{apiKey}}");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"inputs\": [\n {\n \"publishDate\": \"\",\n \"language\": \"\",\n \"enableLayoutStylesheets\": false,\n \"metaDescription\": \"\",\n \"attachedStylesheets\": [\n {}\n ],\n \"password\": \"\",\n \"publishImmediately\": false,\n \"htmlTitle\": \"\",\n \"translations\": {},\n \"id\": \"\",\n \"state\": \"\",\n \"slug\": \"\",\n \"createdById\": \"\",\n \"currentlyPublished\": false,\n \"archivedInDashboard\": false,\n \"created\": \"\",\n \"contentTypeCategory\": \"\",\n \"mabExperimentId\": \"\",\n \"updatedById\": \"\",\n \"translatedFromId\": \"\",\n \"folderId\": \"\",\n \"widgetContainers\": {},\n \"pageExpiryRedirectId\": 0,\n \"dynamicPageDataSourceType\": 0,\n \"featuredImage\": \"\",\n \"authorName\": \"\",\n \"domain\": \"\",\n \"name\": \"\",\n \"dynamicPageHubDbTableId\": \"\",\n \"campaign\": \"\",\n \"dynamicPageDataSourceId\": \"\",\n \"enableDomainStylesheets\": false,\n \"includeDefaultCustomCss\": false,\n \"subcategory\": \"\",\n \"layoutSections\": {},\n \"updated\": \"\",\n \"footerHtml\": \"\",\n \"widgets\": {},\n \"headHtml\": \"\",\n \"pageExpiryRedirectUrl\": \"\",\n \"abStatus\": \"\",\n \"useFeaturedImage\": false,\n \"abTestId\": \"\",\n \"featuredImageAltText\": \"\",\n \"contentGroupId\": \"\",\n \"pageExpiryEnabled\": false,\n \"templatePath\": \"\",\n \"url\": \"\",\n \"publicAccessRules\": [\n {}\n ],\n \"archivedAt\": \"\",\n \"themeSettingsValues\": {},\n \"pageExpiryDate\": 0,\n \"publicAccessRulesEnabled\": false,\n \"pageRedirected\": false,\n \"currentState\": \"\",\n \"categoryId\": 0,\n \"linkRelCanonicalUrl\": \"\"\n }\n ]\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/cms/v3/pages/site-pages/batch/create",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'inputs' => [
[
'publishDate' => '',
'language' => '',
'enableLayoutStylesheets' => null,
'metaDescription' => '',
'attachedStylesheets' => [
[
]
],
'password' => '',
'publishImmediately' => null,
'htmlTitle' => '',
'translations' => [
],
'id' => '',
'state' => '',
'slug' => '',
'createdById' => '',
'currentlyPublished' => null,
'archivedInDashboard' => null,
'created' => '',
'contentTypeCategory' => '',
'mabExperimentId' => '',
'updatedById' => '',
'translatedFromId' => '',
'folderId' => '',
'widgetContainers' => [
],
'pageExpiryRedirectId' => 0,
'dynamicPageDataSourceType' => 0,
'featuredImage' => '',
'authorName' => '',
'domain' => '',
'name' => '',
'dynamicPageHubDbTableId' => '',
'campaign' => '',
'dynamicPageDataSourceId' => '',
'enableDomainStylesheets' => null,
'includeDefaultCustomCss' => null,
'subcategory' => '',
'layoutSections' => [
],
'updated' => '',
'footerHtml' => '',
'widgets' => [
],
'headHtml' => '',
'pageExpiryRedirectUrl' => '',
'abStatus' => '',
'useFeaturedImage' => null,
'abTestId' => '',
'featuredImageAltText' => '',
'contentGroupId' => '',
'pageExpiryEnabled' => null,
'templatePath' => '',
'url' => '',
'publicAccessRules' => [
[
]
],
'archivedAt' => '',
'themeSettingsValues' => [
],
'pageExpiryDate' => 0,
'publicAccessRulesEnabled' => null,
'pageRedirected' => null,
'currentState' => '',
'categoryId' => 0,
'linkRelCanonicalUrl' => ''
]
]
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"private-app-legacy: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/cms/v3/pages/site-pages/batch/create', [
'body' => '{
"inputs": [
{
"publishDate": "",
"language": "",
"enableLayoutStylesheets": false,
"metaDescription": "",
"attachedStylesheets": [
{}
],
"password": "",
"publishImmediately": false,
"htmlTitle": "",
"translations": {},
"id": "",
"state": "",
"slug": "",
"createdById": "",
"currentlyPublished": false,
"archivedInDashboard": false,
"created": "",
"contentTypeCategory": "",
"mabExperimentId": "",
"updatedById": "",
"translatedFromId": "",
"folderId": "",
"widgetContainers": {},
"pageExpiryRedirectId": 0,
"dynamicPageDataSourceType": 0,
"featuredImage": "",
"authorName": "",
"domain": "",
"name": "",
"dynamicPageHubDbTableId": "",
"campaign": "",
"dynamicPageDataSourceId": "",
"enableDomainStylesheets": false,
"includeDefaultCustomCss": false,
"subcategory": "",
"layoutSections": {},
"updated": "",
"footerHtml": "",
"widgets": {},
"headHtml": "",
"pageExpiryRedirectUrl": "",
"abStatus": "",
"useFeaturedImage": false,
"abTestId": "",
"featuredImageAltText": "",
"contentGroupId": "",
"pageExpiryEnabled": false,
"templatePath": "",
"url": "",
"publicAccessRules": [
{}
],
"archivedAt": "",
"themeSettingsValues": {},
"pageExpiryDate": 0,
"publicAccessRulesEnabled": false,
"pageRedirected": false,
"currentState": "",
"categoryId": 0,
"linkRelCanonicalUrl": ""
}
]
}',
'headers' => [
'content-type' => 'application/json',
'private-app-legacy' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/cms/v3/pages/site-pages/batch/create');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'private-app-legacy' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'inputs' => [
[
'publishDate' => '',
'language' => '',
'enableLayoutStylesheets' => null,
'metaDescription' => '',
'attachedStylesheets' => [
[
]
],
'password' => '',
'publishImmediately' => null,
'htmlTitle' => '',
'translations' => [
],
'id' => '',
'state' => '',
'slug' => '',
'createdById' => '',
'currentlyPublished' => null,
'archivedInDashboard' => null,
'created' => '',
'contentTypeCategory' => '',
'mabExperimentId' => '',
'updatedById' => '',
'translatedFromId' => '',
'folderId' => '',
'widgetContainers' => [
],
'pageExpiryRedirectId' => 0,
'dynamicPageDataSourceType' => 0,
'featuredImage' => '',
'authorName' => '',
'domain' => '',
'name' => '',
'dynamicPageHubDbTableId' => '',
'campaign' => '',
'dynamicPageDataSourceId' => '',
'enableDomainStylesheets' => null,
'includeDefaultCustomCss' => null,
'subcategory' => '',
'layoutSections' => [
],
'updated' => '',
'footerHtml' => '',
'widgets' => [
],
'headHtml' => '',
'pageExpiryRedirectUrl' => '',
'abStatus' => '',
'useFeaturedImage' => null,
'abTestId' => '',
'featuredImageAltText' => '',
'contentGroupId' => '',
'pageExpiryEnabled' => null,
'templatePath' => '',
'url' => '',
'publicAccessRules' => [
[
]
],
'archivedAt' => '',
'themeSettingsValues' => [
],
'pageExpiryDate' => 0,
'publicAccessRulesEnabled' => null,
'pageRedirected' => null,
'currentState' => '',
'categoryId' => 0,
'linkRelCanonicalUrl' => ''
]
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'inputs' => [
[
'publishDate' => '',
'language' => '',
'enableLayoutStylesheets' => null,
'metaDescription' => '',
'attachedStylesheets' => [
[
]
],
'password' => '',
'publishImmediately' => null,
'htmlTitle' => '',
'translations' => [
],
'id' => '',
'state' => '',
'slug' => '',
'createdById' => '',
'currentlyPublished' => null,
'archivedInDashboard' => null,
'created' => '',
'contentTypeCategory' => '',
'mabExperimentId' => '',
'updatedById' => '',
'translatedFromId' => '',
'folderId' => '',
'widgetContainers' => [
],
'pageExpiryRedirectId' => 0,
'dynamicPageDataSourceType' => 0,
'featuredImage' => '',
'authorName' => '',
'domain' => '',
'name' => '',
'dynamicPageHubDbTableId' => '',
'campaign' => '',
'dynamicPageDataSourceId' => '',
'enableDomainStylesheets' => null,
'includeDefaultCustomCss' => null,
'subcategory' => '',
'layoutSections' => [
],
'updated' => '',
'footerHtml' => '',
'widgets' => [
],
'headHtml' => '',
'pageExpiryRedirectUrl' => '',
'abStatus' => '',
'useFeaturedImage' => null,
'abTestId' => '',
'featuredImageAltText' => '',
'contentGroupId' => '',
'pageExpiryEnabled' => null,
'templatePath' => '',
'url' => '',
'publicAccessRules' => [
[
]
],
'archivedAt' => '',
'themeSettingsValues' => [
],
'pageExpiryDate' => 0,
'publicAccessRulesEnabled' => null,
'pageRedirected' => null,
'currentState' => '',
'categoryId' => 0,
'linkRelCanonicalUrl' => ''
]
]
]));
$request->setRequestUrl('{{baseUrl}}/cms/v3/pages/site-pages/batch/create');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'private-app-legacy' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("private-app-legacy", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/cms/v3/pages/site-pages/batch/create' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"inputs": [
{
"publishDate": "",
"language": "",
"enableLayoutStylesheets": false,
"metaDescription": "",
"attachedStylesheets": [
{}
],
"password": "",
"publishImmediately": false,
"htmlTitle": "",
"translations": {},
"id": "",
"state": "",
"slug": "",
"createdById": "",
"currentlyPublished": false,
"archivedInDashboard": false,
"created": "",
"contentTypeCategory": "",
"mabExperimentId": "",
"updatedById": "",
"translatedFromId": "",
"folderId": "",
"widgetContainers": {},
"pageExpiryRedirectId": 0,
"dynamicPageDataSourceType": 0,
"featuredImage": "",
"authorName": "",
"domain": "",
"name": "",
"dynamicPageHubDbTableId": "",
"campaign": "",
"dynamicPageDataSourceId": "",
"enableDomainStylesheets": false,
"includeDefaultCustomCss": false,
"subcategory": "",
"layoutSections": {},
"updated": "",
"footerHtml": "",
"widgets": {},
"headHtml": "",
"pageExpiryRedirectUrl": "",
"abStatus": "",
"useFeaturedImage": false,
"abTestId": "",
"featuredImageAltText": "",
"contentGroupId": "",
"pageExpiryEnabled": false,
"templatePath": "",
"url": "",
"publicAccessRules": [
{}
],
"archivedAt": "",
"themeSettingsValues": {},
"pageExpiryDate": 0,
"publicAccessRulesEnabled": false,
"pageRedirected": false,
"currentState": "",
"categoryId": 0,
"linkRelCanonicalUrl": ""
}
]
}'
$headers=@{}
$headers.Add("private-app-legacy", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/cms/v3/pages/site-pages/batch/create' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"inputs": [
{
"publishDate": "",
"language": "",
"enableLayoutStylesheets": false,
"metaDescription": "",
"attachedStylesheets": [
{}
],
"password": "",
"publishImmediately": false,
"htmlTitle": "",
"translations": {},
"id": "",
"state": "",
"slug": "",
"createdById": "",
"currentlyPublished": false,
"archivedInDashboard": false,
"created": "",
"contentTypeCategory": "",
"mabExperimentId": "",
"updatedById": "",
"translatedFromId": "",
"folderId": "",
"widgetContainers": {},
"pageExpiryRedirectId": 0,
"dynamicPageDataSourceType": 0,
"featuredImage": "",
"authorName": "",
"domain": "",
"name": "",
"dynamicPageHubDbTableId": "",
"campaign": "",
"dynamicPageDataSourceId": "",
"enableDomainStylesheets": false,
"includeDefaultCustomCss": false,
"subcategory": "",
"layoutSections": {},
"updated": "",
"footerHtml": "",
"widgets": {},
"headHtml": "",
"pageExpiryRedirectUrl": "",
"abStatus": "",
"useFeaturedImage": false,
"abTestId": "",
"featuredImageAltText": "",
"contentGroupId": "",
"pageExpiryEnabled": false,
"templatePath": "",
"url": "",
"publicAccessRules": [
{}
],
"archivedAt": "",
"themeSettingsValues": {},
"pageExpiryDate": 0,
"publicAccessRulesEnabled": false,
"pageRedirected": false,
"currentState": "",
"categoryId": 0,
"linkRelCanonicalUrl": ""
}
]
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"inputs\": [\n {\n \"publishDate\": \"\",\n \"language\": \"\",\n \"enableLayoutStylesheets\": false,\n \"metaDescription\": \"\",\n \"attachedStylesheets\": [\n {}\n ],\n \"password\": \"\",\n \"publishImmediately\": false,\n \"htmlTitle\": \"\",\n \"translations\": {},\n \"id\": \"\",\n \"state\": \"\",\n \"slug\": \"\",\n \"createdById\": \"\",\n \"currentlyPublished\": false,\n \"archivedInDashboard\": false,\n \"created\": \"\",\n \"contentTypeCategory\": \"\",\n \"mabExperimentId\": \"\",\n \"updatedById\": \"\",\n \"translatedFromId\": \"\",\n \"folderId\": \"\",\n \"widgetContainers\": {},\n \"pageExpiryRedirectId\": 0,\n \"dynamicPageDataSourceType\": 0,\n \"featuredImage\": \"\",\n \"authorName\": \"\",\n \"domain\": \"\",\n \"name\": \"\",\n \"dynamicPageHubDbTableId\": \"\",\n \"campaign\": \"\",\n \"dynamicPageDataSourceId\": \"\",\n \"enableDomainStylesheets\": false,\n \"includeDefaultCustomCss\": false,\n \"subcategory\": \"\",\n \"layoutSections\": {},\n \"updated\": \"\",\n \"footerHtml\": \"\",\n \"widgets\": {},\n \"headHtml\": \"\",\n \"pageExpiryRedirectUrl\": \"\",\n \"abStatus\": \"\",\n \"useFeaturedImage\": false,\n \"abTestId\": \"\",\n \"featuredImageAltText\": \"\",\n \"contentGroupId\": \"\",\n \"pageExpiryEnabled\": false,\n \"templatePath\": \"\",\n \"url\": \"\",\n \"publicAccessRules\": [\n {}\n ],\n \"archivedAt\": \"\",\n \"themeSettingsValues\": {},\n \"pageExpiryDate\": 0,\n \"publicAccessRulesEnabled\": false,\n \"pageRedirected\": false,\n \"currentState\": \"\",\n \"categoryId\": 0,\n \"linkRelCanonicalUrl\": \"\"\n }\n ]\n}"
headers = {
'private-app-legacy': "{{apiKey}}",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/cms/v3/pages/site-pages/batch/create", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/cms/v3/pages/site-pages/batch/create"
payload = { "inputs": [
{
"publishDate": "",
"language": "",
"enableLayoutStylesheets": False,
"metaDescription": "",
"attachedStylesheets": [{}],
"password": "",
"publishImmediately": False,
"htmlTitle": "",
"translations": {},
"id": "",
"state": "",
"slug": "",
"createdById": "",
"currentlyPublished": False,
"archivedInDashboard": False,
"created": "",
"contentTypeCategory": "",
"mabExperimentId": "",
"updatedById": "",
"translatedFromId": "",
"folderId": "",
"widgetContainers": {},
"pageExpiryRedirectId": 0,
"dynamicPageDataSourceType": 0,
"featuredImage": "",
"authorName": "",
"domain": "",
"name": "",
"dynamicPageHubDbTableId": "",
"campaign": "",
"dynamicPageDataSourceId": "",
"enableDomainStylesheets": False,
"includeDefaultCustomCss": False,
"subcategory": "",
"layoutSections": {},
"updated": "",
"footerHtml": "",
"widgets": {},
"headHtml": "",
"pageExpiryRedirectUrl": "",
"abStatus": "",
"useFeaturedImage": False,
"abTestId": "",
"featuredImageAltText": "",
"contentGroupId": "",
"pageExpiryEnabled": False,
"templatePath": "",
"url": "",
"publicAccessRules": [{}],
"archivedAt": "",
"themeSettingsValues": {},
"pageExpiryDate": 0,
"publicAccessRulesEnabled": False,
"pageRedirected": False,
"currentState": "",
"categoryId": 0,
"linkRelCanonicalUrl": ""
}
] }
headers = {
"private-app-legacy": "{{apiKey}}",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/cms/v3/pages/site-pages/batch/create"
payload <- "{\n \"inputs\": [\n {\n \"publishDate\": \"\",\n \"language\": \"\",\n \"enableLayoutStylesheets\": false,\n \"metaDescription\": \"\",\n \"attachedStylesheets\": [\n {}\n ],\n \"password\": \"\",\n \"publishImmediately\": false,\n \"htmlTitle\": \"\",\n \"translations\": {},\n \"id\": \"\",\n \"state\": \"\",\n \"slug\": \"\",\n \"createdById\": \"\",\n \"currentlyPublished\": false,\n \"archivedInDashboard\": false,\n \"created\": \"\",\n \"contentTypeCategory\": \"\",\n \"mabExperimentId\": \"\",\n \"updatedById\": \"\",\n \"translatedFromId\": \"\",\n \"folderId\": \"\",\n \"widgetContainers\": {},\n \"pageExpiryRedirectId\": 0,\n \"dynamicPageDataSourceType\": 0,\n \"featuredImage\": \"\",\n \"authorName\": \"\",\n \"domain\": \"\",\n \"name\": \"\",\n \"dynamicPageHubDbTableId\": \"\",\n \"campaign\": \"\",\n \"dynamicPageDataSourceId\": \"\",\n \"enableDomainStylesheets\": false,\n \"includeDefaultCustomCss\": false,\n \"subcategory\": \"\",\n \"layoutSections\": {},\n \"updated\": \"\",\n \"footerHtml\": \"\",\n \"widgets\": {},\n \"headHtml\": \"\",\n \"pageExpiryRedirectUrl\": \"\",\n \"abStatus\": \"\",\n \"useFeaturedImage\": false,\n \"abTestId\": \"\",\n \"featuredImageAltText\": \"\",\n \"contentGroupId\": \"\",\n \"pageExpiryEnabled\": false,\n \"templatePath\": \"\",\n \"url\": \"\",\n \"publicAccessRules\": [\n {}\n ],\n \"archivedAt\": \"\",\n \"themeSettingsValues\": {},\n \"pageExpiryDate\": 0,\n \"publicAccessRulesEnabled\": false,\n \"pageRedirected\": false,\n \"currentState\": \"\",\n \"categoryId\": 0,\n \"linkRelCanonicalUrl\": \"\"\n }\n ]\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('private-app-legacy' = '{{apiKey}}'), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/cms/v3/pages/site-pages/batch/create")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["private-app-legacy"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n \"inputs\": [\n {\n \"publishDate\": \"\",\n \"language\": \"\",\n \"enableLayoutStylesheets\": false,\n \"metaDescription\": \"\",\n \"attachedStylesheets\": [\n {}\n ],\n \"password\": \"\",\n \"publishImmediately\": false,\n \"htmlTitle\": \"\",\n \"translations\": {},\n \"id\": \"\",\n \"state\": \"\",\n \"slug\": \"\",\n \"createdById\": \"\",\n \"currentlyPublished\": false,\n \"archivedInDashboard\": false,\n \"created\": \"\",\n \"contentTypeCategory\": \"\",\n \"mabExperimentId\": \"\",\n \"updatedById\": \"\",\n \"translatedFromId\": \"\",\n \"folderId\": \"\",\n \"widgetContainers\": {},\n \"pageExpiryRedirectId\": 0,\n \"dynamicPageDataSourceType\": 0,\n \"featuredImage\": \"\",\n \"authorName\": \"\",\n \"domain\": \"\",\n \"name\": \"\",\n \"dynamicPageHubDbTableId\": \"\",\n \"campaign\": \"\",\n \"dynamicPageDataSourceId\": \"\",\n \"enableDomainStylesheets\": false,\n \"includeDefaultCustomCss\": false,\n \"subcategory\": \"\",\n \"layoutSections\": {},\n \"updated\": \"\",\n \"footerHtml\": \"\",\n \"widgets\": {},\n \"headHtml\": \"\",\n \"pageExpiryRedirectUrl\": \"\",\n \"abStatus\": \"\",\n \"useFeaturedImage\": false,\n \"abTestId\": \"\",\n \"featuredImageAltText\": \"\",\n \"contentGroupId\": \"\",\n \"pageExpiryEnabled\": false,\n \"templatePath\": \"\",\n \"url\": \"\",\n \"publicAccessRules\": [\n {}\n ],\n \"archivedAt\": \"\",\n \"themeSettingsValues\": {},\n \"pageExpiryDate\": 0,\n \"publicAccessRulesEnabled\": false,\n \"pageRedirected\": false,\n \"currentState\": \"\",\n \"categoryId\": 0,\n \"linkRelCanonicalUrl\": \"\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/cms/v3/pages/site-pages/batch/create') do |req|
req.headers['private-app-legacy'] = '{{apiKey}}'
req.body = "{\n \"inputs\": [\n {\n \"publishDate\": \"\",\n \"language\": \"\",\n \"enableLayoutStylesheets\": false,\n \"metaDescription\": \"\",\n \"attachedStylesheets\": [\n {}\n ],\n \"password\": \"\",\n \"publishImmediately\": false,\n \"htmlTitle\": \"\",\n \"translations\": {},\n \"id\": \"\",\n \"state\": \"\",\n \"slug\": \"\",\n \"createdById\": \"\",\n \"currentlyPublished\": false,\n \"archivedInDashboard\": false,\n \"created\": \"\",\n \"contentTypeCategory\": \"\",\n \"mabExperimentId\": \"\",\n \"updatedById\": \"\",\n \"translatedFromId\": \"\",\n \"folderId\": \"\",\n \"widgetContainers\": {},\n \"pageExpiryRedirectId\": 0,\n \"dynamicPageDataSourceType\": 0,\n \"featuredImage\": \"\",\n \"authorName\": \"\",\n \"domain\": \"\",\n \"name\": \"\",\n \"dynamicPageHubDbTableId\": \"\",\n \"campaign\": \"\",\n \"dynamicPageDataSourceId\": \"\",\n \"enableDomainStylesheets\": false,\n \"includeDefaultCustomCss\": false,\n \"subcategory\": \"\",\n \"layoutSections\": {},\n \"updated\": \"\",\n \"footerHtml\": \"\",\n \"widgets\": {},\n \"headHtml\": \"\",\n \"pageExpiryRedirectUrl\": \"\",\n \"abStatus\": \"\",\n \"useFeaturedImage\": false,\n \"abTestId\": \"\",\n \"featuredImageAltText\": \"\",\n \"contentGroupId\": \"\",\n \"pageExpiryEnabled\": false,\n \"templatePath\": \"\",\n \"url\": \"\",\n \"publicAccessRules\": [\n {}\n ],\n \"archivedAt\": \"\",\n \"themeSettingsValues\": {},\n \"pageExpiryDate\": 0,\n \"publicAccessRulesEnabled\": false,\n \"pageRedirected\": false,\n \"currentState\": \"\",\n \"categoryId\": 0,\n \"linkRelCanonicalUrl\": \"\"\n }\n ]\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/cms/v3/pages/site-pages/batch/create";
let payload = json!({"inputs": (
json!({
"publishDate": "",
"language": "",
"enableLayoutStylesheets": false,
"metaDescription": "",
"attachedStylesheets": (json!({})),
"password": "",
"publishImmediately": false,
"htmlTitle": "",
"translations": json!({}),
"id": "",
"state": "",
"slug": "",
"createdById": "",
"currentlyPublished": false,
"archivedInDashboard": false,
"created": "",
"contentTypeCategory": "",
"mabExperimentId": "",
"updatedById": "",
"translatedFromId": "",
"folderId": "",
"widgetContainers": json!({}),
"pageExpiryRedirectId": 0,
"dynamicPageDataSourceType": 0,
"featuredImage": "",
"authorName": "",
"domain": "",
"name": "",
"dynamicPageHubDbTableId": "",
"campaign": "",
"dynamicPageDataSourceId": "",
"enableDomainStylesheets": false,
"includeDefaultCustomCss": false,
"subcategory": "",
"layoutSections": json!({}),
"updated": "",
"footerHtml": "",
"widgets": json!({}),
"headHtml": "",
"pageExpiryRedirectUrl": "",
"abStatus": "",
"useFeaturedImage": false,
"abTestId": "",
"featuredImageAltText": "",
"contentGroupId": "",
"pageExpiryEnabled": false,
"templatePath": "",
"url": "",
"publicAccessRules": (json!({})),
"archivedAt": "",
"themeSettingsValues": json!({}),
"pageExpiryDate": 0,
"publicAccessRulesEnabled": false,
"pageRedirected": false,
"currentState": "",
"categoryId": 0,
"linkRelCanonicalUrl": ""
})
)});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("private-app-legacy", "{{apiKey}}".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/cms/v3/pages/site-pages/batch/create \
--header 'content-type: application/json' \
--header 'private-app-legacy: {{apiKey}}' \
--data '{
"inputs": [
{
"publishDate": "",
"language": "",
"enableLayoutStylesheets": false,
"metaDescription": "",
"attachedStylesheets": [
{}
],
"password": "",
"publishImmediately": false,
"htmlTitle": "",
"translations": {},
"id": "",
"state": "",
"slug": "",
"createdById": "",
"currentlyPublished": false,
"archivedInDashboard": false,
"created": "",
"contentTypeCategory": "",
"mabExperimentId": "",
"updatedById": "",
"translatedFromId": "",
"folderId": "",
"widgetContainers": {},
"pageExpiryRedirectId": 0,
"dynamicPageDataSourceType": 0,
"featuredImage": "",
"authorName": "",
"domain": "",
"name": "",
"dynamicPageHubDbTableId": "",
"campaign": "",
"dynamicPageDataSourceId": "",
"enableDomainStylesheets": false,
"includeDefaultCustomCss": false,
"subcategory": "",
"layoutSections": {},
"updated": "",
"footerHtml": "",
"widgets": {},
"headHtml": "",
"pageExpiryRedirectUrl": "",
"abStatus": "",
"useFeaturedImage": false,
"abTestId": "",
"featuredImageAltText": "",
"contentGroupId": "",
"pageExpiryEnabled": false,
"templatePath": "",
"url": "",
"publicAccessRules": [
{}
],
"archivedAt": "",
"themeSettingsValues": {},
"pageExpiryDate": 0,
"publicAccessRulesEnabled": false,
"pageRedirected": false,
"currentState": "",
"categoryId": 0,
"linkRelCanonicalUrl": ""
}
]
}'
echo '{
"inputs": [
{
"publishDate": "",
"language": "",
"enableLayoutStylesheets": false,
"metaDescription": "",
"attachedStylesheets": [
{}
],
"password": "",
"publishImmediately": false,
"htmlTitle": "",
"translations": {},
"id": "",
"state": "",
"slug": "",
"createdById": "",
"currentlyPublished": false,
"archivedInDashboard": false,
"created": "",
"contentTypeCategory": "",
"mabExperimentId": "",
"updatedById": "",
"translatedFromId": "",
"folderId": "",
"widgetContainers": {},
"pageExpiryRedirectId": 0,
"dynamicPageDataSourceType": 0,
"featuredImage": "",
"authorName": "",
"domain": "",
"name": "",
"dynamicPageHubDbTableId": "",
"campaign": "",
"dynamicPageDataSourceId": "",
"enableDomainStylesheets": false,
"includeDefaultCustomCss": false,
"subcategory": "",
"layoutSections": {},
"updated": "",
"footerHtml": "",
"widgets": {},
"headHtml": "",
"pageExpiryRedirectUrl": "",
"abStatus": "",
"useFeaturedImage": false,
"abTestId": "",
"featuredImageAltText": "",
"contentGroupId": "",
"pageExpiryEnabled": false,
"templatePath": "",
"url": "",
"publicAccessRules": [
{}
],
"archivedAt": "",
"themeSettingsValues": {},
"pageExpiryDate": 0,
"publicAccessRulesEnabled": false,
"pageRedirected": false,
"currentState": "",
"categoryId": 0,
"linkRelCanonicalUrl": ""
}
]
}' | \
http POST {{baseUrl}}/cms/v3/pages/site-pages/batch/create \
content-type:application/json \
private-app-legacy:'{{apiKey}}'
wget --quiet \
--method POST \
--header 'private-app-legacy: {{apiKey}}' \
--header 'content-type: application/json' \
--body-data '{\n "inputs": [\n {\n "publishDate": "",\n "language": "",\n "enableLayoutStylesheets": false,\n "metaDescription": "",\n "attachedStylesheets": [\n {}\n ],\n "password": "",\n "publishImmediately": false,\n "htmlTitle": "",\n "translations": {},\n "id": "",\n "state": "",\n "slug": "",\n "createdById": "",\n "currentlyPublished": false,\n "archivedInDashboard": false,\n "created": "",\n "contentTypeCategory": "",\n "mabExperimentId": "",\n "updatedById": "",\n "translatedFromId": "",\n "folderId": "",\n "widgetContainers": {},\n "pageExpiryRedirectId": 0,\n "dynamicPageDataSourceType": 0,\n "featuredImage": "",\n "authorName": "",\n "domain": "",\n "name": "",\n "dynamicPageHubDbTableId": "",\n "campaign": "",\n "dynamicPageDataSourceId": "",\n "enableDomainStylesheets": false,\n "includeDefaultCustomCss": false,\n "subcategory": "",\n "layoutSections": {},\n "updated": "",\n "footerHtml": "",\n "widgets": {},\n "headHtml": "",\n "pageExpiryRedirectUrl": "",\n "abStatus": "",\n "useFeaturedImage": false,\n "abTestId": "",\n "featuredImageAltText": "",\n "contentGroupId": "",\n "pageExpiryEnabled": false,\n "templatePath": "",\n "url": "",\n "publicAccessRules": [\n {}\n ],\n "archivedAt": "",\n "themeSettingsValues": {},\n "pageExpiryDate": 0,\n "publicAccessRulesEnabled": false,\n "pageRedirected": false,\n "currentState": "",\n "categoryId": 0,\n "linkRelCanonicalUrl": ""\n }\n ]\n}' \
--output-document \
- {{baseUrl}}/cms/v3/pages/site-pages/batch/create
import Foundation
let headers = [
"private-app-legacy": "{{apiKey}}",
"content-type": "application/json"
]
let parameters = ["inputs": [
[
"publishDate": "",
"language": "",
"enableLayoutStylesheets": false,
"metaDescription": "",
"attachedStylesheets": [[]],
"password": "",
"publishImmediately": false,
"htmlTitle": "",
"translations": [],
"id": "",
"state": "",
"slug": "",
"createdById": "",
"currentlyPublished": false,
"archivedInDashboard": false,
"created": "",
"contentTypeCategory": "",
"mabExperimentId": "",
"updatedById": "",
"translatedFromId": "",
"folderId": "",
"widgetContainers": [],
"pageExpiryRedirectId": 0,
"dynamicPageDataSourceType": 0,
"featuredImage": "",
"authorName": "",
"domain": "",
"name": "",
"dynamicPageHubDbTableId": "",
"campaign": "",
"dynamicPageDataSourceId": "",
"enableDomainStylesheets": false,
"includeDefaultCustomCss": false,
"subcategory": "",
"layoutSections": [],
"updated": "",
"footerHtml": "",
"widgets": [],
"headHtml": "",
"pageExpiryRedirectUrl": "",
"abStatus": "",
"useFeaturedImage": false,
"abTestId": "",
"featuredImageAltText": "",
"contentGroupId": "",
"pageExpiryEnabled": false,
"templatePath": "",
"url": "",
"publicAccessRules": [[]],
"archivedAt": "",
"themeSettingsValues": [],
"pageExpiryDate": 0,
"publicAccessRulesEnabled": false,
"pageRedirected": false,
"currentState": "",
"categoryId": 0,
"linkRelCanonicalUrl": ""
]
]] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/cms/v3/pages/site-pages/batch/create")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
*/*
RESPONSE BODY text
{
"message": "Invalid input (details will vary based on the error)",
"correlationId": "aeb5f871-7f07-4993-9211-075dc63e7cbf",
"category": "VALIDATION_ERROR",
"links": {
"knowledge-base": "https://www.hubspot.com/products/service/knowledge-base"
}
}
POST
Create a new A-B test variation
{{baseUrl}}/cms/v3/pages/site-pages/ab-test/create-variation
HEADERS
private-app-legacy
{{apiKey}}
BODY json
{
"variationName": "",
"contentId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/cms/v3/pages/site-pages/ab-test/create-variation");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "private-app-legacy: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"variationName\": \"\",\n \"contentId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/cms/v3/pages/site-pages/ab-test/create-variation" {:headers {:private-app-legacy "{{apiKey}}"}
:content-type :json
:form-params {:variationName ""
:contentId ""}})
require "http/client"
url = "{{baseUrl}}/cms/v3/pages/site-pages/ab-test/create-variation"
headers = HTTP::Headers{
"private-app-legacy" => "{{apiKey}}"
"content-type" => "application/json"
}
reqBody = "{\n \"variationName\": \"\",\n \"contentId\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/cms/v3/pages/site-pages/ab-test/create-variation"),
Headers =
{
{ "private-app-legacy", "{{apiKey}}" },
},
Content = new StringContent("{\n \"variationName\": \"\",\n \"contentId\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/cms/v3/pages/site-pages/ab-test/create-variation");
var request = new RestRequest("", Method.Post);
request.AddHeader("private-app-legacy", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"variationName\": \"\",\n \"contentId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/cms/v3/pages/site-pages/ab-test/create-variation"
payload := strings.NewReader("{\n \"variationName\": \"\",\n \"contentId\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("private-app-legacy", "{{apiKey}}")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/cms/v3/pages/site-pages/ab-test/create-variation HTTP/1.1
Private-App-Legacy: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 44
{
"variationName": "",
"contentId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/cms/v3/pages/site-pages/ab-test/create-variation")
.setHeader("private-app-legacy", "{{apiKey}}")
.setHeader("content-type", "application/json")
.setBody("{\n \"variationName\": \"\",\n \"contentId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/cms/v3/pages/site-pages/ab-test/create-variation"))
.header("private-app-legacy", "{{apiKey}}")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"variationName\": \"\",\n \"contentId\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"variationName\": \"\",\n \"contentId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/cms/v3/pages/site-pages/ab-test/create-variation")
.post(body)
.addHeader("private-app-legacy", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/cms/v3/pages/site-pages/ab-test/create-variation")
.header("private-app-legacy", "{{apiKey}}")
.header("content-type", "application/json")
.body("{\n \"variationName\": \"\",\n \"contentId\": \"\"\n}")
.asString();
const data = JSON.stringify({
variationName: '',
contentId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/cms/v3/pages/site-pages/ab-test/create-variation');
xhr.setRequestHeader('private-app-legacy', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/cms/v3/pages/site-pages/ab-test/create-variation',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
data: {variationName: '', contentId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/cms/v3/pages/site-pages/ab-test/create-variation';
const options = {
method: 'POST',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
body: '{"variationName":"","contentId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/cms/v3/pages/site-pages/ab-test/create-variation',
method: 'POST',
headers: {
'private-app-legacy': '{{apiKey}}',
'content-type': 'application/json'
},
processData: false,
data: '{\n "variationName": "",\n "contentId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"variationName\": \"\",\n \"contentId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/cms/v3/pages/site-pages/ab-test/create-variation")
.post(body)
.addHeader("private-app-legacy", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/cms/v3/pages/site-pages/ab-test/create-variation',
headers: {
'private-app-legacy': '{{apiKey}}',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({variationName: '', contentId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/cms/v3/pages/site-pages/ab-test/create-variation',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
body: {variationName: '', contentId: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/cms/v3/pages/site-pages/ab-test/create-variation');
req.headers({
'private-app-legacy': '{{apiKey}}',
'content-type': 'application/json'
});
req.type('json');
req.send({
variationName: '',
contentId: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/cms/v3/pages/site-pages/ab-test/create-variation',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
data: {variationName: '', contentId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/cms/v3/pages/site-pages/ab-test/create-variation';
const options = {
method: 'POST',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
body: '{"variationName":"","contentId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"private-app-legacy": @"{{apiKey}}",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"variationName": @"",
@"contentId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/cms/v3/pages/site-pages/ab-test/create-variation"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/cms/v3/pages/site-pages/ab-test/create-variation" in
let headers = Header.add_list (Header.init ()) [
("private-app-legacy", "{{apiKey}}");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"variationName\": \"\",\n \"contentId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/cms/v3/pages/site-pages/ab-test/create-variation",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'variationName' => '',
'contentId' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"private-app-legacy: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/cms/v3/pages/site-pages/ab-test/create-variation', [
'body' => '{
"variationName": "",
"contentId": ""
}',
'headers' => [
'content-type' => 'application/json',
'private-app-legacy' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/cms/v3/pages/site-pages/ab-test/create-variation');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'private-app-legacy' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'variationName' => '',
'contentId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'variationName' => '',
'contentId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/cms/v3/pages/site-pages/ab-test/create-variation');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'private-app-legacy' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("private-app-legacy", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/cms/v3/pages/site-pages/ab-test/create-variation' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"variationName": "",
"contentId": ""
}'
$headers=@{}
$headers.Add("private-app-legacy", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/cms/v3/pages/site-pages/ab-test/create-variation' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"variationName": "",
"contentId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"variationName\": \"\",\n \"contentId\": \"\"\n}"
headers = {
'private-app-legacy': "{{apiKey}}",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/cms/v3/pages/site-pages/ab-test/create-variation", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/cms/v3/pages/site-pages/ab-test/create-variation"
payload = {
"variationName": "",
"contentId": ""
}
headers = {
"private-app-legacy": "{{apiKey}}",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/cms/v3/pages/site-pages/ab-test/create-variation"
payload <- "{\n \"variationName\": \"\",\n \"contentId\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('private-app-legacy' = '{{apiKey}}'), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/cms/v3/pages/site-pages/ab-test/create-variation")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["private-app-legacy"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n \"variationName\": \"\",\n \"contentId\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/cms/v3/pages/site-pages/ab-test/create-variation') do |req|
req.headers['private-app-legacy'] = '{{apiKey}}'
req.body = "{\n \"variationName\": \"\",\n \"contentId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/cms/v3/pages/site-pages/ab-test/create-variation";
let payload = json!({
"variationName": "",
"contentId": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("private-app-legacy", "{{apiKey}}".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/cms/v3/pages/site-pages/ab-test/create-variation \
--header 'content-type: application/json' \
--header 'private-app-legacy: {{apiKey}}' \
--data '{
"variationName": "",
"contentId": ""
}'
echo '{
"variationName": "",
"contentId": ""
}' | \
http POST {{baseUrl}}/cms/v3/pages/site-pages/ab-test/create-variation \
content-type:application/json \
private-app-legacy:'{{apiKey}}'
wget --quiet \
--method POST \
--header 'private-app-legacy: {{apiKey}}' \
--header 'content-type: application/json' \
--body-data '{\n "variationName": "",\n "contentId": ""\n}' \
--output-document \
- {{baseUrl}}/cms/v3/pages/site-pages/ab-test/create-variation
import Foundation
let headers = [
"private-app-legacy": "{{apiKey}}",
"content-type": "application/json"
]
let parameters = [
"variationName": "",
"contentId": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/cms/v3/pages/site-pages/ab-test/create-variation")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
*/*
RESPONSE BODY text
{
"message": "Invalid input (details will vary based on the error)",
"correlationId": "aeb5f871-7f07-4993-9211-075dc63e7cbf",
"category": "VALIDATION_ERROR",
"links": {
"knowledge-base": "https://www.hubspot.com/products/service/knowledge-base"
}
}
POST
Create a new Site Page
{{baseUrl}}/cms/v3/pages/site-pages
HEADERS
private-app-legacy
{{apiKey}}
BODY json
{
"publishDate": "",
"language": "",
"enableLayoutStylesheets": false,
"metaDescription": "",
"attachedStylesheets": [
{}
],
"password": "",
"publishImmediately": false,
"htmlTitle": "",
"translations": {},
"id": "",
"state": "",
"slug": "",
"createdById": "",
"currentlyPublished": false,
"archivedInDashboard": false,
"created": "",
"contentTypeCategory": "",
"mabExperimentId": "",
"updatedById": "",
"translatedFromId": "",
"folderId": "",
"widgetContainers": {},
"pageExpiryRedirectId": 0,
"dynamicPageDataSourceType": 0,
"featuredImage": "",
"authorName": "",
"domain": "",
"name": "",
"dynamicPageHubDbTableId": "",
"campaign": "",
"dynamicPageDataSourceId": "",
"enableDomainStylesheets": false,
"includeDefaultCustomCss": false,
"subcategory": "",
"layoutSections": {},
"updated": "",
"footerHtml": "",
"widgets": {},
"headHtml": "",
"pageExpiryRedirectUrl": "",
"abStatus": "",
"useFeaturedImage": false,
"abTestId": "",
"featuredImageAltText": "",
"contentGroupId": "",
"pageExpiryEnabled": false,
"templatePath": "",
"url": "",
"publicAccessRules": [
{}
],
"archivedAt": "",
"themeSettingsValues": {},
"pageExpiryDate": 0,
"publicAccessRulesEnabled": false,
"pageRedirected": false,
"currentState": "",
"categoryId": 0,
"linkRelCanonicalUrl": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/cms/v3/pages/site-pages");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "private-app-legacy: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"publishDate\": \"\",\n \"language\": \"\",\n \"enableLayoutStylesheets\": false,\n \"metaDescription\": \"\",\n \"attachedStylesheets\": [\n {}\n ],\n \"password\": \"\",\n \"publishImmediately\": false,\n \"htmlTitle\": \"\",\n \"translations\": {},\n \"id\": \"\",\n \"state\": \"\",\n \"slug\": \"\",\n \"createdById\": \"\",\n \"currentlyPublished\": false,\n \"archivedInDashboard\": false,\n \"created\": \"\",\n \"contentTypeCategory\": \"\",\n \"mabExperimentId\": \"\",\n \"updatedById\": \"\",\n \"translatedFromId\": \"\",\n \"folderId\": \"\",\n \"widgetContainers\": {},\n \"pageExpiryRedirectId\": 0,\n \"dynamicPageDataSourceType\": 0,\n \"featuredImage\": \"\",\n \"authorName\": \"\",\n \"domain\": \"\",\n \"name\": \"\",\n \"dynamicPageHubDbTableId\": \"\",\n \"campaign\": \"\",\n \"dynamicPageDataSourceId\": \"\",\n \"enableDomainStylesheets\": false,\n \"includeDefaultCustomCss\": false,\n \"subcategory\": \"\",\n \"layoutSections\": {},\n \"updated\": \"\",\n \"footerHtml\": \"\",\n \"widgets\": {},\n \"headHtml\": \"\",\n \"pageExpiryRedirectUrl\": \"\",\n \"abStatus\": \"\",\n \"useFeaturedImage\": false,\n \"abTestId\": \"\",\n \"featuredImageAltText\": \"\",\n \"contentGroupId\": \"\",\n \"pageExpiryEnabled\": false,\n \"templatePath\": \"\",\n \"url\": \"\",\n \"publicAccessRules\": [\n {}\n ],\n \"archivedAt\": \"\",\n \"themeSettingsValues\": {},\n \"pageExpiryDate\": 0,\n \"publicAccessRulesEnabled\": false,\n \"pageRedirected\": false,\n \"currentState\": \"\",\n \"categoryId\": 0,\n \"linkRelCanonicalUrl\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/cms/v3/pages/site-pages" {:headers {:private-app-legacy "{{apiKey}}"}
:content-type :json
:form-params {:publishDate ""
:language ""
:enableLayoutStylesheets false
:metaDescription ""
:attachedStylesheets [{}]
:password ""
:publishImmediately false
:htmlTitle ""
:translations {}
:id ""
:state ""
:slug ""
:createdById ""
:currentlyPublished false
:archivedInDashboard false
:created ""
:contentTypeCategory ""
:mabExperimentId ""
:updatedById ""
:translatedFromId ""
:folderId ""
:widgetContainers {}
:pageExpiryRedirectId 0
:dynamicPageDataSourceType 0
:featuredImage ""
:authorName ""
:domain ""
:name ""
:dynamicPageHubDbTableId ""
:campaign ""
:dynamicPageDataSourceId ""
:enableDomainStylesheets false
:includeDefaultCustomCss false
:subcategory ""
:layoutSections {}
:updated ""
:footerHtml ""
:widgets {}
:headHtml ""
:pageExpiryRedirectUrl ""
:abStatus ""
:useFeaturedImage false
:abTestId ""
:featuredImageAltText ""
:contentGroupId ""
:pageExpiryEnabled false
:templatePath ""
:url ""
:publicAccessRules [{}]
:archivedAt ""
:themeSettingsValues {}
:pageExpiryDate 0
:publicAccessRulesEnabled false
:pageRedirected false
:currentState ""
:categoryId 0
:linkRelCanonicalUrl ""}})
require "http/client"
url = "{{baseUrl}}/cms/v3/pages/site-pages"
headers = HTTP::Headers{
"private-app-legacy" => "{{apiKey}}"
"content-type" => "application/json"
}
reqBody = "{\n \"publishDate\": \"\",\n \"language\": \"\",\n \"enableLayoutStylesheets\": false,\n \"metaDescription\": \"\",\n \"attachedStylesheets\": [\n {}\n ],\n \"password\": \"\",\n \"publishImmediately\": false,\n \"htmlTitle\": \"\",\n \"translations\": {},\n \"id\": \"\",\n \"state\": \"\",\n \"slug\": \"\",\n \"createdById\": \"\",\n \"currentlyPublished\": false,\n \"archivedInDashboard\": false,\n \"created\": \"\",\n \"contentTypeCategory\": \"\",\n \"mabExperimentId\": \"\",\n \"updatedById\": \"\",\n \"translatedFromId\": \"\",\n \"folderId\": \"\",\n \"widgetContainers\": {},\n \"pageExpiryRedirectId\": 0,\n \"dynamicPageDataSourceType\": 0,\n \"featuredImage\": \"\",\n \"authorName\": \"\",\n \"domain\": \"\",\n \"name\": \"\",\n \"dynamicPageHubDbTableId\": \"\",\n \"campaign\": \"\",\n \"dynamicPageDataSourceId\": \"\",\n \"enableDomainStylesheets\": false,\n \"includeDefaultCustomCss\": false,\n \"subcategory\": \"\",\n \"layoutSections\": {},\n \"updated\": \"\",\n \"footerHtml\": \"\",\n \"widgets\": {},\n \"headHtml\": \"\",\n \"pageExpiryRedirectUrl\": \"\",\n \"abStatus\": \"\",\n \"useFeaturedImage\": false,\n \"abTestId\": \"\",\n \"featuredImageAltText\": \"\",\n \"contentGroupId\": \"\",\n \"pageExpiryEnabled\": false,\n \"templatePath\": \"\",\n \"url\": \"\",\n \"publicAccessRules\": [\n {}\n ],\n \"archivedAt\": \"\",\n \"themeSettingsValues\": {},\n \"pageExpiryDate\": 0,\n \"publicAccessRulesEnabled\": false,\n \"pageRedirected\": false,\n \"currentState\": \"\",\n \"categoryId\": 0,\n \"linkRelCanonicalUrl\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/cms/v3/pages/site-pages"),
Headers =
{
{ "private-app-legacy", "{{apiKey}}" },
},
Content = new StringContent("{\n \"publishDate\": \"\",\n \"language\": \"\",\n \"enableLayoutStylesheets\": false,\n \"metaDescription\": \"\",\n \"attachedStylesheets\": [\n {}\n ],\n \"password\": \"\",\n \"publishImmediately\": false,\n \"htmlTitle\": \"\",\n \"translations\": {},\n \"id\": \"\",\n \"state\": \"\",\n \"slug\": \"\",\n \"createdById\": \"\",\n \"currentlyPublished\": false,\n \"archivedInDashboard\": false,\n \"created\": \"\",\n \"contentTypeCategory\": \"\",\n \"mabExperimentId\": \"\",\n \"updatedById\": \"\",\n \"translatedFromId\": \"\",\n \"folderId\": \"\",\n \"widgetContainers\": {},\n \"pageExpiryRedirectId\": 0,\n \"dynamicPageDataSourceType\": 0,\n \"featuredImage\": \"\",\n \"authorName\": \"\",\n \"domain\": \"\",\n \"name\": \"\",\n \"dynamicPageHubDbTableId\": \"\",\n \"campaign\": \"\",\n \"dynamicPageDataSourceId\": \"\",\n \"enableDomainStylesheets\": false,\n \"includeDefaultCustomCss\": false,\n \"subcategory\": \"\",\n \"layoutSections\": {},\n \"updated\": \"\",\n \"footerHtml\": \"\",\n \"widgets\": {},\n \"headHtml\": \"\",\n \"pageExpiryRedirectUrl\": \"\",\n \"abStatus\": \"\",\n \"useFeaturedImage\": false,\n \"abTestId\": \"\",\n \"featuredImageAltText\": \"\",\n \"contentGroupId\": \"\",\n \"pageExpiryEnabled\": false,\n \"templatePath\": \"\",\n \"url\": \"\",\n \"publicAccessRules\": [\n {}\n ],\n \"archivedAt\": \"\",\n \"themeSettingsValues\": {},\n \"pageExpiryDate\": 0,\n \"publicAccessRulesEnabled\": false,\n \"pageRedirected\": false,\n \"currentState\": \"\",\n \"categoryId\": 0,\n \"linkRelCanonicalUrl\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/cms/v3/pages/site-pages");
var request = new RestRequest("", Method.Post);
request.AddHeader("private-app-legacy", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"publishDate\": \"\",\n \"language\": \"\",\n \"enableLayoutStylesheets\": false,\n \"metaDescription\": \"\",\n \"attachedStylesheets\": [\n {}\n ],\n \"password\": \"\",\n \"publishImmediately\": false,\n \"htmlTitle\": \"\",\n \"translations\": {},\n \"id\": \"\",\n \"state\": \"\",\n \"slug\": \"\",\n \"createdById\": \"\",\n \"currentlyPublished\": false,\n \"archivedInDashboard\": false,\n \"created\": \"\",\n \"contentTypeCategory\": \"\",\n \"mabExperimentId\": \"\",\n \"updatedById\": \"\",\n \"translatedFromId\": \"\",\n \"folderId\": \"\",\n \"widgetContainers\": {},\n \"pageExpiryRedirectId\": 0,\n \"dynamicPageDataSourceType\": 0,\n \"featuredImage\": \"\",\n \"authorName\": \"\",\n \"domain\": \"\",\n \"name\": \"\",\n \"dynamicPageHubDbTableId\": \"\",\n \"campaign\": \"\",\n \"dynamicPageDataSourceId\": \"\",\n \"enableDomainStylesheets\": false,\n \"includeDefaultCustomCss\": false,\n \"subcategory\": \"\",\n \"layoutSections\": {},\n \"updated\": \"\",\n \"footerHtml\": \"\",\n \"widgets\": {},\n \"headHtml\": \"\",\n \"pageExpiryRedirectUrl\": \"\",\n \"abStatus\": \"\",\n \"useFeaturedImage\": false,\n \"abTestId\": \"\",\n \"featuredImageAltText\": \"\",\n \"contentGroupId\": \"\",\n \"pageExpiryEnabled\": false,\n \"templatePath\": \"\",\n \"url\": \"\",\n \"publicAccessRules\": [\n {}\n ],\n \"archivedAt\": \"\",\n \"themeSettingsValues\": {},\n \"pageExpiryDate\": 0,\n \"publicAccessRulesEnabled\": false,\n \"pageRedirected\": false,\n \"currentState\": \"\",\n \"categoryId\": 0,\n \"linkRelCanonicalUrl\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/cms/v3/pages/site-pages"
payload := strings.NewReader("{\n \"publishDate\": \"\",\n \"language\": \"\",\n \"enableLayoutStylesheets\": false,\n \"metaDescription\": \"\",\n \"attachedStylesheets\": [\n {}\n ],\n \"password\": \"\",\n \"publishImmediately\": false,\n \"htmlTitle\": \"\",\n \"translations\": {},\n \"id\": \"\",\n \"state\": \"\",\n \"slug\": \"\",\n \"createdById\": \"\",\n \"currentlyPublished\": false,\n \"archivedInDashboard\": false,\n \"created\": \"\",\n \"contentTypeCategory\": \"\",\n \"mabExperimentId\": \"\",\n \"updatedById\": \"\",\n \"translatedFromId\": \"\",\n \"folderId\": \"\",\n \"widgetContainers\": {},\n \"pageExpiryRedirectId\": 0,\n \"dynamicPageDataSourceType\": 0,\n \"featuredImage\": \"\",\n \"authorName\": \"\",\n \"domain\": \"\",\n \"name\": \"\",\n \"dynamicPageHubDbTableId\": \"\",\n \"campaign\": \"\",\n \"dynamicPageDataSourceId\": \"\",\n \"enableDomainStylesheets\": false,\n \"includeDefaultCustomCss\": false,\n \"subcategory\": \"\",\n \"layoutSections\": {},\n \"updated\": \"\",\n \"footerHtml\": \"\",\n \"widgets\": {},\n \"headHtml\": \"\",\n \"pageExpiryRedirectUrl\": \"\",\n \"abStatus\": \"\",\n \"useFeaturedImage\": false,\n \"abTestId\": \"\",\n \"featuredImageAltText\": \"\",\n \"contentGroupId\": \"\",\n \"pageExpiryEnabled\": false,\n \"templatePath\": \"\",\n \"url\": \"\",\n \"publicAccessRules\": [\n {}\n ],\n \"archivedAt\": \"\",\n \"themeSettingsValues\": {},\n \"pageExpiryDate\": 0,\n \"publicAccessRulesEnabled\": false,\n \"pageRedirected\": false,\n \"currentState\": \"\",\n \"categoryId\": 0,\n \"linkRelCanonicalUrl\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("private-app-legacy", "{{apiKey}}")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/cms/v3/pages/site-pages HTTP/1.1
Private-App-Legacy: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 1385
{
"publishDate": "",
"language": "",
"enableLayoutStylesheets": false,
"metaDescription": "",
"attachedStylesheets": [
{}
],
"password": "",
"publishImmediately": false,
"htmlTitle": "",
"translations": {},
"id": "",
"state": "",
"slug": "",
"createdById": "",
"currentlyPublished": false,
"archivedInDashboard": false,
"created": "",
"contentTypeCategory": "",
"mabExperimentId": "",
"updatedById": "",
"translatedFromId": "",
"folderId": "",
"widgetContainers": {},
"pageExpiryRedirectId": 0,
"dynamicPageDataSourceType": 0,
"featuredImage": "",
"authorName": "",
"domain": "",
"name": "",
"dynamicPageHubDbTableId": "",
"campaign": "",
"dynamicPageDataSourceId": "",
"enableDomainStylesheets": false,
"includeDefaultCustomCss": false,
"subcategory": "",
"layoutSections": {},
"updated": "",
"footerHtml": "",
"widgets": {},
"headHtml": "",
"pageExpiryRedirectUrl": "",
"abStatus": "",
"useFeaturedImage": false,
"abTestId": "",
"featuredImageAltText": "",
"contentGroupId": "",
"pageExpiryEnabled": false,
"templatePath": "",
"url": "",
"publicAccessRules": [
{}
],
"archivedAt": "",
"themeSettingsValues": {},
"pageExpiryDate": 0,
"publicAccessRulesEnabled": false,
"pageRedirected": false,
"currentState": "",
"categoryId": 0,
"linkRelCanonicalUrl": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/cms/v3/pages/site-pages")
.setHeader("private-app-legacy", "{{apiKey}}")
.setHeader("content-type", "application/json")
.setBody("{\n \"publishDate\": \"\",\n \"language\": \"\",\n \"enableLayoutStylesheets\": false,\n \"metaDescription\": \"\",\n \"attachedStylesheets\": [\n {}\n ],\n \"password\": \"\",\n \"publishImmediately\": false,\n \"htmlTitle\": \"\",\n \"translations\": {},\n \"id\": \"\",\n \"state\": \"\",\n \"slug\": \"\",\n \"createdById\": \"\",\n \"currentlyPublished\": false,\n \"archivedInDashboard\": false,\n \"created\": \"\",\n \"contentTypeCategory\": \"\",\n \"mabExperimentId\": \"\",\n \"updatedById\": \"\",\n \"translatedFromId\": \"\",\n \"folderId\": \"\",\n \"widgetContainers\": {},\n \"pageExpiryRedirectId\": 0,\n \"dynamicPageDataSourceType\": 0,\n \"featuredImage\": \"\",\n \"authorName\": \"\",\n \"domain\": \"\",\n \"name\": \"\",\n \"dynamicPageHubDbTableId\": \"\",\n \"campaign\": \"\",\n \"dynamicPageDataSourceId\": \"\",\n \"enableDomainStylesheets\": false,\n \"includeDefaultCustomCss\": false,\n \"subcategory\": \"\",\n \"layoutSections\": {},\n \"updated\": \"\",\n \"footerHtml\": \"\",\n \"widgets\": {},\n \"headHtml\": \"\",\n \"pageExpiryRedirectUrl\": \"\",\n \"abStatus\": \"\",\n \"useFeaturedImage\": false,\n \"abTestId\": \"\",\n \"featuredImageAltText\": \"\",\n \"contentGroupId\": \"\",\n \"pageExpiryEnabled\": false,\n \"templatePath\": \"\",\n \"url\": \"\",\n \"publicAccessRules\": [\n {}\n ],\n \"archivedAt\": \"\",\n \"themeSettingsValues\": {},\n \"pageExpiryDate\": 0,\n \"publicAccessRulesEnabled\": false,\n \"pageRedirected\": false,\n \"currentState\": \"\",\n \"categoryId\": 0,\n \"linkRelCanonicalUrl\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/cms/v3/pages/site-pages"))
.header("private-app-legacy", "{{apiKey}}")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"publishDate\": \"\",\n \"language\": \"\",\n \"enableLayoutStylesheets\": false,\n \"metaDescription\": \"\",\n \"attachedStylesheets\": [\n {}\n ],\n \"password\": \"\",\n \"publishImmediately\": false,\n \"htmlTitle\": \"\",\n \"translations\": {},\n \"id\": \"\",\n \"state\": \"\",\n \"slug\": \"\",\n \"createdById\": \"\",\n \"currentlyPublished\": false,\n \"archivedInDashboard\": false,\n \"created\": \"\",\n \"contentTypeCategory\": \"\",\n \"mabExperimentId\": \"\",\n \"updatedById\": \"\",\n \"translatedFromId\": \"\",\n \"folderId\": \"\",\n \"widgetContainers\": {},\n \"pageExpiryRedirectId\": 0,\n \"dynamicPageDataSourceType\": 0,\n \"featuredImage\": \"\",\n \"authorName\": \"\",\n \"domain\": \"\",\n \"name\": \"\",\n \"dynamicPageHubDbTableId\": \"\",\n \"campaign\": \"\",\n \"dynamicPageDataSourceId\": \"\",\n \"enableDomainStylesheets\": false,\n \"includeDefaultCustomCss\": false,\n \"subcategory\": \"\",\n \"layoutSections\": {},\n \"updated\": \"\",\n \"footerHtml\": \"\",\n \"widgets\": {},\n \"headHtml\": \"\",\n \"pageExpiryRedirectUrl\": \"\",\n \"abStatus\": \"\",\n \"useFeaturedImage\": false,\n \"abTestId\": \"\",\n \"featuredImageAltText\": \"\",\n \"contentGroupId\": \"\",\n \"pageExpiryEnabled\": false,\n \"templatePath\": \"\",\n \"url\": \"\",\n \"publicAccessRules\": [\n {}\n ],\n \"archivedAt\": \"\",\n \"themeSettingsValues\": {},\n \"pageExpiryDate\": 0,\n \"publicAccessRulesEnabled\": false,\n \"pageRedirected\": false,\n \"currentState\": \"\",\n \"categoryId\": 0,\n \"linkRelCanonicalUrl\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"publishDate\": \"\",\n \"language\": \"\",\n \"enableLayoutStylesheets\": false,\n \"metaDescription\": \"\",\n \"attachedStylesheets\": [\n {}\n ],\n \"password\": \"\",\n \"publishImmediately\": false,\n \"htmlTitle\": \"\",\n \"translations\": {},\n \"id\": \"\",\n \"state\": \"\",\n \"slug\": \"\",\n \"createdById\": \"\",\n \"currentlyPublished\": false,\n \"archivedInDashboard\": false,\n \"created\": \"\",\n \"contentTypeCategory\": \"\",\n \"mabExperimentId\": \"\",\n \"updatedById\": \"\",\n \"translatedFromId\": \"\",\n \"folderId\": \"\",\n \"widgetContainers\": {},\n \"pageExpiryRedirectId\": 0,\n \"dynamicPageDataSourceType\": 0,\n \"featuredImage\": \"\",\n \"authorName\": \"\",\n \"domain\": \"\",\n \"name\": \"\",\n \"dynamicPageHubDbTableId\": \"\",\n \"campaign\": \"\",\n \"dynamicPageDataSourceId\": \"\",\n \"enableDomainStylesheets\": false,\n \"includeDefaultCustomCss\": false,\n \"subcategory\": \"\",\n \"layoutSections\": {},\n \"updated\": \"\",\n \"footerHtml\": \"\",\n \"widgets\": {},\n \"headHtml\": \"\",\n \"pageExpiryRedirectUrl\": \"\",\n \"abStatus\": \"\",\n \"useFeaturedImage\": false,\n \"abTestId\": \"\",\n \"featuredImageAltText\": \"\",\n \"contentGroupId\": \"\",\n \"pageExpiryEnabled\": false,\n \"templatePath\": \"\",\n \"url\": \"\",\n \"publicAccessRules\": [\n {}\n ],\n \"archivedAt\": \"\",\n \"themeSettingsValues\": {},\n \"pageExpiryDate\": 0,\n \"publicAccessRulesEnabled\": false,\n \"pageRedirected\": false,\n \"currentState\": \"\",\n \"categoryId\": 0,\n \"linkRelCanonicalUrl\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/cms/v3/pages/site-pages")
.post(body)
.addHeader("private-app-legacy", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/cms/v3/pages/site-pages")
.header("private-app-legacy", "{{apiKey}}")
.header("content-type", "application/json")
.body("{\n \"publishDate\": \"\",\n \"language\": \"\",\n \"enableLayoutStylesheets\": false,\n \"metaDescription\": \"\",\n \"attachedStylesheets\": [\n {}\n ],\n \"password\": \"\",\n \"publishImmediately\": false,\n \"htmlTitle\": \"\",\n \"translations\": {},\n \"id\": \"\",\n \"state\": \"\",\n \"slug\": \"\",\n \"createdById\": \"\",\n \"currentlyPublished\": false,\n \"archivedInDashboard\": false,\n \"created\": \"\",\n \"contentTypeCategory\": \"\",\n \"mabExperimentId\": \"\",\n \"updatedById\": \"\",\n \"translatedFromId\": \"\",\n \"folderId\": \"\",\n \"widgetContainers\": {},\n \"pageExpiryRedirectId\": 0,\n \"dynamicPageDataSourceType\": 0,\n \"featuredImage\": \"\",\n \"authorName\": \"\",\n \"domain\": \"\",\n \"name\": \"\",\n \"dynamicPageHubDbTableId\": \"\",\n \"campaign\": \"\",\n \"dynamicPageDataSourceId\": \"\",\n \"enableDomainStylesheets\": false,\n \"includeDefaultCustomCss\": false,\n \"subcategory\": \"\",\n \"layoutSections\": {},\n \"updated\": \"\",\n \"footerHtml\": \"\",\n \"widgets\": {},\n \"headHtml\": \"\",\n \"pageExpiryRedirectUrl\": \"\",\n \"abStatus\": \"\",\n \"useFeaturedImage\": false,\n \"abTestId\": \"\",\n \"featuredImageAltText\": \"\",\n \"contentGroupId\": \"\",\n \"pageExpiryEnabled\": false,\n \"templatePath\": \"\",\n \"url\": \"\",\n \"publicAccessRules\": [\n {}\n ],\n \"archivedAt\": \"\",\n \"themeSettingsValues\": {},\n \"pageExpiryDate\": 0,\n \"publicAccessRulesEnabled\": false,\n \"pageRedirected\": false,\n \"currentState\": \"\",\n \"categoryId\": 0,\n \"linkRelCanonicalUrl\": \"\"\n}")
.asString();
const data = JSON.stringify({
publishDate: '',
language: '',
enableLayoutStylesheets: false,
metaDescription: '',
attachedStylesheets: [
{}
],
password: '',
publishImmediately: false,
htmlTitle: '',
translations: {},
id: '',
state: '',
slug: '',
createdById: '',
currentlyPublished: false,
archivedInDashboard: false,
created: '',
contentTypeCategory: '',
mabExperimentId: '',
updatedById: '',
translatedFromId: '',
folderId: '',
widgetContainers: {},
pageExpiryRedirectId: 0,
dynamicPageDataSourceType: 0,
featuredImage: '',
authorName: '',
domain: '',
name: '',
dynamicPageHubDbTableId: '',
campaign: '',
dynamicPageDataSourceId: '',
enableDomainStylesheets: false,
includeDefaultCustomCss: false,
subcategory: '',
layoutSections: {},
updated: '',
footerHtml: '',
widgets: {},
headHtml: '',
pageExpiryRedirectUrl: '',
abStatus: '',
useFeaturedImage: false,
abTestId: '',
featuredImageAltText: '',
contentGroupId: '',
pageExpiryEnabled: false,
templatePath: '',
url: '',
publicAccessRules: [
{}
],
archivedAt: '',
themeSettingsValues: {},
pageExpiryDate: 0,
publicAccessRulesEnabled: false,
pageRedirected: false,
currentState: '',
categoryId: 0,
linkRelCanonicalUrl: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/cms/v3/pages/site-pages');
xhr.setRequestHeader('private-app-legacy', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/cms/v3/pages/site-pages',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
data: {
publishDate: '',
language: '',
enableLayoutStylesheets: false,
metaDescription: '',
attachedStylesheets: [{}],
password: '',
publishImmediately: false,
htmlTitle: '',
translations: {},
id: '',
state: '',
slug: '',
createdById: '',
currentlyPublished: false,
archivedInDashboard: false,
created: '',
contentTypeCategory: '',
mabExperimentId: '',
updatedById: '',
translatedFromId: '',
folderId: '',
widgetContainers: {},
pageExpiryRedirectId: 0,
dynamicPageDataSourceType: 0,
featuredImage: '',
authorName: '',
domain: '',
name: '',
dynamicPageHubDbTableId: '',
campaign: '',
dynamicPageDataSourceId: '',
enableDomainStylesheets: false,
includeDefaultCustomCss: false,
subcategory: '',
layoutSections: {},
updated: '',
footerHtml: '',
widgets: {},
headHtml: '',
pageExpiryRedirectUrl: '',
abStatus: '',
useFeaturedImage: false,
abTestId: '',
featuredImageAltText: '',
contentGroupId: '',
pageExpiryEnabled: false,
templatePath: '',
url: '',
publicAccessRules: [{}],
archivedAt: '',
themeSettingsValues: {},
pageExpiryDate: 0,
publicAccessRulesEnabled: false,
pageRedirected: false,
currentState: '',
categoryId: 0,
linkRelCanonicalUrl: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/cms/v3/pages/site-pages';
const options = {
method: 'POST',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
body: '{"publishDate":"","language":"","enableLayoutStylesheets":false,"metaDescription":"","attachedStylesheets":[{}],"password":"","publishImmediately":false,"htmlTitle":"","translations":{},"id":"","state":"","slug":"","createdById":"","currentlyPublished":false,"archivedInDashboard":false,"created":"","contentTypeCategory":"","mabExperimentId":"","updatedById":"","translatedFromId":"","folderId":"","widgetContainers":{},"pageExpiryRedirectId":0,"dynamicPageDataSourceType":0,"featuredImage":"","authorName":"","domain":"","name":"","dynamicPageHubDbTableId":"","campaign":"","dynamicPageDataSourceId":"","enableDomainStylesheets":false,"includeDefaultCustomCss":false,"subcategory":"","layoutSections":{},"updated":"","footerHtml":"","widgets":{},"headHtml":"","pageExpiryRedirectUrl":"","abStatus":"","useFeaturedImage":false,"abTestId":"","featuredImageAltText":"","contentGroupId":"","pageExpiryEnabled":false,"templatePath":"","url":"","publicAccessRules":[{}],"archivedAt":"","themeSettingsValues":{},"pageExpiryDate":0,"publicAccessRulesEnabled":false,"pageRedirected":false,"currentState":"","categoryId":0,"linkRelCanonicalUrl":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/cms/v3/pages/site-pages',
method: 'POST',
headers: {
'private-app-legacy': '{{apiKey}}',
'content-type': 'application/json'
},
processData: false,
data: '{\n "publishDate": "",\n "language": "",\n "enableLayoutStylesheets": false,\n "metaDescription": "",\n "attachedStylesheets": [\n {}\n ],\n "password": "",\n "publishImmediately": false,\n "htmlTitle": "",\n "translations": {},\n "id": "",\n "state": "",\n "slug": "",\n "createdById": "",\n "currentlyPublished": false,\n "archivedInDashboard": false,\n "created": "",\n "contentTypeCategory": "",\n "mabExperimentId": "",\n "updatedById": "",\n "translatedFromId": "",\n "folderId": "",\n "widgetContainers": {},\n "pageExpiryRedirectId": 0,\n "dynamicPageDataSourceType": 0,\n "featuredImage": "",\n "authorName": "",\n "domain": "",\n "name": "",\n "dynamicPageHubDbTableId": "",\n "campaign": "",\n "dynamicPageDataSourceId": "",\n "enableDomainStylesheets": false,\n "includeDefaultCustomCss": false,\n "subcategory": "",\n "layoutSections": {},\n "updated": "",\n "footerHtml": "",\n "widgets": {},\n "headHtml": "",\n "pageExpiryRedirectUrl": "",\n "abStatus": "",\n "useFeaturedImage": false,\n "abTestId": "",\n "featuredImageAltText": "",\n "contentGroupId": "",\n "pageExpiryEnabled": false,\n "templatePath": "",\n "url": "",\n "publicAccessRules": [\n {}\n ],\n "archivedAt": "",\n "themeSettingsValues": {},\n "pageExpiryDate": 0,\n "publicAccessRulesEnabled": false,\n "pageRedirected": false,\n "currentState": "",\n "categoryId": 0,\n "linkRelCanonicalUrl": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"publishDate\": \"\",\n \"language\": \"\",\n \"enableLayoutStylesheets\": false,\n \"metaDescription\": \"\",\n \"attachedStylesheets\": [\n {}\n ],\n \"password\": \"\",\n \"publishImmediately\": false,\n \"htmlTitle\": \"\",\n \"translations\": {},\n \"id\": \"\",\n \"state\": \"\",\n \"slug\": \"\",\n \"createdById\": \"\",\n \"currentlyPublished\": false,\n \"archivedInDashboard\": false,\n \"created\": \"\",\n \"contentTypeCategory\": \"\",\n \"mabExperimentId\": \"\",\n \"updatedById\": \"\",\n \"translatedFromId\": \"\",\n \"folderId\": \"\",\n \"widgetContainers\": {},\n \"pageExpiryRedirectId\": 0,\n \"dynamicPageDataSourceType\": 0,\n \"featuredImage\": \"\",\n \"authorName\": \"\",\n \"domain\": \"\",\n \"name\": \"\",\n \"dynamicPageHubDbTableId\": \"\",\n \"campaign\": \"\",\n \"dynamicPageDataSourceId\": \"\",\n \"enableDomainStylesheets\": false,\n \"includeDefaultCustomCss\": false,\n \"subcategory\": \"\",\n \"layoutSections\": {},\n \"updated\": \"\",\n \"footerHtml\": \"\",\n \"widgets\": {},\n \"headHtml\": \"\",\n \"pageExpiryRedirectUrl\": \"\",\n \"abStatus\": \"\",\n \"useFeaturedImage\": false,\n \"abTestId\": \"\",\n \"featuredImageAltText\": \"\",\n \"contentGroupId\": \"\",\n \"pageExpiryEnabled\": false,\n \"templatePath\": \"\",\n \"url\": \"\",\n \"publicAccessRules\": [\n {}\n ],\n \"archivedAt\": \"\",\n \"themeSettingsValues\": {},\n \"pageExpiryDate\": 0,\n \"publicAccessRulesEnabled\": false,\n \"pageRedirected\": false,\n \"currentState\": \"\",\n \"categoryId\": 0,\n \"linkRelCanonicalUrl\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/cms/v3/pages/site-pages")
.post(body)
.addHeader("private-app-legacy", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/cms/v3/pages/site-pages',
headers: {
'private-app-legacy': '{{apiKey}}',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
publishDate: '',
language: '',
enableLayoutStylesheets: false,
metaDescription: '',
attachedStylesheets: [{}],
password: '',
publishImmediately: false,
htmlTitle: '',
translations: {},
id: '',
state: '',
slug: '',
createdById: '',
currentlyPublished: false,
archivedInDashboard: false,
created: '',
contentTypeCategory: '',
mabExperimentId: '',
updatedById: '',
translatedFromId: '',
folderId: '',
widgetContainers: {},
pageExpiryRedirectId: 0,
dynamicPageDataSourceType: 0,
featuredImage: '',
authorName: '',
domain: '',
name: '',
dynamicPageHubDbTableId: '',
campaign: '',
dynamicPageDataSourceId: '',
enableDomainStylesheets: false,
includeDefaultCustomCss: false,
subcategory: '',
layoutSections: {},
updated: '',
footerHtml: '',
widgets: {},
headHtml: '',
pageExpiryRedirectUrl: '',
abStatus: '',
useFeaturedImage: false,
abTestId: '',
featuredImageAltText: '',
contentGroupId: '',
pageExpiryEnabled: false,
templatePath: '',
url: '',
publicAccessRules: [{}],
archivedAt: '',
themeSettingsValues: {},
pageExpiryDate: 0,
publicAccessRulesEnabled: false,
pageRedirected: false,
currentState: '',
categoryId: 0,
linkRelCanonicalUrl: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/cms/v3/pages/site-pages',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
body: {
publishDate: '',
language: '',
enableLayoutStylesheets: false,
metaDescription: '',
attachedStylesheets: [{}],
password: '',
publishImmediately: false,
htmlTitle: '',
translations: {},
id: '',
state: '',
slug: '',
createdById: '',
currentlyPublished: false,
archivedInDashboard: false,
created: '',
contentTypeCategory: '',
mabExperimentId: '',
updatedById: '',
translatedFromId: '',
folderId: '',
widgetContainers: {},
pageExpiryRedirectId: 0,
dynamicPageDataSourceType: 0,
featuredImage: '',
authorName: '',
domain: '',
name: '',
dynamicPageHubDbTableId: '',
campaign: '',
dynamicPageDataSourceId: '',
enableDomainStylesheets: false,
includeDefaultCustomCss: false,
subcategory: '',
layoutSections: {},
updated: '',
footerHtml: '',
widgets: {},
headHtml: '',
pageExpiryRedirectUrl: '',
abStatus: '',
useFeaturedImage: false,
abTestId: '',
featuredImageAltText: '',
contentGroupId: '',
pageExpiryEnabled: false,
templatePath: '',
url: '',
publicAccessRules: [{}],
archivedAt: '',
themeSettingsValues: {},
pageExpiryDate: 0,
publicAccessRulesEnabled: false,
pageRedirected: false,
currentState: '',
categoryId: 0,
linkRelCanonicalUrl: ''
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/cms/v3/pages/site-pages');
req.headers({
'private-app-legacy': '{{apiKey}}',
'content-type': 'application/json'
});
req.type('json');
req.send({
publishDate: '',
language: '',
enableLayoutStylesheets: false,
metaDescription: '',
attachedStylesheets: [
{}
],
password: '',
publishImmediately: false,
htmlTitle: '',
translations: {},
id: '',
state: '',
slug: '',
createdById: '',
currentlyPublished: false,
archivedInDashboard: false,
created: '',
contentTypeCategory: '',
mabExperimentId: '',
updatedById: '',
translatedFromId: '',
folderId: '',
widgetContainers: {},
pageExpiryRedirectId: 0,
dynamicPageDataSourceType: 0,
featuredImage: '',
authorName: '',
domain: '',
name: '',
dynamicPageHubDbTableId: '',
campaign: '',
dynamicPageDataSourceId: '',
enableDomainStylesheets: false,
includeDefaultCustomCss: false,
subcategory: '',
layoutSections: {},
updated: '',
footerHtml: '',
widgets: {},
headHtml: '',
pageExpiryRedirectUrl: '',
abStatus: '',
useFeaturedImage: false,
abTestId: '',
featuredImageAltText: '',
contentGroupId: '',
pageExpiryEnabled: false,
templatePath: '',
url: '',
publicAccessRules: [
{}
],
archivedAt: '',
themeSettingsValues: {},
pageExpiryDate: 0,
publicAccessRulesEnabled: false,
pageRedirected: false,
currentState: '',
categoryId: 0,
linkRelCanonicalUrl: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/cms/v3/pages/site-pages',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
data: {
publishDate: '',
language: '',
enableLayoutStylesheets: false,
metaDescription: '',
attachedStylesheets: [{}],
password: '',
publishImmediately: false,
htmlTitle: '',
translations: {},
id: '',
state: '',
slug: '',
createdById: '',
currentlyPublished: false,
archivedInDashboard: false,
created: '',
contentTypeCategory: '',
mabExperimentId: '',
updatedById: '',
translatedFromId: '',
folderId: '',
widgetContainers: {},
pageExpiryRedirectId: 0,
dynamicPageDataSourceType: 0,
featuredImage: '',
authorName: '',
domain: '',
name: '',
dynamicPageHubDbTableId: '',
campaign: '',
dynamicPageDataSourceId: '',
enableDomainStylesheets: false,
includeDefaultCustomCss: false,
subcategory: '',
layoutSections: {},
updated: '',
footerHtml: '',
widgets: {},
headHtml: '',
pageExpiryRedirectUrl: '',
abStatus: '',
useFeaturedImage: false,
abTestId: '',
featuredImageAltText: '',
contentGroupId: '',
pageExpiryEnabled: false,
templatePath: '',
url: '',
publicAccessRules: [{}],
archivedAt: '',
themeSettingsValues: {},
pageExpiryDate: 0,
publicAccessRulesEnabled: false,
pageRedirected: false,
currentState: '',
categoryId: 0,
linkRelCanonicalUrl: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/cms/v3/pages/site-pages';
const options = {
method: 'POST',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
body: '{"publishDate":"","language":"","enableLayoutStylesheets":false,"metaDescription":"","attachedStylesheets":[{}],"password":"","publishImmediately":false,"htmlTitle":"","translations":{},"id":"","state":"","slug":"","createdById":"","currentlyPublished":false,"archivedInDashboard":false,"created":"","contentTypeCategory":"","mabExperimentId":"","updatedById":"","translatedFromId":"","folderId":"","widgetContainers":{},"pageExpiryRedirectId":0,"dynamicPageDataSourceType":0,"featuredImage":"","authorName":"","domain":"","name":"","dynamicPageHubDbTableId":"","campaign":"","dynamicPageDataSourceId":"","enableDomainStylesheets":false,"includeDefaultCustomCss":false,"subcategory":"","layoutSections":{},"updated":"","footerHtml":"","widgets":{},"headHtml":"","pageExpiryRedirectUrl":"","abStatus":"","useFeaturedImage":false,"abTestId":"","featuredImageAltText":"","contentGroupId":"","pageExpiryEnabled":false,"templatePath":"","url":"","publicAccessRules":[{}],"archivedAt":"","themeSettingsValues":{},"pageExpiryDate":0,"publicAccessRulesEnabled":false,"pageRedirected":false,"currentState":"","categoryId":0,"linkRelCanonicalUrl":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"private-app-legacy": @"{{apiKey}}",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"publishDate": @"",
@"language": @"",
@"enableLayoutStylesheets": @NO,
@"metaDescription": @"",
@"attachedStylesheets": @[ @{ } ],
@"password": @"",
@"publishImmediately": @NO,
@"htmlTitle": @"",
@"translations": @{ },
@"id": @"",
@"state": @"",
@"slug": @"",
@"createdById": @"",
@"currentlyPublished": @NO,
@"archivedInDashboard": @NO,
@"created": @"",
@"contentTypeCategory": @"",
@"mabExperimentId": @"",
@"updatedById": @"",
@"translatedFromId": @"",
@"folderId": @"",
@"widgetContainers": @{ },
@"pageExpiryRedirectId": @0,
@"dynamicPageDataSourceType": @0,
@"featuredImage": @"",
@"authorName": @"",
@"domain": @"",
@"name": @"",
@"dynamicPageHubDbTableId": @"",
@"campaign": @"",
@"dynamicPageDataSourceId": @"",
@"enableDomainStylesheets": @NO,
@"includeDefaultCustomCss": @NO,
@"subcategory": @"",
@"layoutSections": @{ },
@"updated": @"",
@"footerHtml": @"",
@"widgets": @{ },
@"headHtml": @"",
@"pageExpiryRedirectUrl": @"",
@"abStatus": @"",
@"useFeaturedImage": @NO,
@"abTestId": @"",
@"featuredImageAltText": @"",
@"contentGroupId": @"",
@"pageExpiryEnabled": @NO,
@"templatePath": @"",
@"url": @"",
@"publicAccessRules": @[ @{ } ],
@"archivedAt": @"",
@"themeSettingsValues": @{ },
@"pageExpiryDate": @0,
@"publicAccessRulesEnabled": @NO,
@"pageRedirected": @NO,
@"currentState": @"",
@"categoryId": @0,
@"linkRelCanonicalUrl": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/cms/v3/pages/site-pages"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/cms/v3/pages/site-pages" in
let headers = Header.add_list (Header.init ()) [
("private-app-legacy", "{{apiKey}}");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"publishDate\": \"\",\n \"language\": \"\",\n \"enableLayoutStylesheets\": false,\n \"metaDescription\": \"\",\n \"attachedStylesheets\": [\n {}\n ],\n \"password\": \"\",\n \"publishImmediately\": false,\n \"htmlTitle\": \"\",\n \"translations\": {},\n \"id\": \"\",\n \"state\": \"\",\n \"slug\": \"\",\n \"createdById\": \"\",\n \"currentlyPublished\": false,\n \"archivedInDashboard\": false,\n \"created\": \"\",\n \"contentTypeCategory\": \"\",\n \"mabExperimentId\": \"\",\n \"updatedById\": \"\",\n \"translatedFromId\": \"\",\n \"folderId\": \"\",\n \"widgetContainers\": {},\n \"pageExpiryRedirectId\": 0,\n \"dynamicPageDataSourceType\": 0,\n \"featuredImage\": \"\",\n \"authorName\": \"\",\n \"domain\": \"\",\n \"name\": \"\",\n \"dynamicPageHubDbTableId\": \"\",\n \"campaign\": \"\",\n \"dynamicPageDataSourceId\": \"\",\n \"enableDomainStylesheets\": false,\n \"includeDefaultCustomCss\": false,\n \"subcategory\": \"\",\n \"layoutSections\": {},\n \"updated\": \"\",\n \"footerHtml\": \"\",\n \"widgets\": {},\n \"headHtml\": \"\",\n \"pageExpiryRedirectUrl\": \"\",\n \"abStatus\": \"\",\n \"useFeaturedImage\": false,\n \"abTestId\": \"\",\n \"featuredImageAltText\": \"\",\n \"contentGroupId\": \"\",\n \"pageExpiryEnabled\": false,\n \"templatePath\": \"\",\n \"url\": \"\",\n \"publicAccessRules\": [\n {}\n ],\n \"archivedAt\": \"\",\n \"themeSettingsValues\": {},\n \"pageExpiryDate\": 0,\n \"publicAccessRulesEnabled\": false,\n \"pageRedirected\": false,\n \"currentState\": \"\",\n \"categoryId\": 0,\n \"linkRelCanonicalUrl\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/cms/v3/pages/site-pages",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'publishDate' => '',
'language' => '',
'enableLayoutStylesheets' => null,
'metaDescription' => '',
'attachedStylesheets' => [
[
]
],
'password' => '',
'publishImmediately' => null,
'htmlTitle' => '',
'translations' => [
],
'id' => '',
'state' => '',
'slug' => '',
'createdById' => '',
'currentlyPublished' => null,
'archivedInDashboard' => null,
'created' => '',
'contentTypeCategory' => '',
'mabExperimentId' => '',
'updatedById' => '',
'translatedFromId' => '',
'folderId' => '',
'widgetContainers' => [
],
'pageExpiryRedirectId' => 0,
'dynamicPageDataSourceType' => 0,
'featuredImage' => '',
'authorName' => '',
'domain' => '',
'name' => '',
'dynamicPageHubDbTableId' => '',
'campaign' => '',
'dynamicPageDataSourceId' => '',
'enableDomainStylesheets' => null,
'includeDefaultCustomCss' => null,
'subcategory' => '',
'layoutSections' => [
],
'updated' => '',
'footerHtml' => '',
'widgets' => [
],
'headHtml' => '',
'pageExpiryRedirectUrl' => '',
'abStatus' => '',
'useFeaturedImage' => null,
'abTestId' => '',
'featuredImageAltText' => '',
'contentGroupId' => '',
'pageExpiryEnabled' => null,
'templatePath' => '',
'url' => '',
'publicAccessRules' => [
[
]
],
'archivedAt' => '',
'themeSettingsValues' => [
],
'pageExpiryDate' => 0,
'publicAccessRulesEnabled' => null,
'pageRedirected' => null,
'currentState' => '',
'categoryId' => 0,
'linkRelCanonicalUrl' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"private-app-legacy: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/cms/v3/pages/site-pages', [
'body' => '{
"publishDate": "",
"language": "",
"enableLayoutStylesheets": false,
"metaDescription": "",
"attachedStylesheets": [
{}
],
"password": "",
"publishImmediately": false,
"htmlTitle": "",
"translations": {},
"id": "",
"state": "",
"slug": "",
"createdById": "",
"currentlyPublished": false,
"archivedInDashboard": false,
"created": "",
"contentTypeCategory": "",
"mabExperimentId": "",
"updatedById": "",
"translatedFromId": "",
"folderId": "",
"widgetContainers": {},
"pageExpiryRedirectId": 0,
"dynamicPageDataSourceType": 0,
"featuredImage": "",
"authorName": "",
"domain": "",
"name": "",
"dynamicPageHubDbTableId": "",
"campaign": "",
"dynamicPageDataSourceId": "",
"enableDomainStylesheets": false,
"includeDefaultCustomCss": false,
"subcategory": "",
"layoutSections": {},
"updated": "",
"footerHtml": "",
"widgets": {},
"headHtml": "",
"pageExpiryRedirectUrl": "",
"abStatus": "",
"useFeaturedImage": false,
"abTestId": "",
"featuredImageAltText": "",
"contentGroupId": "",
"pageExpiryEnabled": false,
"templatePath": "",
"url": "",
"publicAccessRules": [
{}
],
"archivedAt": "",
"themeSettingsValues": {},
"pageExpiryDate": 0,
"publicAccessRulesEnabled": false,
"pageRedirected": false,
"currentState": "",
"categoryId": 0,
"linkRelCanonicalUrl": ""
}',
'headers' => [
'content-type' => 'application/json',
'private-app-legacy' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/cms/v3/pages/site-pages');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'private-app-legacy' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'publishDate' => '',
'language' => '',
'enableLayoutStylesheets' => null,
'metaDescription' => '',
'attachedStylesheets' => [
[
]
],
'password' => '',
'publishImmediately' => null,
'htmlTitle' => '',
'translations' => [
],
'id' => '',
'state' => '',
'slug' => '',
'createdById' => '',
'currentlyPublished' => null,
'archivedInDashboard' => null,
'created' => '',
'contentTypeCategory' => '',
'mabExperimentId' => '',
'updatedById' => '',
'translatedFromId' => '',
'folderId' => '',
'widgetContainers' => [
],
'pageExpiryRedirectId' => 0,
'dynamicPageDataSourceType' => 0,
'featuredImage' => '',
'authorName' => '',
'domain' => '',
'name' => '',
'dynamicPageHubDbTableId' => '',
'campaign' => '',
'dynamicPageDataSourceId' => '',
'enableDomainStylesheets' => null,
'includeDefaultCustomCss' => null,
'subcategory' => '',
'layoutSections' => [
],
'updated' => '',
'footerHtml' => '',
'widgets' => [
],
'headHtml' => '',
'pageExpiryRedirectUrl' => '',
'abStatus' => '',
'useFeaturedImage' => null,
'abTestId' => '',
'featuredImageAltText' => '',
'contentGroupId' => '',
'pageExpiryEnabled' => null,
'templatePath' => '',
'url' => '',
'publicAccessRules' => [
[
]
],
'archivedAt' => '',
'themeSettingsValues' => [
],
'pageExpiryDate' => 0,
'publicAccessRulesEnabled' => null,
'pageRedirected' => null,
'currentState' => '',
'categoryId' => 0,
'linkRelCanonicalUrl' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'publishDate' => '',
'language' => '',
'enableLayoutStylesheets' => null,
'metaDescription' => '',
'attachedStylesheets' => [
[
]
],
'password' => '',
'publishImmediately' => null,
'htmlTitle' => '',
'translations' => [
],
'id' => '',
'state' => '',
'slug' => '',
'createdById' => '',
'currentlyPublished' => null,
'archivedInDashboard' => null,
'created' => '',
'contentTypeCategory' => '',
'mabExperimentId' => '',
'updatedById' => '',
'translatedFromId' => '',
'folderId' => '',
'widgetContainers' => [
],
'pageExpiryRedirectId' => 0,
'dynamicPageDataSourceType' => 0,
'featuredImage' => '',
'authorName' => '',
'domain' => '',
'name' => '',
'dynamicPageHubDbTableId' => '',
'campaign' => '',
'dynamicPageDataSourceId' => '',
'enableDomainStylesheets' => null,
'includeDefaultCustomCss' => null,
'subcategory' => '',
'layoutSections' => [
],
'updated' => '',
'footerHtml' => '',
'widgets' => [
],
'headHtml' => '',
'pageExpiryRedirectUrl' => '',
'abStatus' => '',
'useFeaturedImage' => null,
'abTestId' => '',
'featuredImageAltText' => '',
'contentGroupId' => '',
'pageExpiryEnabled' => null,
'templatePath' => '',
'url' => '',
'publicAccessRules' => [
[
]
],
'archivedAt' => '',
'themeSettingsValues' => [
],
'pageExpiryDate' => 0,
'publicAccessRulesEnabled' => null,
'pageRedirected' => null,
'currentState' => '',
'categoryId' => 0,
'linkRelCanonicalUrl' => ''
]));
$request->setRequestUrl('{{baseUrl}}/cms/v3/pages/site-pages');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'private-app-legacy' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("private-app-legacy", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/cms/v3/pages/site-pages' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"publishDate": "",
"language": "",
"enableLayoutStylesheets": false,
"metaDescription": "",
"attachedStylesheets": [
{}
],
"password": "",
"publishImmediately": false,
"htmlTitle": "",
"translations": {},
"id": "",
"state": "",
"slug": "",
"createdById": "",
"currentlyPublished": false,
"archivedInDashboard": false,
"created": "",
"contentTypeCategory": "",
"mabExperimentId": "",
"updatedById": "",
"translatedFromId": "",
"folderId": "",
"widgetContainers": {},
"pageExpiryRedirectId": 0,
"dynamicPageDataSourceType": 0,
"featuredImage": "",
"authorName": "",
"domain": "",
"name": "",
"dynamicPageHubDbTableId": "",
"campaign": "",
"dynamicPageDataSourceId": "",
"enableDomainStylesheets": false,
"includeDefaultCustomCss": false,
"subcategory": "",
"layoutSections": {},
"updated": "",
"footerHtml": "",
"widgets": {},
"headHtml": "",
"pageExpiryRedirectUrl": "",
"abStatus": "",
"useFeaturedImage": false,
"abTestId": "",
"featuredImageAltText": "",
"contentGroupId": "",
"pageExpiryEnabled": false,
"templatePath": "",
"url": "",
"publicAccessRules": [
{}
],
"archivedAt": "",
"themeSettingsValues": {},
"pageExpiryDate": 0,
"publicAccessRulesEnabled": false,
"pageRedirected": false,
"currentState": "",
"categoryId": 0,
"linkRelCanonicalUrl": ""
}'
$headers=@{}
$headers.Add("private-app-legacy", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/cms/v3/pages/site-pages' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"publishDate": "",
"language": "",
"enableLayoutStylesheets": false,
"metaDescription": "",
"attachedStylesheets": [
{}
],
"password": "",
"publishImmediately": false,
"htmlTitle": "",
"translations": {},
"id": "",
"state": "",
"slug": "",
"createdById": "",
"currentlyPublished": false,
"archivedInDashboard": false,
"created": "",
"contentTypeCategory": "",
"mabExperimentId": "",
"updatedById": "",
"translatedFromId": "",
"folderId": "",
"widgetContainers": {},
"pageExpiryRedirectId": 0,
"dynamicPageDataSourceType": 0,
"featuredImage": "",
"authorName": "",
"domain": "",
"name": "",
"dynamicPageHubDbTableId": "",
"campaign": "",
"dynamicPageDataSourceId": "",
"enableDomainStylesheets": false,
"includeDefaultCustomCss": false,
"subcategory": "",
"layoutSections": {},
"updated": "",
"footerHtml": "",
"widgets": {},
"headHtml": "",
"pageExpiryRedirectUrl": "",
"abStatus": "",
"useFeaturedImage": false,
"abTestId": "",
"featuredImageAltText": "",
"contentGroupId": "",
"pageExpiryEnabled": false,
"templatePath": "",
"url": "",
"publicAccessRules": [
{}
],
"archivedAt": "",
"themeSettingsValues": {},
"pageExpiryDate": 0,
"publicAccessRulesEnabled": false,
"pageRedirected": false,
"currentState": "",
"categoryId": 0,
"linkRelCanonicalUrl": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"publishDate\": \"\",\n \"language\": \"\",\n \"enableLayoutStylesheets\": false,\n \"metaDescription\": \"\",\n \"attachedStylesheets\": [\n {}\n ],\n \"password\": \"\",\n \"publishImmediately\": false,\n \"htmlTitle\": \"\",\n \"translations\": {},\n \"id\": \"\",\n \"state\": \"\",\n \"slug\": \"\",\n \"createdById\": \"\",\n \"currentlyPublished\": false,\n \"archivedInDashboard\": false,\n \"created\": \"\",\n \"contentTypeCategory\": \"\",\n \"mabExperimentId\": \"\",\n \"updatedById\": \"\",\n \"translatedFromId\": \"\",\n \"folderId\": \"\",\n \"widgetContainers\": {},\n \"pageExpiryRedirectId\": 0,\n \"dynamicPageDataSourceType\": 0,\n \"featuredImage\": \"\",\n \"authorName\": \"\",\n \"domain\": \"\",\n \"name\": \"\",\n \"dynamicPageHubDbTableId\": \"\",\n \"campaign\": \"\",\n \"dynamicPageDataSourceId\": \"\",\n \"enableDomainStylesheets\": false,\n \"includeDefaultCustomCss\": false,\n \"subcategory\": \"\",\n \"layoutSections\": {},\n \"updated\": \"\",\n \"footerHtml\": \"\",\n \"widgets\": {},\n \"headHtml\": \"\",\n \"pageExpiryRedirectUrl\": \"\",\n \"abStatus\": \"\",\n \"useFeaturedImage\": false,\n \"abTestId\": \"\",\n \"featuredImageAltText\": \"\",\n \"contentGroupId\": \"\",\n \"pageExpiryEnabled\": false,\n \"templatePath\": \"\",\n \"url\": \"\",\n \"publicAccessRules\": [\n {}\n ],\n \"archivedAt\": \"\",\n \"themeSettingsValues\": {},\n \"pageExpiryDate\": 0,\n \"publicAccessRulesEnabled\": false,\n \"pageRedirected\": false,\n \"currentState\": \"\",\n \"categoryId\": 0,\n \"linkRelCanonicalUrl\": \"\"\n}"
headers = {
'private-app-legacy': "{{apiKey}}",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/cms/v3/pages/site-pages", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/cms/v3/pages/site-pages"
payload = {
"publishDate": "",
"language": "",
"enableLayoutStylesheets": False,
"metaDescription": "",
"attachedStylesheets": [{}],
"password": "",
"publishImmediately": False,
"htmlTitle": "",
"translations": {},
"id": "",
"state": "",
"slug": "",
"createdById": "",
"currentlyPublished": False,
"archivedInDashboard": False,
"created": "",
"contentTypeCategory": "",
"mabExperimentId": "",
"updatedById": "",
"translatedFromId": "",
"folderId": "",
"widgetContainers": {},
"pageExpiryRedirectId": 0,
"dynamicPageDataSourceType": 0,
"featuredImage": "",
"authorName": "",
"domain": "",
"name": "",
"dynamicPageHubDbTableId": "",
"campaign": "",
"dynamicPageDataSourceId": "",
"enableDomainStylesheets": False,
"includeDefaultCustomCss": False,
"subcategory": "",
"layoutSections": {},
"updated": "",
"footerHtml": "",
"widgets": {},
"headHtml": "",
"pageExpiryRedirectUrl": "",
"abStatus": "",
"useFeaturedImage": False,
"abTestId": "",
"featuredImageAltText": "",
"contentGroupId": "",
"pageExpiryEnabled": False,
"templatePath": "",
"url": "",
"publicAccessRules": [{}],
"archivedAt": "",
"themeSettingsValues": {},
"pageExpiryDate": 0,
"publicAccessRulesEnabled": False,
"pageRedirected": False,
"currentState": "",
"categoryId": 0,
"linkRelCanonicalUrl": ""
}
headers = {
"private-app-legacy": "{{apiKey}}",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/cms/v3/pages/site-pages"
payload <- "{\n \"publishDate\": \"\",\n \"language\": \"\",\n \"enableLayoutStylesheets\": false,\n \"metaDescription\": \"\",\n \"attachedStylesheets\": [\n {}\n ],\n \"password\": \"\",\n \"publishImmediately\": false,\n \"htmlTitle\": \"\",\n \"translations\": {},\n \"id\": \"\",\n \"state\": \"\",\n \"slug\": \"\",\n \"createdById\": \"\",\n \"currentlyPublished\": false,\n \"archivedInDashboard\": false,\n \"created\": \"\",\n \"contentTypeCategory\": \"\",\n \"mabExperimentId\": \"\",\n \"updatedById\": \"\",\n \"translatedFromId\": \"\",\n \"folderId\": \"\",\n \"widgetContainers\": {},\n \"pageExpiryRedirectId\": 0,\n \"dynamicPageDataSourceType\": 0,\n \"featuredImage\": \"\",\n \"authorName\": \"\",\n \"domain\": \"\",\n \"name\": \"\",\n \"dynamicPageHubDbTableId\": \"\",\n \"campaign\": \"\",\n \"dynamicPageDataSourceId\": \"\",\n \"enableDomainStylesheets\": false,\n \"includeDefaultCustomCss\": false,\n \"subcategory\": \"\",\n \"layoutSections\": {},\n \"updated\": \"\",\n \"footerHtml\": \"\",\n \"widgets\": {},\n \"headHtml\": \"\",\n \"pageExpiryRedirectUrl\": \"\",\n \"abStatus\": \"\",\n \"useFeaturedImage\": false,\n \"abTestId\": \"\",\n \"featuredImageAltText\": \"\",\n \"contentGroupId\": \"\",\n \"pageExpiryEnabled\": false,\n \"templatePath\": \"\",\n \"url\": \"\",\n \"publicAccessRules\": [\n {}\n ],\n \"archivedAt\": \"\",\n \"themeSettingsValues\": {},\n \"pageExpiryDate\": 0,\n \"publicAccessRulesEnabled\": false,\n \"pageRedirected\": false,\n \"currentState\": \"\",\n \"categoryId\": 0,\n \"linkRelCanonicalUrl\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('private-app-legacy' = '{{apiKey}}'), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/cms/v3/pages/site-pages")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["private-app-legacy"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n \"publishDate\": \"\",\n \"language\": \"\",\n \"enableLayoutStylesheets\": false,\n \"metaDescription\": \"\",\n \"attachedStylesheets\": [\n {}\n ],\n \"password\": \"\",\n \"publishImmediately\": false,\n \"htmlTitle\": \"\",\n \"translations\": {},\n \"id\": \"\",\n \"state\": \"\",\n \"slug\": \"\",\n \"createdById\": \"\",\n \"currentlyPublished\": false,\n \"archivedInDashboard\": false,\n \"created\": \"\",\n \"contentTypeCategory\": \"\",\n \"mabExperimentId\": \"\",\n \"updatedById\": \"\",\n \"translatedFromId\": \"\",\n \"folderId\": \"\",\n \"widgetContainers\": {},\n \"pageExpiryRedirectId\": 0,\n \"dynamicPageDataSourceType\": 0,\n \"featuredImage\": \"\",\n \"authorName\": \"\",\n \"domain\": \"\",\n \"name\": \"\",\n \"dynamicPageHubDbTableId\": \"\",\n \"campaign\": \"\",\n \"dynamicPageDataSourceId\": \"\",\n \"enableDomainStylesheets\": false,\n \"includeDefaultCustomCss\": false,\n \"subcategory\": \"\",\n \"layoutSections\": {},\n \"updated\": \"\",\n \"footerHtml\": \"\",\n \"widgets\": {},\n \"headHtml\": \"\",\n \"pageExpiryRedirectUrl\": \"\",\n \"abStatus\": \"\",\n \"useFeaturedImage\": false,\n \"abTestId\": \"\",\n \"featuredImageAltText\": \"\",\n \"contentGroupId\": \"\",\n \"pageExpiryEnabled\": false,\n \"templatePath\": \"\",\n \"url\": \"\",\n \"publicAccessRules\": [\n {}\n ],\n \"archivedAt\": \"\",\n \"themeSettingsValues\": {},\n \"pageExpiryDate\": 0,\n \"publicAccessRulesEnabled\": false,\n \"pageRedirected\": false,\n \"currentState\": \"\",\n \"categoryId\": 0,\n \"linkRelCanonicalUrl\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/cms/v3/pages/site-pages') do |req|
req.headers['private-app-legacy'] = '{{apiKey}}'
req.body = "{\n \"publishDate\": \"\",\n \"language\": \"\",\n \"enableLayoutStylesheets\": false,\n \"metaDescription\": \"\",\n \"attachedStylesheets\": [\n {}\n ],\n \"password\": \"\",\n \"publishImmediately\": false,\n \"htmlTitle\": \"\",\n \"translations\": {},\n \"id\": \"\",\n \"state\": \"\",\n \"slug\": \"\",\n \"createdById\": \"\",\n \"currentlyPublished\": false,\n \"archivedInDashboard\": false,\n \"created\": \"\",\n \"contentTypeCategory\": \"\",\n \"mabExperimentId\": \"\",\n \"updatedById\": \"\",\n \"translatedFromId\": \"\",\n \"folderId\": \"\",\n \"widgetContainers\": {},\n \"pageExpiryRedirectId\": 0,\n \"dynamicPageDataSourceType\": 0,\n \"featuredImage\": \"\",\n \"authorName\": \"\",\n \"domain\": \"\",\n \"name\": \"\",\n \"dynamicPageHubDbTableId\": \"\",\n \"campaign\": \"\",\n \"dynamicPageDataSourceId\": \"\",\n \"enableDomainStylesheets\": false,\n \"includeDefaultCustomCss\": false,\n \"subcategory\": \"\",\n \"layoutSections\": {},\n \"updated\": \"\",\n \"footerHtml\": \"\",\n \"widgets\": {},\n \"headHtml\": \"\",\n \"pageExpiryRedirectUrl\": \"\",\n \"abStatus\": \"\",\n \"useFeaturedImage\": false,\n \"abTestId\": \"\",\n \"featuredImageAltText\": \"\",\n \"contentGroupId\": \"\",\n \"pageExpiryEnabled\": false,\n \"templatePath\": \"\",\n \"url\": \"\",\n \"publicAccessRules\": [\n {}\n ],\n \"archivedAt\": \"\",\n \"themeSettingsValues\": {},\n \"pageExpiryDate\": 0,\n \"publicAccessRulesEnabled\": false,\n \"pageRedirected\": false,\n \"currentState\": \"\",\n \"categoryId\": 0,\n \"linkRelCanonicalUrl\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/cms/v3/pages/site-pages";
let payload = json!({
"publishDate": "",
"language": "",
"enableLayoutStylesheets": false,
"metaDescription": "",
"attachedStylesheets": (json!({})),
"password": "",
"publishImmediately": false,
"htmlTitle": "",
"translations": json!({}),
"id": "",
"state": "",
"slug": "",
"createdById": "",
"currentlyPublished": false,
"archivedInDashboard": false,
"created": "",
"contentTypeCategory": "",
"mabExperimentId": "",
"updatedById": "",
"translatedFromId": "",
"folderId": "",
"widgetContainers": json!({}),
"pageExpiryRedirectId": 0,
"dynamicPageDataSourceType": 0,
"featuredImage": "",
"authorName": "",
"domain": "",
"name": "",
"dynamicPageHubDbTableId": "",
"campaign": "",
"dynamicPageDataSourceId": "",
"enableDomainStylesheets": false,
"includeDefaultCustomCss": false,
"subcategory": "",
"layoutSections": json!({}),
"updated": "",
"footerHtml": "",
"widgets": json!({}),
"headHtml": "",
"pageExpiryRedirectUrl": "",
"abStatus": "",
"useFeaturedImage": false,
"abTestId": "",
"featuredImageAltText": "",
"contentGroupId": "",
"pageExpiryEnabled": false,
"templatePath": "",
"url": "",
"publicAccessRules": (json!({})),
"archivedAt": "",
"themeSettingsValues": json!({}),
"pageExpiryDate": 0,
"publicAccessRulesEnabled": false,
"pageRedirected": false,
"currentState": "",
"categoryId": 0,
"linkRelCanonicalUrl": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("private-app-legacy", "{{apiKey}}".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/cms/v3/pages/site-pages \
--header 'content-type: application/json' \
--header 'private-app-legacy: {{apiKey}}' \
--data '{
"publishDate": "",
"language": "",
"enableLayoutStylesheets": false,
"metaDescription": "",
"attachedStylesheets": [
{}
],
"password": "",
"publishImmediately": false,
"htmlTitle": "",
"translations": {},
"id": "",
"state": "",
"slug": "",
"createdById": "",
"currentlyPublished": false,
"archivedInDashboard": false,
"created": "",
"contentTypeCategory": "",
"mabExperimentId": "",
"updatedById": "",
"translatedFromId": "",
"folderId": "",
"widgetContainers": {},
"pageExpiryRedirectId": 0,
"dynamicPageDataSourceType": 0,
"featuredImage": "",
"authorName": "",
"domain": "",
"name": "",
"dynamicPageHubDbTableId": "",
"campaign": "",
"dynamicPageDataSourceId": "",
"enableDomainStylesheets": false,
"includeDefaultCustomCss": false,
"subcategory": "",
"layoutSections": {},
"updated": "",
"footerHtml": "",
"widgets": {},
"headHtml": "",
"pageExpiryRedirectUrl": "",
"abStatus": "",
"useFeaturedImage": false,
"abTestId": "",
"featuredImageAltText": "",
"contentGroupId": "",
"pageExpiryEnabled": false,
"templatePath": "",
"url": "",
"publicAccessRules": [
{}
],
"archivedAt": "",
"themeSettingsValues": {},
"pageExpiryDate": 0,
"publicAccessRulesEnabled": false,
"pageRedirected": false,
"currentState": "",
"categoryId": 0,
"linkRelCanonicalUrl": ""
}'
echo '{
"publishDate": "",
"language": "",
"enableLayoutStylesheets": false,
"metaDescription": "",
"attachedStylesheets": [
{}
],
"password": "",
"publishImmediately": false,
"htmlTitle": "",
"translations": {},
"id": "",
"state": "",
"slug": "",
"createdById": "",
"currentlyPublished": false,
"archivedInDashboard": false,
"created": "",
"contentTypeCategory": "",
"mabExperimentId": "",
"updatedById": "",
"translatedFromId": "",
"folderId": "",
"widgetContainers": {},
"pageExpiryRedirectId": 0,
"dynamicPageDataSourceType": 0,
"featuredImage": "",
"authorName": "",
"domain": "",
"name": "",
"dynamicPageHubDbTableId": "",
"campaign": "",
"dynamicPageDataSourceId": "",
"enableDomainStylesheets": false,
"includeDefaultCustomCss": false,
"subcategory": "",
"layoutSections": {},
"updated": "",
"footerHtml": "",
"widgets": {},
"headHtml": "",
"pageExpiryRedirectUrl": "",
"abStatus": "",
"useFeaturedImage": false,
"abTestId": "",
"featuredImageAltText": "",
"contentGroupId": "",
"pageExpiryEnabled": false,
"templatePath": "",
"url": "",
"publicAccessRules": [
{}
],
"archivedAt": "",
"themeSettingsValues": {},
"pageExpiryDate": 0,
"publicAccessRulesEnabled": false,
"pageRedirected": false,
"currentState": "",
"categoryId": 0,
"linkRelCanonicalUrl": ""
}' | \
http POST {{baseUrl}}/cms/v3/pages/site-pages \
content-type:application/json \
private-app-legacy:'{{apiKey}}'
wget --quiet \
--method POST \
--header 'private-app-legacy: {{apiKey}}' \
--header 'content-type: application/json' \
--body-data '{\n "publishDate": "",\n "language": "",\n "enableLayoutStylesheets": false,\n "metaDescription": "",\n "attachedStylesheets": [\n {}\n ],\n "password": "",\n "publishImmediately": false,\n "htmlTitle": "",\n "translations": {},\n "id": "",\n "state": "",\n "slug": "",\n "createdById": "",\n "currentlyPublished": false,\n "archivedInDashboard": false,\n "created": "",\n "contentTypeCategory": "",\n "mabExperimentId": "",\n "updatedById": "",\n "translatedFromId": "",\n "folderId": "",\n "widgetContainers": {},\n "pageExpiryRedirectId": 0,\n "dynamicPageDataSourceType": 0,\n "featuredImage": "",\n "authorName": "",\n "domain": "",\n "name": "",\n "dynamicPageHubDbTableId": "",\n "campaign": "",\n "dynamicPageDataSourceId": "",\n "enableDomainStylesheets": false,\n "includeDefaultCustomCss": false,\n "subcategory": "",\n "layoutSections": {},\n "updated": "",\n "footerHtml": "",\n "widgets": {},\n "headHtml": "",\n "pageExpiryRedirectUrl": "",\n "abStatus": "",\n "useFeaturedImage": false,\n "abTestId": "",\n "featuredImageAltText": "",\n "contentGroupId": "",\n "pageExpiryEnabled": false,\n "templatePath": "",\n "url": "",\n "publicAccessRules": [\n {}\n ],\n "archivedAt": "",\n "themeSettingsValues": {},\n "pageExpiryDate": 0,\n "publicAccessRulesEnabled": false,\n "pageRedirected": false,\n "currentState": "",\n "categoryId": 0,\n "linkRelCanonicalUrl": ""\n}' \
--output-document \
- {{baseUrl}}/cms/v3/pages/site-pages
import Foundation
let headers = [
"private-app-legacy": "{{apiKey}}",
"content-type": "application/json"
]
let parameters = [
"publishDate": "",
"language": "",
"enableLayoutStylesheets": false,
"metaDescription": "",
"attachedStylesheets": [[]],
"password": "",
"publishImmediately": false,
"htmlTitle": "",
"translations": [],
"id": "",
"state": "",
"slug": "",
"createdById": "",
"currentlyPublished": false,
"archivedInDashboard": false,
"created": "",
"contentTypeCategory": "",
"mabExperimentId": "",
"updatedById": "",
"translatedFromId": "",
"folderId": "",
"widgetContainers": [],
"pageExpiryRedirectId": 0,
"dynamicPageDataSourceType": 0,
"featuredImage": "",
"authorName": "",
"domain": "",
"name": "",
"dynamicPageHubDbTableId": "",
"campaign": "",
"dynamicPageDataSourceId": "",
"enableDomainStylesheets": false,
"includeDefaultCustomCss": false,
"subcategory": "",
"layoutSections": [],
"updated": "",
"footerHtml": "",
"widgets": [],
"headHtml": "",
"pageExpiryRedirectUrl": "",
"abStatus": "",
"useFeaturedImage": false,
"abTestId": "",
"featuredImageAltText": "",
"contentGroupId": "",
"pageExpiryEnabled": false,
"templatePath": "",
"url": "",
"publicAccessRules": [[]],
"archivedAt": "",
"themeSettingsValues": [],
"pageExpiryDate": 0,
"publicAccessRulesEnabled": false,
"pageRedirected": false,
"currentState": "",
"categoryId": 0,
"linkRelCanonicalUrl": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/cms/v3/pages/site-pages")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
*/*
RESPONSE BODY text
{
"message": "Invalid input (details will vary based on the error)",
"correlationId": "aeb5f871-7f07-4993-9211-075dc63e7cbf",
"category": "VALIDATION_ERROR",
"links": {
"knowledge-base": "https://www.hubspot.com/products/service/knowledge-base"
}
}
POST
Create a new language variation
{{baseUrl}}/cms/v3/pages/site-pages/multi-language/create-language-variation
HEADERS
private-app-legacy
{{apiKey}}
BODY json
{
"language": "",
"id": "",
"primaryLanguage": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/cms/v3/pages/site-pages/multi-language/create-language-variation");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "private-app-legacy: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"language\": \"\",\n \"id\": \"\",\n \"primaryLanguage\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/cms/v3/pages/site-pages/multi-language/create-language-variation" {:headers {:private-app-legacy "{{apiKey}}"}
:content-type :json
:form-params {:language ""
:id ""
:primaryLanguage ""}})
require "http/client"
url = "{{baseUrl}}/cms/v3/pages/site-pages/multi-language/create-language-variation"
headers = HTTP::Headers{
"private-app-legacy" => "{{apiKey}}"
"content-type" => "application/json"
}
reqBody = "{\n \"language\": \"\",\n \"id\": \"\",\n \"primaryLanguage\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/cms/v3/pages/site-pages/multi-language/create-language-variation"),
Headers =
{
{ "private-app-legacy", "{{apiKey}}" },
},
Content = new StringContent("{\n \"language\": \"\",\n \"id\": \"\",\n \"primaryLanguage\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/cms/v3/pages/site-pages/multi-language/create-language-variation");
var request = new RestRequest("", Method.Post);
request.AddHeader("private-app-legacy", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"language\": \"\",\n \"id\": \"\",\n \"primaryLanguage\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/cms/v3/pages/site-pages/multi-language/create-language-variation"
payload := strings.NewReader("{\n \"language\": \"\",\n \"id\": \"\",\n \"primaryLanguage\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("private-app-legacy", "{{apiKey}}")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/cms/v3/pages/site-pages/multi-language/create-language-variation HTTP/1.1
Private-App-Legacy: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 57
{
"language": "",
"id": "",
"primaryLanguage": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/cms/v3/pages/site-pages/multi-language/create-language-variation")
.setHeader("private-app-legacy", "{{apiKey}}")
.setHeader("content-type", "application/json")
.setBody("{\n \"language\": \"\",\n \"id\": \"\",\n \"primaryLanguage\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/cms/v3/pages/site-pages/multi-language/create-language-variation"))
.header("private-app-legacy", "{{apiKey}}")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"language\": \"\",\n \"id\": \"\",\n \"primaryLanguage\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"language\": \"\",\n \"id\": \"\",\n \"primaryLanguage\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/cms/v3/pages/site-pages/multi-language/create-language-variation")
.post(body)
.addHeader("private-app-legacy", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/cms/v3/pages/site-pages/multi-language/create-language-variation")
.header("private-app-legacy", "{{apiKey}}")
.header("content-type", "application/json")
.body("{\n \"language\": \"\",\n \"id\": \"\",\n \"primaryLanguage\": \"\"\n}")
.asString();
const data = JSON.stringify({
language: '',
id: '',
primaryLanguage: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/cms/v3/pages/site-pages/multi-language/create-language-variation');
xhr.setRequestHeader('private-app-legacy', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/cms/v3/pages/site-pages/multi-language/create-language-variation',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
data: {language: '', id: '', primaryLanguage: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/cms/v3/pages/site-pages/multi-language/create-language-variation';
const options = {
method: 'POST',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
body: '{"language":"","id":"","primaryLanguage":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/cms/v3/pages/site-pages/multi-language/create-language-variation',
method: 'POST',
headers: {
'private-app-legacy': '{{apiKey}}',
'content-type': 'application/json'
},
processData: false,
data: '{\n "language": "",\n "id": "",\n "primaryLanguage": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"language\": \"\",\n \"id\": \"\",\n \"primaryLanguage\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/cms/v3/pages/site-pages/multi-language/create-language-variation")
.post(body)
.addHeader("private-app-legacy", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/cms/v3/pages/site-pages/multi-language/create-language-variation',
headers: {
'private-app-legacy': '{{apiKey}}',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({language: '', id: '', primaryLanguage: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/cms/v3/pages/site-pages/multi-language/create-language-variation',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
body: {language: '', id: '', primaryLanguage: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/cms/v3/pages/site-pages/multi-language/create-language-variation');
req.headers({
'private-app-legacy': '{{apiKey}}',
'content-type': 'application/json'
});
req.type('json');
req.send({
language: '',
id: '',
primaryLanguage: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/cms/v3/pages/site-pages/multi-language/create-language-variation',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
data: {language: '', id: '', primaryLanguage: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/cms/v3/pages/site-pages/multi-language/create-language-variation';
const options = {
method: 'POST',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
body: '{"language":"","id":"","primaryLanguage":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"private-app-legacy": @"{{apiKey}}",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"language": @"",
@"id": @"",
@"primaryLanguage": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/cms/v3/pages/site-pages/multi-language/create-language-variation"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/cms/v3/pages/site-pages/multi-language/create-language-variation" in
let headers = Header.add_list (Header.init ()) [
("private-app-legacy", "{{apiKey}}");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"language\": \"\",\n \"id\": \"\",\n \"primaryLanguage\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/cms/v3/pages/site-pages/multi-language/create-language-variation",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'language' => '',
'id' => '',
'primaryLanguage' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"private-app-legacy: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/cms/v3/pages/site-pages/multi-language/create-language-variation', [
'body' => '{
"language": "",
"id": "",
"primaryLanguage": ""
}',
'headers' => [
'content-type' => 'application/json',
'private-app-legacy' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/cms/v3/pages/site-pages/multi-language/create-language-variation');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'private-app-legacy' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'language' => '',
'id' => '',
'primaryLanguage' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'language' => '',
'id' => '',
'primaryLanguage' => ''
]));
$request->setRequestUrl('{{baseUrl}}/cms/v3/pages/site-pages/multi-language/create-language-variation');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'private-app-legacy' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("private-app-legacy", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/cms/v3/pages/site-pages/multi-language/create-language-variation' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"language": "",
"id": "",
"primaryLanguage": ""
}'
$headers=@{}
$headers.Add("private-app-legacy", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/cms/v3/pages/site-pages/multi-language/create-language-variation' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"language": "",
"id": "",
"primaryLanguage": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"language\": \"\",\n \"id\": \"\",\n \"primaryLanguage\": \"\"\n}"
headers = {
'private-app-legacy': "{{apiKey}}",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/cms/v3/pages/site-pages/multi-language/create-language-variation", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/cms/v3/pages/site-pages/multi-language/create-language-variation"
payload = {
"language": "",
"id": "",
"primaryLanguage": ""
}
headers = {
"private-app-legacy": "{{apiKey}}",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/cms/v3/pages/site-pages/multi-language/create-language-variation"
payload <- "{\n \"language\": \"\",\n \"id\": \"\",\n \"primaryLanguage\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('private-app-legacy' = '{{apiKey}}'), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/cms/v3/pages/site-pages/multi-language/create-language-variation")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["private-app-legacy"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n \"language\": \"\",\n \"id\": \"\",\n \"primaryLanguage\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/cms/v3/pages/site-pages/multi-language/create-language-variation') do |req|
req.headers['private-app-legacy'] = '{{apiKey}}'
req.body = "{\n \"language\": \"\",\n \"id\": \"\",\n \"primaryLanguage\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/cms/v3/pages/site-pages/multi-language/create-language-variation";
let payload = json!({
"language": "",
"id": "",
"primaryLanguage": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("private-app-legacy", "{{apiKey}}".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/cms/v3/pages/site-pages/multi-language/create-language-variation \
--header 'content-type: application/json' \
--header 'private-app-legacy: {{apiKey}}' \
--data '{
"language": "",
"id": "",
"primaryLanguage": ""
}'
echo '{
"language": "",
"id": "",
"primaryLanguage": ""
}' | \
http POST {{baseUrl}}/cms/v3/pages/site-pages/multi-language/create-language-variation \
content-type:application/json \
private-app-legacy:'{{apiKey}}'
wget --quiet \
--method POST \
--header 'private-app-legacy: {{apiKey}}' \
--header 'content-type: application/json' \
--body-data '{\n "language": "",\n "id": "",\n "primaryLanguage": ""\n}' \
--output-document \
- {{baseUrl}}/cms/v3/pages/site-pages/multi-language/create-language-variation
import Foundation
let headers = [
"private-app-legacy": "{{apiKey}}",
"content-type": "application/json"
]
let parameters = [
"language": "",
"id": "",
"primaryLanguage": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/cms/v3/pages/site-pages/multi-language/create-language-variation")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
*/*
RESPONSE BODY text
{
"message": "Invalid input (details will vary based on the error)",
"correlationId": "aeb5f871-7f07-4993-9211-075dc63e7cbf",
"category": "VALIDATION_ERROR",
"links": {
"knowledge-base": "https://www.hubspot.com/products/service/knowledge-base"
}
}
DELETE
Delete a Site Page
{{baseUrl}}/cms/v3/pages/site-pages/:objectId
HEADERS
private-app-legacy
{{apiKey}}
QUERY PARAMS
objectId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/cms/v3/pages/site-pages/:objectId");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "private-app-legacy: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/delete "{{baseUrl}}/cms/v3/pages/site-pages/:objectId" {:headers {:private-app-legacy "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/cms/v3/pages/site-pages/:objectId"
headers = HTTP::Headers{
"private-app-legacy" => "{{apiKey}}"
}
response = HTTP::Client.delete url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Delete,
RequestUri = new Uri("{{baseUrl}}/cms/v3/pages/site-pages/:objectId"),
Headers =
{
{ "private-app-legacy", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/cms/v3/pages/site-pages/:objectId");
var request = new RestRequest("", Method.Delete);
request.AddHeader("private-app-legacy", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/cms/v3/pages/site-pages/:objectId"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("private-app-legacy", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
DELETE /baseUrl/cms/v3/pages/site-pages/:objectId HTTP/1.1
Private-App-Legacy: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/cms/v3/pages/site-pages/:objectId")
.setHeader("private-app-legacy", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/cms/v3/pages/site-pages/:objectId"))
.header("private-app-legacy", "{{apiKey}}")
.method("DELETE", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/cms/v3/pages/site-pages/:objectId")
.delete(null)
.addHeader("private-app-legacy", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/cms/v3/pages/site-pages/:objectId")
.header("private-app-legacy", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('DELETE', '{{baseUrl}}/cms/v3/pages/site-pages/:objectId');
xhr.setRequestHeader('private-app-legacy', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'DELETE',
url: '{{baseUrl}}/cms/v3/pages/site-pages/:objectId',
headers: {'private-app-legacy': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/cms/v3/pages/site-pages/:objectId';
const options = {method: 'DELETE', headers: {'private-app-legacy': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/cms/v3/pages/site-pages/:objectId',
method: 'DELETE',
headers: {
'private-app-legacy': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/cms/v3/pages/site-pages/:objectId")
.delete(null)
.addHeader("private-app-legacy", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'DELETE',
hostname: 'example.com',
port: null,
path: '/baseUrl/cms/v3/pages/site-pages/:objectId',
headers: {
'private-app-legacy': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'DELETE',
url: '{{baseUrl}}/cms/v3/pages/site-pages/:objectId',
headers: {'private-app-legacy': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('DELETE', '{{baseUrl}}/cms/v3/pages/site-pages/:objectId');
req.headers({
'private-app-legacy': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'DELETE',
url: '{{baseUrl}}/cms/v3/pages/site-pages/:objectId',
headers: {'private-app-legacy': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/cms/v3/pages/site-pages/:objectId';
const options = {method: 'DELETE', headers: {'private-app-legacy': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"private-app-legacy": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/cms/v3/pages/site-pages/:objectId"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"DELETE"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/cms/v3/pages/site-pages/:objectId" in
let headers = Header.add (Header.init ()) "private-app-legacy" "{{apiKey}}" in
Client.call ~headers `DELETE uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/cms/v3/pages/site-pages/:objectId",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"private-app-legacy: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('DELETE', '{{baseUrl}}/cms/v3/pages/site-pages/:objectId', [
'headers' => [
'private-app-legacy' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/cms/v3/pages/site-pages/:objectId');
$request->setMethod(HTTP_METH_DELETE);
$request->setHeaders([
'private-app-legacy' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/cms/v3/pages/site-pages/:objectId');
$request->setRequestMethod('DELETE');
$request->setHeaders([
'private-app-legacy' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("private-app-legacy", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/cms/v3/pages/site-pages/:objectId' -Method DELETE -Headers $headers
$headers=@{}
$headers.Add("private-app-legacy", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/cms/v3/pages/site-pages/:objectId' -Method DELETE -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'private-app-legacy': "{{apiKey}}" }
conn.request("DELETE", "/baseUrl/cms/v3/pages/site-pages/:objectId", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/cms/v3/pages/site-pages/:objectId"
headers = {"private-app-legacy": "{{apiKey}}"}
response = requests.delete(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/cms/v3/pages/site-pages/:objectId"
response <- VERB("DELETE", url, add_headers('private-app-legacy' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/cms/v3/pages/site-pages/:objectId")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["private-app-legacy"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.delete('/baseUrl/cms/v3/pages/site-pages/:objectId') do |req|
req.headers['private-app-legacy'] = '{{apiKey}}'
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/cms/v3/pages/site-pages/:objectId";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("private-app-legacy", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("DELETE").unwrap(), url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request DELETE \
--url {{baseUrl}}/cms/v3/pages/site-pages/:objectId \
--header 'private-app-legacy: {{apiKey}}'
http DELETE {{baseUrl}}/cms/v3/pages/site-pages/:objectId \
private-app-legacy:'{{apiKey}}'
wget --quiet \
--method DELETE \
--header 'private-app-legacy: {{apiKey}}' \
--output-document \
- {{baseUrl}}/cms/v3/pages/site-pages/:objectId
import Foundation
let headers = ["private-app-legacy": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/cms/v3/pages/site-pages/:objectId")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "DELETE"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
*/*
RESPONSE BODY text
{
"message": "Invalid input (details will vary based on the error)",
"correlationId": "aeb5f871-7f07-4993-9211-075dc63e7cbf",
"category": "VALIDATION_ERROR",
"links": {
"knowledge-base": "https://www.hubspot.com/products/service/knowledge-base"
}
}
POST
Delete a batch of Site Pages
{{baseUrl}}/cms/v3/pages/site-pages/batch/archive
HEADERS
private-app-legacy
{{apiKey}}
BODY json
{
"inputs": []
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/cms/v3/pages/site-pages/batch/archive");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "private-app-legacy: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"inputs\": []\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/cms/v3/pages/site-pages/batch/archive" {:headers {:private-app-legacy "{{apiKey}}"}
:content-type :json
:form-params {:inputs []}})
require "http/client"
url = "{{baseUrl}}/cms/v3/pages/site-pages/batch/archive"
headers = HTTP::Headers{
"private-app-legacy" => "{{apiKey}}"
"content-type" => "application/json"
}
reqBody = "{\n \"inputs\": []\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/cms/v3/pages/site-pages/batch/archive"),
Headers =
{
{ "private-app-legacy", "{{apiKey}}" },
},
Content = new StringContent("{\n \"inputs\": []\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/cms/v3/pages/site-pages/batch/archive");
var request = new RestRequest("", Method.Post);
request.AddHeader("private-app-legacy", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"inputs\": []\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/cms/v3/pages/site-pages/batch/archive"
payload := strings.NewReader("{\n \"inputs\": []\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("private-app-legacy", "{{apiKey}}")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/cms/v3/pages/site-pages/batch/archive HTTP/1.1
Private-App-Legacy: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 18
{
"inputs": []
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/cms/v3/pages/site-pages/batch/archive")
.setHeader("private-app-legacy", "{{apiKey}}")
.setHeader("content-type", "application/json")
.setBody("{\n \"inputs\": []\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/cms/v3/pages/site-pages/batch/archive"))
.header("private-app-legacy", "{{apiKey}}")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"inputs\": []\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"inputs\": []\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/cms/v3/pages/site-pages/batch/archive")
.post(body)
.addHeader("private-app-legacy", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/cms/v3/pages/site-pages/batch/archive")
.header("private-app-legacy", "{{apiKey}}")
.header("content-type", "application/json")
.body("{\n \"inputs\": []\n}")
.asString();
const data = JSON.stringify({
inputs: []
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/cms/v3/pages/site-pages/batch/archive');
xhr.setRequestHeader('private-app-legacy', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/cms/v3/pages/site-pages/batch/archive',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
data: {inputs: []}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/cms/v3/pages/site-pages/batch/archive';
const options = {
method: 'POST',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
body: '{"inputs":[]}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/cms/v3/pages/site-pages/batch/archive',
method: 'POST',
headers: {
'private-app-legacy': '{{apiKey}}',
'content-type': 'application/json'
},
processData: false,
data: '{\n "inputs": []\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"inputs\": []\n}")
val request = Request.Builder()
.url("{{baseUrl}}/cms/v3/pages/site-pages/batch/archive")
.post(body)
.addHeader("private-app-legacy", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/cms/v3/pages/site-pages/batch/archive',
headers: {
'private-app-legacy': '{{apiKey}}',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({inputs: []}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/cms/v3/pages/site-pages/batch/archive',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
body: {inputs: []},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/cms/v3/pages/site-pages/batch/archive');
req.headers({
'private-app-legacy': '{{apiKey}}',
'content-type': 'application/json'
});
req.type('json');
req.send({
inputs: []
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/cms/v3/pages/site-pages/batch/archive',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
data: {inputs: []}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/cms/v3/pages/site-pages/batch/archive';
const options = {
method: 'POST',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
body: '{"inputs":[]}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"private-app-legacy": @"{{apiKey}}",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"inputs": @[ ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/cms/v3/pages/site-pages/batch/archive"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/cms/v3/pages/site-pages/batch/archive" in
let headers = Header.add_list (Header.init ()) [
("private-app-legacy", "{{apiKey}}");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"inputs\": []\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/cms/v3/pages/site-pages/batch/archive",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'inputs' => [
]
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"private-app-legacy: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/cms/v3/pages/site-pages/batch/archive', [
'body' => '{
"inputs": []
}',
'headers' => [
'content-type' => 'application/json',
'private-app-legacy' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/cms/v3/pages/site-pages/batch/archive');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'private-app-legacy' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'inputs' => [
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'inputs' => [
]
]));
$request->setRequestUrl('{{baseUrl}}/cms/v3/pages/site-pages/batch/archive');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'private-app-legacy' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("private-app-legacy", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/cms/v3/pages/site-pages/batch/archive' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"inputs": []
}'
$headers=@{}
$headers.Add("private-app-legacy", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/cms/v3/pages/site-pages/batch/archive' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"inputs": []
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"inputs\": []\n}"
headers = {
'private-app-legacy': "{{apiKey}}",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/cms/v3/pages/site-pages/batch/archive", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/cms/v3/pages/site-pages/batch/archive"
payload = { "inputs": [] }
headers = {
"private-app-legacy": "{{apiKey}}",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/cms/v3/pages/site-pages/batch/archive"
payload <- "{\n \"inputs\": []\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('private-app-legacy' = '{{apiKey}}'), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/cms/v3/pages/site-pages/batch/archive")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["private-app-legacy"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n \"inputs\": []\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/cms/v3/pages/site-pages/batch/archive') do |req|
req.headers['private-app-legacy'] = '{{apiKey}}'
req.body = "{\n \"inputs\": []\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/cms/v3/pages/site-pages/batch/archive";
let payload = json!({"inputs": ()});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("private-app-legacy", "{{apiKey}}".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/cms/v3/pages/site-pages/batch/archive \
--header 'content-type: application/json' \
--header 'private-app-legacy: {{apiKey}}' \
--data '{
"inputs": []
}'
echo '{
"inputs": []
}' | \
http POST {{baseUrl}}/cms/v3/pages/site-pages/batch/archive \
content-type:application/json \
private-app-legacy:'{{apiKey}}'
wget --quiet \
--method POST \
--header 'private-app-legacy: {{apiKey}}' \
--header 'content-type: application/json' \
--body-data '{\n "inputs": []\n}' \
--output-document \
- {{baseUrl}}/cms/v3/pages/site-pages/batch/archive
import Foundation
let headers = [
"private-app-legacy": "{{apiKey}}",
"content-type": "application/json"
]
let parameters = ["inputs": []] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/cms/v3/pages/site-pages/batch/archive")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
*/*
RESPONSE BODY text
{
"message": "Invalid input (details will vary based on the error)",
"correlationId": "aeb5f871-7f07-4993-9211-075dc63e7cbf",
"category": "VALIDATION_ERROR",
"links": {
"knowledge-base": "https://www.hubspot.com/products/service/knowledge-base"
}
}
POST
Detach a site page from a multi-language group
{{baseUrl}}/cms/v3/pages/site-pages/multi-language/detach-from-lang-group
HEADERS
private-app-legacy
{{apiKey}}
BODY json
{
"id": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/cms/v3/pages/site-pages/multi-language/detach-from-lang-group");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "private-app-legacy: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"id\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/cms/v3/pages/site-pages/multi-language/detach-from-lang-group" {:headers {:private-app-legacy "{{apiKey}}"}
:content-type :json
:form-params {:id ""}})
require "http/client"
url = "{{baseUrl}}/cms/v3/pages/site-pages/multi-language/detach-from-lang-group"
headers = HTTP::Headers{
"private-app-legacy" => "{{apiKey}}"
"content-type" => "application/json"
}
reqBody = "{\n \"id\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/cms/v3/pages/site-pages/multi-language/detach-from-lang-group"),
Headers =
{
{ "private-app-legacy", "{{apiKey}}" },
},
Content = new StringContent("{\n \"id\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/cms/v3/pages/site-pages/multi-language/detach-from-lang-group");
var request = new RestRequest("", Method.Post);
request.AddHeader("private-app-legacy", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"id\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/cms/v3/pages/site-pages/multi-language/detach-from-lang-group"
payload := strings.NewReader("{\n \"id\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("private-app-legacy", "{{apiKey}}")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/cms/v3/pages/site-pages/multi-language/detach-from-lang-group HTTP/1.1
Private-App-Legacy: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 14
{
"id": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/cms/v3/pages/site-pages/multi-language/detach-from-lang-group")
.setHeader("private-app-legacy", "{{apiKey}}")
.setHeader("content-type", "application/json")
.setBody("{\n \"id\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/cms/v3/pages/site-pages/multi-language/detach-from-lang-group"))
.header("private-app-legacy", "{{apiKey}}")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"id\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"id\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/cms/v3/pages/site-pages/multi-language/detach-from-lang-group")
.post(body)
.addHeader("private-app-legacy", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/cms/v3/pages/site-pages/multi-language/detach-from-lang-group")
.header("private-app-legacy", "{{apiKey}}")
.header("content-type", "application/json")
.body("{\n \"id\": \"\"\n}")
.asString();
const data = JSON.stringify({
id: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/cms/v3/pages/site-pages/multi-language/detach-from-lang-group');
xhr.setRequestHeader('private-app-legacy', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/cms/v3/pages/site-pages/multi-language/detach-from-lang-group',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
data: {id: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/cms/v3/pages/site-pages/multi-language/detach-from-lang-group';
const options = {
method: 'POST',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
body: '{"id":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/cms/v3/pages/site-pages/multi-language/detach-from-lang-group',
method: 'POST',
headers: {
'private-app-legacy': '{{apiKey}}',
'content-type': 'application/json'
},
processData: false,
data: '{\n "id": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"id\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/cms/v3/pages/site-pages/multi-language/detach-from-lang-group")
.post(body)
.addHeader("private-app-legacy", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/cms/v3/pages/site-pages/multi-language/detach-from-lang-group',
headers: {
'private-app-legacy': '{{apiKey}}',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({id: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/cms/v3/pages/site-pages/multi-language/detach-from-lang-group',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
body: {id: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/cms/v3/pages/site-pages/multi-language/detach-from-lang-group');
req.headers({
'private-app-legacy': '{{apiKey}}',
'content-type': 'application/json'
});
req.type('json');
req.send({
id: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/cms/v3/pages/site-pages/multi-language/detach-from-lang-group',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
data: {id: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/cms/v3/pages/site-pages/multi-language/detach-from-lang-group';
const options = {
method: 'POST',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
body: '{"id":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"private-app-legacy": @"{{apiKey}}",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"id": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/cms/v3/pages/site-pages/multi-language/detach-from-lang-group"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/cms/v3/pages/site-pages/multi-language/detach-from-lang-group" in
let headers = Header.add_list (Header.init ()) [
("private-app-legacy", "{{apiKey}}");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"id\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/cms/v3/pages/site-pages/multi-language/detach-from-lang-group",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'id' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"private-app-legacy: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/cms/v3/pages/site-pages/multi-language/detach-from-lang-group', [
'body' => '{
"id": ""
}',
'headers' => [
'content-type' => 'application/json',
'private-app-legacy' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/cms/v3/pages/site-pages/multi-language/detach-from-lang-group');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'private-app-legacy' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'id' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'id' => ''
]));
$request->setRequestUrl('{{baseUrl}}/cms/v3/pages/site-pages/multi-language/detach-from-lang-group');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'private-app-legacy' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("private-app-legacy", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/cms/v3/pages/site-pages/multi-language/detach-from-lang-group' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"id": ""
}'
$headers=@{}
$headers.Add("private-app-legacy", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/cms/v3/pages/site-pages/multi-language/detach-from-lang-group' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"id": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"id\": \"\"\n}"
headers = {
'private-app-legacy': "{{apiKey}}",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/cms/v3/pages/site-pages/multi-language/detach-from-lang-group", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/cms/v3/pages/site-pages/multi-language/detach-from-lang-group"
payload = { "id": "" }
headers = {
"private-app-legacy": "{{apiKey}}",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/cms/v3/pages/site-pages/multi-language/detach-from-lang-group"
payload <- "{\n \"id\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('private-app-legacy' = '{{apiKey}}'), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/cms/v3/pages/site-pages/multi-language/detach-from-lang-group")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["private-app-legacy"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n \"id\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/cms/v3/pages/site-pages/multi-language/detach-from-lang-group') do |req|
req.headers['private-app-legacy'] = '{{apiKey}}'
req.body = "{\n \"id\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/cms/v3/pages/site-pages/multi-language/detach-from-lang-group";
let payload = json!({"id": ""});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("private-app-legacy", "{{apiKey}}".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/cms/v3/pages/site-pages/multi-language/detach-from-lang-group \
--header 'content-type: application/json' \
--header 'private-app-legacy: {{apiKey}}' \
--data '{
"id": ""
}'
echo '{
"id": ""
}' | \
http POST {{baseUrl}}/cms/v3/pages/site-pages/multi-language/detach-from-lang-group \
content-type:application/json \
private-app-legacy:'{{apiKey}}'
wget --quiet \
--method POST \
--header 'private-app-legacy: {{apiKey}}' \
--header 'content-type: application/json' \
--body-data '{\n "id": ""\n}' \
--output-document \
- {{baseUrl}}/cms/v3/pages/site-pages/multi-language/detach-from-lang-group
import Foundation
let headers = [
"private-app-legacy": "{{apiKey}}",
"content-type": "application/json"
]
let parameters = ["id": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/cms/v3/pages/site-pages/multi-language/detach-from-lang-group")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
*/*
RESPONSE BODY text
{
"message": "Invalid input (details will vary based on the error)",
"correlationId": "aeb5f871-7f07-4993-9211-075dc63e7cbf",
"category": "VALIDATION_ERROR",
"links": {
"knowledge-base": "https://www.hubspot.com/products/service/knowledge-base"
}
}
POST
End an active A-B test
{{baseUrl}}/cms/v3/pages/site-pages/ab-test/end
HEADERS
private-app-legacy
{{apiKey}}
BODY json
{
"winnerId": "",
"abTestId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/cms/v3/pages/site-pages/ab-test/end");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "private-app-legacy: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"winnerId\": \"\",\n \"abTestId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/cms/v3/pages/site-pages/ab-test/end" {:headers {:private-app-legacy "{{apiKey}}"}
:content-type :json
:form-params {:winnerId ""
:abTestId ""}})
require "http/client"
url = "{{baseUrl}}/cms/v3/pages/site-pages/ab-test/end"
headers = HTTP::Headers{
"private-app-legacy" => "{{apiKey}}"
"content-type" => "application/json"
}
reqBody = "{\n \"winnerId\": \"\",\n \"abTestId\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/cms/v3/pages/site-pages/ab-test/end"),
Headers =
{
{ "private-app-legacy", "{{apiKey}}" },
},
Content = new StringContent("{\n \"winnerId\": \"\",\n \"abTestId\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/cms/v3/pages/site-pages/ab-test/end");
var request = new RestRequest("", Method.Post);
request.AddHeader("private-app-legacy", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"winnerId\": \"\",\n \"abTestId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/cms/v3/pages/site-pages/ab-test/end"
payload := strings.NewReader("{\n \"winnerId\": \"\",\n \"abTestId\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("private-app-legacy", "{{apiKey}}")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/cms/v3/pages/site-pages/ab-test/end HTTP/1.1
Private-App-Legacy: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 38
{
"winnerId": "",
"abTestId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/cms/v3/pages/site-pages/ab-test/end")
.setHeader("private-app-legacy", "{{apiKey}}")
.setHeader("content-type", "application/json")
.setBody("{\n \"winnerId\": \"\",\n \"abTestId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/cms/v3/pages/site-pages/ab-test/end"))
.header("private-app-legacy", "{{apiKey}}")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"winnerId\": \"\",\n \"abTestId\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"winnerId\": \"\",\n \"abTestId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/cms/v3/pages/site-pages/ab-test/end")
.post(body)
.addHeader("private-app-legacy", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/cms/v3/pages/site-pages/ab-test/end")
.header("private-app-legacy", "{{apiKey}}")
.header("content-type", "application/json")
.body("{\n \"winnerId\": \"\",\n \"abTestId\": \"\"\n}")
.asString();
const data = JSON.stringify({
winnerId: '',
abTestId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/cms/v3/pages/site-pages/ab-test/end');
xhr.setRequestHeader('private-app-legacy', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/cms/v3/pages/site-pages/ab-test/end',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
data: {winnerId: '', abTestId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/cms/v3/pages/site-pages/ab-test/end';
const options = {
method: 'POST',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
body: '{"winnerId":"","abTestId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/cms/v3/pages/site-pages/ab-test/end',
method: 'POST',
headers: {
'private-app-legacy': '{{apiKey}}',
'content-type': 'application/json'
},
processData: false,
data: '{\n "winnerId": "",\n "abTestId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"winnerId\": \"\",\n \"abTestId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/cms/v3/pages/site-pages/ab-test/end")
.post(body)
.addHeader("private-app-legacy", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/cms/v3/pages/site-pages/ab-test/end',
headers: {
'private-app-legacy': '{{apiKey}}',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({winnerId: '', abTestId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/cms/v3/pages/site-pages/ab-test/end',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
body: {winnerId: '', abTestId: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/cms/v3/pages/site-pages/ab-test/end');
req.headers({
'private-app-legacy': '{{apiKey}}',
'content-type': 'application/json'
});
req.type('json');
req.send({
winnerId: '',
abTestId: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/cms/v3/pages/site-pages/ab-test/end',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
data: {winnerId: '', abTestId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/cms/v3/pages/site-pages/ab-test/end';
const options = {
method: 'POST',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
body: '{"winnerId":"","abTestId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"private-app-legacy": @"{{apiKey}}",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"winnerId": @"",
@"abTestId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/cms/v3/pages/site-pages/ab-test/end"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/cms/v3/pages/site-pages/ab-test/end" in
let headers = Header.add_list (Header.init ()) [
("private-app-legacy", "{{apiKey}}");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"winnerId\": \"\",\n \"abTestId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/cms/v3/pages/site-pages/ab-test/end",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'winnerId' => '',
'abTestId' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"private-app-legacy: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/cms/v3/pages/site-pages/ab-test/end', [
'body' => '{
"winnerId": "",
"abTestId": ""
}',
'headers' => [
'content-type' => 'application/json',
'private-app-legacy' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/cms/v3/pages/site-pages/ab-test/end');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'private-app-legacy' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'winnerId' => '',
'abTestId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'winnerId' => '',
'abTestId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/cms/v3/pages/site-pages/ab-test/end');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'private-app-legacy' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("private-app-legacy", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/cms/v3/pages/site-pages/ab-test/end' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"winnerId": "",
"abTestId": ""
}'
$headers=@{}
$headers.Add("private-app-legacy", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/cms/v3/pages/site-pages/ab-test/end' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"winnerId": "",
"abTestId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"winnerId\": \"\",\n \"abTestId\": \"\"\n}"
headers = {
'private-app-legacy': "{{apiKey}}",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/cms/v3/pages/site-pages/ab-test/end", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/cms/v3/pages/site-pages/ab-test/end"
payload = {
"winnerId": "",
"abTestId": ""
}
headers = {
"private-app-legacy": "{{apiKey}}",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/cms/v3/pages/site-pages/ab-test/end"
payload <- "{\n \"winnerId\": \"\",\n \"abTestId\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('private-app-legacy' = '{{apiKey}}'), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/cms/v3/pages/site-pages/ab-test/end")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["private-app-legacy"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n \"winnerId\": \"\",\n \"abTestId\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/cms/v3/pages/site-pages/ab-test/end') do |req|
req.headers['private-app-legacy'] = '{{apiKey}}'
req.body = "{\n \"winnerId\": \"\",\n \"abTestId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/cms/v3/pages/site-pages/ab-test/end";
let payload = json!({
"winnerId": "",
"abTestId": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("private-app-legacy", "{{apiKey}}".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/cms/v3/pages/site-pages/ab-test/end \
--header 'content-type: application/json' \
--header 'private-app-legacy: {{apiKey}}' \
--data '{
"winnerId": "",
"abTestId": ""
}'
echo '{
"winnerId": "",
"abTestId": ""
}' | \
http POST {{baseUrl}}/cms/v3/pages/site-pages/ab-test/end \
content-type:application/json \
private-app-legacy:'{{apiKey}}'
wget --quiet \
--method POST \
--header 'private-app-legacy: {{apiKey}}' \
--header 'content-type: application/json' \
--body-data '{\n "winnerId": "",\n "abTestId": ""\n}' \
--output-document \
- {{baseUrl}}/cms/v3/pages/site-pages/ab-test/end
import Foundation
let headers = [
"private-app-legacy": "{{apiKey}}",
"content-type": "application/json"
]
let parameters = [
"winnerId": "",
"abTestId": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/cms/v3/pages/site-pages/ab-test/end")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
*/*
RESPONSE BODY text
{
"message": "Invalid input (details will vary based on the error)",
"correlationId": "aeb5f871-7f07-4993-9211-075dc63e7cbf",
"category": "VALIDATION_ERROR",
"links": {
"knowledge-base": "https://www.hubspot.com/products/service/knowledge-base"
}
}
GET
Get all Site Pages
{{baseUrl}}/cms/v3/pages/site-pages
HEADERS
private-app-legacy
{{apiKey}}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/cms/v3/pages/site-pages");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "private-app-legacy: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/cms/v3/pages/site-pages" {:headers {:private-app-legacy "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/cms/v3/pages/site-pages"
headers = HTTP::Headers{
"private-app-legacy" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/cms/v3/pages/site-pages"),
Headers =
{
{ "private-app-legacy", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/cms/v3/pages/site-pages");
var request = new RestRequest("", Method.Get);
request.AddHeader("private-app-legacy", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/cms/v3/pages/site-pages"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("private-app-legacy", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/cms/v3/pages/site-pages HTTP/1.1
Private-App-Legacy: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/cms/v3/pages/site-pages")
.setHeader("private-app-legacy", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/cms/v3/pages/site-pages"))
.header("private-app-legacy", "{{apiKey}}")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/cms/v3/pages/site-pages")
.get()
.addHeader("private-app-legacy", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/cms/v3/pages/site-pages")
.header("private-app-legacy", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/cms/v3/pages/site-pages');
xhr.setRequestHeader('private-app-legacy', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/cms/v3/pages/site-pages',
headers: {'private-app-legacy': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/cms/v3/pages/site-pages';
const options = {method: 'GET', headers: {'private-app-legacy': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/cms/v3/pages/site-pages',
method: 'GET',
headers: {
'private-app-legacy': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/cms/v3/pages/site-pages")
.get()
.addHeader("private-app-legacy", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/cms/v3/pages/site-pages',
headers: {
'private-app-legacy': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/cms/v3/pages/site-pages',
headers: {'private-app-legacy': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/cms/v3/pages/site-pages');
req.headers({
'private-app-legacy': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/cms/v3/pages/site-pages',
headers: {'private-app-legacy': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/cms/v3/pages/site-pages';
const options = {method: 'GET', headers: {'private-app-legacy': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"private-app-legacy": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/cms/v3/pages/site-pages"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/cms/v3/pages/site-pages" in
let headers = Header.add (Header.init ()) "private-app-legacy" "{{apiKey}}" in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/cms/v3/pages/site-pages",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"private-app-legacy: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/cms/v3/pages/site-pages', [
'headers' => [
'private-app-legacy' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/cms/v3/pages/site-pages');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders([
'private-app-legacy' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/cms/v3/pages/site-pages');
$request->setRequestMethod('GET');
$request->setHeaders([
'private-app-legacy' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("private-app-legacy", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/cms/v3/pages/site-pages' -Method GET -Headers $headers
$headers=@{}
$headers.Add("private-app-legacy", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/cms/v3/pages/site-pages' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'private-app-legacy': "{{apiKey}}" }
conn.request("GET", "/baseUrl/cms/v3/pages/site-pages", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/cms/v3/pages/site-pages"
headers = {"private-app-legacy": "{{apiKey}}"}
response = requests.get(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/cms/v3/pages/site-pages"
response <- VERB("GET", url, add_headers('private-app-legacy' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/cms/v3/pages/site-pages")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["private-app-legacy"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/cms/v3/pages/site-pages') do |req|
req.headers['private-app-legacy'] = '{{apiKey}}'
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/cms/v3/pages/site-pages";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("private-app-legacy", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/cms/v3/pages/site-pages \
--header 'private-app-legacy: {{apiKey}}'
http GET {{baseUrl}}/cms/v3/pages/site-pages \
private-app-legacy:'{{apiKey}}'
wget --quiet \
--method GET \
--header 'private-app-legacy: {{apiKey}}' \
--output-document \
- {{baseUrl}}/cms/v3/pages/site-pages
import Foundation
let headers = ["private-app-legacy": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/cms/v3/pages/site-pages")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
*/*
RESPONSE BODY text
{
"message": "Invalid input (details will vary based on the error)",
"correlationId": "aeb5f871-7f07-4993-9211-075dc63e7cbf",
"category": "VALIDATION_ERROR",
"links": {
"knowledge-base": "https://www.hubspot.com/products/service/knowledge-base"
}
}
POST
Push Site Page draft edits live
{{baseUrl}}/cms/v3/pages/site-pages/:objectId/draft/push-live
HEADERS
private-app-legacy
{{apiKey}}
QUERY PARAMS
objectId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/cms/v3/pages/site-pages/:objectId/draft/push-live");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "private-app-legacy: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/cms/v3/pages/site-pages/:objectId/draft/push-live" {:headers {:private-app-legacy "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/cms/v3/pages/site-pages/:objectId/draft/push-live"
headers = HTTP::Headers{
"private-app-legacy" => "{{apiKey}}"
}
response = HTTP::Client.post url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/cms/v3/pages/site-pages/:objectId/draft/push-live"),
Headers =
{
{ "private-app-legacy", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/cms/v3/pages/site-pages/:objectId/draft/push-live");
var request = new RestRequest("", Method.Post);
request.AddHeader("private-app-legacy", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/cms/v3/pages/site-pages/:objectId/draft/push-live"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("private-app-legacy", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/cms/v3/pages/site-pages/:objectId/draft/push-live HTTP/1.1
Private-App-Legacy: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/cms/v3/pages/site-pages/:objectId/draft/push-live")
.setHeader("private-app-legacy", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/cms/v3/pages/site-pages/:objectId/draft/push-live"))
.header("private-app-legacy", "{{apiKey}}")
.method("POST", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/cms/v3/pages/site-pages/:objectId/draft/push-live")
.post(null)
.addHeader("private-app-legacy", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/cms/v3/pages/site-pages/:objectId/draft/push-live")
.header("private-app-legacy", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/cms/v3/pages/site-pages/:objectId/draft/push-live');
xhr.setRequestHeader('private-app-legacy', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/cms/v3/pages/site-pages/:objectId/draft/push-live',
headers: {'private-app-legacy': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/cms/v3/pages/site-pages/:objectId/draft/push-live';
const options = {method: 'POST', headers: {'private-app-legacy': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/cms/v3/pages/site-pages/:objectId/draft/push-live',
method: 'POST',
headers: {
'private-app-legacy': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/cms/v3/pages/site-pages/:objectId/draft/push-live")
.post(null)
.addHeader("private-app-legacy", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/cms/v3/pages/site-pages/:objectId/draft/push-live',
headers: {
'private-app-legacy': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/cms/v3/pages/site-pages/:objectId/draft/push-live',
headers: {'private-app-legacy': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/cms/v3/pages/site-pages/:objectId/draft/push-live');
req.headers({
'private-app-legacy': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/cms/v3/pages/site-pages/:objectId/draft/push-live',
headers: {'private-app-legacy': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/cms/v3/pages/site-pages/:objectId/draft/push-live';
const options = {method: 'POST', headers: {'private-app-legacy': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"private-app-legacy": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/cms/v3/pages/site-pages/:objectId/draft/push-live"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/cms/v3/pages/site-pages/:objectId/draft/push-live" in
let headers = Header.add (Header.init ()) "private-app-legacy" "{{apiKey}}" in
Client.call ~headers `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/cms/v3/pages/site-pages/:objectId/draft/push-live",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"private-app-legacy: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/cms/v3/pages/site-pages/:objectId/draft/push-live', [
'headers' => [
'private-app-legacy' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/cms/v3/pages/site-pages/:objectId/draft/push-live');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'private-app-legacy' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/cms/v3/pages/site-pages/:objectId/draft/push-live');
$request->setRequestMethod('POST');
$request->setHeaders([
'private-app-legacy' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("private-app-legacy", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/cms/v3/pages/site-pages/:objectId/draft/push-live' -Method POST -Headers $headers
$headers=@{}
$headers.Add("private-app-legacy", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/cms/v3/pages/site-pages/:objectId/draft/push-live' -Method POST -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'private-app-legacy': "{{apiKey}}" }
conn.request("POST", "/baseUrl/cms/v3/pages/site-pages/:objectId/draft/push-live", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/cms/v3/pages/site-pages/:objectId/draft/push-live"
headers = {"private-app-legacy": "{{apiKey}}"}
response = requests.post(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/cms/v3/pages/site-pages/:objectId/draft/push-live"
response <- VERB("POST", url, add_headers('private-app-legacy' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/cms/v3/pages/site-pages/:objectId/draft/push-live")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["private-app-legacy"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.post('/baseUrl/cms/v3/pages/site-pages/:objectId/draft/push-live') do |req|
req.headers['private-app-legacy'] = '{{apiKey}}'
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/cms/v3/pages/site-pages/:objectId/draft/push-live";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("private-app-legacy", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/cms/v3/pages/site-pages/:objectId/draft/push-live \
--header 'private-app-legacy: {{apiKey}}'
http POST {{baseUrl}}/cms/v3/pages/site-pages/:objectId/draft/push-live \
private-app-legacy:'{{apiKey}}'
wget --quiet \
--method POST \
--header 'private-app-legacy: {{apiKey}}' \
--output-document \
- {{baseUrl}}/cms/v3/pages/site-pages/:objectId/draft/push-live
import Foundation
let headers = ["private-app-legacy": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/cms/v3/pages/site-pages/:objectId/draft/push-live")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
*/*
RESPONSE BODY text
{
"message": "Invalid input (details will vary based on the error)",
"correlationId": "aeb5f871-7f07-4993-9211-075dc63e7cbf",
"category": "VALIDATION_ERROR",
"links": {
"knowledge-base": "https://www.hubspot.com/products/service/knowledge-base"
}
}
POST
Rerun a previous A-B test
{{baseUrl}}/cms/v3/pages/site-pages/ab-test/rerun
HEADERS
private-app-legacy
{{apiKey}}
BODY json
{
"variationId": "",
"abTestId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/cms/v3/pages/site-pages/ab-test/rerun");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "private-app-legacy: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"variationId\": \"\",\n \"abTestId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/cms/v3/pages/site-pages/ab-test/rerun" {:headers {:private-app-legacy "{{apiKey}}"}
:content-type :json
:form-params {:variationId ""
:abTestId ""}})
require "http/client"
url = "{{baseUrl}}/cms/v3/pages/site-pages/ab-test/rerun"
headers = HTTP::Headers{
"private-app-legacy" => "{{apiKey}}"
"content-type" => "application/json"
}
reqBody = "{\n \"variationId\": \"\",\n \"abTestId\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/cms/v3/pages/site-pages/ab-test/rerun"),
Headers =
{
{ "private-app-legacy", "{{apiKey}}" },
},
Content = new StringContent("{\n \"variationId\": \"\",\n \"abTestId\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/cms/v3/pages/site-pages/ab-test/rerun");
var request = new RestRequest("", Method.Post);
request.AddHeader("private-app-legacy", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"variationId\": \"\",\n \"abTestId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/cms/v3/pages/site-pages/ab-test/rerun"
payload := strings.NewReader("{\n \"variationId\": \"\",\n \"abTestId\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("private-app-legacy", "{{apiKey}}")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/cms/v3/pages/site-pages/ab-test/rerun HTTP/1.1
Private-App-Legacy: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 41
{
"variationId": "",
"abTestId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/cms/v3/pages/site-pages/ab-test/rerun")
.setHeader("private-app-legacy", "{{apiKey}}")
.setHeader("content-type", "application/json")
.setBody("{\n \"variationId\": \"\",\n \"abTestId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/cms/v3/pages/site-pages/ab-test/rerun"))
.header("private-app-legacy", "{{apiKey}}")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"variationId\": \"\",\n \"abTestId\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"variationId\": \"\",\n \"abTestId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/cms/v3/pages/site-pages/ab-test/rerun")
.post(body)
.addHeader("private-app-legacy", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/cms/v3/pages/site-pages/ab-test/rerun")
.header("private-app-legacy", "{{apiKey}}")
.header("content-type", "application/json")
.body("{\n \"variationId\": \"\",\n \"abTestId\": \"\"\n}")
.asString();
const data = JSON.stringify({
variationId: '',
abTestId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/cms/v3/pages/site-pages/ab-test/rerun');
xhr.setRequestHeader('private-app-legacy', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/cms/v3/pages/site-pages/ab-test/rerun',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
data: {variationId: '', abTestId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/cms/v3/pages/site-pages/ab-test/rerun';
const options = {
method: 'POST',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
body: '{"variationId":"","abTestId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/cms/v3/pages/site-pages/ab-test/rerun',
method: 'POST',
headers: {
'private-app-legacy': '{{apiKey}}',
'content-type': 'application/json'
},
processData: false,
data: '{\n "variationId": "",\n "abTestId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"variationId\": \"\",\n \"abTestId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/cms/v3/pages/site-pages/ab-test/rerun")
.post(body)
.addHeader("private-app-legacy", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/cms/v3/pages/site-pages/ab-test/rerun',
headers: {
'private-app-legacy': '{{apiKey}}',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({variationId: '', abTestId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/cms/v3/pages/site-pages/ab-test/rerun',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
body: {variationId: '', abTestId: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/cms/v3/pages/site-pages/ab-test/rerun');
req.headers({
'private-app-legacy': '{{apiKey}}',
'content-type': 'application/json'
});
req.type('json');
req.send({
variationId: '',
abTestId: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/cms/v3/pages/site-pages/ab-test/rerun',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
data: {variationId: '', abTestId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/cms/v3/pages/site-pages/ab-test/rerun';
const options = {
method: 'POST',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
body: '{"variationId":"","abTestId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"private-app-legacy": @"{{apiKey}}",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"variationId": @"",
@"abTestId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/cms/v3/pages/site-pages/ab-test/rerun"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/cms/v3/pages/site-pages/ab-test/rerun" in
let headers = Header.add_list (Header.init ()) [
("private-app-legacy", "{{apiKey}}");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"variationId\": \"\",\n \"abTestId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/cms/v3/pages/site-pages/ab-test/rerun",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'variationId' => '',
'abTestId' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"private-app-legacy: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/cms/v3/pages/site-pages/ab-test/rerun', [
'body' => '{
"variationId": "",
"abTestId": ""
}',
'headers' => [
'content-type' => 'application/json',
'private-app-legacy' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/cms/v3/pages/site-pages/ab-test/rerun');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'private-app-legacy' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'variationId' => '',
'abTestId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'variationId' => '',
'abTestId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/cms/v3/pages/site-pages/ab-test/rerun');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'private-app-legacy' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("private-app-legacy", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/cms/v3/pages/site-pages/ab-test/rerun' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"variationId": "",
"abTestId": ""
}'
$headers=@{}
$headers.Add("private-app-legacy", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/cms/v3/pages/site-pages/ab-test/rerun' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"variationId": "",
"abTestId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"variationId\": \"\",\n \"abTestId\": \"\"\n}"
headers = {
'private-app-legacy': "{{apiKey}}",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/cms/v3/pages/site-pages/ab-test/rerun", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/cms/v3/pages/site-pages/ab-test/rerun"
payload = {
"variationId": "",
"abTestId": ""
}
headers = {
"private-app-legacy": "{{apiKey}}",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/cms/v3/pages/site-pages/ab-test/rerun"
payload <- "{\n \"variationId\": \"\",\n \"abTestId\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('private-app-legacy' = '{{apiKey}}'), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/cms/v3/pages/site-pages/ab-test/rerun")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["private-app-legacy"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n \"variationId\": \"\",\n \"abTestId\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/cms/v3/pages/site-pages/ab-test/rerun') do |req|
req.headers['private-app-legacy'] = '{{apiKey}}'
req.body = "{\n \"variationId\": \"\",\n \"abTestId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/cms/v3/pages/site-pages/ab-test/rerun";
let payload = json!({
"variationId": "",
"abTestId": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("private-app-legacy", "{{apiKey}}".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/cms/v3/pages/site-pages/ab-test/rerun \
--header 'content-type: application/json' \
--header 'private-app-legacy: {{apiKey}}' \
--data '{
"variationId": "",
"abTestId": ""
}'
echo '{
"variationId": "",
"abTestId": ""
}' | \
http POST {{baseUrl}}/cms/v3/pages/site-pages/ab-test/rerun \
content-type:application/json \
private-app-legacy:'{{apiKey}}'
wget --quiet \
--method POST \
--header 'private-app-legacy: {{apiKey}}' \
--header 'content-type: application/json' \
--body-data '{\n "variationId": "",\n "abTestId": ""\n}' \
--output-document \
- {{baseUrl}}/cms/v3/pages/site-pages/ab-test/rerun
import Foundation
let headers = [
"private-app-legacy": "{{apiKey}}",
"content-type": "application/json"
]
let parameters = [
"variationId": "",
"abTestId": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/cms/v3/pages/site-pages/ab-test/rerun")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
*/*
RESPONSE BODY text
{
"message": "Invalid input (details will vary based on the error)",
"correlationId": "aeb5f871-7f07-4993-9211-075dc63e7cbf",
"category": "VALIDATION_ERROR",
"links": {
"knowledge-base": "https://www.hubspot.com/products/service/knowledge-base"
}
}
POST
Reset the Site Page draft to the live version
{{baseUrl}}/cms/v3/pages/site-pages/:objectId/draft/reset
HEADERS
private-app-legacy
{{apiKey}}
QUERY PARAMS
objectId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/cms/v3/pages/site-pages/:objectId/draft/reset");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "private-app-legacy: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/cms/v3/pages/site-pages/:objectId/draft/reset" {:headers {:private-app-legacy "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/cms/v3/pages/site-pages/:objectId/draft/reset"
headers = HTTP::Headers{
"private-app-legacy" => "{{apiKey}}"
}
response = HTTP::Client.post url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/cms/v3/pages/site-pages/:objectId/draft/reset"),
Headers =
{
{ "private-app-legacy", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/cms/v3/pages/site-pages/:objectId/draft/reset");
var request = new RestRequest("", Method.Post);
request.AddHeader("private-app-legacy", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/cms/v3/pages/site-pages/:objectId/draft/reset"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("private-app-legacy", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/cms/v3/pages/site-pages/:objectId/draft/reset HTTP/1.1
Private-App-Legacy: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/cms/v3/pages/site-pages/:objectId/draft/reset")
.setHeader("private-app-legacy", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/cms/v3/pages/site-pages/:objectId/draft/reset"))
.header("private-app-legacy", "{{apiKey}}")
.method("POST", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/cms/v3/pages/site-pages/:objectId/draft/reset")
.post(null)
.addHeader("private-app-legacy", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/cms/v3/pages/site-pages/:objectId/draft/reset")
.header("private-app-legacy", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/cms/v3/pages/site-pages/:objectId/draft/reset');
xhr.setRequestHeader('private-app-legacy', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/cms/v3/pages/site-pages/:objectId/draft/reset',
headers: {'private-app-legacy': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/cms/v3/pages/site-pages/:objectId/draft/reset';
const options = {method: 'POST', headers: {'private-app-legacy': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/cms/v3/pages/site-pages/:objectId/draft/reset',
method: 'POST',
headers: {
'private-app-legacy': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/cms/v3/pages/site-pages/:objectId/draft/reset")
.post(null)
.addHeader("private-app-legacy", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/cms/v3/pages/site-pages/:objectId/draft/reset',
headers: {
'private-app-legacy': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/cms/v3/pages/site-pages/:objectId/draft/reset',
headers: {'private-app-legacy': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/cms/v3/pages/site-pages/:objectId/draft/reset');
req.headers({
'private-app-legacy': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/cms/v3/pages/site-pages/:objectId/draft/reset',
headers: {'private-app-legacy': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/cms/v3/pages/site-pages/:objectId/draft/reset';
const options = {method: 'POST', headers: {'private-app-legacy': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"private-app-legacy": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/cms/v3/pages/site-pages/:objectId/draft/reset"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/cms/v3/pages/site-pages/:objectId/draft/reset" in
let headers = Header.add (Header.init ()) "private-app-legacy" "{{apiKey}}" in
Client.call ~headers `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/cms/v3/pages/site-pages/:objectId/draft/reset",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"private-app-legacy: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/cms/v3/pages/site-pages/:objectId/draft/reset', [
'headers' => [
'private-app-legacy' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/cms/v3/pages/site-pages/:objectId/draft/reset');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'private-app-legacy' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/cms/v3/pages/site-pages/:objectId/draft/reset');
$request->setRequestMethod('POST');
$request->setHeaders([
'private-app-legacy' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("private-app-legacy", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/cms/v3/pages/site-pages/:objectId/draft/reset' -Method POST -Headers $headers
$headers=@{}
$headers.Add("private-app-legacy", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/cms/v3/pages/site-pages/:objectId/draft/reset' -Method POST -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'private-app-legacy': "{{apiKey}}" }
conn.request("POST", "/baseUrl/cms/v3/pages/site-pages/:objectId/draft/reset", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/cms/v3/pages/site-pages/:objectId/draft/reset"
headers = {"private-app-legacy": "{{apiKey}}"}
response = requests.post(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/cms/v3/pages/site-pages/:objectId/draft/reset"
response <- VERB("POST", url, add_headers('private-app-legacy' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/cms/v3/pages/site-pages/:objectId/draft/reset")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["private-app-legacy"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.post('/baseUrl/cms/v3/pages/site-pages/:objectId/draft/reset') do |req|
req.headers['private-app-legacy'] = '{{apiKey}}'
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/cms/v3/pages/site-pages/:objectId/draft/reset";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("private-app-legacy", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/cms/v3/pages/site-pages/:objectId/draft/reset \
--header 'private-app-legacy: {{apiKey}}'
http POST {{baseUrl}}/cms/v3/pages/site-pages/:objectId/draft/reset \
private-app-legacy:'{{apiKey}}'
wget --quiet \
--method POST \
--header 'private-app-legacy: {{apiKey}}' \
--output-document \
- {{baseUrl}}/cms/v3/pages/site-pages/:objectId/draft/reset
import Foundation
let headers = ["private-app-legacy": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/cms/v3/pages/site-pages/:objectId/draft/reset")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
*/*
RESPONSE BODY text
{
"message": "Invalid input (details will vary based on the error)",
"correlationId": "aeb5f871-7f07-4993-9211-075dc63e7cbf",
"category": "VALIDATION_ERROR",
"links": {
"knowledge-base": "https://www.hubspot.com/products/service/knowledge-base"
}
}
POST
Restore a previous version of a Site Page, to the draft version of the Site Page
{{baseUrl}}/cms/v3/pages/site-pages/:objectId/revisions/:revisionId/restore-to-draft
HEADERS
private-app-legacy
{{apiKey}}
QUERY PARAMS
objectId
revisionId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/cms/v3/pages/site-pages/:objectId/revisions/:revisionId/restore-to-draft");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "private-app-legacy: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/cms/v3/pages/site-pages/:objectId/revisions/:revisionId/restore-to-draft" {:headers {:private-app-legacy "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/cms/v3/pages/site-pages/:objectId/revisions/:revisionId/restore-to-draft"
headers = HTTP::Headers{
"private-app-legacy" => "{{apiKey}}"
}
response = HTTP::Client.post url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/cms/v3/pages/site-pages/:objectId/revisions/:revisionId/restore-to-draft"),
Headers =
{
{ "private-app-legacy", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/cms/v3/pages/site-pages/:objectId/revisions/:revisionId/restore-to-draft");
var request = new RestRequest("", Method.Post);
request.AddHeader("private-app-legacy", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/cms/v3/pages/site-pages/:objectId/revisions/:revisionId/restore-to-draft"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("private-app-legacy", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/cms/v3/pages/site-pages/:objectId/revisions/:revisionId/restore-to-draft HTTP/1.1
Private-App-Legacy: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/cms/v3/pages/site-pages/:objectId/revisions/:revisionId/restore-to-draft")
.setHeader("private-app-legacy", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/cms/v3/pages/site-pages/:objectId/revisions/:revisionId/restore-to-draft"))
.header("private-app-legacy", "{{apiKey}}")
.method("POST", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/cms/v3/pages/site-pages/:objectId/revisions/:revisionId/restore-to-draft")
.post(null)
.addHeader("private-app-legacy", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/cms/v3/pages/site-pages/:objectId/revisions/:revisionId/restore-to-draft")
.header("private-app-legacy", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/cms/v3/pages/site-pages/:objectId/revisions/:revisionId/restore-to-draft');
xhr.setRequestHeader('private-app-legacy', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/cms/v3/pages/site-pages/:objectId/revisions/:revisionId/restore-to-draft',
headers: {'private-app-legacy': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/cms/v3/pages/site-pages/:objectId/revisions/:revisionId/restore-to-draft';
const options = {method: 'POST', headers: {'private-app-legacy': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/cms/v3/pages/site-pages/:objectId/revisions/:revisionId/restore-to-draft',
method: 'POST',
headers: {
'private-app-legacy': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/cms/v3/pages/site-pages/:objectId/revisions/:revisionId/restore-to-draft")
.post(null)
.addHeader("private-app-legacy", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/cms/v3/pages/site-pages/:objectId/revisions/:revisionId/restore-to-draft',
headers: {
'private-app-legacy': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/cms/v3/pages/site-pages/:objectId/revisions/:revisionId/restore-to-draft',
headers: {'private-app-legacy': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/cms/v3/pages/site-pages/:objectId/revisions/:revisionId/restore-to-draft');
req.headers({
'private-app-legacy': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/cms/v3/pages/site-pages/:objectId/revisions/:revisionId/restore-to-draft',
headers: {'private-app-legacy': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/cms/v3/pages/site-pages/:objectId/revisions/:revisionId/restore-to-draft';
const options = {method: 'POST', headers: {'private-app-legacy': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"private-app-legacy": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/cms/v3/pages/site-pages/:objectId/revisions/:revisionId/restore-to-draft"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/cms/v3/pages/site-pages/:objectId/revisions/:revisionId/restore-to-draft" in
let headers = Header.add (Header.init ()) "private-app-legacy" "{{apiKey}}" in
Client.call ~headers `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/cms/v3/pages/site-pages/:objectId/revisions/:revisionId/restore-to-draft",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"private-app-legacy: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/cms/v3/pages/site-pages/:objectId/revisions/:revisionId/restore-to-draft', [
'headers' => [
'private-app-legacy' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/cms/v3/pages/site-pages/:objectId/revisions/:revisionId/restore-to-draft');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'private-app-legacy' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/cms/v3/pages/site-pages/:objectId/revisions/:revisionId/restore-to-draft');
$request->setRequestMethod('POST');
$request->setHeaders([
'private-app-legacy' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("private-app-legacy", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/cms/v3/pages/site-pages/:objectId/revisions/:revisionId/restore-to-draft' -Method POST -Headers $headers
$headers=@{}
$headers.Add("private-app-legacy", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/cms/v3/pages/site-pages/:objectId/revisions/:revisionId/restore-to-draft' -Method POST -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'private-app-legacy': "{{apiKey}}" }
conn.request("POST", "/baseUrl/cms/v3/pages/site-pages/:objectId/revisions/:revisionId/restore-to-draft", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/cms/v3/pages/site-pages/:objectId/revisions/:revisionId/restore-to-draft"
headers = {"private-app-legacy": "{{apiKey}}"}
response = requests.post(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/cms/v3/pages/site-pages/:objectId/revisions/:revisionId/restore-to-draft"
response <- VERB("POST", url, add_headers('private-app-legacy' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/cms/v3/pages/site-pages/:objectId/revisions/:revisionId/restore-to-draft")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["private-app-legacy"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.post('/baseUrl/cms/v3/pages/site-pages/:objectId/revisions/:revisionId/restore-to-draft') do |req|
req.headers['private-app-legacy'] = '{{apiKey}}'
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/cms/v3/pages/site-pages/:objectId/revisions/:revisionId/restore-to-draft";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("private-app-legacy", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/cms/v3/pages/site-pages/:objectId/revisions/:revisionId/restore-to-draft \
--header 'private-app-legacy: {{apiKey}}'
http POST {{baseUrl}}/cms/v3/pages/site-pages/:objectId/revisions/:revisionId/restore-to-draft \
private-app-legacy:'{{apiKey}}'
wget --quiet \
--method POST \
--header 'private-app-legacy: {{apiKey}}' \
--output-document \
- {{baseUrl}}/cms/v3/pages/site-pages/:objectId/revisions/:revisionId/restore-to-draft
import Foundation
let headers = ["private-app-legacy": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/cms/v3/pages/site-pages/:objectId/revisions/:revisionId/restore-to-draft")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
*/*
RESPONSE BODY text
{
"message": "Invalid input (details will vary based on the error)",
"correlationId": "aeb5f871-7f07-4993-9211-075dc63e7cbf",
"category": "VALIDATION_ERROR",
"links": {
"knowledge-base": "https://www.hubspot.com/products/service/knowledge-base"
}
}
POST
Restore a previous version of a Site Page
{{baseUrl}}/cms/v3/pages/site-pages/:objectId/revisions/:revisionId/restore
HEADERS
private-app-legacy
{{apiKey}}
QUERY PARAMS
objectId
revisionId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/cms/v3/pages/site-pages/:objectId/revisions/:revisionId/restore");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "private-app-legacy: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/cms/v3/pages/site-pages/:objectId/revisions/:revisionId/restore" {:headers {:private-app-legacy "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/cms/v3/pages/site-pages/:objectId/revisions/:revisionId/restore"
headers = HTTP::Headers{
"private-app-legacy" => "{{apiKey}}"
}
response = HTTP::Client.post url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/cms/v3/pages/site-pages/:objectId/revisions/:revisionId/restore"),
Headers =
{
{ "private-app-legacy", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/cms/v3/pages/site-pages/:objectId/revisions/:revisionId/restore");
var request = new RestRequest("", Method.Post);
request.AddHeader("private-app-legacy", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/cms/v3/pages/site-pages/:objectId/revisions/:revisionId/restore"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("private-app-legacy", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/cms/v3/pages/site-pages/:objectId/revisions/:revisionId/restore HTTP/1.1
Private-App-Legacy: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/cms/v3/pages/site-pages/:objectId/revisions/:revisionId/restore")
.setHeader("private-app-legacy", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/cms/v3/pages/site-pages/:objectId/revisions/:revisionId/restore"))
.header("private-app-legacy", "{{apiKey}}")
.method("POST", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/cms/v3/pages/site-pages/:objectId/revisions/:revisionId/restore")
.post(null)
.addHeader("private-app-legacy", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/cms/v3/pages/site-pages/:objectId/revisions/:revisionId/restore")
.header("private-app-legacy", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/cms/v3/pages/site-pages/:objectId/revisions/:revisionId/restore');
xhr.setRequestHeader('private-app-legacy', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/cms/v3/pages/site-pages/:objectId/revisions/:revisionId/restore',
headers: {'private-app-legacy': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/cms/v3/pages/site-pages/:objectId/revisions/:revisionId/restore';
const options = {method: 'POST', headers: {'private-app-legacy': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/cms/v3/pages/site-pages/:objectId/revisions/:revisionId/restore',
method: 'POST',
headers: {
'private-app-legacy': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/cms/v3/pages/site-pages/:objectId/revisions/:revisionId/restore")
.post(null)
.addHeader("private-app-legacy", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/cms/v3/pages/site-pages/:objectId/revisions/:revisionId/restore',
headers: {
'private-app-legacy': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/cms/v3/pages/site-pages/:objectId/revisions/:revisionId/restore',
headers: {'private-app-legacy': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/cms/v3/pages/site-pages/:objectId/revisions/:revisionId/restore');
req.headers({
'private-app-legacy': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/cms/v3/pages/site-pages/:objectId/revisions/:revisionId/restore',
headers: {'private-app-legacy': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/cms/v3/pages/site-pages/:objectId/revisions/:revisionId/restore';
const options = {method: 'POST', headers: {'private-app-legacy': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"private-app-legacy": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/cms/v3/pages/site-pages/:objectId/revisions/:revisionId/restore"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/cms/v3/pages/site-pages/:objectId/revisions/:revisionId/restore" in
let headers = Header.add (Header.init ()) "private-app-legacy" "{{apiKey}}" in
Client.call ~headers `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/cms/v3/pages/site-pages/:objectId/revisions/:revisionId/restore",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"private-app-legacy: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/cms/v3/pages/site-pages/:objectId/revisions/:revisionId/restore', [
'headers' => [
'private-app-legacy' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/cms/v3/pages/site-pages/:objectId/revisions/:revisionId/restore');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'private-app-legacy' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/cms/v3/pages/site-pages/:objectId/revisions/:revisionId/restore');
$request->setRequestMethod('POST');
$request->setHeaders([
'private-app-legacy' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("private-app-legacy", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/cms/v3/pages/site-pages/:objectId/revisions/:revisionId/restore' -Method POST -Headers $headers
$headers=@{}
$headers.Add("private-app-legacy", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/cms/v3/pages/site-pages/:objectId/revisions/:revisionId/restore' -Method POST -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'private-app-legacy': "{{apiKey}}" }
conn.request("POST", "/baseUrl/cms/v3/pages/site-pages/:objectId/revisions/:revisionId/restore", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/cms/v3/pages/site-pages/:objectId/revisions/:revisionId/restore"
headers = {"private-app-legacy": "{{apiKey}}"}
response = requests.post(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/cms/v3/pages/site-pages/:objectId/revisions/:revisionId/restore"
response <- VERB("POST", url, add_headers('private-app-legacy' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/cms/v3/pages/site-pages/:objectId/revisions/:revisionId/restore")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["private-app-legacy"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.post('/baseUrl/cms/v3/pages/site-pages/:objectId/revisions/:revisionId/restore') do |req|
req.headers['private-app-legacy'] = '{{apiKey}}'
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/cms/v3/pages/site-pages/:objectId/revisions/:revisionId/restore";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("private-app-legacy", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/cms/v3/pages/site-pages/:objectId/revisions/:revisionId/restore \
--header 'private-app-legacy: {{apiKey}}'
http POST {{baseUrl}}/cms/v3/pages/site-pages/:objectId/revisions/:revisionId/restore \
private-app-legacy:'{{apiKey}}'
wget --quiet \
--method POST \
--header 'private-app-legacy: {{apiKey}}' \
--output-document \
- {{baseUrl}}/cms/v3/pages/site-pages/:objectId/revisions/:revisionId/restore
import Foundation
let headers = ["private-app-legacy": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/cms/v3/pages/site-pages/:objectId/revisions/:revisionId/restore")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
*/*
RESPONSE BODY text
{
"message": "Invalid input (details will vary based on the error)",
"correlationId": "aeb5f871-7f07-4993-9211-075dc63e7cbf",
"category": "VALIDATION_ERROR",
"links": {
"knowledge-base": "https://www.hubspot.com/products/service/knowledge-base"
}
}
GET
Retrieve a Site Page
{{baseUrl}}/cms/v3/pages/site-pages/:objectId
HEADERS
private-app-legacy
{{apiKey}}
QUERY PARAMS
objectId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/cms/v3/pages/site-pages/:objectId");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "private-app-legacy: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/cms/v3/pages/site-pages/:objectId" {:headers {:private-app-legacy "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/cms/v3/pages/site-pages/:objectId"
headers = HTTP::Headers{
"private-app-legacy" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/cms/v3/pages/site-pages/:objectId"),
Headers =
{
{ "private-app-legacy", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/cms/v3/pages/site-pages/:objectId");
var request = new RestRequest("", Method.Get);
request.AddHeader("private-app-legacy", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/cms/v3/pages/site-pages/:objectId"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("private-app-legacy", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/cms/v3/pages/site-pages/:objectId HTTP/1.1
Private-App-Legacy: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/cms/v3/pages/site-pages/:objectId")
.setHeader("private-app-legacy", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/cms/v3/pages/site-pages/:objectId"))
.header("private-app-legacy", "{{apiKey}}")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/cms/v3/pages/site-pages/:objectId")
.get()
.addHeader("private-app-legacy", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/cms/v3/pages/site-pages/:objectId")
.header("private-app-legacy", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/cms/v3/pages/site-pages/:objectId');
xhr.setRequestHeader('private-app-legacy', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/cms/v3/pages/site-pages/:objectId',
headers: {'private-app-legacy': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/cms/v3/pages/site-pages/:objectId';
const options = {method: 'GET', headers: {'private-app-legacy': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/cms/v3/pages/site-pages/:objectId',
method: 'GET',
headers: {
'private-app-legacy': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/cms/v3/pages/site-pages/:objectId")
.get()
.addHeader("private-app-legacy", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/cms/v3/pages/site-pages/:objectId',
headers: {
'private-app-legacy': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/cms/v3/pages/site-pages/:objectId',
headers: {'private-app-legacy': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/cms/v3/pages/site-pages/:objectId');
req.headers({
'private-app-legacy': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/cms/v3/pages/site-pages/:objectId',
headers: {'private-app-legacy': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/cms/v3/pages/site-pages/:objectId';
const options = {method: 'GET', headers: {'private-app-legacy': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"private-app-legacy": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/cms/v3/pages/site-pages/:objectId"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/cms/v3/pages/site-pages/:objectId" in
let headers = Header.add (Header.init ()) "private-app-legacy" "{{apiKey}}" in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/cms/v3/pages/site-pages/:objectId",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"private-app-legacy: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/cms/v3/pages/site-pages/:objectId', [
'headers' => [
'private-app-legacy' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/cms/v3/pages/site-pages/:objectId');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders([
'private-app-legacy' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/cms/v3/pages/site-pages/:objectId');
$request->setRequestMethod('GET');
$request->setHeaders([
'private-app-legacy' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("private-app-legacy", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/cms/v3/pages/site-pages/:objectId' -Method GET -Headers $headers
$headers=@{}
$headers.Add("private-app-legacy", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/cms/v3/pages/site-pages/:objectId' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'private-app-legacy': "{{apiKey}}" }
conn.request("GET", "/baseUrl/cms/v3/pages/site-pages/:objectId", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/cms/v3/pages/site-pages/:objectId"
headers = {"private-app-legacy": "{{apiKey}}"}
response = requests.get(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/cms/v3/pages/site-pages/:objectId"
response <- VERB("GET", url, add_headers('private-app-legacy' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/cms/v3/pages/site-pages/:objectId")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["private-app-legacy"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/cms/v3/pages/site-pages/:objectId') do |req|
req.headers['private-app-legacy'] = '{{apiKey}}'
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/cms/v3/pages/site-pages/:objectId";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("private-app-legacy", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/cms/v3/pages/site-pages/:objectId \
--header 'private-app-legacy: {{apiKey}}'
http GET {{baseUrl}}/cms/v3/pages/site-pages/:objectId \
private-app-legacy:'{{apiKey}}'
wget --quiet \
--method GET \
--header 'private-app-legacy: {{apiKey}}' \
--output-document \
- {{baseUrl}}/cms/v3/pages/site-pages/:objectId
import Foundation
let headers = ["private-app-legacy": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/cms/v3/pages/site-pages/:objectId")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
*/*
RESPONSE BODY text
{
"message": "Invalid input (details will vary based on the error)",
"correlationId": "aeb5f871-7f07-4993-9211-075dc63e7cbf",
"category": "VALIDATION_ERROR",
"links": {
"knowledge-base": "https://www.hubspot.com/products/service/knowledge-base"
}
}
POST
Retrieve a batch of Site Pages
{{baseUrl}}/cms/v3/pages/site-pages/batch/read
HEADERS
private-app-legacy
{{apiKey}}
BODY json
{
"inputs": []
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/cms/v3/pages/site-pages/batch/read");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "private-app-legacy: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"inputs\": []\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/cms/v3/pages/site-pages/batch/read" {:headers {:private-app-legacy "{{apiKey}}"}
:content-type :json
:form-params {:inputs []}})
require "http/client"
url = "{{baseUrl}}/cms/v3/pages/site-pages/batch/read"
headers = HTTP::Headers{
"private-app-legacy" => "{{apiKey}}"
"content-type" => "application/json"
}
reqBody = "{\n \"inputs\": []\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/cms/v3/pages/site-pages/batch/read"),
Headers =
{
{ "private-app-legacy", "{{apiKey}}" },
},
Content = new StringContent("{\n \"inputs\": []\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/cms/v3/pages/site-pages/batch/read");
var request = new RestRequest("", Method.Post);
request.AddHeader("private-app-legacy", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"inputs\": []\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/cms/v3/pages/site-pages/batch/read"
payload := strings.NewReader("{\n \"inputs\": []\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("private-app-legacy", "{{apiKey}}")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/cms/v3/pages/site-pages/batch/read HTTP/1.1
Private-App-Legacy: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 18
{
"inputs": []
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/cms/v3/pages/site-pages/batch/read")
.setHeader("private-app-legacy", "{{apiKey}}")
.setHeader("content-type", "application/json")
.setBody("{\n \"inputs\": []\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/cms/v3/pages/site-pages/batch/read"))
.header("private-app-legacy", "{{apiKey}}")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"inputs\": []\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"inputs\": []\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/cms/v3/pages/site-pages/batch/read")
.post(body)
.addHeader("private-app-legacy", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/cms/v3/pages/site-pages/batch/read")
.header("private-app-legacy", "{{apiKey}}")
.header("content-type", "application/json")
.body("{\n \"inputs\": []\n}")
.asString();
const data = JSON.stringify({
inputs: []
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/cms/v3/pages/site-pages/batch/read');
xhr.setRequestHeader('private-app-legacy', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/cms/v3/pages/site-pages/batch/read',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
data: {inputs: []}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/cms/v3/pages/site-pages/batch/read';
const options = {
method: 'POST',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
body: '{"inputs":[]}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/cms/v3/pages/site-pages/batch/read',
method: 'POST',
headers: {
'private-app-legacy': '{{apiKey}}',
'content-type': 'application/json'
},
processData: false,
data: '{\n "inputs": []\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"inputs\": []\n}")
val request = Request.Builder()
.url("{{baseUrl}}/cms/v3/pages/site-pages/batch/read")
.post(body)
.addHeader("private-app-legacy", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/cms/v3/pages/site-pages/batch/read',
headers: {
'private-app-legacy': '{{apiKey}}',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({inputs: []}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/cms/v3/pages/site-pages/batch/read',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
body: {inputs: []},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/cms/v3/pages/site-pages/batch/read');
req.headers({
'private-app-legacy': '{{apiKey}}',
'content-type': 'application/json'
});
req.type('json');
req.send({
inputs: []
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/cms/v3/pages/site-pages/batch/read',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
data: {inputs: []}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/cms/v3/pages/site-pages/batch/read';
const options = {
method: 'POST',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
body: '{"inputs":[]}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"private-app-legacy": @"{{apiKey}}",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"inputs": @[ ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/cms/v3/pages/site-pages/batch/read"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/cms/v3/pages/site-pages/batch/read" in
let headers = Header.add_list (Header.init ()) [
("private-app-legacy", "{{apiKey}}");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"inputs\": []\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/cms/v3/pages/site-pages/batch/read",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'inputs' => [
]
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"private-app-legacy: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/cms/v3/pages/site-pages/batch/read', [
'body' => '{
"inputs": []
}',
'headers' => [
'content-type' => 'application/json',
'private-app-legacy' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/cms/v3/pages/site-pages/batch/read');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'private-app-legacy' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'inputs' => [
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'inputs' => [
]
]));
$request->setRequestUrl('{{baseUrl}}/cms/v3/pages/site-pages/batch/read');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'private-app-legacy' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("private-app-legacy", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/cms/v3/pages/site-pages/batch/read' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"inputs": []
}'
$headers=@{}
$headers.Add("private-app-legacy", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/cms/v3/pages/site-pages/batch/read' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"inputs": []
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"inputs\": []\n}"
headers = {
'private-app-legacy': "{{apiKey}}",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/cms/v3/pages/site-pages/batch/read", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/cms/v3/pages/site-pages/batch/read"
payload = { "inputs": [] }
headers = {
"private-app-legacy": "{{apiKey}}",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/cms/v3/pages/site-pages/batch/read"
payload <- "{\n \"inputs\": []\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('private-app-legacy' = '{{apiKey}}'), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/cms/v3/pages/site-pages/batch/read")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["private-app-legacy"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n \"inputs\": []\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/cms/v3/pages/site-pages/batch/read') do |req|
req.headers['private-app-legacy'] = '{{apiKey}}'
req.body = "{\n \"inputs\": []\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/cms/v3/pages/site-pages/batch/read";
let payload = json!({"inputs": ()});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("private-app-legacy", "{{apiKey}}".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/cms/v3/pages/site-pages/batch/read \
--header 'content-type: application/json' \
--header 'private-app-legacy: {{apiKey}}' \
--data '{
"inputs": []
}'
echo '{
"inputs": []
}' | \
http POST {{baseUrl}}/cms/v3/pages/site-pages/batch/read \
content-type:application/json \
private-app-legacy:'{{apiKey}}'
wget --quiet \
--method POST \
--header 'private-app-legacy: {{apiKey}}' \
--header 'content-type: application/json' \
--body-data '{\n "inputs": []\n}' \
--output-document \
- {{baseUrl}}/cms/v3/pages/site-pages/batch/read
import Foundation
let headers = [
"private-app-legacy": "{{apiKey}}",
"content-type": "application/json"
]
let parameters = ["inputs": []] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/cms/v3/pages/site-pages/batch/read")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
*/*
RESPONSE BODY text
{
"message": "Invalid input (details will vary based on the error)",
"correlationId": "aeb5f871-7f07-4993-9211-075dc63e7cbf",
"category": "VALIDATION_ERROR",
"links": {
"knowledge-base": "https://www.hubspot.com/products/service/knowledge-base"
}
}
GET
Retrieve the full draft version of the Site Page
{{baseUrl}}/cms/v3/pages/site-pages/:objectId/draft
HEADERS
private-app-legacy
{{apiKey}}
QUERY PARAMS
objectId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/cms/v3/pages/site-pages/:objectId/draft");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "private-app-legacy: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/cms/v3/pages/site-pages/:objectId/draft" {:headers {:private-app-legacy "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/cms/v3/pages/site-pages/:objectId/draft"
headers = HTTP::Headers{
"private-app-legacy" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/cms/v3/pages/site-pages/:objectId/draft"),
Headers =
{
{ "private-app-legacy", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/cms/v3/pages/site-pages/:objectId/draft");
var request = new RestRequest("", Method.Get);
request.AddHeader("private-app-legacy", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/cms/v3/pages/site-pages/:objectId/draft"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("private-app-legacy", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/cms/v3/pages/site-pages/:objectId/draft HTTP/1.1
Private-App-Legacy: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/cms/v3/pages/site-pages/:objectId/draft")
.setHeader("private-app-legacy", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/cms/v3/pages/site-pages/:objectId/draft"))
.header("private-app-legacy", "{{apiKey}}")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/cms/v3/pages/site-pages/:objectId/draft")
.get()
.addHeader("private-app-legacy", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/cms/v3/pages/site-pages/:objectId/draft")
.header("private-app-legacy", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/cms/v3/pages/site-pages/:objectId/draft');
xhr.setRequestHeader('private-app-legacy', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/cms/v3/pages/site-pages/:objectId/draft',
headers: {'private-app-legacy': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/cms/v3/pages/site-pages/:objectId/draft';
const options = {method: 'GET', headers: {'private-app-legacy': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/cms/v3/pages/site-pages/:objectId/draft',
method: 'GET',
headers: {
'private-app-legacy': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/cms/v3/pages/site-pages/:objectId/draft")
.get()
.addHeader("private-app-legacy", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/cms/v3/pages/site-pages/:objectId/draft',
headers: {
'private-app-legacy': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/cms/v3/pages/site-pages/:objectId/draft',
headers: {'private-app-legacy': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/cms/v3/pages/site-pages/:objectId/draft');
req.headers({
'private-app-legacy': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/cms/v3/pages/site-pages/:objectId/draft',
headers: {'private-app-legacy': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/cms/v3/pages/site-pages/:objectId/draft';
const options = {method: 'GET', headers: {'private-app-legacy': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"private-app-legacy": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/cms/v3/pages/site-pages/:objectId/draft"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/cms/v3/pages/site-pages/:objectId/draft" in
let headers = Header.add (Header.init ()) "private-app-legacy" "{{apiKey}}" in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/cms/v3/pages/site-pages/:objectId/draft",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"private-app-legacy: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/cms/v3/pages/site-pages/:objectId/draft', [
'headers' => [
'private-app-legacy' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/cms/v3/pages/site-pages/:objectId/draft');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders([
'private-app-legacy' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/cms/v3/pages/site-pages/:objectId/draft');
$request->setRequestMethod('GET');
$request->setHeaders([
'private-app-legacy' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("private-app-legacy", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/cms/v3/pages/site-pages/:objectId/draft' -Method GET -Headers $headers
$headers=@{}
$headers.Add("private-app-legacy", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/cms/v3/pages/site-pages/:objectId/draft' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'private-app-legacy': "{{apiKey}}" }
conn.request("GET", "/baseUrl/cms/v3/pages/site-pages/:objectId/draft", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/cms/v3/pages/site-pages/:objectId/draft"
headers = {"private-app-legacy": "{{apiKey}}"}
response = requests.get(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/cms/v3/pages/site-pages/:objectId/draft"
response <- VERB("GET", url, add_headers('private-app-legacy' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/cms/v3/pages/site-pages/:objectId/draft")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["private-app-legacy"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/cms/v3/pages/site-pages/:objectId/draft') do |req|
req.headers['private-app-legacy'] = '{{apiKey}}'
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/cms/v3/pages/site-pages/:objectId/draft";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("private-app-legacy", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/cms/v3/pages/site-pages/:objectId/draft \
--header 'private-app-legacy: {{apiKey}}'
http GET {{baseUrl}}/cms/v3/pages/site-pages/:objectId/draft \
private-app-legacy:'{{apiKey}}'
wget --quiet \
--method GET \
--header 'private-app-legacy: {{apiKey}}' \
--output-document \
- {{baseUrl}}/cms/v3/pages/site-pages/:objectId/draft
import Foundation
let headers = ["private-app-legacy": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/cms/v3/pages/site-pages/:objectId/draft")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
*/*
RESPONSE BODY text
{
"message": "Invalid input (details will vary based on the error)",
"correlationId": "aeb5f871-7f07-4993-9211-075dc63e7cbf",
"category": "VALIDATION_ERROR",
"links": {
"knowledge-base": "https://www.hubspot.com/products/service/knowledge-base"
}
}
GET
Retrieves a previous version of a Site Page
{{baseUrl}}/cms/v3/pages/site-pages/:objectId/revisions/:revisionId
HEADERS
private-app-legacy
{{apiKey}}
QUERY PARAMS
objectId
revisionId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/cms/v3/pages/site-pages/:objectId/revisions/:revisionId");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "private-app-legacy: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/cms/v3/pages/site-pages/:objectId/revisions/:revisionId" {:headers {:private-app-legacy "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/cms/v3/pages/site-pages/:objectId/revisions/:revisionId"
headers = HTTP::Headers{
"private-app-legacy" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/cms/v3/pages/site-pages/:objectId/revisions/:revisionId"),
Headers =
{
{ "private-app-legacy", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/cms/v3/pages/site-pages/:objectId/revisions/:revisionId");
var request = new RestRequest("", Method.Get);
request.AddHeader("private-app-legacy", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/cms/v3/pages/site-pages/:objectId/revisions/:revisionId"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("private-app-legacy", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/cms/v3/pages/site-pages/:objectId/revisions/:revisionId HTTP/1.1
Private-App-Legacy: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/cms/v3/pages/site-pages/:objectId/revisions/:revisionId")
.setHeader("private-app-legacy", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/cms/v3/pages/site-pages/:objectId/revisions/:revisionId"))
.header("private-app-legacy", "{{apiKey}}")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/cms/v3/pages/site-pages/:objectId/revisions/:revisionId")
.get()
.addHeader("private-app-legacy", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/cms/v3/pages/site-pages/:objectId/revisions/:revisionId")
.header("private-app-legacy", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/cms/v3/pages/site-pages/:objectId/revisions/:revisionId');
xhr.setRequestHeader('private-app-legacy', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/cms/v3/pages/site-pages/:objectId/revisions/:revisionId',
headers: {'private-app-legacy': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/cms/v3/pages/site-pages/:objectId/revisions/:revisionId';
const options = {method: 'GET', headers: {'private-app-legacy': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/cms/v3/pages/site-pages/:objectId/revisions/:revisionId',
method: 'GET',
headers: {
'private-app-legacy': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/cms/v3/pages/site-pages/:objectId/revisions/:revisionId")
.get()
.addHeader("private-app-legacy", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/cms/v3/pages/site-pages/:objectId/revisions/:revisionId',
headers: {
'private-app-legacy': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/cms/v3/pages/site-pages/:objectId/revisions/:revisionId',
headers: {'private-app-legacy': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/cms/v3/pages/site-pages/:objectId/revisions/:revisionId');
req.headers({
'private-app-legacy': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/cms/v3/pages/site-pages/:objectId/revisions/:revisionId',
headers: {'private-app-legacy': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/cms/v3/pages/site-pages/:objectId/revisions/:revisionId';
const options = {method: 'GET', headers: {'private-app-legacy': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"private-app-legacy": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/cms/v3/pages/site-pages/:objectId/revisions/:revisionId"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/cms/v3/pages/site-pages/:objectId/revisions/:revisionId" in
let headers = Header.add (Header.init ()) "private-app-legacy" "{{apiKey}}" in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/cms/v3/pages/site-pages/:objectId/revisions/:revisionId",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"private-app-legacy: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/cms/v3/pages/site-pages/:objectId/revisions/:revisionId', [
'headers' => [
'private-app-legacy' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/cms/v3/pages/site-pages/:objectId/revisions/:revisionId');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders([
'private-app-legacy' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/cms/v3/pages/site-pages/:objectId/revisions/:revisionId');
$request->setRequestMethod('GET');
$request->setHeaders([
'private-app-legacy' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("private-app-legacy", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/cms/v3/pages/site-pages/:objectId/revisions/:revisionId' -Method GET -Headers $headers
$headers=@{}
$headers.Add("private-app-legacy", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/cms/v3/pages/site-pages/:objectId/revisions/:revisionId' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'private-app-legacy': "{{apiKey}}" }
conn.request("GET", "/baseUrl/cms/v3/pages/site-pages/:objectId/revisions/:revisionId", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/cms/v3/pages/site-pages/:objectId/revisions/:revisionId"
headers = {"private-app-legacy": "{{apiKey}}"}
response = requests.get(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/cms/v3/pages/site-pages/:objectId/revisions/:revisionId"
response <- VERB("GET", url, add_headers('private-app-legacy' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/cms/v3/pages/site-pages/:objectId/revisions/:revisionId")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["private-app-legacy"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/cms/v3/pages/site-pages/:objectId/revisions/:revisionId') do |req|
req.headers['private-app-legacy'] = '{{apiKey}}'
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/cms/v3/pages/site-pages/:objectId/revisions/:revisionId";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("private-app-legacy", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/cms/v3/pages/site-pages/:objectId/revisions/:revisionId \
--header 'private-app-legacy: {{apiKey}}'
http GET {{baseUrl}}/cms/v3/pages/site-pages/:objectId/revisions/:revisionId \
private-app-legacy:'{{apiKey}}'
wget --quiet \
--method GET \
--header 'private-app-legacy: {{apiKey}}' \
--output-document \
- {{baseUrl}}/cms/v3/pages/site-pages/:objectId/revisions/:revisionId
import Foundation
let headers = ["private-app-legacy": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/cms/v3/pages/site-pages/:objectId/revisions/:revisionId")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
*/*
RESPONSE BODY text
{
"message": "Invalid input (details will vary based on the error)",
"correlationId": "aeb5f871-7f07-4993-9211-075dc63e7cbf",
"category": "VALIDATION_ERROR",
"links": {
"knowledge-base": "https://www.hubspot.com/products/service/knowledge-base"
}
}
GET
Retrieves all the previous versions of a Site Page
{{baseUrl}}/cms/v3/pages/site-pages/:objectId/revisions
HEADERS
private-app-legacy
{{apiKey}}
QUERY PARAMS
objectId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/cms/v3/pages/site-pages/:objectId/revisions");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "private-app-legacy: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/cms/v3/pages/site-pages/:objectId/revisions" {:headers {:private-app-legacy "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/cms/v3/pages/site-pages/:objectId/revisions"
headers = HTTP::Headers{
"private-app-legacy" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/cms/v3/pages/site-pages/:objectId/revisions"),
Headers =
{
{ "private-app-legacy", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/cms/v3/pages/site-pages/:objectId/revisions");
var request = new RestRequest("", Method.Get);
request.AddHeader("private-app-legacy", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/cms/v3/pages/site-pages/:objectId/revisions"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("private-app-legacy", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/cms/v3/pages/site-pages/:objectId/revisions HTTP/1.1
Private-App-Legacy: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/cms/v3/pages/site-pages/:objectId/revisions")
.setHeader("private-app-legacy", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/cms/v3/pages/site-pages/:objectId/revisions"))
.header("private-app-legacy", "{{apiKey}}")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/cms/v3/pages/site-pages/:objectId/revisions")
.get()
.addHeader("private-app-legacy", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/cms/v3/pages/site-pages/:objectId/revisions")
.header("private-app-legacy", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/cms/v3/pages/site-pages/:objectId/revisions');
xhr.setRequestHeader('private-app-legacy', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/cms/v3/pages/site-pages/:objectId/revisions',
headers: {'private-app-legacy': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/cms/v3/pages/site-pages/:objectId/revisions';
const options = {method: 'GET', headers: {'private-app-legacy': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/cms/v3/pages/site-pages/:objectId/revisions',
method: 'GET',
headers: {
'private-app-legacy': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/cms/v3/pages/site-pages/:objectId/revisions")
.get()
.addHeader("private-app-legacy", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/cms/v3/pages/site-pages/:objectId/revisions',
headers: {
'private-app-legacy': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/cms/v3/pages/site-pages/:objectId/revisions',
headers: {'private-app-legacy': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/cms/v3/pages/site-pages/:objectId/revisions');
req.headers({
'private-app-legacy': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/cms/v3/pages/site-pages/:objectId/revisions',
headers: {'private-app-legacy': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/cms/v3/pages/site-pages/:objectId/revisions';
const options = {method: 'GET', headers: {'private-app-legacy': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"private-app-legacy": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/cms/v3/pages/site-pages/:objectId/revisions"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/cms/v3/pages/site-pages/:objectId/revisions" in
let headers = Header.add (Header.init ()) "private-app-legacy" "{{apiKey}}" in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/cms/v3/pages/site-pages/:objectId/revisions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"private-app-legacy: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/cms/v3/pages/site-pages/:objectId/revisions', [
'headers' => [
'private-app-legacy' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/cms/v3/pages/site-pages/:objectId/revisions');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders([
'private-app-legacy' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/cms/v3/pages/site-pages/:objectId/revisions');
$request->setRequestMethod('GET');
$request->setHeaders([
'private-app-legacy' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("private-app-legacy", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/cms/v3/pages/site-pages/:objectId/revisions' -Method GET -Headers $headers
$headers=@{}
$headers.Add("private-app-legacy", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/cms/v3/pages/site-pages/:objectId/revisions' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'private-app-legacy': "{{apiKey}}" }
conn.request("GET", "/baseUrl/cms/v3/pages/site-pages/:objectId/revisions", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/cms/v3/pages/site-pages/:objectId/revisions"
headers = {"private-app-legacy": "{{apiKey}}"}
response = requests.get(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/cms/v3/pages/site-pages/:objectId/revisions"
response <- VERB("GET", url, add_headers('private-app-legacy' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/cms/v3/pages/site-pages/:objectId/revisions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["private-app-legacy"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/cms/v3/pages/site-pages/:objectId/revisions') do |req|
req.headers['private-app-legacy'] = '{{apiKey}}'
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/cms/v3/pages/site-pages/:objectId/revisions";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("private-app-legacy", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/cms/v3/pages/site-pages/:objectId/revisions \
--header 'private-app-legacy: {{apiKey}}'
http GET {{baseUrl}}/cms/v3/pages/site-pages/:objectId/revisions \
private-app-legacy:'{{apiKey}}'
wget --quiet \
--method GET \
--header 'private-app-legacy: {{apiKey}}' \
--output-document \
- {{baseUrl}}/cms/v3/pages/site-pages/:objectId/revisions
import Foundation
let headers = ["private-app-legacy": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/cms/v3/pages/site-pages/:objectId/revisions")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
*/*
RESPONSE BODY text
{
"message": "Invalid input (details will vary based on the error)",
"correlationId": "aeb5f871-7f07-4993-9211-075dc63e7cbf",
"category": "VALIDATION_ERROR",
"links": {
"knowledge-base": "https://www.hubspot.com/products/service/knowledge-base"
}
}
POST
Schedule a Site Page to be Published
{{baseUrl}}/cms/v3/pages/site-pages/schedule
HEADERS
private-app-legacy
{{apiKey}}
BODY json
{
"publishDate": "",
"id": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/cms/v3/pages/site-pages/schedule");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "private-app-legacy: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"publishDate\": \"\",\n \"id\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/cms/v3/pages/site-pages/schedule" {:headers {:private-app-legacy "{{apiKey}}"}
:content-type :json
:form-params {:publishDate ""
:id ""}})
require "http/client"
url = "{{baseUrl}}/cms/v3/pages/site-pages/schedule"
headers = HTTP::Headers{
"private-app-legacy" => "{{apiKey}}"
"content-type" => "application/json"
}
reqBody = "{\n \"publishDate\": \"\",\n \"id\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/cms/v3/pages/site-pages/schedule"),
Headers =
{
{ "private-app-legacy", "{{apiKey}}" },
},
Content = new StringContent("{\n \"publishDate\": \"\",\n \"id\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/cms/v3/pages/site-pages/schedule");
var request = new RestRequest("", Method.Post);
request.AddHeader("private-app-legacy", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"publishDate\": \"\",\n \"id\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/cms/v3/pages/site-pages/schedule"
payload := strings.NewReader("{\n \"publishDate\": \"\",\n \"id\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("private-app-legacy", "{{apiKey}}")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/cms/v3/pages/site-pages/schedule HTTP/1.1
Private-App-Legacy: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 35
{
"publishDate": "",
"id": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/cms/v3/pages/site-pages/schedule")
.setHeader("private-app-legacy", "{{apiKey}}")
.setHeader("content-type", "application/json")
.setBody("{\n \"publishDate\": \"\",\n \"id\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/cms/v3/pages/site-pages/schedule"))
.header("private-app-legacy", "{{apiKey}}")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"publishDate\": \"\",\n \"id\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"publishDate\": \"\",\n \"id\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/cms/v3/pages/site-pages/schedule")
.post(body)
.addHeader("private-app-legacy", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/cms/v3/pages/site-pages/schedule")
.header("private-app-legacy", "{{apiKey}}")
.header("content-type", "application/json")
.body("{\n \"publishDate\": \"\",\n \"id\": \"\"\n}")
.asString();
const data = JSON.stringify({
publishDate: '',
id: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/cms/v3/pages/site-pages/schedule');
xhr.setRequestHeader('private-app-legacy', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/cms/v3/pages/site-pages/schedule',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
data: {publishDate: '', id: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/cms/v3/pages/site-pages/schedule';
const options = {
method: 'POST',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
body: '{"publishDate":"","id":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/cms/v3/pages/site-pages/schedule',
method: 'POST',
headers: {
'private-app-legacy': '{{apiKey}}',
'content-type': 'application/json'
},
processData: false,
data: '{\n "publishDate": "",\n "id": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"publishDate\": \"\",\n \"id\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/cms/v3/pages/site-pages/schedule")
.post(body)
.addHeader("private-app-legacy", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/cms/v3/pages/site-pages/schedule',
headers: {
'private-app-legacy': '{{apiKey}}',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({publishDate: '', id: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/cms/v3/pages/site-pages/schedule',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
body: {publishDate: '', id: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/cms/v3/pages/site-pages/schedule');
req.headers({
'private-app-legacy': '{{apiKey}}',
'content-type': 'application/json'
});
req.type('json');
req.send({
publishDate: '',
id: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/cms/v3/pages/site-pages/schedule',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
data: {publishDate: '', id: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/cms/v3/pages/site-pages/schedule';
const options = {
method: 'POST',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
body: '{"publishDate":"","id":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"private-app-legacy": @"{{apiKey}}",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"publishDate": @"",
@"id": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/cms/v3/pages/site-pages/schedule"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/cms/v3/pages/site-pages/schedule" in
let headers = Header.add_list (Header.init ()) [
("private-app-legacy", "{{apiKey}}");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"publishDate\": \"\",\n \"id\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/cms/v3/pages/site-pages/schedule",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'publishDate' => '',
'id' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"private-app-legacy: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/cms/v3/pages/site-pages/schedule', [
'body' => '{
"publishDate": "",
"id": ""
}',
'headers' => [
'content-type' => 'application/json',
'private-app-legacy' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/cms/v3/pages/site-pages/schedule');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'private-app-legacy' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'publishDate' => '',
'id' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'publishDate' => '',
'id' => ''
]));
$request->setRequestUrl('{{baseUrl}}/cms/v3/pages/site-pages/schedule');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'private-app-legacy' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("private-app-legacy", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/cms/v3/pages/site-pages/schedule' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"publishDate": "",
"id": ""
}'
$headers=@{}
$headers.Add("private-app-legacy", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/cms/v3/pages/site-pages/schedule' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"publishDate": "",
"id": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"publishDate\": \"\",\n \"id\": \"\"\n}"
headers = {
'private-app-legacy': "{{apiKey}}",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/cms/v3/pages/site-pages/schedule", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/cms/v3/pages/site-pages/schedule"
payload = {
"publishDate": "",
"id": ""
}
headers = {
"private-app-legacy": "{{apiKey}}",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/cms/v3/pages/site-pages/schedule"
payload <- "{\n \"publishDate\": \"\",\n \"id\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('private-app-legacy' = '{{apiKey}}'), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/cms/v3/pages/site-pages/schedule")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["private-app-legacy"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n \"publishDate\": \"\",\n \"id\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/cms/v3/pages/site-pages/schedule') do |req|
req.headers['private-app-legacy'] = '{{apiKey}}'
req.body = "{\n \"publishDate\": \"\",\n \"id\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/cms/v3/pages/site-pages/schedule";
let payload = json!({
"publishDate": "",
"id": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("private-app-legacy", "{{apiKey}}".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/cms/v3/pages/site-pages/schedule \
--header 'content-type: application/json' \
--header 'private-app-legacy: {{apiKey}}' \
--data '{
"publishDate": "",
"id": ""
}'
echo '{
"publishDate": "",
"id": ""
}' | \
http POST {{baseUrl}}/cms/v3/pages/site-pages/schedule \
content-type:application/json \
private-app-legacy:'{{apiKey}}'
wget --quiet \
--method POST \
--header 'private-app-legacy: {{apiKey}}' \
--header 'content-type: application/json' \
--body-data '{\n "publishDate": "",\n "id": ""\n}' \
--output-document \
- {{baseUrl}}/cms/v3/pages/site-pages/schedule
import Foundation
let headers = [
"private-app-legacy": "{{apiKey}}",
"content-type": "application/json"
]
let parameters = [
"publishDate": "",
"id": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/cms/v3/pages/site-pages/schedule")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
*/*
RESPONSE BODY text
{
"message": "Invalid input (details will vary based on the error)",
"correlationId": "aeb5f871-7f07-4993-9211-075dc63e7cbf",
"category": "VALIDATION_ERROR",
"links": {
"knowledge-base": "https://www.hubspot.com/products/service/knowledge-base"
}
}
PUT
Set a new primary language
{{baseUrl}}/cms/v3/pages/site-pages/multi-language/set-new-lang-primary
HEADERS
private-app-legacy
{{apiKey}}
BODY json
{
"id": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/cms/v3/pages/site-pages/multi-language/set-new-lang-primary");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "private-app-legacy: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"id\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/cms/v3/pages/site-pages/multi-language/set-new-lang-primary" {:headers {:private-app-legacy "{{apiKey}}"}
:content-type :json
:form-params {:id ""}})
require "http/client"
url = "{{baseUrl}}/cms/v3/pages/site-pages/multi-language/set-new-lang-primary"
headers = HTTP::Headers{
"private-app-legacy" => "{{apiKey}}"
"content-type" => "application/json"
}
reqBody = "{\n \"id\": \"\"\n}"
response = HTTP::Client.put url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Put,
RequestUri = new Uri("{{baseUrl}}/cms/v3/pages/site-pages/multi-language/set-new-lang-primary"),
Headers =
{
{ "private-app-legacy", "{{apiKey}}" },
},
Content = new StringContent("{\n \"id\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/cms/v3/pages/site-pages/multi-language/set-new-lang-primary");
var request = new RestRequest("", Method.Put);
request.AddHeader("private-app-legacy", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"id\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/cms/v3/pages/site-pages/multi-language/set-new-lang-primary"
payload := strings.NewReader("{\n \"id\": \"\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("private-app-legacy", "{{apiKey}}")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PUT /baseUrl/cms/v3/pages/site-pages/multi-language/set-new-lang-primary HTTP/1.1
Private-App-Legacy: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 14
{
"id": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/cms/v3/pages/site-pages/multi-language/set-new-lang-primary")
.setHeader("private-app-legacy", "{{apiKey}}")
.setHeader("content-type", "application/json")
.setBody("{\n \"id\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/cms/v3/pages/site-pages/multi-language/set-new-lang-primary"))
.header("private-app-legacy", "{{apiKey}}")
.header("content-type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString("{\n \"id\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"id\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/cms/v3/pages/site-pages/multi-language/set-new-lang-primary")
.put(body)
.addHeader("private-app-legacy", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/cms/v3/pages/site-pages/multi-language/set-new-lang-primary")
.header("private-app-legacy", "{{apiKey}}")
.header("content-type", "application/json")
.body("{\n \"id\": \"\"\n}")
.asString();
const data = JSON.stringify({
id: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/cms/v3/pages/site-pages/multi-language/set-new-lang-primary');
xhr.setRequestHeader('private-app-legacy', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/cms/v3/pages/site-pages/multi-language/set-new-lang-primary',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
data: {id: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/cms/v3/pages/site-pages/multi-language/set-new-lang-primary';
const options = {
method: 'PUT',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
body: '{"id":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/cms/v3/pages/site-pages/multi-language/set-new-lang-primary',
method: 'PUT',
headers: {
'private-app-legacy': '{{apiKey}}',
'content-type': 'application/json'
},
processData: false,
data: '{\n "id": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"id\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/cms/v3/pages/site-pages/multi-language/set-new-lang-primary")
.put(body)
.addHeader("private-app-legacy", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PUT',
hostname: 'example.com',
port: null,
path: '/baseUrl/cms/v3/pages/site-pages/multi-language/set-new-lang-primary',
headers: {
'private-app-legacy': '{{apiKey}}',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({id: ''}));
req.end();
const request = require('request');
const options = {
method: 'PUT',
url: '{{baseUrl}}/cms/v3/pages/site-pages/multi-language/set-new-lang-primary',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
body: {id: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PUT', '{{baseUrl}}/cms/v3/pages/site-pages/multi-language/set-new-lang-primary');
req.headers({
'private-app-legacy': '{{apiKey}}',
'content-type': 'application/json'
});
req.type('json');
req.send({
id: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'PUT',
url: '{{baseUrl}}/cms/v3/pages/site-pages/multi-language/set-new-lang-primary',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
data: {id: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/cms/v3/pages/site-pages/multi-language/set-new-lang-primary';
const options = {
method: 'PUT',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
body: '{"id":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"private-app-legacy": @"{{apiKey}}",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"id": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/cms/v3/pages/site-pages/multi-language/set-new-lang-primary"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PUT"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/cms/v3/pages/site-pages/multi-language/set-new-lang-primary" in
let headers = Header.add_list (Header.init ()) [
("private-app-legacy", "{{apiKey}}");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"id\": \"\"\n}" in
Client.call ~headers ~body `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/cms/v3/pages/site-pages/multi-language/set-new-lang-primary",
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([
'id' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"private-app-legacy: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('PUT', '{{baseUrl}}/cms/v3/pages/site-pages/multi-language/set-new-lang-primary', [
'body' => '{
"id": ""
}',
'headers' => [
'content-type' => 'application/json',
'private-app-legacy' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/cms/v3/pages/site-pages/multi-language/set-new-lang-primary');
$request->setMethod(HTTP_METH_PUT);
$request->setHeaders([
'private-app-legacy' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'id' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'id' => ''
]));
$request->setRequestUrl('{{baseUrl}}/cms/v3/pages/site-pages/multi-language/set-new-lang-primary');
$request->setRequestMethod('PUT');
$request->setBody($body);
$request->setHeaders([
'private-app-legacy' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("private-app-legacy", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/cms/v3/pages/site-pages/multi-language/set-new-lang-primary' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"id": ""
}'
$headers=@{}
$headers.Add("private-app-legacy", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/cms/v3/pages/site-pages/multi-language/set-new-lang-primary' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"id": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"id\": \"\"\n}"
headers = {
'private-app-legacy': "{{apiKey}}",
'content-type': "application/json"
}
conn.request("PUT", "/baseUrl/cms/v3/pages/site-pages/multi-language/set-new-lang-primary", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/cms/v3/pages/site-pages/multi-language/set-new-lang-primary"
payload = { "id": "" }
headers = {
"private-app-legacy": "{{apiKey}}",
"content-type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/cms/v3/pages/site-pages/multi-language/set-new-lang-primary"
payload <- "{\n \"id\": \"\"\n}"
encode <- "json"
response <- VERB("PUT", url, body = payload, add_headers('private-app-legacy' = '{{apiKey}}'), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/cms/v3/pages/site-pages/multi-language/set-new-lang-primary")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["private-app-legacy"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n \"id\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.put('/baseUrl/cms/v3/pages/site-pages/multi-language/set-new-lang-primary') do |req|
req.headers['private-app-legacy'] = '{{apiKey}}'
req.body = "{\n \"id\": \"\"\n}"
end
puts response.status
puts response.body
use std::str::FromStr;
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/cms/v3/pages/site-pages/multi-language/set-new-lang-primary";
let payload = json!({"id": ""});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("private-app-legacy", "{{apiKey}}".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PUT").unwrap(), url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PUT \
--url {{baseUrl}}/cms/v3/pages/site-pages/multi-language/set-new-lang-primary \
--header 'content-type: application/json' \
--header 'private-app-legacy: {{apiKey}}' \
--data '{
"id": ""
}'
echo '{
"id": ""
}' | \
http PUT {{baseUrl}}/cms/v3/pages/site-pages/multi-language/set-new-lang-primary \
content-type:application/json \
private-app-legacy:'{{apiKey}}'
wget --quiet \
--method PUT \
--header 'private-app-legacy: {{apiKey}}' \
--header 'content-type: application/json' \
--body-data '{\n "id": ""\n}' \
--output-document \
- {{baseUrl}}/cms/v3/pages/site-pages/multi-language/set-new-lang-primary
import Foundation
let headers = [
"private-app-legacy": "{{apiKey}}",
"content-type": "application/json"
]
let parameters = ["id": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/cms/v3/pages/site-pages/multi-language/set-new-lang-primary")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
*/*
RESPONSE BODY text
{
"message": "Invalid input (details will vary based on the error)",
"correlationId": "aeb5f871-7f07-4993-9211-075dc63e7cbf",
"category": "VALIDATION_ERROR",
"links": {
"knowledge-base": "https://www.hubspot.com/products/service/knowledge-base"
}
}
PATCH
Update a Site Page draft
{{baseUrl}}/cms/v3/pages/site-pages/:objectId/draft
HEADERS
private-app-legacy
{{apiKey}}
QUERY PARAMS
objectId
BODY json
{
"publishDate": "",
"language": "",
"enableLayoutStylesheets": false,
"metaDescription": "",
"attachedStylesheets": [
{}
],
"password": "",
"publishImmediately": false,
"htmlTitle": "",
"translations": {},
"id": "",
"state": "",
"slug": "",
"createdById": "",
"currentlyPublished": false,
"archivedInDashboard": false,
"created": "",
"contentTypeCategory": "",
"mabExperimentId": "",
"updatedById": "",
"translatedFromId": "",
"folderId": "",
"widgetContainers": {},
"pageExpiryRedirectId": 0,
"dynamicPageDataSourceType": 0,
"featuredImage": "",
"authorName": "",
"domain": "",
"name": "",
"dynamicPageHubDbTableId": "",
"campaign": "",
"dynamicPageDataSourceId": "",
"enableDomainStylesheets": false,
"includeDefaultCustomCss": false,
"subcategory": "",
"layoutSections": {},
"updated": "",
"footerHtml": "",
"widgets": {},
"headHtml": "",
"pageExpiryRedirectUrl": "",
"abStatus": "",
"useFeaturedImage": false,
"abTestId": "",
"featuredImageAltText": "",
"contentGroupId": "",
"pageExpiryEnabled": false,
"templatePath": "",
"url": "",
"publicAccessRules": [
{}
],
"archivedAt": "",
"themeSettingsValues": {},
"pageExpiryDate": 0,
"publicAccessRulesEnabled": false,
"pageRedirected": false,
"currentState": "",
"categoryId": 0,
"linkRelCanonicalUrl": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PATCH");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/cms/v3/pages/site-pages/:objectId/draft");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "private-app-legacy: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"publishDate\": \"\",\n \"language\": \"\",\n \"enableLayoutStylesheets\": false,\n \"metaDescription\": \"\",\n \"attachedStylesheets\": [\n {}\n ],\n \"password\": \"\",\n \"publishImmediately\": false,\n \"htmlTitle\": \"\",\n \"translations\": {},\n \"id\": \"\",\n \"state\": \"\",\n \"slug\": \"\",\n \"createdById\": \"\",\n \"currentlyPublished\": false,\n \"archivedInDashboard\": false,\n \"created\": \"\",\n \"contentTypeCategory\": \"\",\n \"mabExperimentId\": \"\",\n \"updatedById\": \"\",\n \"translatedFromId\": \"\",\n \"folderId\": \"\",\n \"widgetContainers\": {},\n \"pageExpiryRedirectId\": 0,\n \"dynamicPageDataSourceType\": 0,\n \"featuredImage\": \"\",\n \"authorName\": \"\",\n \"domain\": \"\",\n \"name\": \"\",\n \"dynamicPageHubDbTableId\": \"\",\n \"campaign\": \"\",\n \"dynamicPageDataSourceId\": \"\",\n \"enableDomainStylesheets\": false,\n \"includeDefaultCustomCss\": false,\n \"subcategory\": \"\",\n \"layoutSections\": {},\n \"updated\": \"\",\n \"footerHtml\": \"\",\n \"widgets\": {},\n \"headHtml\": \"\",\n \"pageExpiryRedirectUrl\": \"\",\n \"abStatus\": \"\",\n \"useFeaturedImage\": false,\n \"abTestId\": \"\",\n \"featuredImageAltText\": \"\",\n \"contentGroupId\": \"\",\n \"pageExpiryEnabled\": false,\n \"templatePath\": \"\",\n \"url\": \"\",\n \"publicAccessRules\": [\n {}\n ],\n \"archivedAt\": \"\",\n \"themeSettingsValues\": {},\n \"pageExpiryDate\": 0,\n \"publicAccessRulesEnabled\": false,\n \"pageRedirected\": false,\n \"currentState\": \"\",\n \"categoryId\": 0,\n \"linkRelCanonicalUrl\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/patch "{{baseUrl}}/cms/v3/pages/site-pages/:objectId/draft" {:headers {:private-app-legacy "{{apiKey}}"}
:content-type :json
:form-params {:publishDate ""
:language ""
:enableLayoutStylesheets false
:metaDescription ""
:attachedStylesheets [{}]
:password ""
:publishImmediately false
:htmlTitle ""
:translations {}
:id ""
:state ""
:slug ""
:createdById ""
:currentlyPublished false
:archivedInDashboard false
:created ""
:contentTypeCategory ""
:mabExperimentId ""
:updatedById ""
:translatedFromId ""
:folderId ""
:widgetContainers {}
:pageExpiryRedirectId 0
:dynamicPageDataSourceType 0
:featuredImage ""
:authorName ""
:domain ""
:name ""
:dynamicPageHubDbTableId ""
:campaign ""
:dynamicPageDataSourceId ""
:enableDomainStylesheets false
:includeDefaultCustomCss false
:subcategory ""
:layoutSections {}
:updated ""
:footerHtml ""
:widgets {}
:headHtml ""
:pageExpiryRedirectUrl ""
:abStatus ""
:useFeaturedImage false
:abTestId ""
:featuredImageAltText ""
:contentGroupId ""
:pageExpiryEnabled false
:templatePath ""
:url ""
:publicAccessRules [{}]
:archivedAt ""
:themeSettingsValues {}
:pageExpiryDate 0
:publicAccessRulesEnabled false
:pageRedirected false
:currentState ""
:categoryId 0
:linkRelCanonicalUrl ""}})
require "http/client"
url = "{{baseUrl}}/cms/v3/pages/site-pages/:objectId/draft"
headers = HTTP::Headers{
"private-app-legacy" => "{{apiKey}}"
"content-type" => "application/json"
}
reqBody = "{\n \"publishDate\": \"\",\n \"language\": \"\",\n \"enableLayoutStylesheets\": false,\n \"metaDescription\": \"\",\n \"attachedStylesheets\": [\n {}\n ],\n \"password\": \"\",\n \"publishImmediately\": false,\n \"htmlTitle\": \"\",\n \"translations\": {},\n \"id\": \"\",\n \"state\": \"\",\n \"slug\": \"\",\n \"createdById\": \"\",\n \"currentlyPublished\": false,\n \"archivedInDashboard\": false,\n \"created\": \"\",\n \"contentTypeCategory\": \"\",\n \"mabExperimentId\": \"\",\n \"updatedById\": \"\",\n \"translatedFromId\": \"\",\n \"folderId\": \"\",\n \"widgetContainers\": {},\n \"pageExpiryRedirectId\": 0,\n \"dynamicPageDataSourceType\": 0,\n \"featuredImage\": \"\",\n \"authorName\": \"\",\n \"domain\": \"\",\n \"name\": \"\",\n \"dynamicPageHubDbTableId\": \"\",\n \"campaign\": \"\",\n \"dynamicPageDataSourceId\": \"\",\n \"enableDomainStylesheets\": false,\n \"includeDefaultCustomCss\": false,\n \"subcategory\": \"\",\n \"layoutSections\": {},\n \"updated\": \"\",\n \"footerHtml\": \"\",\n \"widgets\": {},\n \"headHtml\": \"\",\n \"pageExpiryRedirectUrl\": \"\",\n \"abStatus\": \"\",\n \"useFeaturedImage\": false,\n \"abTestId\": \"\",\n \"featuredImageAltText\": \"\",\n \"contentGroupId\": \"\",\n \"pageExpiryEnabled\": false,\n \"templatePath\": \"\",\n \"url\": \"\",\n \"publicAccessRules\": [\n {}\n ],\n \"archivedAt\": \"\",\n \"themeSettingsValues\": {},\n \"pageExpiryDate\": 0,\n \"publicAccessRulesEnabled\": false,\n \"pageRedirected\": false,\n \"currentState\": \"\",\n \"categoryId\": 0,\n \"linkRelCanonicalUrl\": \"\"\n}"
response = HTTP::Client.patch url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Patch,
RequestUri = new Uri("{{baseUrl}}/cms/v3/pages/site-pages/:objectId/draft"),
Headers =
{
{ "private-app-legacy", "{{apiKey}}" },
},
Content = new StringContent("{\n \"publishDate\": \"\",\n \"language\": \"\",\n \"enableLayoutStylesheets\": false,\n \"metaDescription\": \"\",\n \"attachedStylesheets\": [\n {}\n ],\n \"password\": \"\",\n \"publishImmediately\": false,\n \"htmlTitle\": \"\",\n \"translations\": {},\n \"id\": \"\",\n \"state\": \"\",\n \"slug\": \"\",\n \"createdById\": \"\",\n \"currentlyPublished\": false,\n \"archivedInDashboard\": false,\n \"created\": \"\",\n \"contentTypeCategory\": \"\",\n \"mabExperimentId\": \"\",\n \"updatedById\": \"\",\n \"translatedFromId\": \"\",\n \"folderId\": \"\",\n \"widgetContainers\": {},\n \"pageExpiryRedirectId\": 0,\n \"dynamicPageDataSourceType\": 0,\n \"featuredImage\": \"\",\n \"authorName\": \"\",\n \"domain\": \"\",\n \"name\": \"\",\n \"dynamicPageHubDbTableId\": \"\",\n \"campaign\": \"\",\n \"dynamicPageDataSourceId\": \"\",\n \"enableDomainStylesheets\": false,\n \"includeDefaultCustomCss\": false,\n \"subcategory\": \"\",\n \"layoutSections\": {},\n \"updated\": \"\",\n \"footerHtml\": \"\",\n \"widgets\": {},\n \"headHtml\": \"\",\n \"pageExpiryRedirectUrl\": \"\",\n \"abStatus\": \"\",\n \"useFeaturedImage\": false,\n \"abTestId\": \"\",\n \"featuredImageAltText\": \"\",\n \"contentGroupId\": \"\",\n \"pageExpiryEnabled\": false,\n \"templatePath\": \"\",\n \"url\": \"\",\n \"publicAccessRules\": [\n {}\n ],\n \"archivedAt\": \"\",\n \"themeSettingsValues\": {},\n \"pageExpiryDate\": 0,\n \"publicAccessRulesEnabled\": false,\n \"pageRedirected\": false,\n \"currentState\": \"\",\n \"categoryId\": 0,\n \"linkRelCanonicalUrl\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/cms/v3/pages/site-pages/:objectId/draft");
var request = new RestRequest("", Method.Patch);
request.AddHeader("private-app-legacy", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"publishDate\": \"\",\n \"language\": \"\",\n \"enableLayoutStylesheets\": false,\n \"metaDescription\": \"\",\n \"attachedStylesheets\": [\n {}\n ],\n \"password\": \"\",\n \"publishImmediately\": false,\n \"htmlTitle\": \"\",\n \"translations\": {},\n \"id\": \"\",\n \"state\": \"\",\n \"slug\": \"\",\n \"createdById\": \"\",\n \"currentlyPublished\": false,\n \"archivedInDashboard\": false,\n \"created\": \"\",\n \"contentTypeCategory\": \"\",\n \"mabExperimentId\": \"\",\n \"updatedById\": \"\",\n \"translatedFromId\": \"\",\n \"folderId\": \"\",\n \"widgetContainers\": {},\n \"pageExpiryRedirectId\": 0,\n \"dynamicPageDataSourceType\": 0,\n \"featuredImage\": \"\",\n \"authorName\": \"\",\n \"domain\": \"\",\n \"name\": \"\",\n \"dynamicPageHubDbTableId\": \"\",\n \"campaign\": \"\",\n \"dynamicPageDataSourceId\": \"\",\n \"enableDomainStylesheets\": false,\n \"includeDefaultCustomCss\": false,\n \"subcategory\": \"\",\n \"layoutSections\": {},\n \"updated\": \"\",\n \"footerHtml\": \"\",\n \"widgets\": {},\n \"headHtml\": \"\",\n \"pageExpiryRedirectUrl\": \"\",\n \"abStatus\": \"\",\n \"useFeaturedImage\": false,\n \"abTestId\": \"\",\n \"featuredImageAltText\": \"\",\n \"contentGroupId\": \"\",\n \"pageExpiryEnabled\": false,\n \"templatePath\": \"\",\n \"url\": \"\",\n \"publicAccessRules\": [\n {}\n ],\n \"archivedAt\": \"\",\n \"themeSettingsValues\": {},\n \"pageExpiryDate\": 0,\n \"publicAccessRulesEnabled\": false,\n \"pageRedirected\": false,\n \"currentState\": \"\",\n \"categoryId\": 0,\n \"linkRelCanonicalUrl\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/cms/v3/pages/site-pages/:objectId/draft"
payload := strings.NewReader("{\n \"publishDate\": \"\",\n \"language\": \"\",\n \"enableLayoutStylesheets\": false,\n \"metaDescription\": \"\",\n \"attachedStylesheets\": [\n {}\n ],\n \"password\": \"\",\n \"publishImmediately\": false,\n \"htmlTitle\": \"\",\n \"translations\": {},\n \"id\": \"\",\n \"state\": \"\",\n \"slug\": \"\",\n \"createdById\": \"\",\n \"currentlyPublished\": false,\n \"archivedInDashboard\": false,\n \"created\": \"\",\n \"contentTypeCategory\": \"\",\n \"mabExperimentId\": \"\",\n \"updatedById\": \"\",\n \"translatedFromId\": \"\",\n \"folderId\": \"\",\n \"widgetContainers\": {},\n \"pageExpiryRedirectId\": 0,\n \"dynamicPageDataSourceType\": 0,\n \"featuredImage\": \"\",\n \"authorName\": \"\",\n \"domain\": \"\",\n \"name\": \"\",\n \"dynamicPageHubDbTableId\": \"\",\n \"campaign\": \"\",\n \"dynamicPageDataSourceId\": \"\",\n \"enableDomainStylesheets\": false,\n \"includeDefaultCustomCss\": false,\n \"subcategory\": \"\",\n \"layoutSections\": {},\n \"updated\": \"\",\n \"footerHtml\": \"\",\n \"widgets\": {},\n \"headHtml\": \"\",\n \"pageExpiryRedirectUrl\": \"\",\n \"abStatus\": \"\",\n \"useFeaturedImage\": false,\n \"abTestId\": \"\",\n \"featuredImageAltText\": \"\",\n \"contentGroupId\": \"\",\n \"pageExpiryEnabled\": false,\n \"templatePath\": \"\",\n \"url\": \"\",\n \"publicAccessRules\": [\n {}\n ],\n \"archivedAt\": \"\",\n \"themeSettingsValues\": {},\n \"pageExpiryDate\": 0,\n \"publicAccessRulesEnabled\": false,\n \"pageRedirected\": false,\n \"currentState\": \"\",\n \"categoryId\": 0,\n \"linkRelCanonicalUrl\": \"\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("private-app-legacy", "{{apiKey}}")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PATCH /baseUrl/cms/v3/pages/site-pages/:objectId/draft HTTP/1.1
Private-App-Legacy: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 1385
{
"publishDate": "",
"language": "",
"enableLayoutStylesheets": false,
"metaDescription": "",
"attachedStylesheets": [
{}
],
"password": "",
"publishImmediately": false,
"htmlTitle": "",
"translations": {},
"id": "",
"state": "",
"slug": "",
"createdById": "",
"currentlyPublished": false,
"archivedInDashboard": false,
"created": "",
"contentTypeCategory": "",
"mabExperimentId": "",
"updatedById": "",
"translatedFromId": "",
"folderId": "",
"widgetContainers": {},
"pageExpiryRedirectId": 0,
"dynamicPageDataSourceType": 0,
"featuredImage": "",
"authorName": "",
"domain": "",
"name": "",
"dynamicPageHubDbTableId": "",
"campaign": "",
"dynamicPageDataSourceId": "",
"enableDomainStylesheets": false,
"includeDefaultCustomCss": false,
"subcategory": "",
"layoutSections": {},
"updated": "",
"footerHtml": "",
"widgets": {},
"headHtml": "",
"pageExpiryRedirectUrl": "",
"abStatus": "",
"useFeaturedImage": false,
"abTestId": "",
"featuredImageAltText": "",
"contentGroupId": "",
"pageExpiryEnabled": false,
"templatePath": "",
"url": "",
"publicAccessRules": [
{}
],
"archivedAt": "",
"themeSettingsValues": {},
"pageExpiryDate": 0,
"publicAccessRulesEnabled": false,
"pageRedirected": false,
"currentState": "",
"categoryId": 0,
"linkRelCanonicalUrl": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PATCH", "{{baseUrl}}/cms/v3/pages/site-pages/:objectId/draft")
.setHeader("private-app-legacy", "{{apiKey}}")
.setHeader("content-type", "application/json")
.setBody("{\n \"publishDate\": \"\",\n \"language\": \"\",\n \"enableLayoutStylesheets\": false,\n \"metaDescription\": \"\",\n \"attachedStylesheets\": [\n {}\n ],\n \"password\": \"\",\n \"publishImmediately\": false,\n \"htmlTitle\": \"\",\n \"translations\": {},\n \"id\": \"\",\n \"state\": \"\",\n \"slug\": \"\",\n \"createdById\": \"\",\n \"currentlyPublished\": false,\n \"archivedInDashboard\": false,\n \"created\": \"\",\n \"contentTypeCategory\": \"\",\n \"mabExperimentId\": \"\",\n \"updatedById\": \"\",\n \"translatedFromId\": \"\",\n \"folderId\": \"\",\n \"widgetContainers\": {},\n \"pageExpiryRedirectId\": 0,\n \"dynamicPageDataSourceType\": 0,\n \"featuredImage\": \"\",\n \"authorName\": \"\",\n \"domain\": \"\",\n \"name\": \"\",\n \"dynamicPageHubDbTableId\": \"\",\n \"campaign\": \"\",\n \"dynamicPageDataSourceId\": \"\",\n \"enableDomainStylesheets\": false,\n \"includeDefaultCustomCss\": false,\n \"subcategory\": \"\",\n \"layoutSections\": {},\n \"updated\": \"\",\n \"footerHtml\": \"\",\n \"widgets\": {},\n \"headHtml\": \"\",\n \"pageExpiryRedirectUrl\": \"\",\n \"abStatus\": \"\",\n \"useFeaturedImage\": false,\n \"abTestId\": \"\",\n \"featuredImageAltText\": \"\",\n \"contentGroupId\": \"\",\n \"pageExpiryEnabled\": false,\n \"templatePath\": \"\",\n \"url\": \"\",\n \"publicAccessRules\": [\n {}\n ],\n \"archivedAt\": \"\",\n \"themeSettingsValues\": {},\n \"pageExpiryDate\": 0,\n \"publicAccessRulesEnabled\": false,\n \"pageRedirected\": false,\n \"currentState\": \"\",\n \"categoryId\": 0,\n \"linkRelCanonicalUrl\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/cms/v3/pages/site-pages/:objectId/draft"))
.header("private-app-legacy", "{{apiKey}}")
.header("content-type", "application/json")
.method("PATCH", HttpRequest.BodyPublishers.ofString("{\n \"publishDate\": \"\",\n \"language\": \"\",\n \"enableLayoutStylesheets\": false,\n \"metaDescription\": \"\",\n \"attachedStylesheets\": [\n {}\n ],\n \"password\": \"\",\n \"publishImmediately\": false,\n \"htmlTitle\": \"\",\n \"translations\": {},\n \"id\": \"\",\n \"state\": \"\",\n \"slug\": \"\",\n \"createdById\": \"\",\n \"currentlyPublished\": false,\n \"archivedInDashboard\": false,\n \"created\": \"\",\n \"contentTypeCategory\": \"\",\n \"mabExperimentId\": \"\",\n \"updatedById\": \"\",\n \"translatedFromId\": \"\",\n \"folderId\": \"\",\n \"widgetContainers\": {},\n \"pageExpiryRedirectId\": 0,\n \"dynamicPageDataSourceType\": 0,\n \"featuredImage\": \"\",\n \"authorName\": \"\",\n \"domain\": \"\",\n \"name\": \"\",\n \"dynamicPageHubDbTableId\": \"\",\n \"campaign\": \"\",\n \"dynamicPageDataSourceId\": \"\",\n \"enableDomainStylesheets\": false,\n \"includeDefaultCustomCss\": false,\n \"subcategory\": \"\",\n \"layoutSections\": {},\n \"updated\": \"\",\n \"footerHtml\": \"\",\n \"widgets\": {},\n \"headHtml\": \"\",\n \"pageExpiryRedirectUrl\": \"\",\n \"abStatus\": \"\",\n \"useFeaturedImage\": false,\n \"abTestId\": \"\",\n \"featuredImageAltText\": \"\",\n \"contentGroupId\": \"\",\n \"pageExpiryEnabled\": false,\n \"templatePath\": \"\",\n \"url\": \"\",\n \"publicAccessRules\": [\n {}\n ],\n \"archivedAt\": \"\",\n \"themeSettingsValues\": {},\n \"pageExpiryDate\": 0,\n \"publicAccessRulesEnabled\": false,\n \"pageRedirected\": false,\n \"currentState\": \"\",\n \"categoryId\": 0,\n \"linkRelCanonicalUrl\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"publishDate\": \"\",\n \"language\": \"\",\n \"enableLayoutStylesheets\": false,\n \"metaDescription\": \"\",\n \"attachedStylesheets\": [\n {}\n ],\n \"password\": \"\",\n \"publishImmediately\": false,\n \"htmlTitle\": \"\",\n \"translations\": {},\n \"id\": \"\",\n \"state\": \"\",\n \"slug\": \"\",\n \"createdById\": \"\",\n \"currentlyPublished\": false,\n \"archivedInDashboard\": false,\n \"created\": \"\",\n \"contentTypeCategory\": \"\",\n \"mabExperimentId\": \"\",\n \"updatedById\": \"\",\n \"translatedFromId\": \"\",\n \"folderId\": \"\",\n \"widgetContainers\": {},\n \"pageExpiryRedirectId\": 0,\n \"dynamicPageDataSourceType\": 0,\n \"featuredImage\": \"\",\n \"authorName\": \"\",\n \"domain\": \"\",\n \"name\": \"\",\n \"dynamicPageHubDbTableId\": \"\",\n \"campaign\": \"\",\n \"dynamicPageDataSourceId\": \"\",\n \"enableDomainStylesheets\": false,\n \"includeDefaultCustomCss\": false,\n \"subcategory\": \"\",\n \"layoutSections\": {},\n \"updated\": \"\",\n \"footerHtml\": \"\",\n \"widgets\": {},\n \"headHtml\": \"\",\n \"pageExpiryRedirectUrl\": \"\",\n \"abStatus\": \"\",\n \"useFeaturedImage\": false,\n \"abTestId\": \"\",\n \"featuredImageAltText\": \"\",\n \"contentGroupId\": \"\",\n \"pageExpiryEnabled\": false,\n \"templatePath\": \"\",\n \"url\": \"\",\n \"publicAccessRules\": [\n {}\n ],\n \"archivedAt\": \"\",\n \"themeSettingsValues\": {},\n \"pageExpiryDate\": 0,\n \"publicAccessRulesEnabled\": false,\n \"pageRedirected\": false,\n \"currentState\": \"\",\n \"categoryId\": 0,\n \"linkRelCanonicalUrl\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/cms/v3/pages/site-pages/:objectId/draft")
.patch(body)
.addHeader("private-app-legacy", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.patch("{{baseUrl}}/cms/v3/pages/site-pages/:objectId/draft")
.header("private-app-legacy", "{{apiKey}}")
.header("content-type", "application/json")
.body("{\n \"publishDate\": \"\",\n \"language\": \"\",\n \"enableLayoutStylesheets\": false,\n \"metaDescription\": \"\",\n \"attachedStylesheets\": [\n {}\n ],\n \"password\": \"\",\n \"publishImmediately\": false,\n \"htmlTitle\": \"\",\n \"translations\": {},\n \"id\": \"\",\n \"state\": \"\",\n \"slug\": \"\",\n \"createdById\": \"\",\n \"currentlyPublished\": false,\n \"archivedInDashboard\": false,\n \"created\": \"\",\n \"contentTypeCategory\": \"\",\n \"mabExperimentId\": \"\",\n \"updatedById\": \"\",\n \"translatedFromId\": \"\",\n \"folderId\": \"\",\n \"widgetContainers\": {},\n \"pageExpiryRedirectId\": 0,\n \"dynamicPageDataSourceType\": 0,\n \"featuredImage\": \"\",\n \"authorName\": \"\",\n \"domain\": \"\",\n \"name\": \"\",\n \"dynamicPageHubDbTableId\": \"\",\n \"campaign\": \"\",\n \"dynamicPageDataSourceId\": \"\",\n \"enableDomainStylesheets\": false,\n \"includeDefaultCustomCss\": false,\n \"subcategory\": \"\",\n \"layoutSections\": {},\n \"updated\": \"\",\n \"footerHtml\": \"\",\n \"widgets\": {},\n \"headHtml\": \"\",\n \"pageExpiryRedirectUrl\": \"\",\n \"abStatus\": \"\",\n \"useFeaturedImage\": false,\n \"abTestId\": \"\",\n \"featuredImageAltText\": \"\",\n \"contentGroupId\": \"\",\n \"pageExpiryEnabled\": false,\n \"templatePath\": \"\",\n \"url\": \"\",\n \"publicAccessRules\": [\n {}\n ],\n \"archivedAt\": \"\",\n \"themeSettingsValues\": {},\n \"pageExpiryDate\": 0,\n \"publicAccessRulesEnabled\": false,\n \"pageRedirected\": false,\n \"currentState\": \"\",\n \"categoryId\": 0,\n \"linkRelCanonicalUrl\": \"\"\n}")
.asString();
const data = JSON.stringify({
publishDate: '',
language: '',
enableLayoutStylesheets: false,
metaDescription: '',
attachedStylesheets: [
{}
],
password: '',
publishImmediately: false,
htmlTitle: '',
translations: {},
id: '',
state: '',
slug: '',
createdById: '',
currentlyPublished: false,
archivedInDashboard: false,
created: '',
contentTypeCategory: '',
mabExperimentId: '',
updatedById: '',
translatedFromId: '',
folderId: '',
widgetContainers: {},
pageExpiryRedirectId: 0,
dynamicPageDataSourceType: 0,
featuredImage: '',
authorName: '',
domain: '',
name: '',
dynamicPageHubDbTableId: '',
campaign: '',
dynamicPageDataSourceId: '',
enableDomainStylesheets: false,
includeDefaultCustomCss: false,
subcategory: '',
layoutSections: {},
updated: '',
footerHtml: '',
widgets: {},
headHtml: '',
pageExpiryRedirectUrl: '',
abStatus: '',
useFeaturedImage: false,
abTestId: '',
featuredImageAltText: '',
contentGroupId: '',
pageExpiryEnabled: false,
templatePath: '',
url: '',
publicAccessRules: [
{}
],
archivedAt: '',
themeSettingsValues: {},
pageExpiryDate: 0,
publicAccessRulesEnabled: false,
pageRedirected: false,
currentState: '',
categoryId: 0,
linkRelCanonicalUrl: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PATCH', '{{baseUrl}}/cms/v3/pages/site-pages/:objectId/draft');
xhr.setRequestHeader('private-app-legacy', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PATCH',
url: '{{baseUrl}}/cms/v3/pages/site-pages/:objectId/draft',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
data: {
publishDate: '',
language: '',
enableLayoutStylesheets: false,
metaDescription: '',
attachedStylesheets: [{}],
password: '',
publishImmediately: false,
htmlTitle: '',
translations: {},
id: '',
state: '',
slug: '',
createdById: '',
currentlyPublished: false,
archivedInDashboard: false,
created: '',
contentTypeCategory: '',
mabExperimentId: '',
updatedById: '',
translatedFromId: '',
folderId: '',
widgetContainers: {},
pageExpiryRedirectId: 0,
dynamicPageDataSourceType: 0,
featuredImage: '',
authorName: '',
domain: '',
name: '',
dynamicPageHubDbTableId: '',
campaign: '',
dynamicPageDataSourceId: '',
enableDomainStylesheets: false,
includeDefaultCustomCss: false,
subcategory: '',
layoutSections: {},
updated: '',
footerHtml: '',
widgets: {},
headHtml: '',
pageExpiryRedirectUrl: '',
abStatus: '',
useFeaturedImage: false,
abTestId: '',
featuredImageAltText: '',
contentGroupId: '',
pageExpiryEnabled: false,
templatePath: '',
url: '',
publicAccessRules: [{}],
archivedAt: '',
themeSettingsValues: {},
pageExpiryDate: 0,
publicAccessRulesEnabled: false,
pageRedirected: false,
currentState: '',
categoryId: 0,
linkRelCanonicalUrl: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/cms/v3/pages/site-pages/:objectId/draft';
const options = {
method: 'PATCH',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
body: '{"publishDate":"","language":"","enableLayoutStylesheets":false,"metaDescription":"","attachedStylesheets":[{}],"password":"","publishImmediately":false,"htmlTitle":"","translations":{},"id":"","state":"","slug":"","createdById":"","currentlyPublished":false,"archivedInDashboard":false,"created":"","contentTypeCategory":"","mabExperimentId":"","updatedById":"","translatedFromId":"","folderId":"","widgetContainers":{},"pageExpiryRedirectId":0,"dynamicPageDataSourceType":0,"featuredImage":"","authorName":"","domain":"","name":"","dynamicPageHubDbTableId":"","campaign":"","dynamicPageDataSourceId":"","enableDomainStylesheets":false,"includeDefaultCustomCss":false,"subcategory":"","layoutSections":{},"updated":"","footerHtml":"","widgets":{},"headHtml":"","pageExpiryRedirectUrl":"","abStatus":"","useFeaturedImage":false,"abTestId":"","featuredImageAltText":"","contentGroupId":"","pageExpiryEnabled":false,"templatePath":"","url":"","publicAccessRules":[{}],"archivedAt":"","themeSettingsValues":{},"pageExpiryDate":0,"publicAccessRulesEnabled":false,"pageRedirected":false,"currentState":"","categoryId":0,"linkRelCanonicalUrl":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/cms/v3/pages/site-pages/:objectId/draft',
method: 'PATCH',
headers: {
'private-app-legacy': '{{apiKey}}',
'content-type': 'application/json'
},
processData: false,
data: '{\n "publishDate": "",\n "language": "",\n "enableLayoutStylesheets": false,\n "metaDescription": "",\n "attachedStylesheets": [\n {}\n ],\n "password": "",\n "publishImmediately": false,\n "htmlTitle": "",\n "translations": {},\n "id": "",\n "state": "",\n "slug": "",\n "createdById": "",\n "currentlyPublished": false,\n "archivedInDashboard": false,\n "created": "",\n "contentTypeCategory": "",\n "mabExperimentId": "",\n "updatedById": "",\n "translatedFromId": "",\n "folderId": "",\n "widgetContainers": {},\n "pageExpiryRedirectId": 0,\n "dynamicPageDataSourceType": 0,\n "featuredImage": "",\n "authorName": "",\n "domain": "",\n "name": "",\n "dynamicPageHubDbTableId": "",\n "campaign": "",\n "dynamicPageDataSourceId": "",\n "enableDomainStylesheets": false,\n "includeDefaultCustomCss": false,\n "subcategory": "",\n "layoutSections": {},\n "updated": "",\n "footerHtml": "",\n "widgets": {},\n "headHtml": "",\n "pageExpiryRedirectUrl": "",\n "abStatus": "",\n "useFeaturedImage": false,\n "abTestId": "",\n "featuredImageAltText": "",\n "contentGroupId": "",\n "pageExpiryEnabled": false,\n "templatePath": "",\n "url": "",\n "publicAccessRules": [\n {}\n ],\n "archivedAt": "",\n "themeSettingsValues": {},\n "pageExpiryDate": 0,\n "publicAccessRulesEnabled": false,\n "pageRedirected": false,\n "currentState": "",\n "categoryId": 0,\n "linkRelCanonicalUrl": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"publishDate\": \"\",\n \"language\": \"\",\n \"enableLayoutStylesheets\": false,\n \"metaDescription\": \"\",\n \"attachedStylesheets\": [\n {}\n ],\n \"password\": \"\",\n \"publishImmediately\": false,\n \"htmlTitle\": \"\",\n \"translations\": {},\n \"id\": \"\",\n \"state\": \"\",\n \"slug\": \"\",\n \"createdById\": \"\",\n \"currentlyPublished\": false,\n \"archivedInDashboard\": false,\n \"created\": \"\",\n \"contentTypeCategory\": \"\",\n \"mabExperimentId\": \"\",\n \"updatedById\": \"\",\n \"translatedFromId\": \"\",\n \"folderId\": \"\",\n \"widgetContainers\": {},\n \"pageExpiryRedirectId\": 0,\n \"dynamicPageDataSourceType\": 0,\n \"featuredImage\": \"\",\n \"authorName\": \"\",\n \"domain\": \"\",\n \"name\": \"\",\n \"dynamicPageHubDbTableId\": \"\",\n \"campaign\": \"\",\n \"dynamicPageDataSourceId\": \"\",\n \"enableDomainStylesheets\": false,\n \"includeDefaultCustomCss\": false,\n \"subcategory\": \"\",\n \"layoutSections\": {},\n \"updated\": \"\",\n \"footerHtml\": \"\",\n \"widgets\": {},\n \"headHtml\": \"\",\n \"pageExpiryRedirectUrl\": \"\",\n \"abStatus\": \"\",\n \"useFeaturedImage\": false,\n \"abTestId\": \"\",\n \"featuredImageAltText\": \"\",\n \"contentGroupId\": \"\",\n \"pageExpiryEnabled\": false,\n \"templatePath\": \"\",\n \"url\": \"\",\n \"publicAccessRules\": [\n {}\n ],\n \"archivedAt\": \"\",\n \"themeSettingsValues\": {},\n \"pageExpiryDate\": 0,\n \"publicAccessRulesEnabled\": false,\n \"pageRedirected\": false,\n \"currentState\": \"\",\n \"categoryId\": 0,\n \"linkRelCanonicalUrl\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/cms/v3/pages/site-pages/:objectId/draft")
.patch(body)
.addHeader("private-app-legacy", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PATCH',
hostname: 'example.com',
port: null,
path: '/baseUrl/cms/v3/pages/site-pages/:objectId/draft',
headers: {
'private-app-legacy': '{{apiKey}}',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
publishDate: '',
language: '',
enableLayoutStylesheets: false,
metaDescription: '',
attachedStylesheets: [{}],
password: '',
publishImmediately: false,
htmlTitle: '',
translations: {},
id: '',
state: '',
slug: '',
createdById: '',
currentlyPublished: false,
archivedInDashboard: false,
created: '',
contentTypeCategory: '',
mabExperimentId: '',
updatedById: '',
translatedFromId: '',
folderId: '',
widgetContainers: {},
pageExpiryRedirectId: 0,
dynamicPageDataSourceType: 0,
featuredImage: '',
authorName: '',
domain: '',
name: '',
dynamicPageHubDbTableId: '',
campaign: '',
dynamicPageDataSourceId: '',
enableDomainStylesheets: false,
includeDefaultCustomCss: false,
subcategory: '',
layoutSections: {},
updated: '',
footerHtml: '',
widgets: {},
headHtml: '',
pageExpiryRedirectUrl: '',
abStatus: '',
useFeaturedImage: false,
abTestId: '',
featuredImageAltText: '',
contentGroupId: '',
pageExpiryEnabled: false,
templatePath: '',
url: '',
publicAccessRules: [{}],
archivedAt: '',
themeSettingsValues: {},
pageExpiryDate: 0,
publicAccessRulesEnabled: false,
pageRedirected: false,
currentState: '',
categoryId: 0,
linkRelCanonicalUrl: ''
}));
req.end();
const request = require('request');
const options = {
method: 'PATCH',
url: '{{baseUrl}}/cms/v3/pages/site-pages/:objectId/draft',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
body: {
publishDate: '',
language: '',
enableLayoutStylesheets: false,
metaDescription: '',
attachedStylesheets: [{}],
password: '',
publishImmediately: false,
htmlTitle: '',
translations: {},
id: '',
state: '',
slug: '',
createdById: '',
currentlyPublished: false,
archivedInDashboard: false,
created: '',
contentTypeCategory: '',
mabExperimentId: '',
updatedById: '',
translatedFromId: '',
folderId: '',
widgetContainers: {},
pageExpiryRedirectId: 0,
dynamicPageDataSourceType: 0,
featuredImage: '',
authorName: '',
domain: '',
name: '',
dynamicPageHubDbTableId: '',
campaign: '',
dynamicPageDataSourceId: '',
enableDomainStylesheets: false,
includeDefaultCustomCss: false,
subcategory: '',
layoutSections: {},
updated: '',
footerHtml: '',
widgets: {},
headHtml: '',
pageExpiryRedirectUrl: '',
abStatus: '',
useFeaturedImage: false,
abTestId: '',
featuredImageAltText: '',
contentGroupId: '',
pageExpiryEnabled: false,
templatePath: '',
url: '',
publicAccessRules: [{}],
archivedAt: '',
themeSettingsValues: {},
pageExpiryDate: 0,
publicAccessRulesEnabled: false,
pageRedirected: false,
currentState: '',
categoryId: 0,
linkRelCanonicalUrl: ''
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PATCH', '{{baseUrl}}/cms/v3/pages/site-pages/:objectId/draft');
req.headers({
'private-app-legacy': '{{apiKey}}',
'content-type': 'application/json'
});
req.type('json');
req.send({
publishDate: '',
language: '',
enableLayoutStylesheets: false,
metaDescription: '',
attachedStylesheets: [
{}
],
password: '',
publishImmediately: false,
htmlTitle: '',
translations: {},
id: '',
state: '',
slug: '',
createdById: '',
currentlyPublished: false,
archivedInDashboard: false,
created: '',
contentTypeCategory: '',
mabExperimentId: '',
updatedById: '',
translatedFromId: '',
folderId: '',
widgetContainers: {},
pageExpiryRedirectId: 0,
dynamicPageDataSourceType: 0,
featuredImage: '',
authorName: '',
domain: '',
name: '',
dynamicPageHubDbTableId: '',
campaign: '',
dynamicPageDataSourceId: '',
enableDomainStylesheets: false,
includeDefaultCustomCss: false,
subcategory: '',
layoutSections: {},
updated: '',
footerHtml: '',
widgets: {},
headHtml: '',
pageExpiryRedirectUrl: '',
abStatus: '',
useFeaturedImage: false,
abTestId: '',
featuredImageAltText: '',
contentGroupId: '',
pageExpiryEnabled: false,
templatePath: '',
url: '',
publicAccessRules: [
{}
],
archivedAt: '',
themeSettingsValues: {},
pageExpiryDate: 0,
publicAccessRulesEnabled: false,
pageRedirected: false,
currentState: '',
categoryId: 0,
linkRelCanonicalUrl: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'PATCH',
url: '{{baseUrl}}/cms/v3/pages/site-pages/:objectId/draft',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
data: {
publishDate: '',
language: '',
enableLayoutStylesheets: false,
metaDescription: '',
attachedStylesheets: [{}],
password: '',
publishImmediately: false,
htmlTitle: '',
translations: {},
id: '',
state: '',
slug: '',
createdById: '',
currentlyPublished: false,
archivedInDashboard: false,
created: '',
contentTypeCategory: '',
mabExperimentId: '',
updatedById: '',
translatedFromId: '',
folderId: '',
widgetContainers: {},
pageExpiryRedirectId: 0,
dynamicPageDataSourceType: 0,
featuredImage: '',
authorName: '',
domain: '',
name: '',
dynamicPageHubDbTableId: '',
campaign: '',
dynamicPageDataSourceId: '',
enableDomainStylesheets: false,
includeDefaultCustomCss: false,
subcategory: '',
layoutSections: {},
updated: '',
footerHtml: '',
widgets: {},
headHtml: '',
pageExpiryRedirectUrl: '',
abStatus: '',
useFeaturedImage: false,
abTestId: '',
featuredImageAltText: '',
contentGroupId: '',
pageExpiryEnabled: false,
templatePath: '',
url: '',
publicAccessRules: [{}],
archivedAt: '',
themeSettingsValues: {},
pageExpiryDate: 0,
publicAccessRulesEnabled: false,
pageRedirected: false,
currentState: '',
categoryId: 0,
linkRelCanonicalUrl: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/cms/v3/pages/site-pages/:objectId/draft';
const options = {
method: 'PATCH',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
body: '{"publishDate":"","language":"","enableLayoutStylesheets":false,"metaDescription":"","attachedStylesheets":[{}],"password":"","publishImmediately":false,"htmlTitle":"","translations":{},"id":"","state":"","slug":"","createdById":"","currentlyPublished":false,"archivedInDashboard":false,"created":"","contentTypeCategory":"","mabExperimentId":"","updatedById":"","translatedFromId":"","folderId":"","widgetContainers":{},"pageExpiryRedirectId":0,"dynamicPageDataSourceType":0,"featuredImage":"","authorName":"","domain":"","name":"","dynamicPageHubDbTableId":"","campaign":"","dynamicPageDataSourceId":"","enableDomainStylesheets":false,"includeDefaultCustomCss":false,"subcategory":"","layoutSections":{},"updated":"","footerHtml":"","widgets":{},"headHtml":"","pageExpiryRedirectUrl":"","abStatus":"","useFeaturedImage":false,"abTestId":"","featuredImageAltText":"","contentGroupId":"","pageExpiryEnabled":false,"templatePath":"","url":"","publicAccessRules":[{}],"archivedAt":"","themeSettingsValues":{},"pageExpiryDate":0,"publicAccessRulesEnabled":false,"pageRedirected":false,"currentState":"","categoryId":0,"linkRelCanonicalUrl":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"private-app-legacy": @"{{apiKey}}",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"publishDate": @"",
@"language": @"",
@"enableLayoutStylesheets": @NO,
@"metaDescription": @"",
@"attachedStylesheets": @[ @{ } ],
@"password": @"",
@"publishImmediately": @NO,
@"htmlTitle": @"",
@"translations": @{ },
@"id": @"",
@"state": @"",
@"slug": @"",
@"createdById": @"",
@"currentlyPublished": @NO,
@"archivedInDashboard": @NO,
@"created": @"",
@"contentTypeCategory": @"",
@"mabExperimentId": @"",
@"updatedById": @"",
@"translatedFromId": @"",
@"folderId": @"",
@"widgetContainers": @{ },
@"pageExpiryRedirectId": @0,
@"dynamicPageDataSourceType": @0,
@"featuredImage": @"",
@"authorName": @"",
@"domain": @"",
@"name": @"",
@"dynamicPageHubDbTableId": @"",
@"campaign": @"",
@"dynamicPageDataSourceId": @"",
@"enableDomainStylesheets": @NO,
@"includeDefaultCustomCss": @NO,
@"subcategory": @"",
@"layoutSections": @{ },
@"updated": @"",
@"footerHtml": @"",
@"widgets": @{ },
@"headHtml": @"",
@"pageExpiryRedirectUrl": @"",
@"abStatus": @"",
@"useFeaturedImage": @NO,
@"abTestId": @"",
@"featuredImageAltText": @"",
@"contentGroupId": @"",
@"pageExpiryEnabled": @NO,
@"templatePath": @"",
@"url": @"",
@"publicAccessRules": @[ @{ } ],
@"archivedAt": @"",
@"themeSettingsValues": @{ },
@"pageExpiryDate": @0,
@"publicAccessRulesEnabled": @NO,
@"pageRedirected": @NO,
@"currentState": @"",
@"categoryId": @0,
@"linkRelCanonicalUrl": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/cms/v3/pages/site-pages/:objectId/draft"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PATCH"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/cms/v3/pages/site-pages/:objectId/draft" in
let headers = Header.add_list (Header.init ()) [
("private-app-legacy", "{{apiKey}}");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"publishDate\": \"\",\n \"language\": \"\",\n \"enableLayoutStylesheets\": false,\n \"metaDescription\": \"\",\n \"attachedStylesheets\": [\n {}\n ],\n \"password\": \"\",\n \"publishImmediately\": false,\n \"htmlTitle\": \"\",\n \"translations\": {},\n \"id\": \"\",\n \"state\": \"\",\n \"slug\": \"\",\n \"createdById\": \"\",\n \"currentlyPublished\": false,\n \"archivedInDashboard\": false,\n \"created\": \"\",\n \"contentTypeCategory\": \"\",\n \"mabExperimentId\": \"\",\n \"updatedById\": \"\",\n \"translatedFromId\": \"\",\n \"folderId\": \"\",\n \"widgetContainers\": {},\n \"pageExpiryRedirectId\": 0,\n \"dynamicPageDataSourceType\": 0,\n \"featuredImage\": \"\",\n \"authorName\": \"\",\n \"domain\": \"\",\n \"name\": \"\",\n \"dynamicPageHubDbTableId\": \"\",\n \"campaign\": \"\",\n \"dynamicPageDataSourceId\": \"\",\n \"enableDomainStylesheets\": false,\n \"includeDefaultCustomCss\": false,\n \"subcategory\": \"\",\n \"layoutSections\": {},\n \"updated\": \"\",\n \"footerHtml\": \"\",\n \"widgets\": {},\n \"headHtml\": \"\",\n \"pageExpiryRedirectUrl\": \"\",\n \"abStatus\": \"\",\n \"useFeaturedImage\": false,\n \"abTestId\": \"\",\n \"featuredImageAltText\": \"\",\n \"contentGroupId\": \"\",\n \"pageExpiryEnabled\": false,\n \"templatePath\": \"\",\n \"url\": \"\",\n \"publicAccessRules\": [\n {}\n ],\n \"archivedAt\": \"\",\n \"themeSettingsValues\": {},\n \"pageExpiryDate\": 0,\n \"publicAccessRulesEnabled\": false,\n \"pageRedirected\": false,\n \"currentState\": \"\",\n \"categoryId\": 0,\n \"linkRelCanonicalUrl\": \"\"\n}" in
Client.call ~headers ~body `PATCH uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/cms/v3/pages/site-pages/:objectId/draft",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'publishDate' => '',
'language' => '',
'enableLayoutStylesheets' => null,
'metaDescription' => '',
'attachedStylesheets' => [
[
]
],
'password' => '',
'publishImmediately' => null,
'htmlTitle' => '',
'translations' => [
],
'id' => '',
'state' => '',
'slug' => '',
'createdById' => '',
'currentlyPublished' => null,
'archivedInDashboard' => null,
'created' => '',
'contentTypeCategory' => '',
'mabExperimentId' => '',
'updatedById' => '',
'translatedFromId' => '',
'folderId' => '',
'widgetContainers' => [
],
'pageExpiryRedirectId' => 0,
'dynamicPageDataSourceType' => 0,
'featuredImage' => '',
'authorName' => '',
'domain' => '',
'name' => '',
'dynamicPageHubDbTableId' => '',
'campaign' => '',
'dynamicPageDataSourceId' => '',
'enableDomainStylesheets' => null,
'includeDefaultCustomCss' => null,
'subcategory' => '',
'layoutSections' => [
],
'updated' => '',
'footerHtml' => '',
'widgets' => [
],
'headHtml' => '',
'pageExpiryRedirectUrl' => '',
'abStatus' => '',
'useFeaturedImage' => null,
'abTestId' => '',
'featuredImageAltText' => '',
'contentGroupId' => '',
'pageExpiryEnabled' => null,
'templatePath' => '',
'url' => '',
'publicAccessRules' => [
[
]
],
'archivedAt' => '',
'themeSettingsValues' => [
],
'pageExpiryDate' => 0,
'publicAccessRulesEnabled' => null,
'pageRedirected' => null,
'currentState' => '',
'categoryId' => 0,
'linkRelCanonicalUrl' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"private-app-legacy: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('PATCH', '{{baseUrl}}/cms/v3/pages/site-pages/:objectId/draft', [
'body' => '{
"publishDate": "",
"language": "",
"enableLayoutStylesheets": false,
"metaDescription": "",
"attachedStylesheets": [
{}
],
"password": "",
"publishImmediately": false,
"htmlTitle": "",
"translations": {},
"id": "",
"state": "",
"slug": "",
"createdById": "",
"currentlyPublished": false,
"archivedInDashboard": false,
"created": "",
"contentTypeCategory": "",
"mabExperimentId": "",
"updatedById": "",
"translatedFromId": "",
"folderId": "",
"widgetContainers": {},
"pageExpiryRedirectId": 0,
"dynamicPageDataSourceType": 0,
"featuredImage": "",
"authorName": "",
"domain": "",
"name": "",
"dynamicPageHubDbTableId": "",
"campaign": "",
"dynamicPageDataSourceId": "",
"enableDomainStylesheets": false,
"includeDefaultCustomCss": false,
"subcategory": "",
"layoutSections": {},
"updated": "",
"footerHtml": "",
"widgets": {},
"headHtml": "",
"pageExpiryRedirectUrl": "",
"abStatus": "",
"useFeaturedImage": false,
"abTestId": "",
"featuredImageAltText": "",
"contentGroupId": "",
"pageExpiryEnabled": false,
"templatePath": "",
"url": "",
"publicAccessRules": [
{}
],
"archivedAt": "",
"themeSettingsValues": {},
"pageExpiryDate": 0,
"publicAccessRulesEnabled": false,
"pageRedirected": false,
"currentState": "",
"categoryId": 0,
"linkRelCanonicalUrl": ""
}',
'headers' => [
'content-type' => 'application/json',
'private-app-legacy' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/cms/v3/pages/site-pages/:objectId/draft');
$request->setMethod(HttpRequest::HTTP_METH_PATCH);
$request->setHeaders([
'private-app-legacy' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'publishDate' => '',
'language' => '',
'enableLayoutStylesheets' => null,
'metaDescription' => '',
'attachedStylesheets' => [
[
]
],
'password' => '',
'publishImmediately' => null,
'htmlTitle' => '',
'translations' => [
],
'id' => '',
'state' => '',
'slug' => '',
'createdById' => '',
'currentlyPublished' => null,
'archivedInDashboard' => null,
'created' => '',
'contentTypeCategory' => '',
'mabExperimentId' => '',
'updatedById' => '',
'translatedFromId' => '',
'folderId' => '',
'widgetContainers' => [
],
'pageExpiryRedirectId' => 0,
'dynamicPageDataSourceType' => 0,
'featuredImage' => '',
'authorName' => '',
'domain' => '',
'name' => '',
'dynamicPageHubDbTableId' => '',
'campaign' => '',
'dynamicPageDataSourceId' => '',
'enableDomainStylesheets' => null,
'includeDefaultCustomCss' => null,
'subcategory' => '',
'layoutSections' => [
],
'updated' => '',
'footerHtml' => '',
'widgets' => [
],
'headHtml' => '',
'pageExpiryRedirectUrl' => '',
'abStatus' => '',
'useFeaturedImage' => null,
'abTestId' => '',
'featuredImageAltText' => '',
'contentGroupId' => '',
'pageExpiryEnabled' => null,
'templatePath' => '',
'url' => '',
'publicAccessRules' => [
[
]
],
'archivedAt' => '',
'themeSettingsValues' => [
],
'pageExpiryDate' => 0,
'publicAccessRulesEnabled' => null,
'pageRedirected' => null,
'currentState' => '',
'categoryId' => 0,
'linkRelCanonicalUrl' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'publishDate' => '',
'language' => '',
'enableLayoutStylesheets' => null,
'metaDescription' => '',
'attachedStylesheets' => [
[
]
],
'password' => '',
'publishImmediately' => null,
'htmlTitle' => '',
'translations' => [
],
'id' => '',
'state' => '',
'slug' => '',
'createdById' => '',
'currentlyPublished' => null,
'archivedInDashboard' => null,
'created' => '',
'contentTypeCategory' => '',
'mabExperimentId' => '',
'updatedById' => '',
'translatedFromId' => '',
'folderId' => '',
'widgetContainers' => [
],
'pageExpiryRedirectId' => 0,
'dynamicPageDataSourceType' => 0,
'featuredImage' => '',
'authorName' => '',
'domain' => '',
'name' => '',
'dynamicPageHubDbTableId' => '',
'campaign' => '',
'dynamicPageDataSourceId' => '',
'enableDomainStylesheets' => null,
'includeDefaultCustomCss' => null,
'subcategory' => '',
'layoutSections' => [
],
'updated' => '',
'footerHtml' => '',
'widgets' => [
],
'headHtml' => '',
'pageExpiryRedirectUrl' => '',
'abStatus' => '',
'useFeaturedImage' => null,
'abTestId' => '',
'featuredImageAltText' => '',
'contentGroupId' => '',
'pageExpiryEnabled' => null,
'templatePath' => '',
'url' => '',
'publicAccessRules' => [
[
]
],
'archivedAt' => '',
'themeSettingsValues' => [
],
'pageExpiryDate' => 0,
'publicAccessRulesEnabled' => null,
'pageRedirected' => null,
'currentState' => '',
'categoryId' => 0,
'linkRelCanonicalUrl' => ''
]));
$request->setRequestUrl('{{baseUrl}}/cms/v3/pages/site-pages/:objectId/draft');
$request->setRequestMethod('PATCH');
$request->setBody($body);
$request->setHeaders([
'private-app-legacy' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("private-app-legacy", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/cms/v3/pages/site-pages/:objectId/draft' -Method PATCH -Headers $headers -ContentType 'application/json' -Body '{
"publishDate": "",
"language": "",
"enableLayoutStylesheets": false,
"metaDescription": "",
"attachedStylesheets": [
{}
],
"password": "",
"publishImmediately": false,
"htmlTitle": "",
"translations": {},
"id": "",
"state": "",
"slug": "",
"createdById": "",
"currentlyPublished": false,
"archivedInDashboard": false,
"created": "",
"contentTypeCategory": "",
"mabExperimentId": "",
"updatedById": "",
"translatedFromId": "",
"folderId": "",
"widgetContainers": {},
"pageExpiryRedirectId": 0,
"dynamicPageDataSourceType": 0,
"featuredImage": "",
"authorName": "",
"domain": "",
"name": "",
"dynamicPageHubDbTableId": "",
"campaign": "",
"dynamicPageDataSourceId": "",
"enableDomainStylesheets": false,
"includeDefaultCustomCss": false,
"subcategory": "",
"layoutSections": {},
"updated": "",
"footerHtml": "",
"widgets": {},
"headHtml": "",
"pageExpiryRedirectUrl": "",
"abStatus": "",
"useFeaturedImage": false,
"abTestId": "",
"featuredImageAltText": "",
"contentGroupId": "",
"pageExpiryEnabled": false,
"templatePath": "",
"url": "",
"publicAccessRules": [
{}
],
"archivedAt": "",
"themeSettingsValues": {},
"pageExpiryDate": 0,
"publicAccessRulesEnabled": false,
"pageRedirected": false,
"currentState": "",
"categoryId": 0,
"linkRelCanonicalUrl": ""
}'
$headers=@{}
$headers.Add("private-app-legacy", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/cms/v3/pages/site-pages/:objectId/draft' -Method PATCH -Headers $headers -ContentType 'application/json' -Body '{
"publishDate": "",
"language": "",
"enableLayoutStylesheets": false,
"metaDescription": "",
"attachedStylesheets": [
{}
],
"password": "",
"publishImmediately": false,
"htmlTitle": "",
"translations": {},
"id": "",
"state": "",
"slug": "",
"createdById": "",
"currentlyPublished": false,
"archivedInDashboard": false,
"created": "",
"contentTypeCategory": "",
"mabExperimentId": "",
"updatedById": "",
"translatedFromId": "",
"folderId": "",
"widgetContainers": {},
"pageExpiryRedirectId": 0,
"dynamicPageDataSourceType": 0,
"featuredImage": "",
"authorName": "",
"domain": "",
"name": "",
"dynamicPageHubDbTableId": "",
"campaign": "",
"dynamicPageDataSourceId": "",
"enableDomainStylesheets": false,
"includeDefaultCustomCss": false,
"subcategory": "",
"layoutSections": {},
"updated": "",
"footerHtml": "",
"widgets": {},
"headHtml": "",
"pageExpiryRedirectUrl": "",
"abStatus": "",
"useFeaturedImage": false,
"abTestId": "",
"featuredImageAltText": "",
"contentGroupId": "",
"pageExpiryEnabled": false,
"templatePath": "",
"url": "",
"publicAccessRules": [
{}
],
"archivedAt": "",
"themeSettingsValues": {},
"pageExpiryDate": 0,
"publicAccessRulesEnabled": false,
"pageRedirected": false,
"currentState": "",
"categoryId": 0,
"linkRelCanonicalUrl": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"publishDate\": \"\",\n \"language\": \"\",\n \"enableLayoutStylesheets\": false,\n \"metaDescription\": \"\",\n \"attachedStylesheets\": [\n {}\n ],\n \"password\": \"\",\n \"publishImmediately\": false,\n \"htmlTitle\": \"\",\n \"translations\": {},\n \"id\": \"\",\n \"state\": \"\",\n \"slug\": \"\",\n \"createdById\": \"\",\n \"currentlyPublished\": false,\n \"archivedInDashboard\": false,\n \"created\": \"\",\n \"contentTypeCategory\": \"\",\n \"mabExperimentId\": \"\",\n \"updatedById\": \"\",\n \"translatedFromId\": \"\",\n \"folderId\": \"\",\n \"widgetContainers\": {},\n \"pageExpiryRedirectId\": 0,\n \"dynamicPageDataSourceType\": 0,\n \"featuredImage\": \"\",\n \"authorName\": \"\",\n \"domain\": \"\",\n \"name\": \"\",\n \"dynamicPageHubDbTableId\": \"\",\n \"campaign\": \"\",\n \"dynamicPageDataSourceId\": \"\",\n \"enableDomainStylesheets\": false,\n \"includeDefaultCustomCss\": false,\n \"subcategory\": \"\",\n \"layoutSections\": {},\n \"updated\": \"\",\n \"footerHtml\": \"\",\n \"widgets\": {},\n \"headHtml\": \"\",\n \"pageExpiryRedirectUrl\": \"\",\n \"abStatus\": \"\",\n \"useFeaturedImage\": false,\n \"abTestId\": \"\",\n \"featuredImageAltText\": \"\",\n \"contentGroupId\": \"\",\n \"pageExpiryEnabled\": false,\n \"templatePath\": \"\",\n \"url\": \"\",\n \"publicAccessRules\": [\n {}\n ],\n \"archivedAt\": \"\",\n \"themeSettingsValues\": {},\n \"pageExpiryDate\": 0,\n \"publicAccessRulesEnabled\": false,\n \"pageRedirected\": false,\n \"currentState\": \"\",\n \"categoryId\": 0,\n \"linkRelCanonicalUrl\": \"\"\n}"
headers = {
'private-app-legacy': "{{apiKey}}",
'content-type': "application/json"
}
conn.request("PATCH", "/baseUrl/cms/v3/pages/site-pages/:objectId/draft", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/cms/v3/pages/site-pages/:objectId/draft"
payload = {
"publishDate": "",
"language": "",
"enableLayoutStylesheets": False,
"metaDescription": "",
"attachedStylesheets": [{}],
"password": "",
"publishImmediately": False,
"htmlTitle": "",
"translations": {},
"id": "",
"state": "",
"slug": "",
"createdById": "",
"currentlyPublished": False,
"archivedInDashboard": False,
"created": "",
"contentTypeCategory": "",
"mabExperimentId": "",
"updatedById": "",
"translatedFromId": "",
"folderId": "",
"widgetContainers": {},
"pageExpiryRedirectId": 0,
"dynamicPageDataSourceType": 0,
"featuredImage": "",
"authorName": "",
"domain": "",
"name": "",
"dynamicPageHubDbTableId": "",
"campaign": "",
"dynamicPageDataSourceId": "",
"enableDomainStylesheets": False,
"includeDefaultCustomCss": False,
"subcategory": "",
"layoutSections": {},
"updated": "",
"footerHtml": "",
"widgets": {},
"headHtml": "",
"pageExpiryRedirectUrl": "",
"abStatus": "",
"useFeaturedImage": False,
"abTestId": "",
"featuredImageAltText": "",
"contentGroupId": "",
"pageExpiryEnabled": False,
"templatePath": "",
"url": "",
"publicAccessRules": [{}],
"archivedAt": "",
"themeSettingsValues": {},
"pageExpiryDate": 0,
"publicAccessRulesEnabled": False,
"pageRedirected": False,
"currentState": "",
"categoryId": 0,
"linkRelCanonicalUrl": ""
}
headers = {
"private-app-legacy": "{{apiKey}}",
"content-type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/cms/v3/pages/site-pages/:objectId/draft"
payload <- "{\n \"publishDate\": \"\",\n \"language\": \"\",\n \"enableLayoutStylesheets\": false,\n \"metaDescription\": \"\",\n \"attachedStylesheets\": [\n {}\n ],\n \"password\": \"\",\n \"publishImmediately\": false,\n \"htmlTitle\": \"\",\n \"translations\": {},\n \"id\": \"\",\n \"state\": \"\",\n \"slug\": \"\",\n \"createdById\": \"\",\n \"currentlyPublished\": false,\n \"archivedInDashboard\": false,\n \"created\": \"\",\n \"contentTypeCategory\": \"\",\n \"mabExperimentId\": \"\",\n \"updatedById\": \"\",\n \"translatedFromId\": \"\",\n \"folderId\": \"\",\n \"widgetContainers\": {},\n \"pageExpiryRedirectId\": 0,\n \"dynamicPageDataSourceType\": 0,\n \"featuredImage\": \"\",\n \"authorName\": \"\",\n \"domain\": \"\",\n \"name\": \"\",\n \"dynamicPageHubDbTableId\": \"\",\n \"campaign\": \"\",\n \"dynamicPageDataSourceId\": \"\",\n \"enableDomainStylesheets\": false,\n \"includeDefaultCustomCss\": false,\n \"subcategory\": \"\",\n \"layoutSections\": {},\n \"updated\": \"\",\n \"footerHtml\": \"\",\n \"widgets\": {},\n \"headHtml\": \"\",\n \"pageExpiryRedirectUrl\": \"\",\n \"abStatus\": \"\",\n \"useFeaturedImage\": false,\n \"abTestId\": \"\",\n \"featuredImageAltText\": \"\",\n \"contentGroupId\": \"\",\n \"pageExpiryEnabled\": false,\n \"templatePath\": \"\",\n \"url\": \"\",\n \"publicAccessRules\": [\n {}\n ],\n \"archivedAt\": \"\",\n \"themeSettingsValues\": {},\n \"pageExpiryDate\": 0,\n \"publicAccessRulesEnabled\": false,\n \"pageRedirected\": false,\n \"currentState\": \"\",\n \"categoryId\": 0,\n \"linkRelCanonicalUrl\": \"\"\n}"
encode <- "json"
response <- VERB("PATCH", url, body = payload, add_headers('private-app-legacy' = '{{apiKey}}'), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/cms/v3/pages/site-pages/:objectId/draft")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["private-app-legacy"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n \"publishDate\": \"\",\n \"language\": \"\",\n \"enableLayoutStylesheets\": false,\n \"metaDescription\": \"\",\n \"attachedStylesheets\": [\n {}\n ],\n \"password\": \"\",\n \"publishImmediately\": false,\n \"htmlTitle\": \"\",\n \"translations\": {},\n \"id\": \"\",\n \"state\": \"\",\n \"slug\": \"\",\n \"createdById\": \"\",\n \"currentlyPublished\": false,\n \"archivedInDashboard\": false,\n \"created\": \"\",\n \"contentTypeCategory\": \"\",\n \"mabExperimentId\": \"\",\n \"updatedById\": \"\",\n \"translatedFromId\": \"\",\n \"folderId\": \"\",\n \"widgetContainers\": {},\n \"pageExpiryRedirectId\": 0,\n \"dynamicPageDataSourceType\": 0,\n \"featuredImage\": \"\",\n \"authorName\": \"\",\n \"domain\": \"\",\n \"name\": \"\",\n \"dynamicPageHubDbTableId\": \"\",\n \"campaign\": \"\",\n \"dynamicPageDataSourceId\": \"\",\n \"enableDomainStylesheets\": false,\n \"includeDefaultCustomCss\": false,\n \"subcategory\": \"\",\n \"layoutSections\": {},\n \"updated\": \"\",\n \"footerHtml\": \"\",\n \"widgets\": {},\n \"headHtml\": \"\",\n \"pageExpiryRedirectUrl\": \"\",\n \"abStatus\": \"\",\n \"useFeaturedImage\": false,\n \"abTestId\": \"\",\n \"featuredImageAltText\": \"\",\n \"contentGroupId\": \"\",\n \"pageExpiryEnabled\": false,\n \"templatePath\": \"\",\n \"url\": \"\",\n \"publicAccessRules\": [\n {}\n ],\n \"archivedAt\": \"\",\n \"themeSettingsValues\": {},\n \"pageExpiryDate\": 0,\n \"publicAccessRulesEnabled\": false,\n \"pageRedirected\": false,\n \"currentState\": \"\",\n \"categoryId\": 0,\n \"linkRelCanonicalUrl\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.patch('/baseUrl/cms/v3/pages/site-pages/:objectId/draft') do |req|
req.headers['private-app-legacy'] = '{{apiKey}}'
req.body = "{\n \"publishDate\": \"\",\n \"language\": \"\",\n \"enableLayoutStylesheets\": false,\n \"metaDescription\": \"\",\n \"attachedStylesheets\": [\n {}\n ],\n \"password\": \"\",\n \"publishImmediately\": false,\n \"htmlTitle\": \"\",\n \"translations\": {},\n \"id\": \"\",\n \"state\": \"\",\n \"slug\": \"\",\n \"createdById\": \"\",\n \"currentlyPublished\": false,\n \"archivedInDashboard\": false,\n \"created\": \"\",\n \"contentTypeCategory\": \"\",\n \"mabExperimentId\": \"\",\n \"updatedById\": \"\",\n \"translatedFromId\": \"\",\n \"folderId\": \"\",\n \"widgetContainers\": {},\n \"pageExpiryRedirectId\": 0,\n \"dynamicPageDataSourceType\": 0,\n \"featuredImage\": \"\",\n \"authorName\": \"\",\n \"domain\": \"\",\n \"name\": \"\",\n \"dynamicPageHubDbTableId\": \"\",\n \"campaign\": \"\",\n \"dynamicPageDataSourceId\": \"\",\n \"enableDomainStylesheets\": false,\n \"includeDefaultCustomCss\": false,\n \"subcategory\": \"\",\n \"layoutSections\": {},\n \"updated\": \"\",\n \"footerHtml\": \"\",\n \"widgets\": {},\n \"headHtml\": \"\",\n \"pageExpiryRedirectUrl\": \"\",\n \"abStatus\": \"\",\n \"useFeaturedImage\": false,\n \"abTestId\": \"\",\n \"featuredImageAltText\": \"\",\n \"contentGroupId\": \"\",\n \"pageExpiryEnabled\": false,\n \"templatePath\": \"\",\n \"url\": \"\",\n \"publicAccessRules\": [\n {}\n ],\n \"archivedAt\": \"\",\n \"themeSettingsValues\": {},\n \"pageExpiryDate\": 0,\n \"publicAccessRulesEnabled\": false,\n \"pageRedirected\": false,\n \"currentState\": \"\",\n \"categoryId\": 0,\n \"linkRelCanonicalUrl\": \"\"\n}"
end
puts response.status
puts response.body
use std::str::FromStr;
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/cms/v3/pages/site-pages/:objectId/draft";
let payload = json!({
"publishDate": "",
"language": "",
"enableLayoutStylesheets": false,
"metaDescription": "",
"attachedStylesheets": (json!({})),
"password": "",
"publishImmediately": false,
"htmlTitle": "",
"translations": json!({}),
"id": "",
"state": "",
"slug": "",
"createdById": "",
"currentlyPublished": false,
"archivedInDashboard": false,
"created": "",
"contentTypeCategory": "",
"mabExperimentId": "",
"updatedById": "",
"translatedFromId": "",
"folderId": "",
"widgetContainers": json!({}),
"pageExpiryRedirectId": 0,
"dynamicPageDataSourceType": 0,
"featuredImage": "",
"authorName": "",
"domain": "",
"name": "",
"dynamicPageHubDbTableId": "",
"campaign": "",
"dynamicPageDataSourceId": "",
"enableDomainStylesheets": false,
"includeDefaultCustomCss": false,
"subcategory": "",
"layoutSections": json!({}),
"updated": "",
"footerHtml": "",
"widgets": json!({}),
"headHtml": "",
"pageExpiryRedirectUrl": "",
"abStatus": "",
"useFeaturedImage": false,
"abTestId": "",
"featuredImageAltText": "",
"contentGroupId": "",
"pageExpiryEnabled": false,
"templatePath": "",
"url": "",
"publicAccessRules": (json!({})),
"archivedAt": "",
"themeSettingsValues": json!({}),
"pageExpiryDate": 0,
"publicAccessRulesEnabled": false,
"pageRedirected": false,
"currentState": "",
"categoryId": 0,
"linkRelCanonicalUrl": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("private-app-legacy", "{{apiKey}}".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PATCH").unwrap(), url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PATCH \
--url {{baseUrl}}/cms/v3/pages/site-pages/:objectId/draft \
--header 'content-type: application/json' \
--header 'private-app-legacy: {{apiKey}}' \
--data '{
"publishDate": "",
"language": "",
"enableLayoutStylesheets": false,
"metaDescription": "",
"attachedStylesheets": [
{}
],
"password": "",
"publishImmediately": false,
"htmlTitle": "",
"translations": {},
"id": "",
"state": "",
"slug": "",
"createdById": "",
"currentlyPublished": false,
"archivedInDashboard": false,
"created": "",
"contentTypeCategory": "",
"mabExperimentId": "",
"updatedById": "",
"translatedFromId": "",
"folderId": "",
"widgetContainers": {},
"pageExpiryRedirectId": 0,
"dynamicPageDataSourceType": 0,
"featuredImage": "",
"authorName": "",
"domain": "",
"name": "",
"dynamicPageHubDbTableId": "",
"campaign": "",
"dynamicPageDataSourceId": "",
"enableDomainStylesheets": false,
"includeDefaultCustomCss": false,
"subcategory": "",
"layoutSections": {},
"updated": "",
"footerHtml": "",
"widgets": {},
"headHtml": "",
"pageExpiryRedirectUrl": "",
"abStatus": "",
"useFeaturedImage": false,
"abTestId": "",
"featuredImageAltText": "",
"contentGroupId": "",
"pageExpiryEnabled": false,
"templatePath": "",
"url": "",
"publicAccessRules": [
{}
],
"archivedAt": "",
"themeSettingsValues": {},
"pageExpiryDate": 0,
"publicAccessRulesEnabled": false,
"pageRedirected": false,
"currentState": "",
"categoryId": 0,
"linkRelCanonicalUrl": ""
}'
echo '{
"publishDate": "",
"language": "",
"enableLayoutStylesheets": false,
"metaDescription": "",
"attachedStylesheets": [
{}
],
"password": "",
"publishImmediately": false,
"htmlTitle": "",
"translations": {},
"id": "",
"state": "",
"slug": "",
"createdById": "",
"currentlyPublished": false,
"archivedInDashboard": false,
"created": "",
"contentTypeCategory": "",
"mabExperimentId": "",
"updatedById": "",
"translatedFromId": "",
"folderId": "",
"widgetContainers": {},
"pageExpiryRedirectId": 0,
"dynamicPageDataSourceType": 0,
"featuredImage": "",
"authorName": "",
"domain": "",
"name": "",
"dynamicPageHubDbTableId": "",
"campaign": "",
"dynamicPageDataSourceId": "",
"enableDomainStylesheets": false,
"includeDefaultCustomCss": false,
"subcategory": "",
"layoutSections": {},
"updated": "",
"footerHtml": "",
"widgets": {},
"headHtml": "",
"pageExpiryRedirectUrl": "",
"abStatus": "",
"useFeaturedImage": false,
"abTestId": "",
"featuredImageAltText": "",
"contentGroupId": "",
"pageExpiryEnabled": false,
"templatePath": "",
"url": "",
"publicAccessRules": [
{}
],
"archivedAt": "",
"themeSettingsValues": {},
"pageExpiryDate": 0,
"publicAccessRulesEnabled": false,
"pageRedirected": false,
"currentState": "",
"categoryId": 0,
"linkRelCanonicalUrl": ""
}' | \
http PATCH {{baseUrl}}/cms/v3/pages/site-pages/:objectId/draft \
content-type:application/json \
private-app-legacy:'{{apiKey}}'
wget --quiet \
--method PATCH \
--header 'private-app-legacy: {{apiKey}}' \
--header 'content-type: application/json' \
--body-data '{\n "publishDate": "",\n "language": "",\n "enableLayoutStylesheets": false,\n "metaDescription": "",\n "attachedStylesheets": [\n {}\n ],\n "password": "",\n "publishImmediately": false,\n "htmlTitle": "",\n "translations": {},\n "id": "",\n "state": "",\n "slug": "",\n "createdById": "",\n "currentlyPublished": false,\n "archivedInDashboard": false,\n "created": "",\n "contentTypeCategory": "",\n "mabExperimentId": "",\n "updatedById": "",\n "translatedFromId": "",\n "folderId": "",\n "widgetContainers": {},\n "pageExpiryRedirectId": 0,\n "dynamicPageDataSourceType": 0,\n "featuredImage": "",\n "authorName": "",\n "domain": "",\n "name": "",\n "dynamicPageHubDbTableId": "",\n "campaign": "",\n "dynamicPageDataSourceId": "",\n "enableDomainStylesheets": false,\n "includeDefaultCustomCss": false,\n "subcategory": "",\n "layoutSections": {},\n "updated": "",\n "footerHtml": "",\n "widgets": {},\n "headHtml": "",\n "pageExpiryRedirectUrl": "",\n "abStatus": "",\n "useFeaturedImage": false,\n "abTestId": "",\n "featuredImageAltText": "",\n "contentGroupId": "",\n "pageExpiryEnabled": false,\n "templatePath": "",\n "url": "",\n "publicAccessRules": [\n {}\n ],\n "archivedAt": "",\n "themeSettingsValues": {},\n "pageExpiryDate": 0,\n "publicAccessRulesEnabled": false,\n "pageRedirected": false,\n "currentState": "",\n "categoryId": 0,\n "linkRelCanonicalUrl": ""\n}' \
--output-document \
- {{baseUrl}}/cms/v3/pages/site-pages/:objectId/draft
import Foundation
let headers = [
"private-app-legacy": "{{apiKey}}",
"content-type": "application/json"
]
let parameters = [
"publishDate": "",
"language": "",
"enableLayoutStylesheets": false,
"metaDescription": "",
"attachedStylesheets": [[]],
"password": "",
"publishImmediately": false,
"htmlTitle": "",
"translations": [],
"id": "",
"state": "",
"slug": "",
"createdById": "",
"currentlyPublished": false,
"archivedInDashboard": false,
"created": "",
"contentTypeCategory": "",
"mabExperimentId": "",
"updatedById": "",
"translatedFromId": "",
"folderId": "",
"widgetContainers": [],
"pageExpiryRedirectId": 0,
"dynamicPageDataSourceType": 0,
"featuredImage": "",
"authorName": "",
"domain": "",
"name": "",
"dynamicPageHubDbTableId": "",
"campaign": "",
"dynamicPageDataSourceId": "",
"enableDomainStylesheets": false,
"includeDefaultCustomCss": false,
"subcategory": "",
"layoutSections": [],
"updated": "",
"footerHtml": "",
"widgets": [],
"headHtml": "",
"pageExpiryRedirectUrl": "",
"abStatus": "",
"useFeaturedImage": false,
"abTestId": "",
"featuredImageAltText": "",
"contentGroupId": "",
"pageExpiryEnabled": false,
"templatePath": "",
"url": "",
"publicAccessRules": [[]],
"archivedAt": "",
"themeSettingsValues": [],
"pageExpiryDate": 0,
"publicAccessRulesEnabled": false,
"pageRedirected": false,
"currentState": "",
"categoryId": 0,
"linkRelCanonicalUrl": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/cms/v3/pages/site-pages/:objectId/draft")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PATCH"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
*/*
RESPONSE BODY text
{
"message": "Invalid input (details will vary based on the error)",
"correlationId": "aeb5f871-7f07-4993-9211-075dc63e7cbf",
"category": "VALIDATION_ERROR",
"links": {
"knowledge-base": "https://www.hubspot.com/products/service/knowledge-base"
}
}
PATCH
Update a Site Page
{{baseUrl}}/cms/v3/pages/site-pages/:objectId
HEADERS
private-app-legacy
{{apiKey}}
QUERY PARAMS
objectId
BODY json
{
"publishDate": "",
"language": "",
"enableLayoutStylesheets": false,
"metaDescription": "",
"attachedStylesheets": [
{}
],
"password": "",
"publishImmediately": false,
"htmlTitle": "",
"translations": {},
"id": "",
"state": "",
"slug": "",
"createdById": "",
"currentlyPublished": false,
"archivedInDashboard": false,
"created": "",
"contentTypeCategory": "",
"mabExperimentId": "",
"updatedById": "",
"translatedFromId": "",
"folderId": "",
"widgetContainers": {},
"pageExpiryRedirectId": 0,
"dynamicPageDataSourceType": 0,
"featuredImage": "",
"authorName": "",
"domain": "",
"name": "",
"dynamicPageHubDbTableId": "",
"campaign": "",
"dynamicPageDataSourceId": "",
"enableDomainStylesheets": false,
"includeDefaultCustomCss": false,
"subcategory": "",
"layoutSections": {},
"updated": "",
"footerHtml": "",
"widgets": {},
"headHtml": "",
"pageExpiryRedirectUrl": "",
"abStatus": "",
"useFeaturedImage": false,
"abTestId": "",
"featuredImageAltText": "",
"contentGroupId": "",
"pageExpiryEnabled": false,
"templatePath": "",
"url": "",
"publicAccessRules": [
{}
],
"archivedAt": "",
"themeSettingsValues": {},
"pageExpiryDate": 0,
"publicAccessRulesEnabled": false,
"pageRedirected": false,
"currentState": "",
"categoryId": 0,
"linkRelCanonicalUrl": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PATCH");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/cms/v3/pages/site-pages/:objectId");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "private-app-legacy: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"publishDate\": \"\",\n \"language\": \"\",\n \"enableLayoutStylesheets\": false,\n \"metaDescription\": \"\",\n \"attachedStylesheets\": [\n {}\n ],\n \"password\": \"\",\n \"publishImmediately\": false,\n \"htmlTitle\": \"\",\n \"translations\": {},\n \"id\": \"\",\n \"state\": \"\",\n \"slug\": \"\",\n \"createdById\": \"\",\n \"currentlyPublished\": false,\n \"archivedInDashboard\": false,\n \"created\": \"\",\n \"contentTypeCategory\": \"\",\n \"mabExperimentId\": \"\",\n \"updatedById\": \"\",\n \"translatedFromId\": \"\",\n \"folderId\": \"\",\n \"widgetContainers\": {},\n \"pageExpiryRedirectId\": 0,\n \"dynamicPageDataSourceType\": 0,\n \"featuredImage\": \"\",\n \"authorName\": \"\",\n \"domain\": \"\",\n \"name\": \"\",\n \"dynamicPageHubDbTableId\": \"\",\n \"campaign\": \"\",\n \"dynamicPageDataSourceId\": \"\",\n \"enableDomainStylesheets\": false,\n \"includeDefaultCustomCss\": false,\n \"subcategory\": \"\",\n \"layoutSections\": {},\n \"updated\": \"\",\n \"footerHtml\": \"\",\n \"widgets\": {},\n \"headHtml\": \"\",\n \"pageExpiryRedirectUrl\": \"\",\n \"abStatus\": \"\",\n \"useFeaturedImage\": false,\n \"abTestId\": \"\",\n \"featuredImageAltText\": \"\",\n \"contentGroupId\": \"\",\n \"pageExpiryEnabled\": false,\n \"templatePath\": \"\",\n \"url\": \"\",\n \"publicAccessRules\": [\n {}\n ],\n \"archivedAt\": \"\",\n \"themeSettingsValues\": {},\n \"pageExpiryDate\": 0,\n \"publicAccessRulesEnabled\": false,\n \"pageRedirected\": false,\n \"currentState\": \"\",\n \"categoryId\": 0,\n \"linkRelCanonicalUrl\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/patch "{{baseUrl}}/cms/v3/pages/site-pages/:objectId" {:headers {:private-app-legacy "{{apiKey}}"}
:content-type :json
:form-params {:publishDate ""
:language ""
:enableLayoutStylesheets false
:metaDescription ""
:attachedStylesheets [{}]
:password ""
:publishImmediately false
:htmlTitle ""
:translations {}
:id ""
:state ""
:slug ""
:createdById ""
:currentlyPublished false
:archivedInDashboard false
:created ""
:contentTypeCategory ""
:mabExperimentId ""
:updatedById ""
:translatedFromId ""
:folderId ""
:widgetContainers {}
:pageExpiryRedirectId 0
:dynamicPageDataSourceType 0
:featuredImage ""
:authorName ""
:domain ""
:name ""
:dynamicPageHubDbTableId ""
:campaign ""
:dynamicPageDataSourceId ""
:enableDomainStylesheets false
:includeDefaultCustomCss false
:subcategory ""
:layoutSections {}
:updated ""
:footerHtml ""
:widgets {}
:headHtml ""
:pageExpiryRedirectUrl ""
:abStatus ""
:useFeaturedImage false
:abTestId ""
:featuredImageAltText ""
:contentGroupId ""
:pageExpiryEnabled false
:templatePath ""
:url ""
:publicAccessRules [{}]
:archivedAt ""
:themeSettingsValues {}
:pageExpiryDate 0
:publicAccessRulesEnabled false
:pageRedirected false
:currentState ""
:categoryId 0
:linkRelCanonicalUrl ""}})
require "http/client"
url = "{{baseUrl}}/cms/v3/pages/site-pages/:objectId"
headers = HTTP::Headers{
"private-app-legacy" => "{{apiKey}}"
"content-type" => "application/json"
}
reqBody = "{\n \"publishDate\": \"\",\n \"language\": \"\",\n \"enableLayoutStylesheets\": false,\n \"metaDescription\": \"\",\n \"attachedStylesheets\": [\n {}\n ],\n \"password\": \"\",\n \"publishImmediately\": false,\n \"htmlTitle\": \"\",\n \"translations\": {},\n \"id\": \"\",\n \"state\": \"\",\n \"slug\": \"\",\n \"createdById\": \"\",\n \"currentlyPublished\": false,\n \"archivedInDashboard\": false,\n \"created\": \"\",\n \"contentTypeCategory\": \"\",\n \"mabExperimentId\": \"\",\n \"updatedById\": \"\",\n \"translatedFromId\": \"\",\n \"folderId\": \"\",\n \"widgetContainers\": {},\n \"pageExpiryRedirectId\": 0,\n \"dynamicPageDataSourceType\": 0,\n \"featuredImage\": \"\",\n \"authorName\": \"\",\n \"domain\": \"\",\n \"name\": \"\",\n \"dynamicPageHubDbTableId\": \"\",\n \"campaign\": \"\",\n \"dynamicPageDataSourceId\": \"\",\n \"enableDomainStylesheets\": false,\n \"includeDefaultCustomCss\": false,\n \"subcategory\": \"\",\n \"layoutSections\": {},\n \"updated\": \"\",\n \"footerHtml\": \"\",\n \"widgets\": {},\n \"headHtml\": \"\",\n \"pageExpiryRedirectUrl\": \"\",\n \"abStatus\": \"\",\n \"useFeaturedImage\": false,\n \"abTestId\": \"\",\n \"featuredImageAltText\": \"\",\n \"contentGroupId\": \"\",\n \"pageExpiryEnabled\": false,\n \"templatePath\": \"\",\n \"url\": \"\",\n \"publicAccessRules\": [\n {}\n ],\n \"archivedAt\": \"\",\n \"themeSettingsValues\": {},\n \"pageExpiryDate\": 0,\n \"publicAccessRulesEnabled\": false,\n \"pageRedirected\": false,\n \"currentState\": \"\",\n \"categoryId\": 0,\n \"linkRelCanonicalUrl\": \"\"\n}"
response = HTTP::Client.patch url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Patch,
RequestUri = new Uri("{{baseUrl}}/cms/v3/pages/site-pages/:objectId"),
Headers =
{
{ "private-app-legacy", "{{apiKey}}" },
},
Content = new StringContent("{\n \"publishDate\": \"\",\n \"language\": \"\",\n \"enableLayoutStylesheets\": false,\n \"metaDescription\": \"\",\n \"attachedStylesheets\": [\n {}\n ],\n \"password\": \"\",\n \"publishImmediately\": false,\n \"htmlTitle\": \"\",\n \"translations\": {},\n \"id\": \"\",\n \"state\": \"\",\n \"slug\": \"\",\n \"createdById\": \"\",\n \"currentlyPublished\": false,\n \"archivedInDashboard\": false,\n \"created\": \"\",\n \"contentTypeCategory\": \"\",\n \"mabExperimentId\": \"\",\n \"updatedById\": \"\",\n \"translatedFromId\": \"\",\n \"folderId\": \"\",\n \"widgetContainers\": {},\n \"pageExpiryRedirectId\": 0,\n \"dynamicPageDataSourceType\": 0,\n \"featuredImage\": \"\",\n \"authorName\": \"\",\n \"domain\": \"\",\n \"name\": \"\",\n \"dynamicPageHubDbTableId\": \"\",\n \"campaign\": \"\",\n \"dynamicPageDataSourceId\": \"\",\n \"enableDomainStylesheets\": false,\n \"includeDefaultCustomCss\": false,\n \"subcategory\": \"\",\n \"layoutSections\": {},\n \"updated\": \"\",\n \"footerHtml\": \"\",\n \"widgets\": {},\n \"headHtml\": \"\",\n \"pageExpiryRedirectUrl\": \"\",\n \"abStatus\": \"\",\n \"useFeaturedImage\": false,\n \"abTestId\": \"\",\n \"featuredImageAltText\": \"\",\n \"contentGroupId\": \"\",\n \"pageExpiryEnabled\": false,\n \"templatePath\": \"\",\n \"url\": \"\",\n \"publicAccessRules\": [\n {}\n ],\n \"archivedAt\": \"\",\n \"themeSettingsValues\": {},\n \"pageExpiryDate\": 0,\n \"publicAccessRulesEnabled\": false,\n \"pageRedirected\": false,\n \"currentState\": \"\",\n \"categoryId\": 0,\n \"linkRelCanonicalUrl\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/cms/v3/pages/site-pages/:objectId");
var request = new RestRequest("", Method.Patch);
request.AddHeader("private-app-legacy", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"publishDate\": \"\",\n \"language\": \"\",\n \"enableLayoutStylesheets\": false,\n \"metaDescription\": \"\",\n \"attachedStylesheets\": [\n {}\n ],\n \"password\": \"\",\n \"publishImmediately\": false,\n \"htmlTitle\": \"\",\n \"translations\": {},\n \"id\": \"\",\n \"state\": \"\",\n \"slug\": \"\",\n \"createdById\": \"\",\n \"currentlyPublished\": false,\n \"archivedInDashboard\": false,\n \"created\": \"\",\n \"contentTypeCategory\": \"\",\n \"mabExperimentId\": \"\",\n \"updatedById\": \"\",\n \"translatedFromId\": \"\",\n \"folderId\": \"\",\n \"widgetContainers\": {},\n \"pageExpiryRedirectId\": 0,\n \"dynamicPageDataSourceType\": 0,\n \"featuredImage\": \"\",\n \"authorName\": \"\",\n \"domain\": \"\",\n \"name\": \"\",\n \"dynamicPageHubDbTableId\": \"\",\n \"campaign\": \"\",\n \"dynamicPageDataSourceId\": \"\",\n \"enableDomainStylesheets\": false,\n \"includeDefaultCustomCss\": false,\n \"subcategory\": \"\",\n \"layoutSections\": {},\n \"updated\": \"\",\n \"footerHtml\": \"\",\n \"widgets\": {},\n \"headHtml\": \"\",\n \"pageExpiryRedirectUrl\": \"\",\n \"abStatus\": \"\",\n \"useFeaturedImage\": false,\n \"abTestId\": \"\",\n \"featuredImageAltText\": \"\",\n \"contentGroupId\": \"\",\n \"pageExpiryEnabled\": false,\n \"templatePath\": \"\",\n \"url\": \"\",\n \"publicAccessRules\": [\n {}\n ],\n \"archivedAt\": \"\",\n \"themeSettingsValues\": {},\n \"pageExpiryDate\": 0,\n \"publicAccessRulesEnabled\": false,\n \"pageRedirected\": false,\n \"currentState\": \"\",\n \"categoryId\": 0,\n \"linkRelCanonicalUrl\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/cms/v3/pages/site-pages/:objectId"
payload := strings.NewReader("{\n \"publishDate\": \"\",\n \"language\": \"\",\n \"enableLayoutStylesheets\": false,\n \"metaDescription\": \"\",\n \"attachedStylesheets\": [\n {}\n ],\n \"password\": \"\",\n \"publishImmediately\": false,\n \"htmlTitle\": \"\",\n \"translations\": {},\n \"id\": \"\",\n \"state\": \"\",\n \"slug\": \"\",\n \"createdById\": \"\",\n \"currentlyPublished\": false,\n \"archivedInDashboard\": false,\n \"created\": \"\",\n \"contentTypeCategory\": \"\",\n \"mabExperimentId\": \"\",\n \"updatedById\": \"\",\n \"translatedFromId\": \"\",\n \"folderId\": \"\",\n \"widgetContainers\": {},\n \"pageExpiryRedirectId\": 0,\n \"dynamicPageDataSourceType\": 0,\n \"featuredImage\": \"\",\n \"authorName\": \"\",\n \"domain\": \"\",\n \"name\": \"\",\n \"dynamicPageHubDbTableId\": \"\",\n \"campaign\": \"\",\n \"dynamicPageDataSourceId\": \"\",\n \"enableDomainStylesheets\": false,\n \"includeDefaultCustomCss\": false,\n \"subcategory\": \"\",\n \"layoutSections\": {},\n \"updated\": \"\",\n \"footerHtml\": \"\",\n \"widgets\": {},\n \"headHtml\": \"\",\n \"pageExpiryRedirectUrl\": \"\",\n \"abStatus\": \"\",\n \"useFeaturedImage\": false,\n \"abTestId\": \"\",\n \"featuredImageAltText\": \"\",\n \"contentGroupId\": \"\",\n \"pageExpiryEnabled\": false,\n \"templatePath\": \"\",\n \"url\": \"\",\n \"publicAccessRules\": [\n {}\n ],\n \"archivedAt\": \"\",\n \"themeSettingsValues\": {},\n \"pageExpiryDate\": 0,\n \"publicAccessRulesEnabled\": false,\n \"pageRedirected\": false,\n \"currentState\": \"\",\n \"categoryId\": 0,\n \"linkRelCanonicalUrl\": \"\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("private-app-legacy", "{{apiKey}}")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PATCH /baseUrl/cms/v3/pages/site-pages/:objectId HTTP/1.1
Private-App-Legacy: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 1385
{
"publishDate": "",
"language": "",
"enableLayoutStylesheets": false,
"metaDescription": "",
"attachedStylesheets": [
{}
],
"password": "",
"publishImmediately": false,
"htmlTitle": "",
"translations": {},
"id": "",
"state": "",
"slug": "",
"createdById": "",
"currentlyPublished": false,
"archivedInDashboard": false,
"created": "",
"contentTypeCategory": "",
"mabExperimentId": "",
"updatedById": "",
"translatedFromId": "",
"folderId": "",
"widgetContainers": {},
"pageExpiryRedirectId": 0,
"dynamicPageDataSourceType": 0,
"featuredImage": "",
"authorName": "",
"domain": "",
"name": "",
"dynamicPageHubDbTableId": "",
"campaign": "",
"dynamicPageDataSourceId": "",
"enableDomainStylesheets": false,
"includeDefaultCustomCss": false,
"subcategory": "",
"layoutSections": {},
"updated": "",
"footerHtml": "",
"widgets": {},
"headHtml": "",
"pageExpiryRedirectUrl": "",
"abStatus": "",
"useFeaturedImage": false,
"abTestId": "",
"featuredImageAltText": "",
"contentGroupId": "",
"pageExpiryEnabled": false,
"templatePath": "",
"url": "",
"publicAccessRules": [
{}
],
"archivedAt": "",
"themeSettingsValues": {},
"pageExpiryDate": 0,
"publicAccessRulesEnabled": false,
"pageRedirected": false,
"currentState": "",
"categoryId": 0,
"linkRelCanonicalUrl": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PATCH", "{{baseUrl}}/cms/v3/pages/site-pages/:objectId")
.setHeader("private-app-legacy", "{{apiKey}}")
.setHeader("content-type", "application/json")
.setBody("{\n \"publishDate\": \"\",\n \"language\": \"\",\n \"enableLayoutStylesheets\": false,\n \"metaDescription\": \"\",\n \"attachedStylesheets\": [\n {}\n ],\n \"password\": \"\",\n \"publishImmediately\": false,\n \"htmlTitle\": \"\",\n \"translations\": {},\n \"id\": \"\",\n \"state\": \"\",\n \"slug\": \"\",\n \"createdById\": \"\",\n \"currentlyPublished\": false,\n \"archivedInDashboard\": false,\n \"created\": \"\",\n \"contentTypeCategory\": \"\",\n \"mabExperimentId\": \"\",\n \"updatedById\": \"\",\n \"translatedFromId\": \"\",\n \"folderId\": \"\",\n \"widgetContainers\": {},\n \"pageExpiryRedirectId\": 0,\n \"dynamicPageDataSourceType\": 0,\n \"featuredImage\": \"\",\n \"authorName\": \"\",\n \"domain\": \"\",\n \"name\": \"\",\n \"dynamicPageHubDbTableId\": \"\",\n \"campaign\": \"\",\n \"dynamicPageDataSourceId\": \"\",\n \"enableDomainStylesheets\": false,\n \"includeDefaultCustomCss\": false,\n \"subcategory\": \"\",\n \"layoutSections\": {},\n \"updated\": \"\",\n \"footerHtml\": \"\",\n \"widgets\": {},\n \"headHtml\": \"\",\n \"pageExpiryRedirectUrl\": \"\",\n \"abStatus\": \"\",\n \"useFeaturedImage\": false,\n \"abTestId\": \"\",\n \"featuredImageAltText\": \"\",\n \"contentGroupId\": \"\",\n \"pageExpiryEnabled\": false,\n \"templatePath\": \"\",\n \"url\": \"\",\n \"publicAccessRules\": [\n {}\n ],\n \"archivedAt\": \"\",\n \"themeSettingsValues\": {},\n \"pageExpiryDate\": 0,\n \"publicAccessRulesEnabled\": false,\n \"pageRedirected\": false,\n \"currentState\": \"\",\n \"categoryId\": 0,\n \"linkRelCanonicalUrl\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/cms/v3/pages/site-pages/:objectId"))
.header("private-app-legacy", "{{apiKey}}")
.header("content-type", "application/json")
.method("PATCH", HttpRequest.BodyPublishers.ofString("{\n \"publishDate\": \"\",\n \"language\": \"\",\n \"enableLayoutStylesheets\": false,\n \"metaDescription\": \"\",\n \"attachedStylesheets\": [\n {}\n ],\n \"password\": \"\",\n \"publishImmediately\": false,\n \"htmlTitle\": \"\",\n \"translations\": {},\n \"id\": \"\",\n \"state\": \"\",\n \"slug\": \"\",\n \"createdById\": \"\",\n \"currentlyPublished\": false,\n \"archivedInDashboard\": false,\n \"created\": \"\",\n \"contentTypeCategory\": \"\",\n \"mabExperimentId\": \"\",\n \"updatedById\": \"\",\n \"translatedFromId\": \"\",\n \"folderId\": \"\",\n \"widgetContainers\": {},\n \"pageExpiryRedirectId\": 0,\n \"dynamicPageDataSourceType\": 0,\n \"featuredImage\": \"\",\n \"authorName\": \"\",\n \"domain\": \"\",\n \"name\": \"\",\n \"dynamicPageHubDbTableId\": \"\",\n \"campaign\": \"\",\n \"dynamicPageDataSourceId\": \"\",\n \"enableDomainStylesheets\": false,\n \"includeDefaultCustomCss\": false,\n \"subcategory\": \"\",\n \"layoutSections\": {},\n \"updated\": \"\",\n \"footerHtml\": \"\",\n \"widgets\": {},\n \"headHtml\": \"\",\n \"pageExpiryRedirectUrl\": \"\",\n \"abStatus\": \"\",\n \"useFeaturedImage\": false,\n \"abTestId\": \"\",\n \"featuredImageAltText\": \"\",\n \"contentGroupId\": \"\",\n \"pageExpiryEnabled\": false,\n \"templatePath\": \"\",\n \"url\": \"\",\n \"publicAccessRules\": [\n {}\n ],\n \"archivedAt\": \"\",\n \"themeSettingsValues\": {},\n \"pageExpiryDate\": 0,\n \"publicAccessRulesEnabled\": false,\n \"pageRedirected\": false,\n \"currentState\": \"\",\n \"categoryId\": 0,\n \"linkRelCanonicalUrl\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"publishDate\": \"\",\n \"language\": \"\",\n \"enableLayoutStylesheets\": false,\n \"metaDescription\": \"\",\n \"attachedStylesheets\": [\n {}\n ],\n \"password\": \"\",\n \"publishImmediately\": false,\n \"htmlTitle\": \"\",\n \"translations\": {},\n \"id\": \"\",\n \"state\": \"\",\n \"slug\": \"\",\n \"createdById\": \"\",\n \"currentlyPublished\": false,\n \"archivedInDashboard\": false,\n \"created\": \"\",\n \"contentTypeCategory\": \"\",\n \"mabExperimentId\": \"\",\n \"updatedById\": \"\",\n \"translatedFromId\": \"\",\n \"folderId\": \"\",\n \"widgetContainers\": {},\n \"pageExpiryRedirectId\": 0,\n \"dynamicPageDataSourceType\": 0,\n \"featuredImage\": \"\",\n \"authorName\": \"\",\n \"domain\": \"\",\n \"name\": \"\",\n \"dynamicPageHubDbTableId\": \"\",\n \"campaign\": \"\",\n \"dynamicPageDataSourceId\": \"\",\n \"enableDomainStylesheets\": false,\n \"includeDefaultCustomCss\": false,\n \"subcategory\": \"\",\n \"layoutSections\": {},\n \"updated\": \"\",\n \"footerHtml\": \"\",\n \"widgets\": {},\n \"headHtml\": \"\",\n \"pageExpiryRedirectUrl\": \"\",\n \"abStatus\": \"\",\n \"useFeaturedImage\": false,\n \"abTestId\": \"\",\n \"featuredImageAltText\": \"\",\n \"contentGroupId\": \"\",\n \"pageExpiryEnabled\": false,\n \"templatePath\": \"\",\n \"url\": \"\",\n \"publicAccessRules\": [\n {}\n ],\n \"archivedAt\": \"\",\n \"themeSettingsValues\": {},\n \"pageExpiryDate\": 0,\n \"publicAccessRulesEnabled\": false,\n \"pageRedirected\": false,\n \"currentState\": \"\",\n \"categoryId\": 0,\n \"linkRelCanonicalUrl\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/cms/v3/pages/site-pages/:objectId")
.patch(body)
.addHeader("private-app-legacy", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.patch("{{baseUrl}}/cms/v3/pages/site-pages/:objectId")
.header("private-app-legacy", "{{apiKey}}")
.header("content-type", "application/json")
.body("{\n \"publishDate\": \"\",\n \"language\": \"\",\n \"enableLayoutStylesheets\": false,\n \"metaDescription\": \"\",\n \"attachedStylesheets\": [\n {}\n ],\n \"password\": \"\",\n \"publishImmediately\": false,\n \"htmlTitle\": \"\",\n \"translations\": {},\n \"id\": \"\",\n \"state\": \"\",\n \"slug\": \"\",\n \"createdById\": \"\",\n \"currentlyPublished\": false,\n \"archivedInDashboard\": false,\n \"created\": \"\",\n \"contentTypeCategory\": \"\",\n \"mabExperimentId\": \"\",\n \"updatedById\": \"\",\n \"translatedFromId\": \"\",\n \"folderId\": \"\",\n \"widgetContainers\": {},\n \"pageExpiryRedirectId\": 0,\n \"dynamicPageDataSourceType\": 0,\n \"featuredImage\": \"\",\n \"authorName\": \"\",\n \"domain\": \"\",\n \"name\": \"\",\n \"dynamicPageHubDbTableId\": \"\",\n \"campaign\": \"\",\n \"dynamicPageDataSourceId\": \"\",\n \"enableDomainStylesheets\": false,\n \"includeDefaultCustomCss\": false,\n \"subcategory\": \"\",\n \"layoutSections\": {},\n \"updated\": \"\",\n \"footerHtml\": \"\",\n \"widgets\": {},\n \"headHtml\": \"\",\n \"pageExpiryRedirectUrl\": \"\",\n \"abStatus\": \"\",\n \"useFeaturedImage\": false,\n \"abTestId\": \"\",\n \"featuredImageAltText\": \"\",\n \"contentGroupId\": \"\",\n \"pageExpiryEnabled\": false,\n \"templatePath\": \"\",\n \"url\": \"\",\n \"publicAccessRules\": [\n {}\n ],\n \"archivedAt\": \"\",\n \"themeSettingsValues\": {},\n \"pageExpiryDate\": 0,\n \"publicAccessRulesEnabled\": false,\n \"pageRedirected\": false,\n \"currentState\": \"\",\n \"categoryId\": 0,\n \"linkRelCanonicalUrl\": \"\"\n}")
.asString();
const data = JSON.stringify({
publishDate: '',
language: '',
enableLayoutStylesheets: false,
metaDescription: '',
attachedStylesheets: [
{}
],
password: '',
publishImmediately: false,
htmlTitle: '',
translations: {},
id: '',
state: '',
slug: '',
createdById: '',
currentlyPublished: false,
archivedInDashboard: false,
created: '',
contentTypeCategory: '',
mabExperimentId: '',
updatedById: '',
translatedFromId: '',
folderId: '',
widgetContainers: {},
pageExpiryRedirectId: 0,
dynamicPageDataSourceType: 0,
featuredImage: '',
authorName: '',
domain: '',
name: '',
dynamicPageHubDbTableId: '',
campaign: '',
dynamicPageDataSourceId: '',
enableDomainStylesheets: false,
includeDefaultCustomCss: false,
subcategory: '',
layoutSections: {},
updated: '',
footerHtml: '',
widgets: {},
headHtml: '',
pageExpiryRedirectUrl: '',
abStatus: '',
useFeaturedImage: false,
abTestId: '',
featuredImageAltText: '',
contentGroupId: '',
pageExpiryEnabled: false,
templatePath: '',
url: '',
publicAccessRules: [
{}
],
archivedAt: '',
themeSettingsValues: {},
pageExpiryDate: 0,
publicAccessRulesEnabled: false,
pageRedirected: false,
currentState: '',
categoryId: 0,
linkRelCanonicalUrl: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PATCH', '{{baseUrl}}/cms/v3/pages/site-pages/:objectId');
xhr.setRequestHeader('private-app-legacy', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PATCH',
url: '{{baseUrl}}/cms/v3/pages/site-pages/:objectId',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
data: {
publishDate: '',
language: '',
enableLayoutStylesheets: false,
metaDescription: '',
attachedStylesheets: [{}],
password: '',
publishImmediately: false,
htmlTitle: '',
translations: {},
id: '',
state: '',
slug: '',
createdById: '',
currentlyPublished: false,
archivedInDashboard: false,
created: '',
contentTypeCategory: '',
mabExperimentId: '',
updatedById: '',
translatedFromId: '',
folderId: '',
widgetContainers: {},
pageExpiryRedirectId: 0,
dynamicPageDataSourceType: 0,
featuredImage: '',
authorName: '',
domain: '',
name: '',
dynamicPageHubDbTableId: '',
campaign: '',
dynamicPageDataSourceId: '',
enableDomainStylesheets: false,
includeDefaultCustomCss: false,
subcategory: '',
layoutSections: {},
updated: '',
footerHtml: '',
widgets: {},
headHtml: '',
pageExpiryRedirectUrl: '',
abStatus: '',
useFeaturedImage: false,
abTestId: '',
featuredImageAltText: '',
contentGroupId: '',
pageExpiryEnabled: false,
templatePath: '',
url: '',
publicAccessRules: [{}],
archivedAt: '',
themeSettingsValues: {},
pageExpiryDate: 0,
publicAccessRulesEnabled: false,
pageRedirected: false,
currentState: '',
categoryId: 0,
linkRelCanonicalUrl: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/cms/v3/pages/site-pages/:objectId';
const options = {
method: 'PATCH',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
body: '{"publishDate":"","language":"","enableLayoutStylesheets":false,"metaDescription":"","attachedStylesheets":[{}],"password":"","publishImmediately":false,"htmlTitle":"","translations":{},"id":"","state":"","slug":"","createdById":"","currentlyPublished":false,"archivedInDashboard":false,"created":"","contentTypeCategory":"","mabExperimentId":"","updatedById":"","translatedFromId":"","folderId":"","widgetContainers":{},"pageExpiryRedirectId":0,"dynamicPageDataSourceType":0,"featuredImage":"","authorName":"","domain":"","name":"","dynamicPageHubDbTableId":"","campaign":"","dynamicPageDataSourceId":"","enableDomainStylesheets":false,"includeDefaultCustomCss":false,"subcategory":"","layoutSections":{},"updated":"","footerHtml":"","widgets":{},"headHtml":"","pageExpiryRedirectUrl":"","abStatus":"","useFeaturedImage":false,"abTestId":"","featuredImageAltText":"","contentGroupId":"","pageExpiryEnabled":false,"templatePath":"","url":"","publicAccessRules":[{}],"archivedAt":"","themeSettingsValues":{},"pageExpiryDate":0,"publicAccessRulesEnabled":false,"pageRedirected":false,"currentState":"","categoryId":0,"linkRelCanonicalUrl":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/cms/v3/pages/site-pages/:objectId',
method: 'PATCH',
headers: {
'private-app-legacy': '{{apiKey}}',
'content-type': 'application/json'
},
processData: false,
data: '{\n "publishDate": "",\n "language": "",\n "enableLayoutStylesheets": false,\n "metaDescription": "",\n "attachedStylesheets": [\n {}\n ],\n "password": "",\n "publishImmediately": false,\n "htmlTitle": "",\n "translations": {},\n "id": "",\n "state": "",\n "slug": "",\n "createdById": "",\n "currentlyPublished": false,\n "archivedInDashboard": false,\n "created": "",\n "contentTypeCategory": "",\n "mabExperimentId": "",\n "updatedById": "",\n "translatedFromId": "",\n "folderId": "",\n "widgetContainers": {},\n "pageExpiryRedirectId": 0,\n "dynamicPageDataSourceType": 0,\n "featuredImage": "",\n "authorName": "",\n "domain": "",\n "name": "",\n "dynamicPageHubDbTableId": "",\n "campaign": "",\n "dynamicPageDataSourceId": "",\n "enableDomainStylesheets": false,\n "includeDefaultCustomCss": false,\n "subcategory": "",\n "layoutSections": {},\n "updated": "",\n "footerHtml": "",\n "widgets": {},\n "headHtml": "",\n "pageExpiryRedirectUrl": "",\n "abStatus": "",\n "useFeaturedImage": false,\n "abTestId": "",\n "featuredImageAltText": "",\n "contentGroupId": "",\n "pageExpiryEnabled": false,\n "templatePath": "",\n "url": "",\n "publicAccessRules": [\n {}\n ],\n "archivedAt": "",\n "themeSettingsValues": {},\n "pageExpiryDate": 0,\n "publicAccessRulesEnabled": false,\n "pageRedirected": false,\n "currentState": "",\n "categoryId": 0,\n "linkRelCanonicalUrl": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"publishDate\": \"\",\n \"language\": \"\",\n \"enableLayoutStylesheets\": false,\n \"metaDescription\": \"\",\n \"attachedStylesheets\": [\n {}\n ],\n \"password\": \"\",\n \"publishImmediately\": false,\n \"htmlTitle\": \"\",\n \"translations\": {},\n \"id\": \"\",\n \"state\": \"\",\n \"slug\": \"\",\n \"createdById\": \"\",\n \"currentlyPublished\": false,\n \"archivedInDashboard\": false,\n \"created\": \"\",\n \"contentTypeCategory\": \"\",\n \"mabExperimentId\": \"\",\n \"updatedById\": \"\",\n \"translatedFromId\": \"\",\n \"folderId\": \"\",\n \"widgetContainers\": {},\n \"pageExpiryRedirectId\": 0,\n \"dynamicPageDataSourceType\": 0,\n \"featuredImage\": \"\",\n \"authorName\": \"\",\n \"domain\": \"\",\n \"name\": \"\",\n \"dynamicPageHubDbTableId\": \"\",\n \"campaign\": \"\",\n \"dynamicPageDataSourceId\": \"\",\n \"enableDomainStylesheets\": false,\n \"includeDefaultCustomCss\": false,\n \"subcategory\": \"\",\n \"layoutSections\": {},\n \"updated\": \"\",\n \"footerHtml\": \"\",\n \"widgets\": {},\n \"headHtml\": \"\",\n \"pageExpiryRedirectUrl\": \"\",\n \"abStatus\": \"\",\n \"useFeaturedImage\": false,\n \"abTestId\": \"\",\n \"featuredImageAltText\": \"\",\n \"contentGroupId\": \"\",\n \"pageExpiryEnabled\": false,\n \"templatePath\": \"\",\n \"url\": \"\",\n \"publicAccessRules\": [\n {}\n ],\n \"archivedAt\": \"\",\n \"themeSettingsValues\": {},\n \"pageExpiryDate\": 0,\n \"publicAccessRulesEnabled\": false,\n \"pageRedirected\": false,\n \"currentState\": \"\",\n \"categoryId\": 0,\n \"linkRelCanonicalUrl\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/cms/v3/pages/site-pages/:objectId")
.patch(body)
.addHeader("private-app-legacy", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PATCH',
hostname: 'example.com',
port: null,
path: '/baseUrl/cms/v3/pages/site-pages/:objectId',
headers: {
'private-app-legacy': '{{apiKey}}',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
publishDate: '',
language: '',
enableLayoutStylesheets: false,
metaDescription: '',
attachedStylesheets: [{}],
password: '',
publishImmediately: false,
htmlTitle: '',
translations: {},
id: '',
state: '',
slug: '',
createdById: '',
currentlyPublished: false,
archivedInDashboard: false,
created: '',
contentTypeCategory: '',
mabExperimentId: '',
updatedById: '',
translatedFromId: '',
folderId: '',
widgetContainers: {},
pageExpiryRedirectId: 0,
dynamicPageDataSourceType: 0,
featuredImage: '',
authorName: '',
domain: '',
name: '',
dynamicPageHubDbTableId: '',
campaign: '',
dynamicPageDataSourceId: '',
enableDomainStylesheets: false,
includeDefaultCustomCss: false,
subcategory: '',
layoutSections: {},
updated: '',
footerHtml: '',
widgets: {},
headHtml: '',
pageExpiryRedirectUrl: '',
abStatus: '',
useFeaturedImage: false,
abTestId: '',
featuredImageAltText: '',
contentGroupId: '',
pageExpiryEnabled: false,
templatePath: '',
url: '',
publicAccessRules: [{}],
archivedAt: '',
themeSettingsValues: {},
pageExpiryDate: 0,
publicAccessRulesEnabled: false,
pageRedirected: false,
currentState: '',
categoryId: 0,
linkRelCanonicalUrl: ''
}));
req.end();
const request = require('request');
const options = {
method: 'PATCH',
url: '{{baseUrl}}/cms/v3/pages/site-pages/:objectId',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
body: {
publishDate: '',
language: '',
enableLayoutStylesheets: false,
metaDescription: '',
attachedStylesheets: [{}],
password: '',
publishImmediately: false,
htmlTitle: '',
translations: {},
id: '',
state: '',
slug: '',
createdById: '',
currentlyPublished: false,
archivedInDashboard: false,
created: '',
contentTypeCategory: '',
mabExperimentId: '',
updatedById: '',
translatedFromId: '',
folderId: '',
widgetContainers: {},
pageExpiryRedirectId: 0,
dynamicPageDataSourceType: 0,
featuredImage: '',
authorName: '',
domain: '',
name: '',
dynamicPageHubDbTableId: '',
campaign: '',
dynamicPageDataSourceId: '',
enableDomainStylesheets: false,
includeDefaultCustomCss: false,
subcategory: '',
layoutSections: {},
updated: '',
footerHtml: '',
widgets: {},
headHtml: '',
pageExpiryRedirectUrl: '',
abStatus: '',
useFeaturedImage: false,
abTestId: '',
featuredImageAltText: '',
contentGroupId: '',
pageExpiryEnabled: false,
templatePath: '',
url: '',
publicAccessRules: [{}],
archivedAt: '',
themeSettingsValues: {},
pageExpiryDate: 0,
publicAccessRulesEnabled: false,
pageRedirected: false,
currentState: '',
categoryId: 0,
linkRelCanonicalUrl: ''
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PATCH', '{{baseUrl}}/cms/v3/pages/site-pages/:objectId');
req.headers({
'private-app-legacy': '{{apiKey}}',
'content-type': 'application/json'
});
req.type('json');
req.send({
publishDate: '',
language: '',
enableLayoutStylesheets: false,
metaDescription: '',
attachedStylesheets: [
{}
],
password: '',
publishImmediately: false,
htmlTitle: '',
translations: {},
id: '',
state: '',
slug: '',
createdById: '',
currentlyPublished: false,
archivedInDashboard: false,
created: '',
contentTypeCategory: '',
mabExperimentId: '',
updatedById: '',
translatedFromId: '',
folderId: '',
widgetContainers: {},
pageExpiryRedirectId: 0,
dynamicPageDataSourceType: 0,
featuredImage: '',
authorName: '',
domain: '',
name: '',
dynamicPageHubDbTableId: '',
campaign: '',
dynamicPageDataSourceId: '',
enableDomainStylesheets: false,
includeDefaultCustomCss: false,
subcategory: '',
layoutSections: {},
updated: '',
footerHtml: '',
widgets: {},
headHtml: '',
pageExpiryRedirectUrl: '',
abStatus: '',
useFeaturedImage: false,
abTestId: '',
featuredImageAltText: '',
contentGroupId: '',
pageExpiryEnabled: false,
templatePath: '',
url: '',
publicAccessRules: [
{}
],
archivedAt: '',
themeSettingsValues: {},
pageExpiryDate: 0,
publicAccessRulesEnabled: false,
pageRedirected: false,
currentState: '',
categoryId: 0,
linkRelCanonicalUrl: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'PATCH',
url: '{{baseUrl}}/cms/v3/pages/site-pages/:objectId',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
data: {
publishDate: '',
language: '',
enableLayoutStylesheets: false,
metaDescription: '',
attachedStylesheets: [{}],
password: '',
publishImmediately: false,
htmlTitle: '',
translations: {},
id: '',
state: '',
slug: '',
createdById: '',
currentlyPublished: false,
archivedInDashboard: false,
created: '',
contentTypeCategory: '',
mabExperimentId: '',
updatedById: '',
translatedFromId: '',
folderId: '',
widgetContainers: {},
pageExpiryRedirectId: 0,
dynamicPageDataSourceType: 0,
featuredImage: '',
authorName: '',
domain: '',
name: '',
dynamicPageHubDbTableId: '',
campaign: '',
dynamicPageDataSourceId: '',
enableDomainStylesheets: false,
includeDefaultCustomCss: false,
subcategory: '',
layoutSections: {},
updated: '',
footerHtml: '',
widgets: {},
headHtml: '',
pageExpiryRedirectUrl: '',
abStatus: '',
useFeaturedImage: false,
abTestId: '',
featuredImageAltText: '',
contentGroupId: '',
pageExpiryEnabled: false,
templatePath: '',
url: '',
publicAccessRules: [{}],
archivedAt: '',
themeSettingsValues: {},
pageExpiryDate: 0,
publicAccessRulesEnabled: false,
pageRedirected: false,
currentState: '',
categoryId: 0,
linkRelCanonicalUrl: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/cms/v3/pages/site-pages/:objectId';
const options = {
method: 'PATCH',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
body: '{"publishDate":"","language":"","enableLayoutStylesheets":false,"metaDescription":"","attachedStylesheets":[{}],"password":"","publishImmediately":false,"htmlTitle":"","translations":{},"id":"","state":"","slug":"","createdById":"","currentlyPublished":false,"archivedInDashboard":false,"created":"","contentTypeCategory":"","mabExperimentId":"","updatedById":"","translatedFromId":"","folderId":"","widgetContainers":{},"pageExpiryRedirectId":0,"dynamicPageDataSourceType":0,"featuredImage":"","authorName":"","domain":"","name":"","dynamicPageHubDbTableId":"","campaign":"","dynamicPageDataSourceId":"","enableDomainStylesheets":false,"includeDefaultCustomCss":false,"subcategory":"","layoutSections":{},"updated":"","footerHtml":"","widgets":{},"headHtml":"","pageExpiryRedirectUrl":"","abStatus":"","useFeaturedImage":false,"abTestId":"","featuredImageAltText":"","contentGroupId":"","pageExpiryEnabled":false,"templatePath":"","url":"","publicAccessRules":[{}],"archivedAt":"","themeSettingsValues":{},"pageExpiryDate":0,"publicAccessRulesEnabled":false,"pageRedirected":false,"currentState":"","categoryId":0,"linkRelCanonicalUrl":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"private-app-legacy": @"{{apiKey}}",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"publishDate": @"",
@"language": @"",
@"enableLayoutStylesheets": @NO,
@"metaDescription": @"",
@"attachedStylesheets": @[ @{ } ],
@"password": @"",
@"publishImmediately": @NO,
@"htmlTitle": @"",
@"translations": @{ },
@"id": @"",
@"state": @"",
@"slug": @"",
@"createdById": @"",
@"currentlyPublished": @NO,
@"archivedInDashboard": @NO,
@"created": @"",
@"contentTypeCategory": @"",
@"mabExperimentId": @"",
@"updatedById": @"",
@"translatedFromId": @"",
@"folderId": @"",
@"widgetContainers": @{ },
@"pageExpiryRedirectId": @0,
@"dynamicPageDataSourceType": @0,
@"featuredImage": @"",
@"authorName": @"",
@"domain": @"",
@"name": @"",
@"dynamicPageHubDbTableId": @"",
@"campaign": @"",
@"dynamicPageDataSourceId": @"",
@"enableDomainStylesheets": @NO,
@"includeDefaultCustomCss": @NO,
@"subcategory": @"",
@"layoutSections": @{ },
@"updated": @"",
@"footerHtml": @"",
@"widgets": @{ },
@"headHtml": @"",
@"pageExpiryRedirectUrl": @"",
@"abStatus": @"",
@"useFeaturedImage": @NO,
@"abTestId": @"",
@"featuredImageAltText": @"",
@"contentGroupId": @"",
@"pageExpiryEnabled": @NO,
@"templatePath": @"",
@"url": @"",
@"publicAccessRules": @[ @{ } ],
@"archivedAt": @"",
@"themeSettingsValues": @{ },
@"pageExpiryDate": @0,
@"publicAccessRulesEnabled": @NO,
@"pageRedirected": @NO,
@"currentState": @"",
@"categoryId": @0,
@"linkRelCanonicalUrl": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/cms/v3/pages/site-pages/:objectId"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PATCH"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/cms/v3/pages/site-pages/:objectId" in
let headers = Header.add_list (Header.init ()) [
("private-app-legacy", "{{apiKey}}");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"publishDate\": \"\",\n \"language\": \"\",\n \"enableLayoutStylesheets\": false,\n \"metaDescription\": \"\",\n \"attachedStylesheets\": [\n {}\n ],\n \"password\": \"\",\n \"publishImmediately\": false,\n \"htmlTitle\": \"\",\n \"translations\": {},\n \"id\": \"\",\n \"state\": \"\",\n \"slug\": \"\",\n \"createdById\": \"\",\n \"currentlyPublished\": false,\n \"archivedInDashboard\": false,\n \"created\": \"\",\n \"contentTypeCategory\": \"\",\n \"mabExperimentId\": \"\",\n \"updatedById\": \"\",\n \"translatedFromId\": \"\",\n \"folderId\": \"\",\n \"widgetContainers\": {},\n \"pageExpiryRedirectId\": 0,\n \"dynamicPageDataSourceType\": 0,\n \"featuredImage\": \"\",\n \"authorName\": \"\",\n \"domain\": \"\",\n \"name\": \"\",\n \"dynamicPageHubDbTableId\": \"\",\n \"campaign\": \"\",\n \"dynamicPageDataSourceId\": \"\",\n \"enableDomainStylesheets\": false,\n \"includeDefaultCustomCss\": false,\n \"subcategory\": \"\",\n \"layoutSections\": {},\n \"updated\": \"\",\n \"footerHtml\": \"\",\n \"widgets\": {},\n \"headHtml\": \"\",\n \"pageExpiryRedirectUrl\": \"\",\n \"abStatus\": \"\",\n \"useFeaturedImage\": false,\n \"abTestId\": \"\",\n \"featuredImageAltText\": \"\",\n \"contentGroupId\": \"\",\n \"pageExpiryEnabled\": false,\n \"templatePath\": \"\",\n \"url\": \"\",\n \"publicAccessRules\": [\n {}\n ],\n \"archivedAt\": \"\",\n \"themeSettingsValues\": {},\n \"pageExpiryDate\": 0,\n \"publicAccessRulesEnabled\": false,\n \"pageRedirected\": false,\n \"currentState\": \"\",\n \"categoryId\": 0,\n \"linkRelCanonicalUrl\": \"\"\n}" in
Client.call ~headers ~body `PATCH uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/cms/v3/pages/site-pages/:objectId",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'publishDate' => '',
'language' => '',
'enableLayoutStylesheets' => null,
'metaDescription' => '',
'attachedStylesheets' => [
[
]
],
'password' => '',
'publishImmediately' => null,
'htmlTitle' => '',
'translations' => [
],
'id' => '',
'state' => '',
'slug' => '',
'createdById' => '',
'currentlyPublished' => null,
'archivedInDashboard' => null,
'created' => '',
'contentTypeCategory' => '',
'mabExperimentId' => '',
'updatedById' => '',
'translatedFromId' => '',
'folderId' => '',
'widgetContainers' => [
],
'pageExpiryRedirectId' => 0,
'dynamicPageDataSourceType' => 0,
'featuredImage' => '',
'authorName' => '',
'domain' => '',
'name' => '',
'dynamicPageHubDbTableId' => '',
'campaign' => '',
'dynamicPageDataSourceId' => '',
'enableDomainStylesheets' => null,
'includeDefaultCustomCss' => null,
'subcategory' => '',
'layoutSections' => [
],
'updated' => '',
'footerHtml' => '',
'widgets' => [
],
'headHtml' => '',
'pageExpiryRedirectUrl' => '',
'abStatus' => '',
'useFeaturedImage' => null,
'abTestId' => '',
'featuredImageAltText' => '',
'contentGroupId' => '',
'pageExpiryEnabled' => null,
'templatePath' => '',
'url' => '',
'publicAccessRules' => [
[
]
],
'archivedAt' => '',
'themeSettingsValues' => [
],
'pageExpiryDate' => 0,
'publicAccessRulesEnabled' => null,
'pageRedirected' => null,
'currentState' => '',
'categoryId' => 0,
'linkRelCanonicalUrl' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"private-app-legacy: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('PATCH', '{{baseUrl}}/cms/v3/pages/site-pages/:objectId', [
'body' => '{
"publishDate": "",
"language": "",
"enableLayoutStylesheets": false,
"metaDescription": "",
"attachedStylesheets": [
{}
],
"password": "",
"publishImmediately": false,
"htmlTitle": "",
"translations": {},
"id": "",
"state": "",
"slug": "",
"createdById": "",
"currentlyPublished": false,
"archivedInDashboard": false,
"created": "",
"contentTypeCategory": "",
"mabExperimentId": "",
"updatedById": "",
"translatedFromId": "",
"folderId": "",
"widgetContainers": {},
"pageExpiryRedirectId": 0,
"dynamicPageDataSourceType": 0,
"featuredImage": "",
"authorName": "",
"domain": "",
"name": "",
"dynamicPageHubDbTableId": "",
"campaign": "",
"dynamicPageDataSourceId": "",
"enableDomainStylesheets": false,
"includeDefaultCustomCss": false,
"subcategory": "",
"layoutSections": {},
"updated": "",
"footerHtml": "",
"widgets": {},
"headHtml": "",
"pageExpiryRedirectUrl": "",
"abStatus": "",
"useFeaturedImage": false,
"abTestId": "",
"featuredImageAltText": "",
"contentGroupId": "",
"pageExpiryEnabled": false,
"templatePath": "",
"url": "",
"publicAccessRules": [
{}
],
"archivedAt": "",
"themeSettingsValues": {},
"pageExpiryDate": 0,
"publicAccessRulesEnabled": false,
"pageRedirected": false,
"currentState": "",
"categoryId": 0,
"linkRelCanonicalUrl": ""
}',
'headers' => [
'content-type' => 'application/json',
'private-app-legacy' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/cms/v3/pages/site-pages/:objectId');
$request->setMethod(HttpRequest::HTTP_METH_PATCH);
$request->setHeaders([
'private-app-legacy' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'publishDate' => '',
'language' => '',
'enableLayoutStylesheets' => null,
'metaDescription' => '',
'attachedStylesheets' => [
[
]
],
'password' => '',
'publishImmediately' => null,
'htmlTitle' => '',
'translations' => [
],
'id' => '',
'state' => '',
'slug' => '',
'createdById' => '',
'currentlyPublished' => null,
'archivedInDashboard' => null,
'created' => '',
'contentTypeCategory' => '',
'mabExperimentId' => '',
'updatedById' => '',
'translatedFromId' => '',
'folderId' => '',
'widgetContainers' => [
],
'pageExpiryRedirectId' => 0,
'dynamicPageDataSourceType' => 0,
'featuredImage' => '',
'authorName' => '',
'domain' => '',
'name' => '',
'dynamicPageHubDbTableId' => '',
'campaign' => '',
'dynamicPageDataSourceId' => '',
'enableDomainStylesheets' => null,
'includeDefaultCustomCss' => null,
'subcategory' => '',
'layoutSections' => [
],
'updated' => '',
'footerHtml' => '',
'widgets' => [
],
'headHtml' => '',
'pageExpiryRedirectUrl' => '',
'abStatus' => '',
'useFeaturedImage' => null,
'abTestId' => '',
'featuredImageAltText' => '',
'contentGroupId' => '',
'pageExpiryEnabled' => null,
'templatePath' => '',
'url' => '',
'publicAccessRules' => [
[
]
],
'archivedAt' => '',
'themeSettingsValues' => [
],
'pageExpiryDate' => 0,
'publicAccessRulesEnabled' => null,
'pageRedirected' => null,
'currentState' => '',
'categoryId' => 0,
'linkRelCanonicalUrl' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'publishDate' => '',
'language' => '',
'enableLayoutStylesheets' => null,
'metaDescription' => '',
'attachedStylesheets' => [
[
]
],
'password' => '',
'publishImmediately' => null,
'htmlTitle' => '',
'translations' => [
],
'id' => '',
'state' => '',
'slug' => '',
'createdById' => '',
'currentlyPublished' => null,
'archivedInDashboard' => null,
'created' => '',
'contentTypeCategory' => '',
'mabExperimentId' => '',
'updatedById' => '',
'translatedFromId' => '',
'folderId' => '',
'widgetContainers' => [
],
'pageExpiryRedirectId' => 0,
'dynamicPageDataSourceType' => 0,
'featuredImage' => '',
'authorName' => '',
'domain' => '',
'name' => '',
'dynamicPageHubDbTableId' => '',
'campaign' => '',
'dynamicPageDataSourceId' => '',
'enableDomainStylesheets' => null,
'includeDefaultCustomCss' => null,
'subcategory' => '',
'layoutSections' => [
],
'updated' => '',
'footerHtml' => '',
'widgets' => [
],
'headHtml' => '',
'pageExpiryRedirectUrl' => '',
'abStatus' => '',
'useFeaturedImage' => null,
'abTestId' => '',
'featuredImageAltText' => '',
'contentGroupId' => '',
'pageExpiryEnabled' => null,
'templatePath' => '',
'url' => '',
'publicAccessRules' => [
[
]
],
'archivedAt' => '',
'themeSettingsValues' => [
],
'pageExpiryDate' => 0,
'publicAccessRulesEnabled' => null,
'pageRedirected' => null,
'currentState' => '',
'categoryId' => 0,
'linkRelCanonicalUrl' => ''
]));
$request->setRequestUrl('{{baseUrl}}/cms/v3/pages/site-pages/:objectId');
$request->setRequestMethod('PATCH');
$request->setBody($body);
$request->setHeaders([
'private-app-legacy' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("private-app-legacy", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/cms/v3/pages/site-pages/:objectId' -Method PATCH -Headers $headers -ContentType 'application/json' -Body '{
"publishDate": "",
"language": "",
"enableLayoutStylesheets": false,
"metaDescription": "",
"attachedStylesheets": [
{}
],
"password": "",
"publishImmediately": false,
"htmlTitle": "",
"translations": {},
"id": "",
"state": "",
"slug": "",
"createdById": "",
"currentlyPublished": false,
"archivedInDashboard": false,
"created": "",
"contentTypeCategory": "",
"mabExperimentId": "",
"updatedById": "",
"translatedFromId": "",
"folderId": "",
"widgetContainers": {},
"pageExpiryRedirectId": 0,
"dynamicPageDataSourceType": 0,
"featuredImage": "",
"authorName": "",
"domain": "",
"name": "",
"dynamicPageHubDbTableId": "",
"campaign": "",
"dynamicPageDataSourceId": "",
"enableDomainStylesheets": false,
"includeDefaultCustomCss": false,
"subcategory": "",
"layoutSections": {},
"updated": "",
"footerHtml": "",
"widgets": {},
"headHtml": "",
"pageExpiryRedirectUrl": "",
"abStatus": "",
"useFeaturedImage": false,
"abTestId": "",
"featuredImageAltText": "",
"contentGroupId": "",
"pageExpiryEnabled": false,
"templatePath": "",
"url": "",
"publicAccessRules": [
{}
],
"archivedAt": "",
"themeSettingsValues": {},
"pageExpiryDate": 0,
"publicAccessRulesEnabled": false,
"pageRedirected": false,
"currentState": "",
"categoryId": 0,
"linkRelCanonicalUrl": ""
}'
$headers=@{}
$headers.Add("private-app-legacy", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/cms/v3/pages/site-pages/:objectId' -Method PATCH -Headers $headers -ContentType 'application/json' -Body '{
"publishDate": "",
"language": "",
"enableLayoutStylesheets": false,
"metaDescription": "",
"attachedStylesheets": [
{}
],
"password": "",
"publishImmediately": false,
"htmlTitle": "",
"translations": {},
"id": "",
"state": "",
"slug": "",
"createdById": "",
"currentlyPublished": false,
"archivedInDashboard": false,
"created": "",
"contentTypeCategory": "",
"mabExperimentId": "",
"updatedById": "",
"translatedFromId": "",
"folderId": "",
"widgetContainers": {},
"pageExpiryRedirectId": 0,
"dynamicPageDataSourceType": 0,
"featuredImage": "",
"authorName": "",
"domain": "",
"name": "",
"dynamicPageHubDbTableId": "",
"campaign": "",
"dynamicPageDataSourceId": "",
"enableDomainStylesheets": false,
"includeDefaultCustomCss": false,
"subcategory": "",
"layoutSections": {},
"updated": "",
"footerHtml": "",
"widgets": {},
"headHtml": "",
"pageExpiryRedirectUrl": "",
"abStatus": "",
"useFeaturedImage": false,
"abTestId": "",
"featuredImageAltText": "",
"contentGroupId": "",
"pageExpiryEnabled": false,
"templatePath": "",
"url": "",
"publicAccessRules": [
{}
],
"archivedAt": "",
"themeSettingsValues": {},
"pageExpiryDate": 0,
"publicAccessRulesEnabled": false,
"pageRedirected": false,
"currentState": "",
"categoryId": 0,
"linkRelCanonicalUrl": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"publishDate\": \"\",\n \"language\": \"\",\n \"enableLayoutStylesheets\": false,\n \"metaDescription\": \"\",\n \"attachedStylesheets\": [\n {}\n ],\n \"password\": \"\",\n \"publishImmediately\": false,\n \"htmlTitle\": \"\",\n \"translations\": {},\n \"id\": \"\",\n \"state\": \"\",\n \"slug\": \"\",\n \"createdById\": \"\",\n \"currentlyPublished\": false,\n \"archivedInDashboard\": false,\n \"created\": \"\",\n \"contentTypeCategory\": \"\",\n \"mabExperimentId\": \"\",\n \"updatedById\": \"\",\n \"translatedFromId\": \"\",\n \"folderId\": \"\",\n \"widgetContainers\": {},\n \"pageExpiryRedirectId\": 0,\n \"dynamicPageDataSourceType\": 0,\n \"featuredImage\": \"\",\n \"authorName\": \"\",\n \"domain\": \"\",\n \"name\": \"\",\n \"dynamicPageHubDbTableId\": \"\",\n \"campaign\": \"\",\n \"dynamicPageDataSourceId\": \"\",\n \"enableDomainStylesheets\": false,\n \"includeDefaultCustomCss\": false,\n \"subcategory\": \"\",\n \"layoutSections\": {},\n \"updated\": \"\",\n \"footerHtml\": \"\",\n \"widgets\": {},\n \"headHtml\": \"\",\n \"pageExpiryRedirectUrl\": \"\",\n \"abStatus\": \"\",\n \"useFeaturedImage\": false,\n \"abTestId\": \"\",\n \"featuredImageAltText\": \"\",\n \"contentGroupId\": \"\",\n \"pageExpiryEnabled\": false,\n \"templatePath\": \"\",\n \"url\": \"\",\n \"publicAccessRules\": [\n {}\n ],\n \"archivedAt\": \"\",\n \"themeSettingsValues\": {},\n \"pageExpiryDate\": 0,\n \"publicAccessRulesEnabled\": false,\n \"pageRedirected\": false,\n \"currentState\": \"\",\n \"categoryId\": 0,\n \"linkRelCanonicalUrl\": \"\"\n}"
headers = {
'private-app-legacy': "{{apiKey}}",
'content-type': "application/json"
}
conn.request("PATCH", "/baseUrl/cms/v3/pages/site-pages/:objectId", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/cms/v3/pages/site-pages/:objectId"
payload = {
"publishDate": "",
"language": "",
"enableLayoutStylesheets": False,
"metaDescription": "",
"attachedStylesheets": [{}],
"password": "",
"publishImmediately": False,
"htmlTitle": "",
"translations": {},
"id": "",
"state": "",
"slug": "",
"createdById": "",
"currentlyPublished": False,
"archivedInDashboard": False,
"created": "",
"contentTypeCategory": "",
"mabExperimentId": "",
"updatedById": "",
"translatedFromId": "",
"folderId": "",
"widgetContainers": {},
"pageExpiryRedirectId": 0,
"dynamicPageDataSourceType": 0,
"featuredImage": "",
"authorName": "",
"domain": "",
"name": "",
"dynamicPageHubDbTableId": "",
"campaign": "",
"dynamicPageDataSourceId": "",
"enableDomainStylesheets": False,
"includeDefaultCustomCss": False,
"subcategory": "",
"layoutSections": {},
"updated": "",
"footerHtml": "",
"widgets": {},
"headHtml": "",
"pageExpiryRedirectUrl": "",
"abStatus": "",
"useFeaturedImage": False,
"abTestId": "",
"featuredImageAltText": "",
"contentGroupId": "",
"pageExpiryEnabled": False,
"templatePath": "",
"url": "",
"publicAccessRules": [{}],
"archivedAt": "",
"themeSettingsValues": {},
"pageExpiryDate": 0,
"publicAccessRulesEnabled": False,
"pageRedirected": False,
"currentState": "",
"categoryId": 0,
"linkRelCanonicalUrl": ""
}
headers = {
"private-app-legacy": "{{apiKey}}",
"content-type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/cms/v3/pages/site-pages/:objectId"
payload <- "{\n \"publishDate\": \"\",\n \"language\": \"\",\n \"enableLayoutStylesheets\": false,\n \"metaDescription\": \"\",\n \"attachedStylesheets\": [\n {}\n ],\n \"password\": \"\",\n \"publishImmediately\": false,\n \"htmlTitle\": \"\",\n \"translations\": {},\n \"id\": \"\",\n \"state\": \"\",\n \"slug\": \"\",\n \"createdById\": \"\",\n \"currentlyPublished\": false,\n \"archivedInDashboard\": false,\n \"created\": \"\",\n \"contentTypeCategory\": \"\",\n \"mabExperimentId\": \"\",\n \"updatedById\": \"\",\n \"translatedFromId\": \"\",\n \"folderId\": \"\",\n \"widgetContainers\": {},\n \"pageExpiryRedirectId\": 0,\n \"dynamicPageDataSourceType\": 0,\n \"featuredImage\": \"\",\n \"authorName\": \"\",\n \"domain\": \"\",\n \"name\": \"\",\n \"dynamicPageHubDbTableId\": \"\",\n \"campaign\": \"\",\n \"dynamicPageDataSourceId\": \"\",\n \"enableDomainStylesheets\": false,\n \"includeDefaultCustomCss\": false,\n \"subcategory\": \"\",\n \"layoutSections\": {},\n \"updated\": \"\",\n \"footerHtml\": \"\",\n \"widgets\": {},\n \"headHtml\": \"\",\n \"pageExpiryRedirectUrl\": \"\",\n \"abStatus\": \"\",\n \"useFeaturedImage\": false,\n \"abTestId\": \"\",\n \"featuredImageAltText\": \"\",\n \"contentGroupId\": \"\",\n \"pageExpiryEnabled\": false,\n \"templatePath\": \"\",\n \"url\": \"\",\n \"publicAccessRules\": [\n {}\n ],\n \"archivedAt\": \"\",\n \"themeSettingsValues\": {},\n \"pageExpiryDate\": 0,\n \"publicAccessRulesEnabled\": false,\n \"pageRedirected\": false,\n \"currentState\": \"\",\n \"categoryId\": 0,\n \"linkRelCanonicalUrl\": \"\"\n}"
encode <- "json"
response <- VERB("PATCH", url, body = payload, add_headers('private-app-legacy' = '{{apiKey}}'), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/cms/v3/pages/site-pages/:objectId")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["private-app-legacy"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n \"publishDate\": \"\",\n \"language\": \"\",\n \"enableLayoutStylesheets\": false,\n \"metaDescription\": \"\",\n \"attachedStylesheets\": [\n {}\n ],\n \"password\": \"\",\n \"publishImmediately\": false,\n \"htmlTitle\": \"\",\n \"translations\": {},\n \"id\": \"\",\n \"state\": \"\",\n \"slug\": \"\",\n \"createdById\": \"\",\n \"currentlyPublished\": false,\n \"archivedInDashboard\": false,\n \"created\": \"\",\n \"contentTypeCategory\": \"\",\n \"mabExperimentId\": \"\",\n \"updatedById\": \"\",\n \"translatedFromId\": \"\",\n \"folderId\": \"\",\n \"widgetContainers\": {},\n \"pageExpiryRedirectId\": 0,\n \"dynamicPageDataSourceType\": 0,\n \"featuredImage\": \"\",\n \"authorName\": \"\",\n \"domain\": \"\",\n \"name\": \"\",\n \"dynamicPageHubDbTableId\": \"\",\n \"campaign\": \"\",\n \"dynamicPageDataSourceId\": \"\",\n \"enableDomainStylesheets\": false,\n \"includeDefaultCustomCss\": false,\n \"subcategory\": \"\",\n \"layoutSections\": {},\n \"updated\": \"\",\n \"footerHtml\": \"\",\n \"widgets\": {},\n \"headHtml\": \"\",\n \"pageExpiryRedirectUrl\": \"\",\n \"abStatus\": \"\",\n \"useFeaturedImage\": false,\n \"abTestId\": \"\",\n \"featuredImageAltText\": \"\",\n \"contentGroupId\": \"\",\n \"pageExpiryEnabled\": false,\n \"templatePath\": \"\",\n \"url\": \"\",\n \"publicAccessRules\": [\n {}\n ],\n \"archivedAt\": \"\",\n \"themeSettingsValues\": {},\n \"pageExpiryDate\": 0,\n \"publicAccessRulesEnabled\": false,\n \"pageRedirected\": false,\n \"currentState\": \"\",\n \"categoryId\": 0,\n \"linkRelCanonicalUrl\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.patch('/baseUrl/cms/v3/pages/site-pages/:objectId') do |req|
req.headers['private-app-legacy'] = '{{apiKey}}'
req.body = "{\n \"publishDate\": \"\",\n \"language\": \"\",\n \"enableLayoutStylesheets\": false,\n \"metaDescription\": \"\",\n \"attachedStylesheets\": [\n {}\n ],\n \"password\": \"\",\n \"publishImmediately\": false,\n \"htmlTitle\": \"\",\n \"translations\": {},\n \"id\": \"\",\n \"state\": \"\",\n \"slug\": \"\",\n \"createdById\": \"\",\n \"currentlyPublished\": false,\n \"archivedInDashboard\": false,\n \"created\": \"\",\n \"contentTypeCategory\": \"\",\n \"mabExperimentId\": \"\",\n \"updatedById\": \"\",\n \"translatedFromId\": \"\",\n \"folderId\": \"\",\n \"widgetContainers\": {},\n \"pageExpiryRedirectId\": 0,\n \"dynamicPageDataSourceType\": 0,\n \"featuredImage\": \"\",\n \"authorName\": \"\",\n \"domain\": \"\",\n \"name\": \"\",\n \"dynamicPageHubDbTableId\": \"\",\n \"campaign\": \"\",\n \"dynamicPageDataSourceId\": \"\",\n \"enableDomainStylesheets\": false,\n \"includeDefaultCustomCss\": false,\n \"subcategory\": \"\",\n \"layoutSections\": {},\n \"updated\": \"\",\n \"footerHtml\": \"\",\n \"widgets\": {},\n \"headHtml\": \"\",\n \"pageExpiryRedirectUrl\": \"\",\n \"abStatus\": \"\",\n \"useFeaturedImage\": false,\n \"abTestId\": \"\",\n \"featuredImageAltText\": \"\",\n \"contentGroupId\": \"\",\n \"pageExpiryEnabled\": false,\n \"templatePath\": \"\",\n \"url\": \"\",\n \"publicAccessRules\": [\n {}\n ],\n \"archivedAt\": \"\",\n \"themeSettingsValues\": {},\n \"pageExpiryDate\": 0,\n \"publicAccessRulesEnabled\": false,\n \"pageRedirected\": false,\n \"currentState\": \"\",\n \"categoryId\": 0,\n \"linkRelCanonicalUrl\": \"\"\n}"
end
puts response.status
puts response.body
use std::str::FromStr;
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/cms/v3/pages/site-pages/:objectId";
let payload = json!({
"publishDate": "",
"language": "",
"enableLayoutStylesheets": false,
"metaDescription": "",
"attachedStylesheets": (json!({})),
"password": "",
"publishImmediately": false,
"htmlTitle": "",
"translations": json!({}),
"id": "",
"state": "",
"slug": "",
"createdById": "",
"currentlyPublished": false,
"archivedInDashboard": false,
"created": "",
"contentTypeCategory": "",
"mabExperimentId": "",
"updatedById": "",
"translatedFromId": "",
"folderId": "",
"widgetContainers": json!({}),
"pageExpiryRedirectId": 0,
"dynamicPageDataSourceType": 0,
"featuredImage": "",
"authorName": "",
"domain": "",
"name": "",
"dynamicPageHubDbTableId": "",
"campaign": "",
"dynamicPageDataSourceId": "",
"enableDomainStylesheets": false,
"includeDefaultCustomCss": false,
"subcategory": "",
"layoutSections": json!({}),
"updated": "",
"footerHtml": "",
"widgets": json!({}),
"headHtml": "",
"pageExpiryRedirectUrl": "",
"abStatus": "",
"useFeaturedImage": false,
"abTestId": "",
"featuredImageAltText": "",
"contentGroupId": "",
"pageExpiryEnabled": false,
"templatePath": "",
"url": "",
"publicAccessRules": (json!({})),
"archivedAt": "",
"themeSettingsValues": json!({}),
"pageExpiryDate": 0,
"publicAccessRulesEnabled": false,
"pageRedirected": false,
"currentState": "",
"categoryId": 0,
"linkRelCanonicalUrl": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("private-app-legacy", "{{apiKey}}".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PATCH").unwrap(), url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PATCH \
--url {{baseUrl}}/cms/v3/pages/site-pages/:objectId \
--header 'content-type: application/json' \
--header 'private-app-legacy: {{apiKey}}' \
--data '{
"publishDate": "",
"language": "",
"enableLayoutStylesheets": false,
"metaDescription": "",
"attachedStylesheets": [
{}
],
"password": "",
"publishImmediately": false,
"htmlTitle": "",
"translations": {},
"id": "",
"state": "",
"slug": "",
"createdById": "",
"currentlyPublished": false,
"archivedInDashboard": false,
"created": "",
"contentTypeCategory": "",
"mabExperimentId": "",
"updatedById": "",
"translatedFromId": "",
"folderId": "",
"widgetContainers": {},
"pageExpiryRedirectId": 0,
"dynamicPageDataSourceType": 0,
"featuredImage": "",
"authorName": "",
"domain": "",
"name": "",
"dynamicPageHubDbTableId": "",
"campaign": "",
"dynamicPageDataSourceId": "",
"enableDomainStylesheets": false,
"includeDefaultCustomCss": false,
"subcategory": "",
"layoutSections": {},
"updated": "",
"footerHtml": "",
"widgets": {},
"headHtml": "",
"pageExpiryRedirectUrl": "",
"abStatus": "",
"useFeaturedImage": false,
"abTestId": "",
"featuredImageAltText": "",
"contentGroupId": "",
"pageExpiryEnabled": false,
"templatePath": "",
"url": "",
"publicAccessRules": [
{}
],
"archivedAt": "",
"themeSettingsValues": {},
"pageExpiryDate": 0,
"publicAccessRulesEnabled": false,
"pageRedirected": false,
"currentState": "",
"categoryId": 0,
"linkRelCanonicalUrl": ""
}'
echo '{
"publishDate": "",
"language": "",
"enableLayoutStylesheets": false,
"metaDescription": "",
"attachedStylesheets": [
{}
],
"password": "",
"publishImmediately": false,
"htmlTitle": "",
"translations": {},
"id": "",
"state": "",
"slug": "",
"createdById": "",
"currentlyPublished": false,
"archivedInDashboard": false,
"created": "",
"contentTypeCategory": "",
"mabExperimentId": "",
"updatedById": "",
"translatedFromId": "",
"folderId": "",
"widgetContainers": {},
"pageExpiryRedirectId": 0,
"dynamicPageDataSourceType": 0,
"featuredImage": "",
"authorName": "",
"domain": "",
"name": "",
"dynamicPageHubDbTableId": "",
"campaign": "",
"dynamicPageDataSourceId": "",
"enableDomainStylesheets": false,
"includeDefaultCustomCss": false,
"subcategory": "",
"layoutSections": {},
"updated": "",
"footerHtml": "",
"widgets": {},
"headHtml": "",
"pageExpiryRedirectUrl": "",
"abStatus": "",
"useFeaturedImage": false,
"abTestId": "",
"featuredImageAltText": "",
"contentGroupId": "",
"pageExpiryEnabled": false,
"templatePath": "",
"url": "",
"publicAccessRules": [
{}
],
"archivedAt": "",
"themeSettingsValues": {},
"pageExpiryDate": 0,
"publicAccessRulesEnabled": false,
"pageRedirected": false,
"currentState": "",
"categoryId": 0,
"linkRelCanonicalUrl": ""
}' | \
http PATCH {{baseUrl}}/cms/v3/pages/site-pages/:objectId \
content-type:application/json \
private-app-legacy:'{{apiKey}}'
wget --quiet \
--method PATCH \
--header 'private-app-legacy: {{apiKey}}' \
--header 'content-type: application/json' \
--body-data '{\n "publishDate": "",\n "language": "",\n "enableLayoutStylesheets": false,\n "metaDescription": "",\n "attachedStylesheets": [\n {}\n ],\n "password": "",\n "publishImmediately": false,\n "htmlTitle": "",\n "translations": {},\n "id": "",\n "state": "",\n "slug": "",\n "createdById": "",\n "currentlyPublished": false,\n "archivedInDashboard": false,\n "created": "",\n "contentTypeCategory": "",\n "mabExperimentId": "",\n "updatedById": "",\n "translatedFromId": "",\n "folderId": "",\n "widgetContainers": {},\n "pageExpiryRedirectId": 0,\n "dynamicPageDataSourceType": 0,\n "featuredImage": "",\n "authorName": "",\n "domain": "",\n "name": "",\n "dynamicPageHubDbTableId": "",\n "campaign": "",\n "dynamicPageDataSourceId": "",\n "enableDomainStylesheets": false,\n "includeDefaultCustomCss": false,\n "subcategory": "",\n "layoutSections": {},\n "updated": "",\n "footerHtml": "",\n "widgets": {},\n "headHtml": "",\n "pageExpiryRedirectUrl": "",\n "abStatus": "",\n "useFeaturedImage": false,\n "abTestId": "",\n "featuredImageAltText": "",\n "contentGroupId": "",\n "pageExpiryEnabled": false,\n "templatePath": "",\n "url": "",\n "publicAccessRules": [\n {}\n ],\n "archivedAt": "",\n "themeSettingsValues": {},\n "pageExpiryDate": 0,\n "publicAccessRulesEnabled": false,\n "pageRedirected": false,\n "currentState": "",\n "categoryId": 0,\n "linkRelCanonicalUrl": ""\n}' \
--output-document \
- {{baseUrl}}/cms/v3/pages/site-pages/:objectId
import Foundation
let headers = [
"private-app-legacy": "{{apiKey}}",
"content-type": "application/json"
]
let parameters = [
"publishDate": "",
"language": "",
"enableLayoutStylesheets": false,
"metaDescription": "",
"attachedStylesheets": [[]],
"password": "",
"publishImmediately": false,
"htmlTitle": "",
"translations": [],
"id": "",
"state": "",
"slug": "",
"createdById": "",
"currentlyPublished": false,
"archivedInDashboard": false,
"created": "",
"contentTypeCategory": "",
"mabExperimentId": "",
"updatedById": "",
"translatedFromId": "",
"folderId": "",
"widgetContainers": [],
"pageExpiryRedirectId": 0,
"dynamicPageDataSourceType": 0,
"featuredImage": "",
"authorName": "",
"domain": "",
"name": "",
"dynamicPageHubDbTableId": "",
"campaign": "",
"dynamicPageDataSourceId": "",
"enableDomainStylesheets": false,
"includeDefaultCustomCss": false,
"subcategory": "",
"layoutSections": [],
"updated": "",
"footerHtml": "",
"widgets": [],
"headHtml": "",
"pageExpiryRedirectUrl": "",
"abStatus": "",
"useFeaturedImage": false,
"abTestId": "",
"featuredImageAltText": "",
"contentGroupId": "",
"pageExpiryEnabled": false,
"templatePath": "",
"url": "",
"publicAccessRules": [[]],
"archivedAt": "",
"themeSettingsValues": [],
"pageExpiryDate": 0,
"publicAccessRulesEnabled": false,
"pageRedirected": false,
"currentState": "",
"categoryId": 0,
"linkRelCanonicalUrl": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/cms/v3/pages/site-pages/:objectId")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PATCH"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
*/*
RESPONSE BODY text
{
"message": "Invalid input (details will vary based on the error)",
"correlationId": "aeb5f871-7f07-4993-9211-075dc63e7cbf",
"category": "VALIDATION_ERROR",
"links": {
"knowledge-base": "https://www.hubspot.com/products/service/knowledge-base"
}
}
POST
Update a batch of Site Pages
{{baseUrl}}/cms/v3/pages/site-pages/batch/update
HEADERS
private-app-legacy
{{apiKey}}
BODY json
{
"inputs": [
{}
]
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/cms/v3/pages/site-pages/batch/update");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "private-app-legacy: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"inputs\": [\n {}\n ]\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/cms/v3/pages/site-pages/batch/update" {:headers {:private-app-legacy "{{apiKey}}"}
:content-type :json
:form-params {:inputs [{}]}})
require "http/client"
url = "{{baseUrl}}/cms/v3/pages/site-pages/batch/update"
headers = HTTP::Headers{
"private-app-legacy" => "{{apiKey}}"
"content-type" => "application/json"
}
reqBody = "{\n \"inputs\": [\n {}\n ]\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/cms/v3/pages/site-pages/batch/update"),
Headers =
{
{ "private-app-legacy", "{{apiKey}}" },
},
Content = new StringContent("{\n \"inputs\": [\n {}\n ]\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/cms/v3/pages/site-pages/batch/update");
var request = new RestRequest("", Method.Post);
request.AddHeader("private-app-legacy", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"inputs\": [\n {}\n ]\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/cms/v3/pages/site-pages/batch/update"
payload := strings.NewReader("{\n \"inputs\": [\n {}\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("private-app-legacy", "{{apiKey}}")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/cms/v3/pages/site-pages/batch/update HTTP/1.1
Private-App-Legacy: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 28
{
"inputs": [
{}
]
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/cms/v3/pages/site-pages/batch/update")
.setHeader("private-app-legacy", "{{apiKey}}")
.setHeader("content-type", "application/json")
.setBody("{\n \"inputs\": [\n {}\n ]\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/cms/v3/pages/site-pages/batch/update"))
.header("private-app-legacy", "{{apiKey}}")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"inputs\": [\n {}\n ]\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"inputs\": [\n {}\n ]\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/cms/v3/pages/site-pages/batch/update")
.post(body)
.addHeader("private-app-legacy", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/cms/v3/pages/site-pages/batch/update")
.header("private-app-legacy", "{{apiKey}}")
.header("content-type", "application/json")
.body("{\n \"inputs\": [\n {}\n ]\n}")
.asString();
const data = JSON.stringify({
inputs: [
{}
]
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/cms/v3/pages/site-pages/batch/update');
xhr.setRequestHeader('private-app-legacy', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/cms/v3/pages/site-pages/batch/update',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
data: {inputs: [{}]}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/cms/v3/pages/site-pages/batch/update';
const options = {
method: 'POST',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
body: '{"inputs":[{}]}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/cms/v3/pages/site-pages/batch/update',
method: 'POST',
headers: {
'private-app-legacy': '{{apiKey}}',
'content-type': 'application/json'
},
processData: false,
data: '{\n "inputs": [\n {}\n ]\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"inputs\": [\n {}\n ]\n}")
val request = Request.Builder()
.url("{{baseUrl}}/cms/v3/pages/site-pages/batch/update")
.post(body)
.addHeader("private-app-legacy", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/cms/v3/pages/site-pages/batch/update',
headers: {
'private-app-legacy': '{{apiKey}}',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({inputs: [{}]}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/cms/v3/pages/site-pages/batch/update',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
body: {inputs: [{}]},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/cms/v3/pages/site-pages/batch/update');
req.headers({
'private-app-legacy': '{{apiKey}}',
'content-type': 'application/json'
});
req.type('json');
req.send({
inputs: [
{}
]
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/cms/v3/pages/site-pages/batch/update',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
data: {inputs: [{}]}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/cms/v3/pages/site-pages/batch/update';
const options = {
method: 'POST',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
body: '{"inputs":[{}]}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"private-app-legacy": @"{{apiKey}}",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"inputs": @[ @{ } ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/cms/v3/pages/site-pages/batch/update"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/cms/v3/pages/site-pages/batch/update" in
let headers = Header.add_list (Header.init ()) [
("private-app-legacy", "{{apiKey}}");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"inputs\": [\n {}\n ]\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/cms/v3/pages/site-pages/batch/update",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'inputs' => [
[
]
]
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"private-app-legacy: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/cms/v3/pages/site-pages/batch/update', [
'body' => '{
"inputs": [
{}
]
}',
'headers' => [
'content-type' => 'application/json',
'private-app-legacy' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/cms/v3/pages/site-pages/batch/update');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'private-app-legacy' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'inputs' => [
[
]
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'inputs' => [
[
]
]
]));
$request->setRequestUrl('{{baseUrl}}/cms/v3/pages/site-pages/batch/update');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'private-app-legacy' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("private-app-legacy", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/cms/v3/pages/site-pages/batch/update' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"inputs": [
{}
]
}'
$headers=@{}
$headers.Add("private-app-legacy", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/cms/v3/pages/site-pages/batch/update' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"inputs": [
{}
]
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"inputs\": [\n {}\n ]\n}"
headers = {
'private-app-legacy': "{{apiKey}}",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/cms/v3/pages/site-pages/batch/update", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/cms/v3/pages/site-pages/batch/update"
payload = { "inputs": [{}] }
headers = {
"private-app-legacy": "{{apiKey}}",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/cms/v3/pages/site-pages/batch/update"
payload <- "{\n \"inputs\": [\n {}\n ]\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('private-app-legacy' = '{{apiKey}}'), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/cms/v3/pages/site-pages/batch/update")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["private-app-legacy"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n \"inputs\": [\n {}\n ]\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/cms/v3/pages/site-pages/batch/update') do |req|
req.headers['private-app-legacy'] = '{{apiKey}}'
req.body = "{\n \"inputs\": [\n {}\n ]\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/cms/v3/pages/site-pages/batch/update";
let payload = json!({"inputs": (json!({}))});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("private-app-legacy", "{{apiKey}}".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/cms/v3/pages/site-pages/batch/update \
--header 'content-type: application/json' \
--header 'private-app-legacy: {{apiKey}}' \
--data '{
"inputs": [
{}
]
}'
echo '{
"inputs": [
{}
]
}' | \
http POST {{baseUrl}}/cms/v3/pages/site-pages/batch/update \
content-type:application/json \
private-app-legacy:'{{apiKey}}'
wget --quiet \
--method POST \
--header 'private-app-legacy: {{apiKey}}' \
--header 'content-type: application/json' \
--body-data '{\n "inputs": [\n {}\n ]\n}' \
--output-document \
- {{baseUrl}}/cms/v3/pages/site-pages/batch/update
import Foundation
let headers = [
"private-app-legacy": "{{apiKey}}",
"content-type": "application/json"
]
let parameters = ["inputs": [[]]] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/cms/v3/pages/site-pages/batch/update")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
*/*
RESPONSE BODY text
{
"message": "Invalid input (details will vary based on the error)",
"correlationId": "aeb5f871-7f07-4993-9211-075dc63e7cbf",
"category": "VALIDATION_ERROR",
"links": {
"knowledge-base": "https://www.hubspot.com/products/service/knowledge-base"
}
}
POST
Update languages of multi-language group
{{baseUrl}}/cms/v3/pages/site-pages/multi-language/update-languages
HEADERS
private-app-legacy
{{apiKey}}
BODY json
{
"languages": {},
"primaryId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/cms/v3/pages/site-pages/multi-language/update-languages");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "private-app-legacy: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"languages\": {},\n \"primaryId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/cms/v3/pages/site-pages/multi-language/update-languages" {:headers {:private-app-legacy "{{apiKey}}"}
:content-type :json
:form-params {:languages {}
:primaryId ""}})
require "http/client"
url = "{{baseUrl}}/cms/v3/pages/site-pages/multi-language/update-languages"
headers = HTTP::Headers{
"private-app-legacy" => "{{apiKey}}"
"content-type" => "application/json"
}
reqBody = "{\n \"languages\": {},\n \"primaryId\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/cms/v3/pages/site-pages/multi-language/update-languages"),
Headers =
{
{ "private-app-legacy", "{{apiKey}}" },
},
Content = new StringContent("{\n \"languages\": {},\n \"primaryId\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/cms/v3/pages/site-pages/multi-language/update-languages");
var request = new RestRequest("", Method.Post);
request.AddHeader("private-app-legacy", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"languages\": {},\n \"primaryId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/cms/v3/pages/site-pages/multi-language/update-languages"
payload := strings.NewReader("{\n \"languages\": {},\n \"primaryId\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("private-app-legacy", "{{apiKey}}")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/cms/v3/pages/site-pages/multi-language/update-languages HTTP/1.1
Private-App-Legacy: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 40
{
"languages": {},
"primaryId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/cms/v3/pages/site-pages/multi-language/update-languages")
.setHeader("private-app-legacy", "{{apiKey}}")
.setHeader("content-type", "application/json")
.setBody("{\n \"languages\": {},\n \"primaryId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/cms/v3/pages/site-pages/multi-language/update-languages"))
.header("private-app-legacy", "{{apiKey}}")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"languages\": {},\n \"primaryId\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"languages\": {},\n \"primaryId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/cms/v3/pages/site-pages/multi-language/update-languages")
.post(body)
.addHeader("private-app-legacy", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/cms/v3/pages/site-pages/multi-language/update-languages")
.header("private-app-legacy", "{{apiKey}}")
.header("content-type", "application/json")
.body("{\n \"languages\": {},\n \"primaryId\": \"\"\n}")
.asString();
const data = JSON.stringify({
languages: {},
primaryId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/cms/v3/pages/site-pages/multi-language/update-languages');
xhr.setRequestHeader('private-app-legacy', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/cms/v3/pages/site-pages/multi-language/update-languages',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
data: {languages: {}, primaryId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/cms/v3/pages/site-pages/multi-language/update-languages';
const options = {
method: 'POST',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
body: '{"languages":{},"primaryId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/cms/v3/pages/site-pages/multi-language/update-languages',
method: 'POST',
headers: {
'private-app-legacy': '{{apiKey}}',
'content-type': 'application/json'
},
processData: false,
data: '{\n "languages": {},\n "primaryId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"languages\": {},\n \"primaryId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/cms/v3/pages/site-pages/multi-language/update-languages")
.post(body)
.addHeader("private-app-legacy", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/cms/v3/pages/site-pages/multi-language/update-languages',
headers: {
'private-app-legacy': '{{apiKey}}',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({languages: {}, primaryId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/cms/v3/pages/site-pages/multi-language/update-languages',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
body: {languages: {}, primaryId: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/cms/v3/pages/site-pages/multi-language/update-languages');
req.headers({
'private-app-legacy': '{{apiKey}}',
'content-type': 'application/json'
});
req.type('json');
req.send({
languages: {},
primaryId: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/cms/v3/pages/site-pages/multi-language/update-languages',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
data: {languages: {}, primaryId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/cms/v3/pages/site-pages/multi-language/update-languages';
const options = {
method: 'POST',
headers: {'private-app-legacy': '{{apiKey}}', 'content-type': 'application/json'},
body: '{"languages":{},"primaryId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"private-app-legacy": @"{{apiKey}}",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"languages": @{ },
@"primaryId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/cms/v3/pages/site-pages/multi-language/update-languages"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/cms/v3/pages/site-pages/multi-language/update-languages" in
let headers = Header.add_list (Header.init ()) [
("private-app-legacy", "{{apiKey}}");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"languages\": {},\n \"primaryId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/cms/v3/pages/site-pages/multi-language/update-languages",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'languages' => [
],
'primaryId' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"private-app-legacy: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/cms/v3/pages/site-pages/multi-language/update-languages', [
'body' => '{
"languages": {},
"primaryId": ""
}',
'headers' => [
'content-type' => 'application/json',
'private-app-legacy' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/cms/v3/pages/site-pages/multi-language/update-languages');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'private-app-legacy' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'languages' => [
],
'primaryId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'languages' => [
],
'primaryId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/cms/v3/pages/site-pages/multi-language/update-languages');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'private-app-legacy' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("private-app-legacy", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/cms/v3/pages/site-pages/multi-language/update-languages' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"languages": {},
"primaryId": ""
}'
$headers=@{}
$headers.Add("private-app-legacy", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/cms/v3/pages/site-pages/multi-language/update-languages' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"languages": {},
"primaryId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"languages\": {},\n \"primaryId\": \"\"\n}"
headers = {
'private-app-legacy': "{{apiKey}}",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/cms/v3/pages/site-pages/multi-language/update-languages", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/cms/v3/pages/site-pages/multi-language/update-languages"
payload = {
"languages": {},
"primaryId": ""
}
headers = {
"private-app-legacy": "{{apiKey}}",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/cms/v3/pages/site-pages/multi-language/update-languages"
payload <- "{\n \"languages\": {},\n \"primaryId\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('private-app-legacy' = '{{apiKey}}'), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/cms/v3/pages/site-pages/multi-language/update-languages")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["private-app-legacy"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n \"languages\": {},\n \"primaryId\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/cms/v3/pages/site-pages/multi-language/update-languages') do |req|
req.headers['private-app-legacy'] = '{{apiKey}}'
req.body = "{\n \"languages\": {},\n \"primaryId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/cms/v3/pages/site-pages/multi-language/update-languages";
let payload = json!({
"languages": json!({}),
"primaryId": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("private-app-legacy", "{{apiKey}}".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/cms/v3/pages/site-pages/multi-language/update-languages \
--header 'content-type: application/json' \
--header 'private-app-legacy: {{apiKey}}' \
--data '{
"languages": {},
"primaryId": ""
}'
echo '{
"languages": {},
"primaryId": ""
}' | \
http POST {{baseUrl}}/cms/v3/pages/site-pages/multi-language/update-languages \
content-type:application/json \
private-app-legacy:'{{apiKey}}'
wget --quiet \
--method POST \
--header 'private-app-legacy: {{apiKey}}' \
--header 'content-type: application/json' \
--body-data '{\n "languages": {},\n "primaryId": ""\n}' \
--output-document \
- {{baseUrl}}/cms/v3/pages/site-pages/multi-language/update-languages
import Foundation
let headers = [
"private-app-legacy": "{{apiKey}}",
"content-type": "application/json"
]
let parameters = [
"languages": [],
"primaryId": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/cms/v3/pages/site-pages/multi-language/update-languages")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
*/*
RESPONSE BODY text
{
"message": "Invalid input (details will vary based on the error)",
"correlationId": "aeb5f871-7f07-4993-9211-075dc63e7cbf",
"category": "VALIDATION_ERROR",
"links": {
"knowledge-base": "https://www.hubspot.com/products/service/knowledge-base"
}
}