PDF Generator API
PDF Generator APIv3.1.1
Introduction PDF Generator API allows you easily generate transactional PDF documents and reduce the development and support costs by enabling your users to create and manage their document templates using a browser-based drag-and-drop document editor. The PDF Generator API features a web API architecture, allowing you to code in the language of your choice. This API supports the JSON media type, and uses UTF-8 character encoding. You can find our previous API documentation page with references to Simple and Signature authentication here. Base URL The base URL for all the API endpoints is…
- Endpoints
- 11 (5 POST, 3 GET, 2 DELETE, 1 PUT)
- Base URL
https://us1.pdfgeneratorapi.com/api/v3- Authentication
- Bearer token
- Spec format
- OpenAPI 3.0.3
- API version
- 3.1.1
- Source
- docs.pdfgeneratorapi.com
- Provider
- pdfgeneratorapi.com
- Categories
- Text
- Last updated
Use this API in Bruno:
- Download the Bruno collection above and unzip it.
- In Bruno, choose Open Collection and select the unzipped folder.
- Set the
baseUrlvariable (for examplehttps://us1.pdfgeneratorapi.com/api/v3) and your Bearer token credentials, then send requests.
POST
Generate document (multiple templates)
{{baseUrl}}/templates/output
BODY json
[
{
"data": {
"id": 0,
"name": ""
},
"template": 0
}
]
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/templates/output");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "[\n {\n \"data\": {\n \"id\": 0,\n \"name\": \"\"\n },\n \"template\": 0\n }\n]");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/templates/output" {:content-type :json
:form-params [{:data {:id 0
:name ""}
:template 0}]})
require "http/client"
url = "{{baseUrl}}/templates/output"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "[\n {\n \"data\": {\n \"id\": 0,\n \"name\": \"\"\n },\n \"template\": 0\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}}/templates/output"),
Content = new StringContent("[\n {\n \"data\": {\n \"id\": 0,\n \"name\": \"\"\n },\n \"template\": 0\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}}/templates/output");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "[\n {\n \"data\": {\n \"id\": 0,\n \"name\": \"\"\n },\n \"template\": 0\n }\n]", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/templates/output"
payload := strings.NewReader("[\n {\n \"data\": {\n \"id\": 0,\n \"name\": \"\"\n },\n \"template\": 0\n }\n]")
req, _ := http.NewRequest("POST", url, payload)
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/templates/output HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 82
[
{
"data": {
"id": 0,
"name": ""
},
"template": 0
}
]
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/templates/output")
.setHeader("content-type", "application/json")
.setBody("[\n {\n \"data\": {\n \"id\": 0,\n \"name\": \"\"\n },\n \"template\": 0\n }\n]")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/templates/output"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("[\n {\n \"data\": {\n \"id\": 0,\n \"name\": \"\"\n },\n \"template\": 0\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 {\n \"data\": {\n \"id\": 0,\n \"name\": \"\"\n },\n \"template\": 0\n }\n]");
Request request = new Request.Builder()
.url("{{baseUrl}}/templates/output")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/templates/output")
.header("content-type", "application/json")
.body("[\n {\n \"data\": {\n \"id\": 0,\n \"name\": \"\"\n },\n \"template\": 0\n }\n]")
.asString();
const data = JSON.stringify([
{
data: {
id: 0,
name: ''
},
template: 0
}
]);
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/templates/output');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/templates/output',
headers: {'content-type': 'application/json'},
data: [{data: {id: 0, name: ''}, template: 0}]
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/templates/output';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '[{"data":{"id":0,"name":""},"template":0}]'
};
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}}/templates/output',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '[\n {\n "data": {\n "id": 0,\n "name": ""\n },\n "template": 0\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 {\n \"data\": {\n \"id\": 0,\n \"name\": \"\"\n },\n \"template\": 0\n }\n]")
val request = Request.Builder()
.url("{{baseUrl}}/templates/output")
.post(body)
.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/templates/output',
headers: {
'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([{data: {id: 0, name: ''}, template: 0}]));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/templates/output',
headers: {'content-type': 'application/json'},
body: [{data: {id: 0, name: ''}, template: 0}],
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}}/templates/output');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send([
{
data: {
id: 0,
name: ''
},
template: 0
}
]);
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}}/templates/output',
headers: {'content-type': 'application/json'},
data: [{data: {id: 0, name: ''}, template: 0}]
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/templates/output';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '[{"data":{"id":0,"name":""},"template":0}]'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @[ @{ @"data": @{ @"id": @0, @"name": @"" }, @"template": @0 } ];
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/templates/output"]
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}}/templates/output" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "[\n {\n \"data\": {\n \"id\": 0,\n \"name\": \"\"\n },\n \"template\": 0\n }\n]" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/templates/output",
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([
[
'data' => [
'id' => 0,
'name' => ''
],
'template' => 0
]
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/templates/output', [
'body' => '[
{
"data": {
"id": 0,
"name": ""
},
"template": 0
}
]',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/templates/output');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
[
'data' => [
'id' => 0,
'name' => ''
],
'template' => 0
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
[
'data' => [
'id' => 0,
'name' => ''
],
'template' => 0
]
]));
$request->setRequestUrl('{{baseUrl}}/templates/output');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/templates/output' -Method POST -Headers $headers -ContentType 'application/json' -Body '[
{
"data": {
"id": 0,
"name": ""
},
"template": 0
}
]'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/templates/output' -Method POST -Headers $headers -ContentType 'application/json' -Body '[
{
"data": {
"id": 0,
"name": ""
},
"template": 0
}
]'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "[\n {\n \"data\": {\n \"id\": 0,\n \"name\": \"\"\n },\n \"template\": 0\n }\n]"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/templates/output", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/templates/output"
payload = [
{
"data": {
"id": 0,
"name": ""
},
"template": 0
}
]
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/templates/output"
payload <- "[\n {\n \"data\": {\n \"id\": 0,\n \"name\": \"\"\n },\n \"template\": 0\n }\n]"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/templates/output")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "[\n {\n \"data\": {\n \"id\": 0,\n \"name\": \"\"\n },\n \"template\": 0\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/templates/output') do |req|
req.body = "[\n {\n \"data\": {\n \"id\": 0,\n \"name\": \"\"\n },\n \"template\": 0\n }\n]"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/templates/output";
let payload = (
json!({
"data": json!({
"id": 0,
"name": ""
}),
"template": 0
})
);
let mut headers = reqwest::header::HeaderMap::new();
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}}/templates/output \
--header 'content-type: application/json' \
--data '[
{
"data": {
"id": 0,
"name": ""
},
"template": 0
}
]'
echo '[
{
"data": {
"id": 0,
"name": ""
},
"template": 0
}
]' | \
http POST {{baseUrl}}/templates/output \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '[\n {\n "data": {\n "id": 0,\n "name": ""\n },\n "template": 0\n }\n]' \
--output-document \
- {{baseUrl}}/templates/output
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
[
"data": [
"id": 0,
"name": ""
],
"template": 0
]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/templates/output")! 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
application/json
RESPONSE BODY json
{
"meta": {
"content-type": "application/pdf",
"display_name": "a2bd25b8921f3dc7a440fd7f427f90a4",
"encoding": "base64",
"name": "a2bd25b8921f3dc7a440fd7f427f90a4.pdf"
},
"response": "JVBERi0xLjcKJeLjz9MKNyAwIG9iago8PCAvVHlwZSA..."
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Authentication failed",
"status": 401
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Access not granted",
"status": 403
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Entity not found",
"status": 404
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Incorrect parameter value",
"status": 422
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Internal error",
"status": 500
}
POST
Generate document
{{baseUrl}}/templates/templateId/output
QUERY PARAMS
templateId
BODY json
{
"id": 0,
"name": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/templates/templateId/output?templateId=");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"id\": 0,\n \"name\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/templates/templateId/output" {:query-params {:templateId ""}
:content-type :json
:form-params {:id 0
:name ""}})
require "http/client"
url = "{{baseUrl}}/templates/templateId/output?templateId="
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"id\": 0,\n \"name\": \"\"\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}}/templates/templateId/output?templateId="),
Content = new StringContent("{\n \"id\": 0,\n \"name\": \"\"\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}}/templates/templateId/output?templateId=");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"id\": 0,\n \"name\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/templates/templateId/output?templateId="
payload := strings.NewReader("{\n \"id\": 0,\n \"name\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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/templates/templateId/output?templateId= HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 27
{
"id": 0,
"name": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/templates/templateId/output?templateId=")
.setHeader("content-type", "application/json")
.setBody("{\n \"id\": 0,\n \"name\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/templates/templateId/output?templateId="))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"id\": 0,\n \"name\": \"\"\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\": 0,\n \"name\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/templates/templateId/output?templateId=")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/templates/templateId/output?templateId=")
.header("content-type", "application/json")
.body("{\n \"id\": 0,\n \"name\": \"\"\n}")
.asString();
const data = JSON.stringify({
id: 0,
name: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/templates/templateId/output?templateId=');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/templates/templateId/output',
params: {templateId: ''},
headers: {'content-type': 'application/json'},
data: {id: 0, name: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/templates/templateId/output?templateId=';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"id":0,"name":""}'
};
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}}/templates/templateId/output?templateId=',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "id": 0,\n "name": ""\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\": 0,\n \"name\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/templates/templateId/output?templateId=")
.post(body)
.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/templates/templateId/output?templateId=',
headers: {
'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: 0, name: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/templates/templateId/output',
qs: {templateId: ''},
headers: {'content-type': 'application/json'},
body: {id: 0, name: ''},
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}}/templates/templateId/output');
req.query({
templateId: ''
});
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
id: 0,
name: ''
});
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}}/templates/templateId/output',
params: {templateId: ''},
headers: {'content-type': 'application/json'},
data: {id: 0, name: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/templates/templateId/output?templateId=';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"id":0,"name":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"id": @0,
@"name": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/templates/templateId/output?templateId="]
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}}/templates/templateId/output?templateId=" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"id\": 0,\n \"name\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/templates/templateId/output?templateId=",
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' => 0,
'name' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/templates/templateId/output?templateId=', [
'body' => '{
"id": 0,
"name": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/templates/templateId/output');
$request->setMethod(HTTP_METH_POST);
$request->setQueryData([
'templateId' => ''
]);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'id' => 0,
'name' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'id' => 0,
'name' => ''
]));
$request->setRequestUrl('{{baseUrl}}/templates/templateId/output');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setQuery(new http\QueryString([
'templateId' => ''
]));
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/templates/templateId/output?templateId=' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"id": 0,
"name": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/templates/templateId/output?templateId=' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"id": 0,
"name": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"id\": 0,\n \"name\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/templates/templateId/output?templateId=", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/templates/templateId/output"
querystring = {"templateId":""}
payload = {
"id": 0,
"name": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/templates/templateId/output"
queryString <- list(templateId = "")
payload <- "{\n \"id\": 0,\n \"name\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, query = queryString, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/templates/templateId/output?templateId=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"id\": 0,\n \"name\": \"\"\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/templates/templateId/output') do |req|
req.params['templateId'] = ''
req.body = "{\n \"id\": 0,\n \"name\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/templates/templateId/output";
let querystring = [
("templateId", ""),
];
let payload = json!({
"id": 0,
"name": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.query(&querystring)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/templates/templateId/output?templateId=' \
--header 'content-type: application/json' \
--data '{
"id": 0,
"name": ""
}'
echo '{
"id": 0,
"name": ""
}' | \
http POST '{{baseUrl}}/templates/templateId/output?templateId=' \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "id": 0,\n "name": ""\n}' \
--output-document \
- '{{baseUrl}}/templates/templateId/output?templateId='
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"id": 0,
"name": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/templates/templateId/output?templateId=")! 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
application/json
RESPONSE BODY json
{
"meta": {
"content-type": "application/pdf",
"display_name": "a2bd25b8921f3dc7a440fd7f427f90a4",
"encoding": "base64",
"name": "a2bd25b8921f3dc7a440fd7f427f90a4.pdf"
},
"response": "JVBERi0xLjcKJeLjz9MKNyAwIG9iago8PCAvVHlwZSA..."
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Authentication failed",
"status": 401
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Access not granted",
"status": 403
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Entity not found",
"status": 404
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Incorrect parameter value",
"status": 422
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Internal error",
"status": 500
}
POST
Copy template
{{baseUrl}}/templates/templateId/copy
QUERY PARAMS
templateId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/templates/templateId/copy?templateId=");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/templates/templateId/copy" {:query-params {:templateId ""}})
require "http/client"
url = "{{baseUrl}}/templates/templateId/copy?templateId="
response = HTTP::Client.post url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/templates/templateId/copy?templateId="),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/templates/templateId/copy?templateId=");
var request = new RestRequest("", Method.Post);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/templates/templateId/copy?templateId="
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/templates/templateId/copy?templateId= HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/templates/templateId/copy?templateId=")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/templates/templateId/copy?templateId="))
.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}}/templates/templateId/copy?templateId=")
.post(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/templates/templateId/copy?templateId=")
.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}}/templates/templateId/copy?templateId=');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/templates/templateId/copy',
params: {templateId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/templates/templateId/copy?templateId=';
const options = {method: 'POST'};
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}}/templates/templateId/copy?templateId=',
method: 'POST',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/templates/templateId/copy?templateId=")
.post(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/templates/templateId/copy?templateId=',
headers: {}
};
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}}/templates/templateId/copy',
qs: {templateId: ''}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/templates/templateId/copy');
req.query({
templateId: ''
});
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}}/templates/templateId/copy',
params: {templateId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/templates/templateId/copy?templateId=';
const options = {method: 'POST'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/templates/templateId/copy?templateId="]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
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}}/templates/templateId/copy?templateId=" in
Client.call `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/templates/templateId/copy?templateId=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/templates/templateId/copy?templateId=');
echo $response->getBody();
setUrl('{{baseUrl}}/templates/templateId/copy');
$request->setMethod(HTTP_METH_POST);
$request->setQueryData([
'templateId' => ''
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/templates/templateId/copy');
$request->setRequestMethod('POST');
$request->setQuery(new http\QueryString([
'templateId' => ''
]));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/templates/templateId/copy?templateId=' -Method POST
$response = Invoke-RestMethod -Uri '{{baseUrl}}/templates/templateId/copy?templateId=' -Method POST
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("POST", "/baseUrl/templates/templateId/copy?templateId=")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/templates/templateId/copy"
querystring = {"templateId":""}
response = requests.post(url, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/templates/templateId/copy"
queryString <- list(templateId = "")
response <- VERB("POST", url, query = queryString, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/templates/templateId/copy?templateId=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.post('/baseUrl/templates/templateId/copy') do |req|
req.params['templateId'] = ''
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/templates/templateId/copy";
let querystring = [
("templateId", ""),
];
let client = reqwest::Client::new();
let response = client.post(url)
.query(&querystring)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/templates/templateId/copy?templateId='
http POST '{{baseUrl}}/templates/templateId/copy?templateId='
wget --quiet \
--method POST \
--output-document \
- '{{baseUrl}}/templates/templateId/copy?templateId='
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/templates/templateId/copy?templateId=")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
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
application/json
RESPONSE BODY json
{
"response": {
"id": 24382,
"isDraft": true,
"name": "Invoice template",
"tags": [
"invoice",
"orders"
]
}
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Authentication failed",
"status": 401
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Access not granted",
"status": 403
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Entity not found",
"status": 404
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Incorrect parameter value",
"status": 422
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Internal error",
"status": 500
}
POST
Create template
{{baseUrl}}/templates
BODY json
{
"isDraft": false,
"layout": {
"emptyLabels": 0,
"format": "",
"height": "",
"margins": {
"bottom": "",
"left": "",
"right": "",
"top": ""
},
"orientation": "",
"repeatLayout": {
"format": "",
"height": "",
"width": ""
},
"rotaion": 0,
"unit": "",
"width": ""
},
"name": "",
"pages": [
{
"components": [
{
"cls": "",
"dataIndex": "",
"height": "",
"id": "",
"left": "",
"top": "",
"value": "",
"width": "",
"zindex": 0
}
],
"height": "",
"margins": {
"bottom": "",
"right": ""
},
"width": ""
}
],
"tags": []
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/templates");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"isDraft\": false,\n \"layout\": {\n \"emptyLabels\": 0,\n \"format\": \"\",\n \"height\": \"\",\n \"margins\": {\n \"bottom\": \"\",\n \"left\": \"\",\n \"right\": \"\",\n \"top\": \"\"\n },\n \"orientation\": \"\",\n \"repeatLayout\": {\n \"format\": \"\",\n \"height\": \"\",\n \"width\": \"\"\n },\n \"rotaion\": 0,\n \"unit\": \"\",\n \"width\": \"\"\n },\n \"name\": \"\",\n \"pages\": [\n {\n \"components\": [\n {\n \"cls\": \"\",\n \"dataIndex\": \"\",\n \"height\": \"\",\n \"id\": \"\",\n \"left\": \"\",\n \"top\": \"\",\n \"value\": \"\",\n \"width\": \"\",\n \"zindex\": 0\n }\n ],\n \"height\": \"\",\n \"margins\": {\n \"bottom\": \"\",\n \"right\": \"\"\n },\n \"width\": \"\"\n }\n ],\n \"tags\": []\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/templates" {:content-type :json
:form-params {:isDraft false
:layout {:emptyLabels 0
:format ""
:height ""
:margins {:bottom ""
:left ""
:right ""
:top ""}
:orientation ""
:repeatLayout {:format ""
:height ""
:width ""}
:rotaion 0
:unit ""
:width ""}
:name ""
:pages [{:components [{:cls ""
:dataIndex ""
:height ""
:id ""
:left ""
:top ""
:value ""
:width ""
:zindex 0}]
:height ""
:margins {:bottom ""
:right ""}
:width ""}]
:tags []}})
require "http/client"
url = "{{baseUrl}}/templates"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"isDraft\": false,\n \"layout\": {\n \"emptyLabels\": 0,\n \"format\": \"\",\n \"height\": \"\",\n \"margins\": {\n \"bottom\": \"\",\n \"left\": \"\",\n \"right\": \"\",\n \"top\": \"\"\n },\n \"orientation\": \"\",\n \"repeatLayout\": {\n \"format\": \"\",\n \"height\": \"\",\n \"width\": \"\"\n },\n \"rotaion\": 0,\n \"unit\": \"\",\n \"width\": \"\"\n },\n \"name\": \"\",\n \"pages\": [\n {\n \"components\": [\n {\n \"cls\": \"\",\n \"dataIndex\": \"\",\n \"height\": \"\",\n \"id\": \"\",\n \"left\": \"\",\n \"top\": \"\",\n \"value\": \"\",\n \"width\": \"\",\n \"zindex\": 0\n }\n ],\n \"height\": \"\",\n \"margins\": {\n \"bottom\": \"\",\n \"right\": \"\"\n },\n \"width\": \"\"\n }\n ],\n \"tags\": []\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}}/templates"),
Content = new StringContent("{\n \"isDraft\": false,\n \"layout\": {\n \"emptyLabels\": 0,\n \"format\": \"\",\n \"height\": \"\",\n \"margins\": {\n \"bottom\": \"\",\n \"left\": \"\",\n \"right\": \"\",\n \"top\": \"\"\n },\n \"orientation\": \"\",\n \"repeatLayout\": {\n \"format\": \"\",\n \"height\": \"\",\n \"width\": \"\"\n },\n \"rotaion\": 0,\n \"unit\": \"\",\n \"width\": \"\"\n },\n \"name\": \"\",\n \"pages\": [\n {\n \"components\": [\n {\n \"cls\": \"\",\n \"dataIndex\": \"\",\n \"height\": \"\",\n \"id\": \"\",\n \"left\": \"\",\n \"top\": \"\",\n \"value\": \"\",\n \"width\": \"\",\n \"zindex\": 0\n }\n ],\n \"height\": \"\",\n \"margins\": {\n \"bottom\": \"\",\n \"right\": \"\"\n },\n \"width\": \"\"\n }\n ],\n \"tags\": []\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}}/templates");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"isDraft\": false,\n \"layout\": {\n \"emptyLabels\": 0,\n \"format\": \"\",\n \"height\": \"\",\n \"margins\": {\n \"bottom\": \"\",\n \"left\": \"\",\n \"right\": \"\",\n \"top\": \"\"\n },\n \"orientation\": \"\",\n \"repeatLayout\": {\n \"format\": \"\",\n \"height\": \"\",\n \"width\": \"\"\n },\n \"rotaion\": 0,\n \"unit\": \"\",\n \"width\": \"\"\n },\n \"name\": \"\",\n \"pages\": [\n {\n \"components\": [\n {\n \"cls\": \"\",\n \"dataIndex\": \"\",\n \"height\": \"\",\n \"id\": \"\",\n \"left\": \"\",\n \"top\": \"\",\n \"value\": \"\",\n \"width\": \"\",\n \"zindex\": 0\n }\n ],\n \"height\": \"\",\n \"margins\": {\n \"bottom\": \"\",\n \"right\": \"\"\n },\n \"width\": \"\"\n }\n ],\n \"tags\": []\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/templates"
payload := strings.NewReader("{\n \"isDraft\": false,\n \"layout\": {\n \"emptyLabels\": 0,\n \"format\": \"\",\n \"height\": \"\",\n \"margins\": {\n \"bottom\": \"\",\n \"left\": \"\",\n \"right\": \"\",\n \"top\": \"\"\n },\n \"orientation\": \"\",\n \"repeatLayout\": {\n \"format\": \"\",\n \"height\": \"\",\n \"width\": \"\"\n },\n \"rotaion\": 0,\n \"unit\": \"\",\n \"width\": \"\"\n },\n \"name\": \"\",\n \"pages\": [\n {\n \"components\": [\n {\n \"cls\": \"\",\n \"dataIndex\": \"\",\n \"height\": \"\",\n \"id\": \"\",\n \"left\": \"\",\n \"top\": \"\",\n \"value\": \"\",\n \"width\": \"\",\n \"zindex\": 0\n }\n ],\n \"height\": \"\",\n \"margins\": {\n \"bottom\": \"\",\n \"right\": \"\"\n },\n \"width\": \"\"\n }\n ],\n \"tags\": []\n}")
req, _ := http.NewRequest("POST", url, payload)
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/templates HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 776
{
"isDraft": false,
"layout": {
"emptyLabels": 0,
"format": "",
"height": "",
"margins": {
"bottom": "",
"left": "",
"right": "",
"top": ""
},
"orientation": "",
"repeatLayout": {
"format": "",
"height": "",
"width": ""
},
"rotaion": 0,
"unit": "",
"width": ""
},
"name": "",
"pages": [
{
"components": [
{
"cls": "",
"dataIndex": "",
"height": "",
"id": "",
"left": "",
"top": "",
"value": "",
"width": "",
"zindex": 0
}
],
"height": "",
"margins": {
"bottom": "",
"right": ""
},
"width": ""
}
],
"tags": []
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/templates")
.setHeader("content-type", "application/json")
.setBody("{\n \"isDraft\": false,\n \"layout\": {\n \"emptyLabels\": 0,\n \"format\": \"\",\n \"height\": \"\",\n \"margins\": {\n \"bottom\": \"\",\n \"left\": \"\",\n \"right\": \"\",\n \"top\": \"\"\n },\n \"orientation\": \"\",\n \"repeatLayout\": {\n \"format\": \"\",\n \"height\": \"\",\n \"width\": \"\"\n },\n \"rotaion\": 0,\n \"unit\": \"\",\n \"width\": \"\"\n },\n \"name\": \"\",\n \"pages\": [\n {\n \"components\": [\n {\n \"cls\": \"\",\n \"dataIndex\": \"\",\n \"height\": \"\",\n \"id\": \"\",\n \"left\": \"\",\n \"top\": \"\",\n \"value\": \"\",\n \"width\": \"\",\n \"zindex\": 0\n }\n ],\n \"height\": \"\",\n \"margins\": {\n \"bottom\": \"\",\n \"right\": \"\"\n },\n \"width\": \"\"\n }\n ],\n \"tags\": []\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/templates"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"isDraft\": false,\n \"layout\": {\n \"emptyLabels\": 0,\n \"format\": \"\",\n \"height\": \"\",\n \"margins\": {\n \"bottom\": \"\",\n \"left\": \"\",\n \"right\": \"\",\n \"top\": \"\"\n },\n \"orientation\": \"\",\n \"repeatLayout\": {\n \"format\": \"\",\n \"height\": \"\",\n \"width\": \"\"\n },\n \"rotaion\": 0,\n \"unit\": \"\",\n \"width\": \"\"\n },\n \"name\": \"\",\n \"pages\": [\n {\n \"components\": [\n {\n \"cls\": \"\",\n \"dataIndex\": \"\",\n \"height\": \"\",\n \"id\": \"\",\n \"left\": \"\",\n \"top\": \"\",\n \"value\": \"\",\n \"width\": \"\",\n \"zindex\": 0\n }\n ],\n \"height\": \"\",\n \"margins\": {\n \"bottom\": \"\",\n \"right\": \"\"\n },\n \"width\": \"\"\n }\n ],\n \"tags\": []\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 \"isDraft\": false,\n \"layout\": {\n \"emptyLabels\": 0,\n \"format\": \"\",\n \"height\": \"\",\n \"margins\": {\n \"bottom\": \"\",\n \"left\": \"\",\n \"right\": \"\",\n \"top\": \"\"\n },\n \"orientation\": \"\",\n \"repeatLayout\": {\n \"format\": \"\",\n \"height\": \"\",\n \"width\": \"\"\n },\n \"rotaion\": 0,\n \"unit\": \"\",\n \"width\": \"\"\n },\n \"name\": \"\",\n \"pages\": [\n {\n \"components\": [\n {\n \"cls\": \"\",\n \"dataIndex\": \"\",\n \"height\": \"\",\n \"id\": \"\",\n \"left\": \"\",\n \"top\": \"\",\n \"value\": \"\",\n \"width\": \"\",\n \"zindex\": 0\n }\n ],\n \"height\": \"\",\n \"margins\": {\n \"bottom\": \"\",\n \"right\": \"\"\n },\n \"width\": \"\"\n }\n ],\n \"tags\": []\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/templates")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/templates")
.header("content-type", "application/json")
.body("{\n \"isDraft\": false,\n \"layout\": {\n \"emptyLabels\": 0,\n \"format\": \"\",\n \"height\": \"\",\n \"margins\": {\n \"bottom\": \"\",\n \"left\": \"\",\n \"right\": \"\",\n \"top\": \"\"\n },\n \"orientation\": \"\",\n \"repeatLayout\": {\n \"format\": \"\",\n \"height\": \"\",\n \"width\": \"\"\n },\n \"rotaion\": 0,\n \"unit\": \"\",\n \"width\": \"\"\n },\n \"name\": \"\",\n \"pages\": [\n {\n \"components\": [\n {\n \"cls\": \"\",\n \"dataIndex\": \"\",\n \"height\": \"\",\n \"id\": \"\",\n \"left\": \"\",\n \"top\": \"\",\n \"value\": \"\",\n \"width\": \"\",\n \"zindex\": 0\n }\n ],\n \"height\": \"\",\n \"margins\": {\n \"bottom\": \"\",\n \"right\": \"\"\n },\n \"width\": \"\"\n }\n ],\n \"tags\": []\n}")
.asString();
const data = JSON.stringify({
isDraft: false,
layout: {
emptyLabels: 0,
format: '',
height: '',
margins: {
bottom: '',
left: '',
right: '',
top: ''
},
orientation: '',
repeatLayout: {
format: '',
height: '',
width: ''
},
rotaion: 0,
unit: '',
width: ''
},
name: '',
pages: [
{
components: [
{
cls: '',
dataIndex: '',
height: '',
id: '',
left: '',
top: '',
value: '',
width: '',
zindex: 0
}
],
height: '',
margins: {
bottom: '',
right: ''
},
width: ''
}
],
tags: []
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/templates');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/templates',
headers: {'content-type': 'application/json'},
data: {
isDraft: false,
layout: {
emptyLabels: 0,
format: '',
height: '',
margins: {bottom: '', left: '', right: '', top: ''},
orientation: '',
repeatLayout: {format: '', height: '', width: ''},
rotaion: 0,
unit: '',
width: ''
},
name: '',
pages: [
{
components: [
{
cls: '',
dataIndex: '',
height: '',
id: '',
left: '',
top: '',
value: '',
width: '',
zindex: 0
}
],
height: '',
margins: {bottom: '', right: ''},
width: ''
}
],
tags: []
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/templates';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"isDraft":false,"layout":{"emptyLabels":0,"format":"","height":"","margins":{"bottom":"","left":"","right":"","top":""},"orientation":"","repeatLayout":{"format":"","height":"","width":""},"rotaion":0,"unit":"","width":""},"name":"","pages":[{"components":[{"cls":"","dataIndex":"","height":"","id":"","left":"","top":"","value":"","width":"","zindex":0}],"height":"","margins":{"bottom":"","right":""},"width":""}],"tags":[]}'
};
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}}/templates',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "isDraft": false,\n "layout": {\n "emptyLabels": 0,\n "format": "",\n "height": "",\n "margins": {\n "bottom": "",\n "left": "",\n "right": "",\n "top": ""\n },\n "orientation": "",\n "repeatLayout": {\n "format": "",\n "height": "",\n "width": ""\n },\n "rotaion": 0,\n "unit": "",\n "width": ""\n },\n "name": "",\n "pages": [\n {\n "components": [\n {\n "cls": "",\n "dataIndex": "",\n "height": "",\n "id": "",\n "left": "",\n "top": "",\n "value": "",\n "width": "",\n "zindex": 0\n }\n ],\n "height": "",\n "margins": {\n "bottom": "",\n "right": ""\n },\n "width": ""\n }\n ],\n "tags": []\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"isDraft\": false,\n \"layout\": {\n \"emptyLabels\": 0,\n \"format\": \"\",\n \"height\": \"\",\n \"margins\": {\n \"bottom\": \"\",\n \"left\": \"\",\n \"right\": \"\",\n \"top\": \"\"\n },\n \"orientation\": \"\",\n \"repeatLayout\": {\n \"format\": \"\",\n \"height\": \"\",\n \"width\": \"\"\n },\n \"rotaion\": 0,\n \"unit\": \"\",\n \"width\": \"\"\n },\n \"name\": \"\",\n \"pages\": [\n {\n \"components\": [\n {\n \"cls\": \"\",\n \"dataIndex\": \"\",\n \"height\": \"\",\n \"id\": \"\",\n \"left\": \"\",\n \"top\": \"\",\n \"value\": \"\",\n \"width\": \"\",\n \"zindex\": 0\n }\n ],\n \"height\": \"\",\n \"margins\": {\n \"bottom\": \"\",\n \"right\": \"\"\n },\n \"width\": \"\"\n }\n ],\n \"tags\": []\n}")
val request = Request.Builder()
.url("{{baseUrl}}/templates")
.post(body)
.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/templates',
headers: {
'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({
isDraft: false,
layout: {
emptyLabels: 0,
format: '',
height: '',
margins: {bottom: '', left: '', right: '', top: ''},
orientation: '',
repeatLayout: {format: '', height: '', width: ''},
rotaion: 0,
unit: '',
width: ''
},
name: '',
pages: [
{
components: [
{
cls: '',
dataIndex: '',
height: '',
id: '',
left: '',
top: '',
value: '',
width: '',
zindex: 0
}
],
height: '',
margins: {bottom: '', right: ''},
width: ''
}
],
tags: []
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/templates',
headers: {'content-type': 'application/json'},
body: {
isDraft: false,
layout: {
emptyLabels: 0,
format: '',
height: '',
margins: {bottom: '', left: '', right: '', top: ''},
orientation: '',
repeatLayout: {format: '', height: '', width: ''},
rotaion: 0,
unit: '',
width: ''
},
name: '',
pages: [
{
components: [
{
cls: '',
dataIndex: '',
height: '',
id: '',
left: '',
top: '',
value: '',
width: '',
zindex: 0
}
],
height: '',
margins: {bottom: '', right: ''},
width: ''
}
],
tags: []
},
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}}/templates');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
isDraft: false,
layout: {
emptyLabels: 0,
format: '',
height: '',
margins: {
bottom: '',
left: '',
right: '',
top: ''
},
orientation: '',
repeatLayout: {
format: '',
height: '',
width: ''
},
rotaion: 0,
unit: '',
width: ''
},
name: '',
pages: [
{
components: [
{
cls: '',
dataIndex: '',
height: '',
id: '',
left: '',
top: '',
value: '',
width: '',
zindex: 0
}
],
height: '',
margins: {
bottom: '',
right: ''
},
width: ''
}
],
tags: []
});
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}}/templates',
headers: {'content-type': 'application/json'},
data: {
isDraft: false,
layout: {
emptyLabels: 0,
format: '',
height: '',
margins: {bottom: '', left: '', right: '', top: ''},
orientation: '',
repeatLayout: {format: '', height: '', width: ''},
rotaion: 0,
unit: '',
width: ''
},
name: '',
pages: [
{
components: [
{
cls: '',
dataIndex: '',
height: '',
id: '',
left: '',
top: '',
value: '',
width: '',
zindex: 0
}
],
height: '',
margins: {bottom: '', right: ''},
width: ''
}
],
tags: []
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/templates';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"isDraft":false,"layout":{"emptyLabels":0,"format":"","height":"","margins":{"bottom":"","left":"","right":"","top":""},"orientation":"","repeatLayout":{"format":"","height":"","width":""},"rotaion":0,"unit":"","width":""},"name":"","pages":[{"components":[{"cls":"","dataIndex":"","height":"","id":"","left":"","top":"","value":"","width":"","zindex":0}],"height":"","margins":{"bottom":"","right":""},"width":""}],"tags":[]}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"isDraft": @NO,
@"layout": @{ @"emptyLabels": @0, @"format": @"", @"height": @"", @"margins": @{ @"bottom": @"", @"left": @"", @"right": @"", @"top": @"" }, @"orientation": @"", @"repeatLayout": @{ @"format": @"", @"height": @"", @"width": @"" }, @"rotaion": @0, @"unit": @"", @"width": @"" },
@"name": @"",
@"pages": @[ @{ @"components": @[ @{ @"cls": @"", @"dataIndex": @"", @"height": @"", @"id": @"", @"left": @"", @"top": @"", @"value": @"", @"width": @"", @"zindex": @0 } ], @"height": @"", @"margins": @{ @"bottom": @"", @"right": @"" }, @"width": @"" } ],
@"tags": @[ ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/templates"]
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}}/templates" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"isDraft\": false,\n \"layout\": {\n \"emptyLabels\": 0,\n \"format\": \"\",\n \"height\": \"\",\n \"margins\": {\n \"bottom\": \"\",\n \"left\": \"\",\n \"right\": \"\",\n \"top\": \"\"\n },\n \"orientation\": \"\",\n \"repeatLayout\": {\n \"format\": \"\",\n \"height\": \"\",\n \"width\": \"\"\n },\n \"rotaion\": 0,\n \"unit\": \"\",\n \"width\": \"\"\n },\n \"name\": \"\",\n \"pages\": [\n {\n \"components\": [\n {\n \"cls\": \"\",\n \"dataIndex\": \"\",\n \"height\": \"\",\n \"id\": \"\",\n \"left\": \"\",\n \"top\": \"\",\n \"value\": \"\",\n \"width\": \"\",\n \"zindex\": 0\n }\n ],\n \"height\": \"\",\n \"margins\": {\n \"bottom\": \"\",\n \"right\": \"\"\n },\n \"width\": \"\"\n }\n ],\n \"tags\": []\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/templates",
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([
'isDraft' => null,
'layout' => [
'emptyLabels' => 0,
'format' => '',
'height' => '',
'margins' => [
'bottom' => '',
'left' => '',
'right' => '',
'top' => ''
],
'orientation' => '',
'repeatLayout' => [
'format' => '',
'height' => '',
'width' => ''
],
'rotaion' => 0,
'unit' => '',
'width' => ''
],
'name' => '',
'pages' => [
[
'components' => [
[
'cls' => '',
'dataIndex' => '',
'height' => '',
'id' => '',
'left' => '',
'top' => '',
'value' => '',
'width' => '',
'zindex' => 0
]
],
'height' => '',
'margins' => [
'bottom' => '',
'right' => ''
],
'width' => ''
]
],
'tags' => [
]
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/templates', [
'body' => '{
"isDraft": false,
"layout": {
"emptyLabels": 0,
"format": "",
"height": "",
"margins": {
"bottom": "",
"left": "",
"right": "",
"top": ""
},
"orientation": "",
"repeatLayout": {
"format": "",
"height": "",
"width": ""
},
"rotaion": 0,
"unit": "",
"width": ""
},
"name": "",
"pages": [
{
"components": [
{
"cls": "",
"dataIndex": "",
"height": "",
"id": "",
"left": "",
"top": "",
"value": "",
"width": "",
"zindex": 0
}
],
"height": "",
"margins": {
"bottom": "",
"right": ""
},
"width": ""
}
],
"tags": []
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/templates');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'isDraft' => null,
'layout' => [
'emptyLabels' => 0,
'format' => '',
'height' => '',
'margins' => [
'bottom' => '',
'left' => '',
'right' => '',
'top' => ''
],
'orientation' => '',
'repeatLayout' => [
'format' => '',
'height' => '',
'width' => ''
],
'rotaion' => 0,
'unit' => '',
'width' => ''
],
'name' => '',
'pages' => [
[
'components' => [
[
'cls' => '',
'dataIndex' => '',
'height' => '',
'id' => '',
'left' => '',
'top' => '',
'value' => '',
'width' => '',
'zindex' => 0
]
],
'height' => '',
'margins' => [
'bottom' => '',
'right' => ''
],
'width' => ''
]
],
'tags' => [
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'isDraft' => null,
'layout' => [
'emptyLabels' => 0,
'format' => '',
'height' => '',
'margins' => [
'bottom' => '',
'left' => '',
'right' => '',
'top' => ''
],
'orientation' => '',
'repeatLayout' => [
'format' => '',
'height' => '',
'width' => ''
],
'rotaion' => 0,
'unit' => '',
'width' => ''
],
'name' => '',
'pages' => [
[
'components' => [
[
'cls' => '',
'dataIndex' => '',
'height' => '',
'id' => '',
'left' => '',
'top' => '',
'value' => '',
'width' => '',
'zindex' => 0
]
],
'height' => '',
'margins' => [
'bottom' => '',
'right' => ''
],
'width' => ''
]
],
'tags' => [
]
]));
$request->setRequestUrl('{{baseUrl}}/templates');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/templates' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"isDraft": false,
"layout": {
"emptyLabels": 0,
"format": "",
"height": "",
"margins": {
"bottom": "",
"left": "",
"right": "",
"top": ""
},
"orientation": "",
"repeatLayout": {
"format": "",
"height": "",
"width": ""
},
"rotaion": 0,
"unit": "",
"width": ""
},
"name": "",
"pages": [
{
"components": [
{
"cls": "",
"dataIndex": "",
"height": "",
"id": "",
"left": "",
"top": "",
"value": "",
"width": "",
"zindex": 0
}
],
"height": "",
"margins": {
"bottom": "",
"right": ""
},
"width": ""
}
],
"tags": []
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/templates' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"isDraft": false,
"layout": {
"emptyLabels": 0,
"format": "",
"height": "",
"margins": {
"bottom": "",
"left": "",
"right": "",
"top": ""
},
"orientation": "",
"repeatLayout": {
"format": "",
"height": "",
"width": ""
},
"rotaion": 0,
"unit": "",
"width": ""
},
"name": "",
"pages": [
{
"components": [
{
"cls": "",
"dataIndex": "",
"height": "",
"id": "",
"left": "",
"top": "",
"value": "",
"width": "",
"zindex": 0
}
],
"height": "",
"margins": {
"bottom": "",
"right": ""
},
"width": ""
}
],
"tags": []
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"isDraft\": false,\n \"layout\": {\n \"emptyLabels\": 0,\n \"format\": \"\",\n \"height\": \"\",\n \"margins\": {\n \"bottom\": \"\",\n \"left\": \"\",\n \"right\": \"\",\n \"top\": \"\"\n },\n \"orientation\": \"\",\n \"repeatLayout\": {\n \"format\": \"\",\n \"height\": \"\",\n \"width\": \"\"\n },\n \"rotaion\": 0,\n \"unit\": \"\",\n \"width\": \"\"\n },\n \"name\": \"\",\n \"pages\": [\n {\n \"components\": [\n {\n \"cls\": \"\",\n \"dataIndex\": \"\",\n \"height\": \"\",\n \"id\": \"\",\n \"left\": \"\",\n \"top\": \"\",\n \"value\": \"\",\n \"width\": \"\",\n \"zindex\": 0\n }\n ],\n \"height\": \"\",\n \"margins\": {\n \"bottom\": \"\",\n \"right\": \"\"\n },\n \"width\": \"\"\n }\n ],\n \"tags\": []\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/templates", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/templates"
payload = {
"isDraft": False,
"layout": {
"emptyLabels": 0,
"format": "",
"height": "",
"margins": {
"bottom": "",
"left": "",
"right": "",
"top": ""
},
"orientation": "",
"repeatLayout": {
"format": "",
"height": "",
"width": ""
},
"rotaion": 0,
"unit": "",
"width": ""
},
"name": "",
"pages": [
{
"components": [
{
"cls": "",
"dataIndex": "",
"height": "",
"id": "",
"left": "",
"top": "",
"value": "",
"width": "",
"zindex": 0
}
],
"height": "",
"margins": {
"bottom": "",
"right": ""
},
"width": ""
}
],
"tags": []
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/templates"
payload <- "{\n \"isDraft\": false,\n \"layout\": {\n \"emptyLabels\": 0,\n \"format\": \"\",\n \"height\": \"\",\n \"margins\": {\n \"bottom\": \"\",\n \"left\": \"\",\n \"right\": \"\",\n \"top\": \"\"\n },\n \"orientation\": \"\",\n \"repeatLayout\": {\n \"format\": \"\",\n \"height\": \"\",\n \"width\": \"\"\n },\n \"rotaion\": 0,\n \"unit\": \"\",\n \"width\": \"\"\n },\n \"name\": \"\",\n \"pages\": [\n {\n \"components\": [\n {\n \"cls\": \"\",\n \"dataIndex\": \"\",\n \"height\": \"\",\n \"id\": \"\",\n \"left\": \"\",\n \"top\": \"\",\n \"value\": \"\",\n \"width\": \"\",\n \"zindex\": 0\n }\n ],\n \"height\": \"\",\n \"margins\": {\n \"bottom\": \"\",\n \"right\": \"\"\n },\n \"width\": \"\"\n }\n ],\n \"tags\": []\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/templates")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"isDraft\": false,\n \"layout\": {\n \"emptyLabels\": 0,\n \"format\": \"\",\n \"height\": \"\",\n \"margins\": {\n \"bottom\": \"\",\n \"left\": \"\",\n \"right\": \"\",\n \"top\": \"\"\n },\n \"orientation\": \"\",\n \"repeatLayout\": {\n \"format\": \"\",\n \"height\": \"\",\n \"width\": \"\"\n },\n \"rotaion\": 0,\n \"unit\": \"\",\n \"width\": \"\"\n },\n \"name\": \"\",\n \"pages\": [\n {\n \"components\": [\n {\n \"cls\": \"\",\n \"dataIndex\": \"\",\n \"height\": \"\",\n \"id\": \"\",\n \"left\": \"\",\n \"top\": \"\",\n \"value\": \"\",\n \"width\": \"\",\n \"zindex\": 0\n }\n ],\n \"height\": \"\",\n \"margins\": {\n \"bottom\": \"\",\n \"right\": \"\"\n },\n \"width\": \"\"\n }\n ],\n \"tags\": []\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/templates') do |req|
req.body = "{\n \"isDraft\": false,\n \"layout\": {\n \"emptyLabels\": 0,\n \"format\": \"\",\n \"height\": \"\",\n \"margins\": {\n \"bottom\": \"\",\n \"left\": \"\",\n \"right\": \"\",\n \"top\": \"\"\n },\n \"orientation\": \"\",\n \"repeatLayout\": {\n \"format\": \"\",\n \"height\": \"\",\n \"width\": \"\"\n },\n \"rotaion\": 0,\n \"unit\": \"\",\n \"width\": \"\"\n },\n \"name\": \"\",\n \"pages\": [\n {\n \"components\": [\n {\n \"cls\": \"\",\n \"dataIndex\": \"\",\n \"height\": \"\",\n \"id\": \"\",\n \"left\": \"\",\n \"top\": \"\",\n \"value\": \"\",\n \"width\": \"\",\n \"zindex\": 0\n }\n ],\n \"height\": \"\",\n \"margins\": {\n \"bottom\": \"\",\n \"right\": \"\"\n },\n \"width\": \"\"\n }\n ],\n \"tags\": []\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/templates";
let payload = json!({
"isDraft": false,
"layout": json!({
"emptyLabels": 0,
"format": "",
"height": "",
"margins": json!({
"bottom": "",
"left": "",
"right": "",
"top": ""
}),
"orientation": "",
"repeatLayout": json!({
"format": "",
"height": "",
"width": ""
}),
"rotaion": 0,
"unit": "",
"width": ""
}),
"name": "",
"pages": (
json!({
"components": (
json!({
"cls": "",
"dataIndex": "",
"height": "",
"id": "",
"left": "",
"top": "",
"value": "",
"width": "",
"zindex": 0
})
),
"height": "",
"margins": json!({
"bottom": "",
"right": ""
}),
"width": ""
})
),
"tags": ()
});
let mut headers = reqwest::header::HeaderMap::new();
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}}/templates \
--header 'content-type: application/json' \
--data '{
"isDraft": false,
"layout": {
"emptyLabels": 0,
"format": "",
"height": "",
"margins": {
"bottom": "",
"left": "",
"right": "",
"top": ""
},
"orientation": "",
"repeatLayout": {
"format": "",
"height": "",
"width": ""
},
"rotaion": 0,
"unit": "",
"width": ""
},
"name": "",
"pages": [
{
"components": [
{
"cls": "",
"dataIndex": "",
"height": "",
"id": "",
"left": "",
"top": "",
"value": "",
"width": "",
"zindex": 0
}
],
"height": "",
"margins": {
"bottom": "",
"right": ""
},
"width": ""
}
],
"tags": []
}'
echo '{
"isDraft": false,
"layout": {
"emptyLabels": 0,
"format": "",
"height": "",
"margins": {
"bottom": "",
"left": "",
"right": "",
"top": ""
},
"orientation": "",
"repeatLayout": {
"format": "",
"height": "",
"width": ""
},
"rotaion": 0,
"unit": "",
"width": ""
},
"name": "",
"pages": [
{
"components": [
{
"cls": "",
"dataIndex": "",
"height": "",
"id": "",
"left": "",
"top": "",
"value": "",
"width": "",
"zindex": 0
}
],
"height": "",
"margins": {
"bottom": "",
"right": ""
},
"width": ""
}
],
"tags": []
}' | \
http POST {{baseUrl}}/templates \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "isDraft": false,\n "layout": {\n "emptyLabels": 0,\n "format": "",\n "height": "",\n "margins": {\n "bottom": "",\n "left": "",\n "right": "",\n "top": ""\n },\n "orientation": "",\n "repeatLayout": {\n "format": "",\n "height": "",\n "width": ""\n },\n "rotaion": 0,\n "unit": "",\n "width": ""\n },\n "name": "",\n "pages": [\n {\n "components": [\n {\n "cls": "",\n "dataIndex": "",\n "height": "",\n "id": "",\n "left": "",\n "top": "",\n "value": "",\n "width": "",\n "zindex": 0\n }\n ],\n "height": "",\n "margins": {\n "bottom": "",\n "right": ""\n },\n "width": ""\n }\n ],\n "tags": []\n}' \
--output-document \
- {{baseUrl}}/templates
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"isDraft": false,
"layout": [
"emptyLabels": 0,
"format": "",
"height": "",
"margins": [
"bottom": "",
"left": "",
"right": "",
"top": ""
],
"orientation": "",
"repeatLayout": [
"format": "",
"height": "",
"width": ""
],
"rotaion": 0,
"unit": "",
"width": ""
],
"name": "",
"pages": [
[
"components": [
[
"cls": "",
"dataIndex": "",
"height": "",
"id": "",
"left": "",
"top": "",
"value": "",
"width": "",
"zindex": 0
]
],
"height": "",
"margins": [
"bottom": "",
"right": ""
],
"width": ""
]
],
"tags": []
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/templates")! 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
application/json
RESPONSE BODY json
{
"response": {
"id": 24382,
"isDraft": true,
"name": "Invoice template",
"tags": [
"invoice",
"orders"
]
}
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Authentication failed",
"status": 401
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Access not granted",
"status": 403
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Entity not found",
"status": 404
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Incorrect parameter value",
"status": 422
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Internal error",
"status": 500
}
DELETE
Delete template
{{baseUrl}}/templates/templateId
QUERY PARAMS
templateId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/templates/templateId?templateId=");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/delete "{{baseUrl}}/templates/templateId" {:query-params {:templateId ""}})
require "http/client"
url = "{{baseUrl}}/templates/templateId?templateId="
response = HTTP::Client.delete url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Delete,
RequestUri = new Uri("{{baseUrl}}/templates/templateId?templateId="),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/templates/templateId?templateId=");
var request = new RestRequest("", Method.Delete);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/templates/templateId?templateId="
req, _ := http.NewRequest("DELETE", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
DELETE /baseUrl/templates/templateId?templateId= HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/templates/templateId?templateId=")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/templates/templateId?templateId="))
.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}}/templates/templateId?templateId=")
.delete(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/templates/templateId?templateId=")
.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}}/templates/templateId?templateId=');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'DELETE',
url: '{{baseUrl}}/templates/templateId',
params: {templateId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/templates/templateId?templateId=';
const options = {method: 'DELETE'};
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}}/templates/templateId?templateId=',
method: 'DELETE',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/templates/templateId?templateId=")
.delete(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'DELETE',
hostname: 'example.com',
port: null,
path: '/baseUrl/templates/templateId?templateId=',
headers: {}
};
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}}/templates/templateId',
qs: {templateId: ''}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('DELETE', '{{baseUrl}}/templates/templateId');
req.query({
templateId: ''
});
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}}/templates/templateId',
params: {templateId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/templates/templateId?templateId=';
const options = {method: 'DELETE'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/templates/templateId?templateId="]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"DELETE"];
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}}/templates/templateId?templateId=" in
Client.call `DELETE uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/templates/templateId?templateId=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('DELETE', '{{baseUrl}}/templates/templateId?templateId=');
echo $response->getBody();
setUrl('{{baseUrl}}/templates/templateId');
$request->setMethod(HTTP_METH_DELETE);
$request->setQueryData([
'templateId' => ''
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/templates/templateId');
$request->setRequestMethod('DELETE');
$request->setQuery(new http\QueryString([
'templateId' => ''
]));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/templates/templateId?templateId=' -Method DELETE
$response = Invoke-RestMethod -Uri '{{baseUrl}}/templates/templateId?templateId=' -Method DELETE
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("DELETE", "/baseUrl/templates/templateId?templateId=")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/templates/templateId"
querystring = {"templateId":""}
response = requests.delete(url, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/templates/templateId"
queryString <- list(templateId = "")
response <- VERB("DELETE", url, query = queryString, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/templates/templateId?templateId=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.delete('/baseUrl/templates/templateId') do |req|
req.params['templateId'] = ''
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/templates/templateId";
let querystring = [
("templateId", ""),
];
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("DELETE").unwrap(), url)
.query(&querystring)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request DELETE \
--url '{{baseUrl}}/templates/templateId?templateId='
http DELETE '{{baseUrl}}/templates/templateId?templateId='
wget --quiet \
--method DELETE \
--output-document \
- '{{baseUrl}}/templates/templateId?templateId='
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/templates/templateId?templateId=")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "DELETE"
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
application/json
RESPONSE BODY json
{
"response": {
"success": true
}
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Authentication failed",
"status": 401
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Access not granted",
"status": 403
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Entity not found",
"status": 404
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Incorrect parameter value",
"status": 422
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Internal error",
"status": 500
}
GET
Get template
{{baseUrl}}/templates/templateId
QUERY PARAMS
templateId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/templates/templateId?templateId=");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/templates/templateId" {:query-params {:templateId ""}})
require "http/client"
url = "{{baseUrl}}/templates/templateId?templateId="
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/templates/templateId?templateId="),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/templates/templateId?templateId=");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/templates/templateId?templateId="
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/templates/templateId?templateId= HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/templates/templateId?templateId=")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/templates/templateId?templateId="))
.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}}/templates/templateId?templateId=")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/templates/templateId?templateId=")
.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}}/templates/templateId?templateId=');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/templates/templateId',
params: {templateId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/templates/templateId?templateId=';
const options = {method: 'GET'};
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}}/templates/templateId?templateId=',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/templates/templateId?templateId=")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/templates/templateId?templateId=',
headers: {}
};
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}}/templates/templateId',
qs: {templateId: ''}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/templates/templateId');
req.query({
templateId: ''
});
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}}/templates/templateId',
params: {templateId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/templates/templateId?templateId=';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/templates/templateId?templateId="]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
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}}/templates/templateId?templateId=" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/templates/templateId?templateId=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/templates/templateId?templateId=');
echo $response->getBody();
setUrl('{{baseUrl}}/templates/templateId');
$request->setMethod(HTTP_METH_GET);
$request->setQueryData([
'templateId' => ''
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/templates/templateId');
$request->setRequestMethod('GET');
$request->setQuery(new http\QueryString([
'templateId' => ''
]));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/templates/templateId?templateId=' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/templates/templateId?templateId=' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/templates/templateId?templateId=")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/templates/templateId"
querystring = {"templateId":""}
response = requests.get(url, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/templates/templateId"
queryString <- list(templateId = "")
response <- VERB("GET", url, query = queryString, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/templates/templateId?templateId=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/templates/templateId') do |req|
req.params['templateId'] = ''
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/templates/templateId";
let querystring = [
("templateId", ""),
];
let client = reqwest::Client::new();
let response = client.get(url)
.query(&querystring)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url '{{baseUrl}}/templates/templateId?templateId='
http GET '{{baseUrl}}/templates/templateId?templateId='
wget --quiet \
--method GET \
--output-document \
- '{{baseUrl}}/templates/templateId?templateId='
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/templates/templateId?templateId=")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
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
application/json
RESPONSE BODY json
{
"response": {
"id": 24382,
"isDraft": true,
"name": "Invoice template",
"tags": [
"invoice",
"orders"
]
}
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Authentication failed",
"status": 401
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Access not granted",
"status": 403
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Entity not found",
"status": 404
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Incorrect parameter value",
"status": 422
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Internal error",
"status": 500
}
GET
Get templates
{{baseUrl}}/templates
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/templates");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/templates")
require "http/client"
url = "{{baseUrl}}/templates"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/templates"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/templates");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/templates"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/templates HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/templates")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/templates"))
.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}}/templates")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/templates")
.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}}/templates');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/templates'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/templates';
const options = {method: 'GET'};
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}}/templates',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/templates")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/templates',
headers: {}
};
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}}/templates'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/templates');
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}}/templates'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/templates';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/templates"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
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}}/templates" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/templates",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/templates');
echo $response->getBody();
setUrl('{{baseUrl}}/templates');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/templates');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/templates' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/templates' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/templates")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/templates"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/templates"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/templates")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/templates') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/templates";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/templates
http GET {{baseUrl}}/templates
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/templates
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/templates")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
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
application/json
RESPONSE BODY json
{
"error": "Authentication failed",
"status": 401
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Access not granted",
"status": 403
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Entity not found",
"status": 404
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Incorrect parameter value",
"status": 422
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Internal error",
"status": 500
}
POST
Open editor
{{baseUrl}}/templates/templateId/editor
QUERY PARAMS
templateId
BODY json
{}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/templates/templateId/editor?templateId=");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/templates/templateId/editor" {:query-params {:templateId ""}
:content-type :json})
require "http/client"
url = "{{baseUrl}}/templates/templateId/editor?templateId="
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{}"
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}}/templates/templateId/editor?templateId="),
Content = new StringContent("{}")
{
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}}/templates/templateId/editor?templateId=");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/templates/templateId/editor?templateId="
payload := strings.NewReader("{}")
req, _ := http.NewRequest("POST", url, payload)
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/templates/templateId/editor?templateId= HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 2
{}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/templates/templateId/editor?templateId=")
.setHeader("content-type", "application/json")
.setBody("{}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/templates/templateId/editor?templateId="))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{}"))
.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, "{}");
Request request = new Request.Builder()
.url("{{baseUrl}}/templates/templateId/editor?templateId=")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/templates/templateId/editor?templateId=")
.header("content-type", "application/json")
.body("{}")
.asString();
const data = JSON.stringify({});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/templates/templateId/editor?templateId=');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/templates/templateId/editor',
params: {templateId: ''},
headers: {'content-type': 'application/json'},
data: {}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/templates/templateId/editor?templateId=';
const options = {method: 'POST', headers: {'content-type': 'application/json'}, body: '{}'};
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}}/templates/templateId/editor?templateId=',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{}")
val request = Request.Builder()
.url("{{baseUrl}}/templates/templateId/editor?templateId=")
.post(body)
.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/templates/templateId/editor?templateId=',
headers: {
'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({}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/templates/templateId/editor',
qs: {templateId: ''},
headers: {'content-type': 'application/json'},
body: {},
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}}/templates/templateId/editor');
req.query({
templateId: ''
});
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({});
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}}/templates/templateId/editor',
params: {templateId: ''},
headers: {'content-type': 'application/json'},
data: {}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/templates/templateId/editor?templateId=';
const options = {method: 'POST', headers: {'content-type': 'application/json'}, body: '{}'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/templates/templateId/editor?templateId="]
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}}/templates/templateId/editor?templateId=" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/templates/templateId/editor?templateId=",
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([
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/templates/templateId/editor?templateId=', [
'body' => '{}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/templates/templateId/editor');
$request->setMethod(HTTP_METH_POST);
$request->setQueryData([
'templateId' => ''
]);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
]));
$request->setRequestUrl('{{baseUrl}}/templates/templateId/editor');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setQuery(new http\QueryString([
'templateId' => ''
]));
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/templates/templateId/editor?templateId=' -Method POST -Headers $headers -ContentType 'application/json' -Body '{}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/templates/templateId/editor?templateId=' -Method POST -Headers $headers -ContentType 'application/json' -Body '{}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/templates/templateId/editor?templateId=", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/templates/templateId/editor"
querystring = {"templateId":""}
payload = {}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/templates/templateId/editor"
queryString <- list(templateId = "")
payload <- "{}"
encode <- "json"
response <- VERB("POST", url, body = payload, query = queryString, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/templates/templateId/editor?templateId=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{}"
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/templates/templateId/editor') do |req|
req.params['templateId'] = ''
req.body = "{}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/templates/templateId/editor";
let querystring = [
("templateId", ""),
];
let payload = json!({});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.query(&querystring)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/templates/templateId/editor?templateId=' \
--header 'content-type: application/json' \
--data '{}'
echo '{}' | \
http POST '{{baseUrl}}/templates/templateId/editor?templateId=' \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{}' \
--output-document \
- '{{baseUrl}}/templates/templateId/editor?templateId='
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/templates/templateId/editor?templateId=")! 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
application/json
RESPONSE BODY json
{
"response": "https://us1.pdfgeneratorapi.com/editor/open/2ff98760d39456c4b2cf974fef005ecf"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Authentication failed",
"status": 401
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Access not granted",
"status": 403
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Entity not found",
"status": 404
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Incorrect parameter value",
"status": 422
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Internal error",
"status": 500
}
PUT
Update template
{{baseUrl}}/templates/templateId
QUERY PARAMS
templateId
BODY json
{
"isDraft": false,
"layout": {
"emptyLabels": 0,
"format": "",
"height": "",
"margins": {
"bottom": "",
"left": "",
"right": "",
"top": ""
},
"orientation": "",
"repeatLayout": {
"format": "",
"height": "",
"width": ""
},
"rotaion": 0,
"unit": "",
"width": ""
},
"name": "",
"pages": [
{
"components": [
{
"cls": "",
"dataIndex": "",
"height": "",
"id": "",
"left": "",
"top": "",
"value": "",
"width": "",
"zindex": 0
}
],
"height": "",
"margins": {
"bottom": "",
"right": ""
},
"width": ""
}
],
"tags": []
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/templates/templateId?templateId=");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"isDraft\": false,\n \"layout\": {\n \"emptyLabels\": 0,\n \"format\": \"\",\n \"height\": \"\",\n \"margins\": {\n \"bottom\": \"\",\n \"left\": \"\",\n \"right\": \"\",\n \"top\": \"\"\n },\n \"orientation\": \"\",\n \"repeatLayout\": {\n \"format\": \"\",\n \"height\": \"\",\n \"width\": \"\"\n },\n \"rotaion\": 0,\n \"unit\": \"\",\n \"width\": \"\"\n },\n \"name\": \"\",\n \"pages\": [\n {\n \"components\": [\n {\n \"cls\": \"\",\n \"dataIndex\": \"\",\n \"height\": \"\",\n \"id\": \"\",\n \"left\": \"\",\n \"top\": \"\",\n \"value\": \"\",\n \"width\": \"\",\n \"zindex\": 0\n }\n ],\n \"height\": \"\",\n \"margins\": {\n \"bottom\": \"\",\n \"right\": \"\"\n },\n \"width\": \"\"\n }\n ],\n \"tags\": []\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/templates/templateId" {:query-params {:templateId ""}
:content-type :json
:form-params {:isDraft false
:layout {:emptyLabels 0
:format ""
:height ""
:margins {:bottom ""
:left ""
:right ""
:top ""}
:orientation ""
:repeatLayout {:format ""
:height ""
:width ""}
:rotaion 0
:unit ""
:width ""}
:name ""
:pages [{:components [{:cls ""
:dataIndex ""
:height ""
:id ""
:left ""
:top ""
:value ""
:width ""
:zindex 0}]
:height ""
:margins {:bottom ""
:right ""}
:width ""}]
:tags []}})
require "http/client"
url = "{{baseUrl}}/templates/templateId?templateId="
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"isDraft\": false,\n \"layout\": {\n \"emptyLabels\": 0,\n \"format\": \"\",\n \"height\": \"\",\n \"margins\": {\n \"bottom\": \"\",\n \"left\": \"\",\n \"right\": \"\",\n \"top\": \"\"\n },\n \"orientation\": \"\",\n \"repeatLayout\": {\n \"format\": \"\",\n \"height\": \"\",\n \"width\": \"\"\n },\n \"rotaion\": 0,\n \"unit\": \"\",\n \"width\": \"\"\n },\n \"name\": \"\",\n \"pages\": [\n {\n \"components\": [\n {\n \"cls\": \"\",\n \"dataIndex\": \"\",\n \"height\": \"\",\n \"id\": \"\",\n \"left\": \"\",\n \"top\": \"\",\n \"value\": \"\",\n \"width\": \"\",\n \"zindex\": 0\n }\n ],\n \"height\": \"\",\n \"margins\": {\n \"bottom\": \"\",\n \"right\": \"\"\n },\n \"width\": \"\"\n }\n ],\n \"tags\": []\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}}/templates/templateId?templateId="),
Content = new StringContent("{\n \"isDraft\": false,\n \"layout\": {\n \"emptyLabels\": 0,\n \"format\": \"\",\n \"height\": \"\",\n \"margins\": {\n \"bottom\": \"\",\n \"left\": \"\",\n \"right\": \"\",\n \"top\": \"\"\n },\n \"orientation\": \"\",\n \"repeatLayout\": {\n \"format\": \"\",\n \"height\": \"\",\n \"width\": \"\"\n },\n \"rotaion\": 0,\n \"unit\": \"\",\n \"width\": \"\"\n },\n \"name\": \"\",\n \"pages\": [\n {\n \"components\": [\n {\n \"cls\": \"\",\n \"dataIndex\": \"\",\n \"height\": \"\",\n \"id\": \"\",\n \"left\": \"\",\n \"top\": \"\",\n \"value\": \"\",\n \"width\": \"\",\n \"zindex\": 0\n }\n ],\n \"height\": \"\",\n \"margins\": {\n \"bottom\": \"\",\n \"right\": \"\"\n },\n \"width\": \"\"\n }\n ],\n \"tags\": []\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}}/templates/templateId?templateId=");
var request = new RestRequest("", Method.Put);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"isDraft\": false,\n \"layout\": {\n \"emptyLabels\": 0,\n \"format\": \"\",\n \"height\": \"\",\n \"margins\": {\n \"bottom\": \"\",\n \"left\": \"\",\n \"right\": \"\",\n \"top\": \"\"\n },\n \"orientation\": \"\",\n \"repeatLayout\": {\n \"format\": \"\",\n \"height\": \"\",\n \"width\": \"\"\n },\n \"rotaion\": 0,\n \"unit\": \"\",\n \"width\": \"\"\n },\n \"name\": \"\",\n \"pages\": [\n {\n \"components\": [\n {\n \"cls\": \"\",\n \"dataIndex\": \"\",\n \"height\": \"\",\n \"id\": \"\",\n \"left\": \"\",\n \"top\": \"\",\n \"value\": \"\",\n \"width\": \"\",\n \"zindex\": 0\n }\n ],\n \"height\": \"\",\n \"margins\": {\n \"bottom\": \"\",\n \"right\": \"\"\n },\n \"width\": \"\"\n }\n ],\n \"tags\": []\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/templates/templateId?templateId="
payload := strings.NewReader("{\n \"isDraft\": false,\n \"layout\": {\n \"emptyLabels\": 0,\n \"format\": \"\",\n \"height\": \"\",\n \"margins\": {\n \"bottom\": \"\",\n \"left\": \"\",\n \"right\": \"\",\n \"top\": \"\"\n },\n \"orientation\": \"\",\n \"repeatLayout\": {\n \"format\": \"\",\n \"height\": \"\",\n \"width\": \"\"\n },\n \"rotaion\": 0,\n \"unit\": \"\",\n \"width\": \"\"\n },\n \"name\": \"\",\n \"pages\": [\n {\n \"components\": [\n {\n \"cls\": \"\",\n \"dataIndex\": \"\",\n \"height\": \"\",\n \"id\": \"\",\n \"left\": \"\",\n \"top\": \"\",\n \"value\": \"\",\n \"width\": \"\",\n \"zindex\": 0\n }\n ],\n \"height\": \"\",\n \"margins\": {\n \"bottom\": \"\",\n \"right\": \"\"\n },\n \"width\": \"\"\n }\n ],\n \"tags\": []\n}")
req, _ := http.NewRequest("PUT", url, payload)
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/templates/templateId?templateId= HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 776
{
"isDraft": false,
"layout": {
"emptyLabels": 0,
"format": "",
"height": "",
"margins": {
"bottom": "",
"left": "",
"right": "",
"top": ""
},
"orientation": "",
"repeatLayout": {
"format": "",
"height": "",
"width": ""
},
"rotaion": 0,
"unit": "",
"width": ""
},
"name": "",
"pages": [
{
"components": [
{
"cls": "",
"dataIndex": "",
"height": "",
"id": "",
"left": "",
"top": "",
"value": "",
"width": "",
"zindex": 0
}
],
"height": "",
"margins": {
"bottom": "",
"right": ""
},
"width": ""
}
],
"tags": []
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/templates/templateId?templateId=")
.setHeader("content-type", "application/json")
.setBody("{\n \"isDraft\": false,\n \"layout\": {\n \"emptyLabels\": 0,\n \"format\": \"\",\n \"height\": \"\",\n \"margins\": {\n \"bottom\": \"\",\n \"left\": \"\",\n \"right\": \"\",\n \"top\": \"\"\n },\n \"orientation\": \"\",\n \"repeatLayout\": {\n \"format\": \"\",\n \"height\": \"\",\n \"width\": \"\"\n },\n \"rotaion\": 0,\n \"unit\": \"\",\n \"width\": \"\"\n },\n \"name\": \"\",\n \"pages\": [\n {\n \"components\": [\n {\n \"cls\": \"\",\n \"dataIndex\": \"\",\n \"height\": \"\",\n \"id\": \"\",\n \"left\": \"\",\n \"top\": \"\",\n \"value\": \"\",\n \"width\": \"\",\n \"zindex\": 0\n }\n ],\n \"height\": \"\",\n \"margins\": {\n \"bottom\": \"\",\n \"right\": \"\"\n },\n \"width\": \"\"\n }\n ],\n \"tags\": []\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/templates/templateId?templateId="))
.header("content-type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString("{\n \"isDraft\": false,\n \"layout\": {\n \"emptyLabels\": 0,\n \"format\": \"\",\n \"height\": \"\",\n \"margins\": {\n \"bottom\": \"\",\n \"left\": \"\",\n \"right\": \"\",\n \"top\": \"\"\n },\n \"orientation\": \"\",\n \"repeatLayout\": {\n \"format\": \"\",\n \"height\": \"\",\n \"width\": \"\"\n },\n \"rotaion\": 0,\n \"unit\": \"\",\n \"width\": \"\"\n },\n \"name\": \"\",\n \"pages\": [\n {\n \"components\": [\n {\n \"cls\": \"\",\n \"dataIndex\": \"\",\n \"height\": \"\",\n \"id\": \"\",\n \"left\": \"\",\n \"top\": \"\",\n \"value\": \"\",\n \"width\": \"\",\n \"zindex\": 0\n }\n ],\n \"height\": \"\",\n \"margins\": {\n \"bottom\": \"\",\n \"right\": \"\"\n },\n \"width\": \"\"\n }\n ],\n \"tags\": []\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 \"isDraft\": false,\n \"layout\": {\n \"emptyLabels\": 0,\n \"format\": \"\",\n \"height\": \"\",\n \"margins\": {\n \"bottom\": \"\",\n \"left\": \"\",\n \"right\": \"\",\n \"top\": \"\"\n },\n \"orientation\": \"\",\n \"repeatLayout\": {\n \"format\": \"\",\n \"height\": \"\",\n \"width\": \"\"\n },\n \"rotaion\": 0,\n \"unit\": \"\",\n \"width\": \"\"\n },\n \"name\": \"\",\n \"pages\": [\n {\n \"components\": [\n {\n \"cls\": \"\",\n \"dataIndex\": \"\",\n \"height\": \"\",\n \"id\": \"\",\n \"left\": \"\",\n \"top\": \"\",\n \"value\": \"\",\n \"width\": \"\",\n \"zindex\": 0\n }\n ],\n \"height\": \"\",\n \"margins\": {\n \"bottom\": \"\",\n \"right\": \"\"\n },\n \"width\": \"\"\n }\n ],\n \"tags\": []\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/templates/templateId?templateId=")
.put(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/templates/templateId?templateId=")
.header("content-type", "application/json")
.body("{\n \"isDraft\": false,\n \"layout\": {\n \"emptyLabels\": 0,\n \"format\": \"\",\n \"height\": \"\",\n \"margins\": {\n \"bottom\": \"\",\n \"left\": \"\",\n \"right\": \"\",\n \"top\": \"\"\n },\n \"orientation\": \"\",\n \"repeatLayout\": {\n \"format\": \"\",\n \"height\": \"\",\n \"width\": \"\"\n },\n \"rotaion\": 0,\n \"unit\": \"\",\n \"width\": \"\"\n },\n \"name\": \"\",\n \"pages\": [\n {\n \"components\": [\n {\n \"cls\": \"\",\n \"dataIndex\": \"\",\n \"height\": \"\",\n \"id\": \"\",\n \"left\": \"\",\n \"top\": \"\",\n \"value\": \"\",\n \"width\": \"\",\n \"zindex\": 0\n }\n ],\n \"height\": \"\",\n \"margins\": {\n \"bottom\": \"\",\n \"right\": \"\"\n },\n \"width\": \"\"\n }\n ],\n \"tags\": []\n}")
.asString();
const data = JSON.stringify({
isDraft: false,
layout: {
emptyLabels: 0,
format: '',
height: '',
margins: {
bottom: '',
left: '',
right: '',
top: ''
},
orientation: '',
repeatLayout: {
format: '',
height: '',
width: ''
},
rotaion: 0,
unit: '',
width: ''
},
name: '',
pages: [
{
components: [
{
cls: '',
dataIndex: '',
height: '',
id: '',
left: '',
top: '',
value: '',
width: '',
zindex: 0
}
],
height: '',
margins: {
bottom: '',
right: ''
},
width: ''
}
],
tags: []
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/templates/templateId?templateId=');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/templates/templateId',
params: {templateId: ''},
headers: {'content-type': 'application/json'},
data: {
isDraft: false,
layout: {
emptyLabels: 0,
format: '',
height: '',
margins: {bottom: '', left: '', right: '', top: ''},
orientation: '',
repeatLayout: {format: '', height: '', width: ''},
rotaion: 0,
unit: '',
width: ''
},
name: '',
pages: [
{
components: [
{
cls: '',
dataIndex: '',
height: '',
id: '',
left: '',
top: '',
value: '',
width: '',
zindex: 0
}
],
height: '',
margins: {bottom: '', right: ''},
width: ''
}
],
tags: []
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/templates/templateId?templateId=';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"isDraft":false,"layout":{"emptyLabels":0,"format":"","height":"","margins":{"bottom":"","left":"","right":"","top":""},"orientation":"","repeatLayout":{"format":"","height":"","width":""},"rotaion":0,"unit":"","width":""},"name":"","pages":[{"components":[{"cls":"","dataIndex":"","height":"","id":"","left":"","top":"","value":"","width":"","zindex":0}],"height":"","margins":{"bottom":"","right":""},"width":""}],"tags":[]}'
};
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}}/templates/templateId?templateId=',
method: 'PUT',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "isDraft": false,\n "layout": {\n "emptyLabels": 0,\n "format": "",\n "height": "",\n "margins": {\n "bottom": "",\n "left": "",\n "right": "",\n "top": ""\n },\n "orientation": "",\n "repeatLayout": {\n "format": "",\n "height": "",\n "width": ""\n },\n "rotaion": 0,\n "unit": "",\n "width": ""\n },\n "name": "",\n "pages": [\n {\n "components": [\n {\n "cls": "",\n "dataIndex": "",\n "height": "",\n "id": "",\n "left": "",\n "top": "",\n "value": "",\n "width": "",\n "zindex": 0\n }\n ],\n "height": "",\n "margins": {\n "bottom": "",\n "right": ""\n },\n "width": ""\n }\n ],\n "tags": []\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"isDraft\": false,\n \"layout\": {\n \"emptyLabels\": 0,\n \"format\": \"\",\n \"height\": \"\",\n \"margins\": {\n \"bottom\": \"\",\n \"left\": \"\",\n \"right\": \"\",\n \"top\": \"\"\n },\n \"orientation\": \"\",\n \"repeatLayout\": {\n \"format\": \"\",\n \"height\": \"\",\n \"width\": \"\"\n },\n \"rotaion\": 0,\n \"unit\": \"\",\n \"width\": \"\"\n },\n \"name\": \"\",\n \"pages\": [\n {\n \"components\": [\n {\n \"cls\": \"\",\n \"dataIndex\": \"\",\n \"height\": \"\",\n \"id\": \"\",\n \"left\": \"\",\n \"top\": \"\",\n \"value\": \"\",\n \"width\": \"\",\n \"zindex\": 0\n }\n ],\n \"height\": \"\",\n \"margins\": {\n \"bottom\": \"\",\n \"right\": \"\"\n },\n \"width\": \"\"\n }\n ],\n \"tags\": []\n}")
val request = Request.Builder()
.url("{{baseUrl}}/templates/templateId?templateId=")
.put(body)
.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/templates/templateId?templateId=',
headers: {
'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({
isDraft: false,
layout: {
emptyLabels: 0,
format: '',
height: '',
margins: {bottom: '', left: '', right: '', top: ''},
orientation: '',
repeatLayout: {format: '', height: '', width: ''},
rotaion: 0,
unit: '',
width: ''
},
name: '',
pages: [
{
components: [
{
cls: '',
dataIndex: '',
height: '',
id: '',
left: '',
top: '',
value: '',
width: '',
zindex: 0
}
],
height: '',
margins: {bottom: '', right: ''},
width: ''
}
],
tags: []
}));
req.end();
const request = require('request');
const options = {
method: 'PUT',
url: '{{baseUrl}}/templates/templateId',
qs: {templateId: ''},
headers: {'content-type': 'application/json'},
body: {
isDraft: false,
layout: {
emptyLabels: 0,
format: '',
height: '',
margins: {bottom: '', left: '', right: '', top: ''},
orientation: '',
repeatLayout: {format: '', height: '', width: ''},
rotaion: 0,
unit: '',
width: ''
},
name: '',
pages: [
{
components: [
{
cls: '',
dataIndex: '',
height: '',
id: '',
left: '',
top: '',
value: '',
width: '',
zindex: 0
}
],
height: '',
margins: {bottom: '', right: ''},
width: ''
}
],
tags: []
},
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}}/templates/templateId');
req.query({
templateId: ''
});
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
isDraft: false,
layout: {
emptyLabels: 0,
format: '',
height: '',
margins: {
bottom: '',
left: '',
right: '',
top: ''
},
orientation: '',
repeatLayout: {
format: '',
height: '',
width: ''
},
rotaion: 0,
unit: '',
width: ''
},
name: '',
pages: [
{
components: [
{
cls: '',
dataIndex: '',
height: '',
id: '',
left: '',
top: '',
value: '',
width: '',
zindex: 0
}
],
height: '',
margins: {
bottom: '',
right: ''
},
width: ''
}
],
tags: []
});
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}}/templates/templateId',
params: {templateId: ''},
headers: {'content-type': 'application/json'},
data: {
isDraft: false,
layout: {
emptyLabels: 0,
format: '',
height: '',
margins: {bottom: '', left: '', right: '', top: ''},
orientation: '',
repeatLayout: {format: '', height: '', width: ''},
rotaion: 0,
unit: '',
width: ''
},
name: '',
pages: [
{
components: [
{
cls: '',
dataIndex: '',
height: '',
id: '',
left: '',
top: '',
value: '',
width: '',
zindex: 0
}
],
height: '',
margins: {bottom: '', right: ''},
width: ''
}
],
tags: []
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/templates/templateId?templateId=';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"isDraft":false,"layout":{"emptyLabels":0,"format":"","height":"","margins":{"bottom":"","left":"","right":"","top":""},"orientation":"","repeatLayout":{"format":"","height":"","width":""},"rotaion":0,"unit":"","width":""},"name":"","pages":[{"components":[{"cls":"","dataIndex":"","height":"","id":"","left":"","top":"","value":"","width":"","zindex":0}],"height":"","margins":{"bottom":"","right":""},"width":""}],"tags":[]}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"isDraft": @NO,
@"layout": @{ @"emptyLabels": @0, @"format": @"", @"height": @"", @"margins": @{ @"bottom": @"", @"left": @"", @"right": @"", @"top": @"" }, @"orientation": @"", @"repeatLayout": @{ @"format": @"", @"height": @"", @"width": @"" }, @"rotaion": @0, @"unit": @"", @"width": @"" },
@"name": @"",
@"pages": @[ @{ @"components": @[ @{ @"cls": @"", @"dataIndex": @"", @"height": @"", @"id": @"", @"left": @"", @"top": @"", @"value": @"", @"width": @"", @"zindex": @0 } ], @"height": @"", @"margins": @{ @"bottom": @"", @"right": @"" }, @"width": @"" } ],
@"tags": @[ ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/templates/templateId?templateId="]
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}}/templates/templateId?templateId=" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"isDraft\": false,\n \"layout\": {\n \"emptyLabels\": 0,\n \"format\": \"\",\n \"height\": \"\",\n \"margins\": {\n \"bottom\": \"\",\n \"left\": \"\",\n \"right\": \"\",\n \"top\": \"\"\n },\n \"orientation\": \"\",\n \"repeatLayout\": {\n \"format\": \"\",\n \"height\": \"\",\n \"width\": \"\"\n },\n \"rotaion\": 0,\n \"unit\": \"\",\n \"width\": \"\"\n },\n \"name\": \"\",\n \"pages\": [\n {\n \"components\": [\n {\n \"cls\": \"\",\n \"dataIndex\": \"\",\n \"height\": \"\",\n \"id\": \"\",\n \"left\": \"\",\n \"top\": \"\",\n \"value\": \"\",\n \"width\": \"\",\n \"zindex\": 0\n }\n ],\n \"height\": \"\",\n \"margins\": {\n \"bottom\": \"\",\n \"right\": \"\"\n },\n \"width\": \"\"\n }\n ],\n \"tags\": []\n}" in
Client.call ~headers ~body `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/templates/templateId?templateId=",
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([
'isDraft' => null,
'layout' => [
'emptyLabels' => 0,
'format' => '',
'height' => '',
'margins' => [
'bottom' => '',
'left' => '',
'right' => '',
'top' => ''
],
'orientation' => '',
'repeatLayout' => [
'format' => '',
'height' => '',
'width' => ''
],
'rotaion' => 0,
'unit' => '',
'width' => ''
],
'name' => '',
'pages' => [
[
'components' => [
[
'cls' => '',
'dataIndex' => '',
'height' => '',
'id' => '',
'left' => '',
'top' => '',
'value' => '',
'width' => '',
'zindex' => 0
]
],
'height' => '',
'margins' => [
'bottom' => '',
'right' => ''
],
'width' => ''
]
],
'tags' => [
]
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('PUT', '{{baseUrl}}/templates/templateId?templateId=', [
'body' => '{
"isDraft": false,
"layout": {
"emptyLabels": 0,
"format": "",
"height": "",
"margins": {
"bottom": "",
"left": "",
"right": "",
"top": ""
},
"orientation": "",
"repeatLayout": {
"format": "",
"height": "",
"width": ""
},
"rotaion": 0,
"unit": "",
"width": ""
},
"name": "",
"pages": [
{
"components": [
{
"cls": "",
"dataIndex": "",
"height": "",
"id": "",
"left": "",
"top": "",
"value": "",
"width": "",
"zindex": 0
}
],
"height": "",
"margins": {
"bottom": "",
"right": ""
},
"width": ""
}
],
"tags": []
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/templates/templateId');
$request->setMethod(HTTP_METH_PUT);
$request->setQueryData([
'templateId' => ''
]);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'isDraft' => null,
'layout' => [
'emptyLabels' => 0,
'format' => '',
'height' => '',
'margins' => [
'bottom' => '',
'left' => '',
'right' => '',
'top' => ''
],
'orientation' => '',
'repeatLayout' => [
'format' => '',
'height' => '',
'width' => ''
],
'rotaion' => 0,
'unit' => '',
'width' => ''
],
'name' => '',
'pages' => [
[
'components' => [
[
'cls' => '',
'dataIndex' => '',
'height' => '',
'id' => '',
'left' => '',
'top' => '',
'value' => '',
'width' => '',
'zindex' => 0
]
],
'height' => '',
'margins' => [
'bottom' => '',
'right' => ''
],
'width' => ''
]
],
'tags' => [
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'isDraft' => null,
'layout' => [
'emptyLabels' => 0,
'format' => '',
'height' => '',
'margins' => [
'bottom' => '',
'left' => '',
'right' => '',
'top' => ''
],
'orientation' => '',
'repeatLayout' => [
'format' => '',
'height' => '',
'width' => ''
],
'rotaion' => 0,
'unit' => '',
'width' => ''
],
'name' => '',
'pages' => [
[
'components' => [
[
'cls' => '',
'dataIndex' => '',
'height' => '',
'id' => '',
'left' => '',
'top' => '',
'value' => '',
'width' => '',
'zindex' => 0
]
],
'height' => '',
'margins' => [
'bottom' => '',
'right' => ''
],
'width' => ''
]
],
'tags' => [
]
]));
$request->setRequestUrl('{{baseUrl}}/templates/templateId');
$request->setRequestMethod('PUT');
$request->setBody($body);
$request->setQuery(new http\QueryString([
'templateId' => ''
]));
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/templates/templateId?templateId=' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"isDraft": false,
"layout": {
"emptyLabels": 0,
"format": "",
"height": "",
"margins": {
"bottom": "",
"left": "",
"right": "",
"top": ""
},
"orientation": "",
"repeatLayout": {
"format": "",
"height": "",
"width": ""
},
"rotaion": 0,
"unit": "",
"width": ""
},
"name": "",
"pages": [
{
"components": [
{
"cls": "",
"dataIndex": "",
"height": "",
"id": "",
"left": "",
"top": "",
"value": "",
"width": "",
"zindex": 0
}
],
"height": "",
"margins": {
"bottom": "",
"right": ""
},
"width": ""
}
],
"tags": []
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/templates/templateId?templateId=' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"isDraft": false,
"layout": {
"emptyLabels": 0,
"format": "",
"height": "",
"margins": {
"bottom": "",
"left": "",
"right": "",
"top": ""
},
"orientation": "",
"repeatLayout": {
"format": "",
"height": "",
"width": ""
},
"rotaion": 0,
"unit": "",
"width": ""
},
"name": "",
"pages": [
{
"components": [
{
"cls": "",
"dataIndex": "",
"height": "",
"id": "",
"left": "",
"top": "",
"value": "",
"width": "",
"zindex": 0
}
],
"height": "",
"margins": {
"bottom": "",
"right": ""
},
"width": ""
}
],
"tags": []
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"isDraft\": false,\n \"layout\": {\n \"emptyLabels\": 0,\n \"format\": \"\",\n \"height\": \"\",\n \"margins\": {\n \"bottom\": \"\",\n \"left\": \"\",\n \"right\": \"\",\n \"top\": \"\"\n },\n \"orientation\": \"\",\n \"repeatLayout\": {\n \"format\": \"\",\n \"height\": \"\",\n \"width\": \"\"\n },\n \"rotaion\": 0,\n \"unit\": \"\",\n \"width\": \"\"\n },\n \"name\": \"\",\n \"pages\": [\n {\n \"components\": [\n {\n \"cls\": \"\",\n \"dataIndex\": \"\",\n \"height\": \"\",\n \"id\": \"\",\n \"left\": \"\",\n \"top\": \"\",\n \"value\": \"\",\n \"width\": \"\",\n \"zindex\": 0\n }\n ],\n \"height\": \"\",\n \"margins\": {\n \"bottom\": \"\",\n \"right\": \"\"\n },\n \"width\": \"\"\n }\n ],\n \"tags\": []\n}"
headers = { 'content-type': "application/json" }
conn.request("PUT", "/baseUrl/templates/templateId?templateId=", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/templates/templateId"
querystring = {"templateId":""}
payload = {
"isDraft": False,
"layout": {
"emptyLabels": 0,
"format": "",
"height": "",
"margins": {
"bottom": "",
"left": "",
"right": "",
"top": ""
},
"orientation": "",
"repeatLayout": {
"format": "",
"height": "",
"width": ""
},
"rotaion": 0,
"unit": "",
"width": ""
},
"name": "",
"pages": [
{
"components": [
{
"cls": "",
"dataIndex": "",
"height": "",
"id": "",
"left": "",
"top": "",
"value": "",
"width": "",
"zindex": 0
}
],
"height": "",
"margins": {
"bottom": "",
"right": ""
},
"width": ""
}
],
"tags": []
}
headers = {"content-type": "application/json"}
response = requests.put(url, json=payload, headers=headers, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/templates/templateId"
queryString <- list(templateId = "")
payload <- "{\n \"isDraft\": false,\n \"layout\": {\n \"emptyLabels\": 0,\n \"format\": \"\",\n \"height\": \"\",\n \"margins\": {\n \"bottom\": \"\",\n \"left\": \"\",\n \"right\": \"\",\n \"top\": \"\"\n },\n \"orientation\": \"\",\n \"repeatLayout\": {\n \"format\": \"\",\n \"height\": \"\",\n \"width\": \"\"\n },\n \"rotaion\": 0,\n \"unit\": \"\",\n \"width\": \"\"\n },\n \"name\": \"\",\n \"pages\": [\n {\n \"components\": [\n {\n \"cls\": \"\",\n \"dataIndex\": \"\",\n \"height\": \"\",\n \"id\": \"\",\n \"left\": \"\",\n \"top\": \"\",\n \"value\": \"\",\n \"width\": \"\",\n \"zindex\": 0\n }\n ],\n \"height\": \"\",\n \"margins\": {\n \"bottom\": \"\",\n \"right\": \"\"\n },\n \"width\": \"\"\n }\n ],\n \"tags\": []\n}"
encode <- "json"
response <- VERB("PUT", url, body = payload, query = queryString, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/templates/templateId?templateId=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"isDraft\": false,\n \"layout\": {\n \"emptyLabels\": 0,\n \"format\": \"\",\n \"height\": \"\",\n \"margins\": {\n \"bottom\": \"\",\n \"left\": \"\",\n \"right\": \"\",\n \"top\": \"\"\n },\n \"orientation\": \"\",\n \"repeatLayout\": {\n \"format\": \"\",\n \"height\": \"\",\n \"width\": \"\"\n },\n \"rotaion\": 0,\n \"unit\": \"\",\n \"width\": \"\"\n },\n \"name\": \"\",\n \"pages\": [\n {\n \"components\": [\n {\n \"cls\": \"\",\n \"dataIndex\": \"\",\n \"height\": \"\",\n \"id\": \"\",\n \"left\": \"\",\n \"top\": \"\",\n \"value\": \"\",\n \"width\": \"\",\n \"zindex\": 0\n }\n ],\n \"height\": \"\",\n \"margins\": {\n \"bottom\": \"\",\n \"right\": \"\"\n },\n \"width\": \"\"\n }\n ],\n \"tags\": []\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/templates/templateId') do |req|
req.params['templateId'] = ''
req.body = "{\n \"isDraft\": false,\n \"layout\": {\n \"emptyLabels\": 0,\n \"format\": \"\",\n \"height\": \"\",\n \"margins\": {\n \"bottom\": \"\",\n \"left\": \"\",\n \"right\": \"\",\n \"top\": \"\"\n },\n \"orientation\": \"\",\n \"repeatLayout\": {\n \"format\": \"\",\n \"height\": \"\",\n \"width\": \"\"\n },\n \"rotaion\": 0,\n \"unit\": \"\",\n \"width\": \"\"\n },\n \"name\": \"\",\n \"pages\": [\n {\n \"components\": [\n {\n \"cls\": \"\",\n \"dataIndex\": \"\",\n \"height\": \"\",\n \"id\": \"\",\n \"left\": \"\",\n \"top\": \"\",\n \"value\": \"\",\n \"width\": \"\",\n \"zindex\": 0\n }\n ],\n \"height\": \"\",\n \"margins\": {\n \"bottom\": \"\",\n \"right\": \"\"\n },\n \"width\": \"\"\n }\n ],\n \"tags\": []\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}}/templates/templateId";
let querystring = [
("templateId", ""),
];
let payload = json!({
"isDraft": false,
"layout": json!({
"emptyLabels": 0,
"format": "",
"height": "",
"margins": json!({
"bottom": "",
"left": "",
"right": "",
"top": ""
}),
"orientation": "",
"repeatLayout": json!({
"format": "",
"height": "",
"width": ""
}),
"rotaion": 0,
"unit": "",
"width": ""
}),
"name": "",
"pages": (
json!({
"components": (
json!({
"cls": "",
"dataIndex": "",
"height": "",
"id": "",
"left": "",
"top": "",
"value": "",
"width": "",
"zindex": 0
})
),
"height": "",
"margins": json!({
"bottom": "",
"right": ""
}),
"width": ""
})
),
"tags": ()
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PUT").unwrap(), url)
.query(&querystring)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PUT \
--url '{{baseUrl}}/templates/templateId?templateId=' \
--header 'content-type: application/json' \
--data '{
"isDraft": false,
"layout": {
"emptyLabels": 0,
"format": "",
"height": "",
"margins": {
"bottom": "",
"left": "",
"right": "",
"top": ""
},
"orientation": "",
"repeatLayout": {
"format": "",
"height": "",
"width": ""
},
"rotaion": 0,
"unit": "",
"width": ""
},
"name": "",
"pages": [
{
"components": [
{
"cls": "",
"dataIndex": "",
"height": "",
"id": "",
"left": "",
"top": "",
"value": "",
"width": "",
"zindex": 0
}
],
"height": "",
"margins": {
"bottom": "",
"right": ""
},
"width": ""
}
],
"tags": []
}'
echo '{
"isDraft": false,
"layout": {
"emptyLabels": 0,
"format": "",
"height": "",
"margins": {
"bottom": "",
"left": "",
"right": "",
"top": ""
},
"orientation": "",
"repeatLayout": {
"format": "",
"height": "",
"width": ""
},
"rotaion": 0,
"unit": "",
"width": ""
},
"name": "",
"pages": [
{
"components": [
{
"cls": "",
"dataIndex": "",
"height": "",
"id": "",
"left": "",
"top": "",
"value": "",
"width": "",
"zindex": 0
}
],
"height": "",
"margins": {
"bottom": "",
"right": ""
},
"width": ""
}
],
"tags": []
}' | \
http PUT '{{baseUrl}}/templates/templateId?templateId=' \
content-type:application/json
wget --quiet \
--method PUT \
--header 'content-type: application/json' \
--body-data '{\n "isDraft": false,\n "layout": {\n "emptyLabels": 0,\n "format": "",\n "height": "",\n "margins": {\n "bottom": "",\n "left": "",\n "right": "",\n "top": ""\n },\n "orientation": "",\n "repeatLayout": {\n "format": "",\n "height": "",\n "width": ""\n },\n "rotaion": 0,\n "unit": "",\n "width": ""\n },\n "name": "",\n "pages": [\n {\n "components": [\n {\n "cls": "",\n "dataIndex": "",\n "height": "",\n "id": "",\n "left": "",\n "top": "",\n "value": "",\n "width": "",\n "zindex": 0\n }\n ],\n "height": "",\n "margins": {\n "bottom": "",\n "right": ""\n },\n "width": ""\n }\n ],\n "tags": []\n}' \
--output-document \
- '{{baseUrl}}/templates/templateId?templateId='
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"isDraft": false,
"layout": [
"emptyLabels": 0,
"format": "",
"height": "",
"margins": [
"bottom": "",
"left": "",
"right": "",
"top": ""
],
"orientation": "",
"repeatLayout": [
"format": "",
"height": "",
"width": ""
],
"rotaion": 0,
"unit": "",
"width": ""
],
"name": "",
"pages": [
[
"components": [
[
"cls": "",
"dataIndex": "",
"height": "",
"id": "",
"left": "",
"top": "",
"value": "",
"width": "",
"zindex": 0
]
],
"height": "",
"margins": [
"bottom": "",
"right": ""
],
"width": ""
]
],
"tags": []
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/templates/templateId?templateId=")! 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
application/json
RESPONSE BODY json
{
"response": {
"id": 24382,
"isDraft": true,
"name": "Invoice template",
"tags": [
"invoice",
"orders"
]
}
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Authentication failed",
"status": 401
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Access not granted",
"status": 403
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Entity not found",
"status": 404
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Incorrect parameter value",
"status": 422
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Internal error",
"status": 500
}
DELETE
Delete workspace
{{baseUrl}}/workspaces/workspaceId
QUERY PARAMS
workspaceId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/workspaces/workspaceId?workspaceId=");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/delete "{{baseUrl}}/workspaces/workspaceId" {:query-params {:workspaceId ""}})
require "http/client"
url = "{{baseUrl}}/workspaces/workspaceId?workspaceId="
response = HTTP::Client.delete url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Delete,
RequestUri = new Uri("{{baseUrl}}/workspaces/workspaceId?workspaceId="),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/workspaces/workspaceId?workspaceId=");
var request = new RestRequest("", Method.Delete);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/workspaces/workspaceId?workspaceId="
req, _ := http.NewRequest("DELETE", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
DELETE /baseUrl/workspaces/workspaceId?workspaceId= HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/workspaces/workspaceId?workspaceId=")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/workspaces/workspaceId?workspaceId="))
.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}}/workspaces/workspaceId?workspaceId=")
.delete(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/workspaces/workspaceId?workspaceId=")
.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}}/workspaces/workspaceId?workspaceId=');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'DELETE',
url: '{{baseUrl}}/workspaces/workspaceId',
params: {workspaceId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/workspaces/workspaceId?workspaceId=';
const options = {method: 'DELETE'};
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}}/workspaces/workspaceId?workspaceId=',
method: 'DELETE',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/workspaces/workspaceId?workspaceId=")
.delete(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'DELETE',
hostname: 'example.com',
port: null,
path: '/baseUrl/workspaces/workspaceId?workspaceId=',
headers: {}
};
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}}/workspaces/workspaceId',
qs: {workspaceId: ''}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('DELETE', '{{baseUrl}}/workspaces/workspaceId');
req.query({
workspaceId: ''
});
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}}/workspaces/workspaceId',
params: {workspaceId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/workspaces/workspaceId?workspaceId=';
const options = {method: 'DELETE'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/workspaces/workspaceId?workspaceId="]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"DELETE"];
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}}/workspaces/workspaceId?workspaceId=" in
Client.call `DELETE uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/workspaces/workspaceId?workspaceId=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('DELETE', '{{baseUrl}}/workspaces/workspaceId?workspaceId=');
echo $response->getBody();
setUrl('{{baseUrl}}/workspaces/workspaceId');
$request->setMethod(HTTP_METH_DELETE);
$request->setQueryData([
'workspaceId' => ''
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/workspaces/workspaceId');
$request->setRequestMethod('DELETE');
$request->setQuery(new http\QueryString([
'workspaceId' => ''
]));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/workspaces/workspaceId?workspaceId=' -Method DELETE
$response = Invoke-RestMethod -Uri '{{baseUrl}}/workspaces/workspaceId?workspaceId=' -Method DELETE
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("DELETE", "/baseUrl/workspaces/workspaceId?workspaceId=")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/workspaces/workspaceId"
querystring = {"workspaceId":""}
response = requests.delete(url, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/workspaces/workspaceId"
queryString <- list(workspaceId = "")
response <- VERB("DELETE", url, query = queryString, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/workspaces/workspaceId?workspaceId=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.delete('/baseUrl/workspaces/workspaceId') do |req|
req.params['workspaceId'] = ''
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/workspaces/workspaceId";
let querystring = [
("workspaceId", ""),
];
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("DELETE").unwrap(), url)
.query(&querystring)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request DELETE \
--url '{{baseUrl}}/workspaces/workspaceId?workspaceId='
http DELETE '{{baseUrl}}/workspaces/workspaceId?workspaceId='
wget --quiet \
--method DELETE \
--output-document \
- '{{baseUrl}}/workspaces/workspaceId?workspaceId='
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/workspaces/workspaceId?workspaceId=")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "DELETE"
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
application/json
RESPONSE BODY json
{
"response": {
"success": true
}
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Authentication failed",
"status": 401
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Access not granted",
"status": 403
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Entity not found",
"status": 404
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Incorrect parameter value",
"status": 422
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Internal error",
"status": 500
}
GET
Get workspace
{{baseUrl}}/workspaces/workspaceId
QUERY PARAMS
workspaceId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/workspaces/workspaceId?workspaceId=");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/workspaces/workspaceId" {:query-params {:workspaceId ""}})
require "http/client"
url = "{{baseUrl}}/workspaces/workspaceId?workspaceId="
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/workspaces/workspaceId?workspaceId="),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/workspaces/workspaceId?workspaceId=");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/workspaces/workspaceId?workspaceId="
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/workspaces/workspaceId?workspaceId= HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/workspaces/workspaceId?workspaceId=")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/workspaces/workspaceId?workspaceId="))
.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}}/workspaces/workspaceId?workspaceId=")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/workspaces/workspaceId?workspaceId=")
.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}}/workspaces/workspaceId?workspaceId=');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/workspaces/workspaceId',
params: {workspaceId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/workspaces/workspaceId?workspaceId=';
const options = {method: 'GET'};
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}}/workspaces/workspaceId?workspaceId=',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/workspaces/workspaceId?workspaceId=")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/workspaces/workspaceId?workspaceId=',
headers: {}
};
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}}/workspaces/workspaceId',
qs: {workspaceId: ''}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/workspaces/workspaceId');
req.query({
workspaceId: ''
});
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}}/workspaces/workspaceId',
params: {workspaceId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/workspaces/workspaceId?workspaceId=';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/workspaces/workspaceId?workspaceId="]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
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}}/workspaces/workspaceId?workspaceId=" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/workspaces/workspaceId?workspaceId=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/workspaces/workspaceId?workspaceId=');
echo $response->getBody();
setUrl('{{baseUrl}}/workspaces/workspaceId');
$request->setMethod(HTTP_METH_GET);
$request->setQueryData([
'workspaceId' => ''
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/workspaces/workspaceId');
$request->setRequestMethod('GET');
$request->setQuery(new http\QueryString([
'workspaceId' => ''
]));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/workspaces/workspaceId?workspaceId=' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/workspaces/workspaceId?workspaceId=' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/workspaces/workspaceId?workspaceId=")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/workspaces/workspaceId"
querystring = {"workspaceId":""}
response = requests.get(url, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/workspaces/workspaceId"
queryString <- list(workspaceId = "")
response <- VERB("GET", url, query = queryString, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/workspaces/workspaceId?workspaceId=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/workspaces/workspaceId') do |req|
req.params['workspaceId'] = ''
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/workspaces/workspaceId";
let querystring = [
("workspaceId", ""),
];
let client = reqwest::Client::new();
let response = client.get(url)
.query(&querystring)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url '{{baseUrl}}/workspaces/workspaceId?workspaceId='
http GET '{{baseUrl}}/workspaces/workspaceId?workspaceId='
wget --quiet \
--method GET \
--output-document \
- '{{baseUrl}}/workspaces/workspaceId?workspaceId='
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/workspaces/workspaceId?workspaceId=")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
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
application/json
RESPONSE BODY json
{
"response": {
"created_at": "2020-04-01 12:03:12",
"id": 1,
"identifier": "demo.example@actualreports.com",
"is_master_workspace": false
}
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Authentication failed",
"status": 401
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Access not granted",
"status": 403
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Entity not found",
"status": 404
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Incorrect parameter value",
"status": 422
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": "Internal error",
"status": 500
}