Superdesk Rundowns API
POST
Create Rundown Item
{{baseUrl}}/rundown_items
BODY json
{
"title": "",
"item_type": "",
"content": "",
"duration": "",
"planned_duration": "",
"show_part": "",
"additional_notes": "",
"rundown": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/rundown_items");
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 \"title\": \"\",\n \"item_type\": \"\",\n \"content\": \"\",\n \"duration\": \"\",\n \"planned_duration\": \"\",\n \"show_part\": \"\",\n \"additional_notes\": \"\",\n \"rundown\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/rundown_items" {:content-type :json
:form-params {:title ""
:item_type ""
:content ""
:duration ""
:planned_duration ""
:show_part ""
:additional_notes ""
:rundown ""}})
require "http/client"
url = "{{baseUrl}}/rundown_items"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"title\": \"\",\n \"item_type\": \"\",\n \"content\": \"\",\n \"duration\": \"\",\n \"planned_duration\": \"\",\n \"show_part\": \"\",\n \"additional_notes\": \"\",\n \"rundown\": \"\"\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}}/rundown_items"),
Content = new StringContent("{\n \"title\": \"\",\n \"item_type\": \"\",\n \"content\": \"\",\n \"duration\": \"\",\n \"planned_duration\": \"\",\n \"show_part\": \"\",\n \"additional_notes\": \"\",\n \"rundown\": \"\"\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}}/rundown_items");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"title\": \"\",\n \"item_type\": \"\",\n \"content\": \"\",\n \"duration\": \"\",\n \"planned_duration\": \"\",\n \"show_part\": \"\",\n \"additional_notes\": \"\",\n \"rundown\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/rundown_items"
payload := strings.NewReader("{\n \"title\": \"\",\n \"item_type\": \"\",\n \"content\": \"\",\n \"duration\": \"\",\n \"planned_duration\": \"\",\n \"show_part\": \"\",\n \"additional_notes\": \"\",\n \"rundown\": \"\"\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/rundown_items HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 159
{
"title": "",
"item_type": "",
"content": "",
"duration": "",
"planned_duration": "",
"show_part": "",
"additional_notes": "",
"rundown": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/rundown_items")
.setHeader("content-type", "application/json")
.setBody("{\n \"title\": \"\",\n \"item_type\": \"\",\n \"content\": \"\",\n \"duration\": \"\",\n \"planned_duration\": \"\",\n \"show_part\": \"\",\n \"additional_notes\": \"\",\n \"rundown\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/rundown_items"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"title\": \"\",\n \"item_type\": \"\",\n \"content\": \"\",\n \"duration\": \"\",\n \"planned_duration\": \"\",\n \"show_part\": \"\",\n \"additional_notes\": \"\",\n \"rundown\": \"\"\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 \"title\": \"\",\n \"item_type\": \"\",\n \"content\": \"\",\n \"duration\": \"\",\n \"planned_duration\": \"\",\n \"show_part\": \"\",\n \"additional_notes\": \"\",\n \"rundown\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/rundown_items")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/rundown_items")
.header("content-type", "application/json")
.body("{\n \"title\": \"\",\n \"item_type\": \"\",\n \"content\": \"\",\n \"duration\": \"\",\n \"planned_duration\": \"\",\n \"show_part\": \"\",\n \"additional_notes\": \"\",\n \"rundown\": \"\"\n}")
.asString();
const data = JSON.stringify({
title: '',
item_type: '',
content: '',
duration: '',
planned_duration: '',
show_part: '',
additional_notes: '',
rundown: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/rundown_items');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/rundown_items',
headers: {'content-type': 'application/json'},
data: {
title: '',
item_type: '',
content: '',
duration: '',
planned_duration: '',
show_part: '',
additional_notes: '',
rundown: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/rundown_items';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"title":"","item_type":"","content":"","duration":"","planned_duration":"","show_part":"","additional_notes":"","rundown":""}'
};
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}}/rundown_items',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "title": "",\n "item_type": "",\n "content": "",\n "duration": "",\n "planned_duration": "",\n "show_part": "",\n "additional_notes": "",\n "rundown": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"title\": \"\",\n \"item_type\": \"\",\n \"content\": \"\",\n \"duration\": \"\",\n \"planned_duration\": \"\",\n \"show_part\": \"\",\n \"additional_notes\": \"\",\n \"rundown\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/rundown_items")
.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/rundown_items',
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({
title: '',
item_type: '',
content: '',
duration: '',
planned_duration: '',
show_part: '',
additional_notes: '',
rundown: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/rundown_items',
headers: {'content-type': 'application/json'},
body: {
title: '',
item_type: '',
content: '',
duration: '',
planned_duration: '',
show_part: '',
additional_notes: '',
rundown: ''
},
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}}/rundown_items');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
title: '',
item_type: '',
content: '',
duration: '',
planned_duration: '',
show_part: '',
additional_notes: '',
rundown: ''
});
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}}/rundown_items',
headers: {'content-type': 'application/json'},
data: {
title: '',
item_type: '',
content: '',
duration: '',
planned_duration: '',
show_part: '',
additional_notes: '',
rundown: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/rundown_items';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"title":"","item_type":"","content":"","duration":"","planned_duration":"","show_part":"","additional_notes":"","rundown":""}'
};
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 = @{ @"title": @"",
@"item_type": @"",
@"content": @"",
@"duration": @"",
@"planned_duration": @"",
@"show_part": @"",
@"additional_notes": @"",
@"rundown": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/rundown_items"]
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}}/rundown_items" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"title\": \"\",\n \"item_type\": \"\",\n \"content\": \"\",\n \"duration\": \"\",\n \"planned_duration\": \"\",\n \"show_part\": \"\",\n \"additional_notes\": \"\",\n \"rundown\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/rundown_items",
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([
'title' => '',
'item_type' => '',
'content' => '',
'duration' => '',
'planned_duration' => '',
'show_part' => '',
'additional_notes' => '',
'rundown' => ''
]),
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}}/rundown_items', [
'body' => '{
"title": "",
"item_type": "",
"content": "",
"duration": "",
"planned_duration": "",
"show_part": "",
"additional_notes": "",
"rundown": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/rundown_items');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'title' => '',
'item_type' => '',
'content' => '',
'duration' => '',
'planned_duration' => '',
'show_part' => '',
'additional_notes' => '',
'rundown' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'title' => '',
'item_type' => '',
'content' => '',
'duration' => '',
'planned_duration' => '',
'show_part' => '',
'additional_notes' => '',
'rundown' => ''
]));
$request->setRequestUrl('{{baseUrl}}/rundown_items');
$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}}/rundown_items' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"title": "",
"item_type": "",
"content": "",
"duration": "",
"planned_duration": "",
"show_part": "",
"additional_notes": "",
"rundown": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/rundown_items' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"title": "",
"item_type": "",
"content": "",
"duration": "",
"planned_duration": "",
"show_part": "",
"additional_notes": "",
"rundown": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"title\": \"\",\n \"item_type\": \"\",\n \"content\": \"\",\n \"duration\": \"\",\n \"planned_duration\": \"\",\n \"show_part\": \"\",\n \"additional_notes\": \"\",\n \"rundown\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/rundown_items", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/rundown_items"
payload = {
"title": "",
"item_type": "",
"content": "",
"duration": "",
"planned_duration": "",
"show_part": "",
"additional_notes": "",
"rundown": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/rundown_items"
payload <- "{\n \"title\": \"\",\n \"item_type\": \"\",\n \"content\": \"\",\n \"duration\": \"\",\n \"planned_duration\": \"\",\n \"show_part\": \"\",\n \"additional_notes\": \"\",\n \"rundown\": \"\"\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}}/rundown_items")
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 \"title\": \"\",\n \"item_type\": \"\",\n \"content\": \"\",\n \"duration\": \"\",\n \"planned_duration\": \"\",\n \"show_part\": \"\",\n \"additional_notes\": \"\",\n \"rundown\": \"\"\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/rundown_items') do |req|
req.body = "{\n \"title\": \"\",\n \"item_type\": \"\",\n \"content\": \"\",\n \"duration\": \"\",\n \"planned_duration\": \"\",\n \"show_part\": \"\",\n \"additional_notes\": \"\",\n \"rundown\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/rundown_items";
let payload = json!({
"title": "",
"item_type": "",
"content": "",
"duration": "",
"planned_duration": "",
"show_part": "",
"additional_notes": "",
"rundown": ""
});
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}}/rundown_items \
--header 'content-type: application/json' \
--data '{
"title": "",
"item_type": "",
"content": "",
"duration": "",
"planned_duration": "",
"show_part": "",
"additional_notes": "",
"rundown": ""
}'
echo '{
"title": "",
"item_type": "",
"content": "",
"duration": "",
"planned_duration": "",
"show_part": "",
"additional_notes": "",
"rundown": ""
}' | \
http POST {{baseUrl}}/rundown_items \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "title": "",\n "item_type": "",\n "content": "",\n "duration": "",\n "planned_duration": "",\n "show_part": "",\n "additional_notes": "",\n "rundown": ""\n}' \
--output-document \
- {{baseUrl}}/rundown_items
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"title": "",
"item_type": "",
"content": "",
"duration": "",
"planned_duration": "",
"show_part": "",
"additional_notes": "",
"rundown": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/rundown_items")! 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
{
"title": "Intro",
"duration": 130,
"planned_duration": 120,
"rundown": "629864349728636e382c74ce"
}
POST
Create Rundown
{{baseUrl}}/rundowns
BODY json
{
"title": "",
"duration": "",
"planned_duration": "",
"airtime_time": "",
"airtime_date": "",
"show": "",
"template": "",
"items": []
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/rundowns");
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 \"title\": \"\",\n \"duration\": \"\",\n \"planned_duration\": \"\",\n \"airtime_time\": \"\",\n \"airtime_date\": \"\",\n \"show\": \"\",\n \"template\": \"\",\n \"items\": []\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/rundowns" {:content-type :json
:form-params {:title ""
:duration ""
:planned_duration ""
:airtime_time ""
:airtime_date ""
:show ""
:template ""
:items []}})
require "http/client"
url = "{{baseUrl}}/rundowns"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"title\": \"\",\n \"duration\": \"\",\n \"planned_duration\": \"\",\n \"airtime_time\": \"\",\n \"airtime_date\": \"\",\n \"show\": \"\",\n \"template\": \"\",\n \"items\": []\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}}/rundowns"),
Content = new StringContent("{\n \"title\": \"\",\n \"duration\": \"\",\n \"planned_duration\": \"\",\n \"airtime_time\": \"\",\n \"airtime_date\": \"\",\n \"show\": \"\",\n \"template\": \"\",\n \"items\": []\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}}/rundowns");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"title\": \"\",\n \"duration\": \"\",\n \"planned_duration\": \"\",\n \"airtime_time\": \"\",\n \"airtime_date\": \"\",\n \"show\": \"\",\n \"template\": \"\",\n \"items\": []\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/rundowns"
payload := strings.NewReader("{\n \"title\": \"\",\n \"duration\": \"\",\n \"planned_duration\": \"\",\n \"airtime_time\": \"\",\n \"airtime_date\": \"\",\n \"show\": \"\",\n \"template\": \"\",\n \"items\": []\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/rundowns HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 152
{
"title": "",
"duration": "",
"planned_duration": "",
"airtime_time": "",
"airtime_date": "",
"show": "",
"template": "",
"items": []
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/rundowns")
.setHeader("content-type", "application/json")
.setBody("{\n \"title\": \"\",\n \"duration\": \"\",\n \"planned_duration\": \"\",\n \"airtime_time\": \"\",\n \"airtime_date\": \"\",\n \"show\": \"\",\n \"template\": \"\",\n \"items\": []\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/rundowns"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"title\": \"\",\n \"duration\": \"\",\n \"planned_duration\": \"\",\n \"airtime_time\": \"\",\n \"airtime_date\": \"\",\n \"show\": \"\",\n \"template\": \"\",\n \"items\": []\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 \"title\": \"\",\n \"duration\": \"\",\n \"planned_duration\": \"\",\n \"airtime_time\": \"\",\n \"airtime_date\": \"\",\n \"show\": \"\",\n \"template\": \"\",\n \"items\": []\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/rundowns")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/rundowns")
.header("content-type", "application/json")
.body("{\n \"title\": \"\",\n \"duration\": \"\",\n \"planned_duration\": \"\",\n \"airtime_time\": \"\",\n \"airtime_date\": \"\",\n \"show\": \"\",\n \"template\": \"\",\n \"items\": []\n}")
.asString();
const data = JSON.stringify({
title: '',
duration: '',
planned_duration: '',
airtime_time: '',
airtime_date: '',
show: '',
template: '',
items: []
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/rundowns');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/rundowns',
headers: {'content-type': 'application/json'},
data: {
title: '',
duration: '',
planned_duration: '',
airtime_time: '',
airtime_date: '',
show: '',
template: '',
items: []
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/rundowns';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"title":"","duration":"","planned_duration":"","airtime_time":"","airtime_date":"","show":"","template":"","items":[]}'
};
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}}/rundowns',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "title": "",\n "duration": "",\n "planned_duration": "",\n "airtime_time": "",\n "airtime_date": "",\n "show": "",\n "template": "",\n "items": []\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"title\": \"\",\n \"duration\": \"\",\n \"planned_duration\": \"\",\n \"airtime_time\": \"\",\n \"airtime_date\": \"\",\n \"show\": \"\",\n \"template\": \"\",\n \"items\": []\n}")
val request = Request.Builder()
.url("{{baseUrl}}/rundowns")
.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/rundowns',
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({
title: '',
duration: '',
planned_duration: '',
airtime_time: '',
airtime_date: '',
show: '',
template: '',
items: []
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/rundowns',
headers: {'content-type': 'application/json'},
body: {
title: '',
duration: '',
planned_duration: '',
airtime_time: '',
airtime_date: '',
show: '',
template: '',
items: []
},
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}}/rundowns');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
title: '',
duration: '',
planned_duration: '',
airtime_time: '',
airtime_date: '',
show: '',
template: '',
items: []
});
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}}/rundowns',
headers: {'content-type': 'application/json'},
data: {
title: '',
duration: '',
planned_duration: '',
airtime_time: '',
airtime_date: '',
show: '',
template: '',
items: []
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/rundowns';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"title":"","duration":"","planned_duration":"","airtime_time":"","airtime_date":"","show":"","template":"","items":[]}'
};
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 = @{ @"title": @"",
@"duration": @"",
@"planned_duration": @"",
@"airtime_time": @"",
@"airtime_date": @"",
@"show": @"",
@"template": @"",
@"items": @[ ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/rundowns"]
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}}/rundowns" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"title\": \"\",\n \"duration\": \"\",\n \"planned_duration\": \"\",\n \"airtime_time\": \"\",\n \"airtime_date\": \"\",\n \"show\": \"\",\n \"template\": \"\",\n \"items\": []\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/rundowns",
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([
'title' => '',
'duration' => '',
'planned_duration' => '',
'airtime_time' => '',
'airtime_date' => '',
'show' => '',
'template' => '',
'items' => [
]
]),
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}}/rundowns', [
'body' => '{
"title": "",
"duration": "",
"planned_duration": "",
"airtime_time": "",
"airtime_date": "",
"show": "",
"template": "",
"items": []
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/rundowns');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'title' => '',
'duration' => '',
'planned_duration' => '',
'airtime_time' => '',
'airtime_date' => '',
'show' => '',
'template' => '',
'items' => [
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'title' => '',
'duration' => '',
'planned_duration' => '',
'airtime_time' => '',
'airtime_date' => '',
'show' => '',
'template' => '',
'items' => [
]
]));
$request->setRequestUrl('{{baseUrl}}/rundowns');
$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}}/rundowns' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"title": "",
"duration": "",
"planned_duration": "",
"airtime_time": "",
"airtime_date": "",
"show": "",
"template": "",
"items": []
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/rundowns' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"title": "",
"duration": "",
"planned_duration": "",
"airtime_time": "",
"airtime_date": "",
"show": "",
"template": "",
"items": []
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"title\": \"\",\n \"duration\": \"\",\n \"planned_duration\": \"\",\n \"airtime_time\": \"\",\n \"airtime_date\": \"\",\n \"show\": \"\",\n \"template\": \"\",\n \"items\": []\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/rundowns", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/rundowns"
payload = {
"title": "",
"duration": "",
"planned_duration": "",
"airtime_time": "",
"airtime_date": "",
"show": "",
"template": "",
"items": []
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/rundowns"
payload <- "{\n \"title\": \"\",\n \"duration\": \"\",\n \"planned_duration\": \"\",\n \"airtime_time\": \"\",\n \"airtime_date\": \"\",\n \"show\": \"\",\n \"template\": \"\",\n \"items\": []\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}}/rundowns")
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 \"title\": \"\",\n \"duration\": \"\",\n \"planned_duration\": \"\",\n \"airtime_time\": \"\",\n \"airtime_date\": \"\",\n \"show\": \"\",\n \"template\": \"\",\n \"items\": []\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/rundowns') do |req|
req.body = "{\n \"title\": \"\",\n \"duration\": \"\",\n \"planned_duration\": \"\",\n \"airtime_time\": \"\",\n \"airtime_date\": \"\",\n \"show\": \"\",\n \"template\": \"\",\n \"items\": []\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/rundowns";
let payload = json!({
"title": "",
"duration": "",
"planned_duration": "",
"airtime_time": "",
"airtime_date": "",
"show": "",
"template": "",
"items": ()
});
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}}/rundowns \
--header 'content-type: application/json' \
--data '{
"title": "",
"duration": "",
"planned_duration": "",
"airtime_time": "",
"airtime_date": "",
"show": "",
"template": "",
"items": []
}'
echo '{
"title": "",
"duration": "",
"planned_duration": "",
"airtime_time": "",
"airtime_date": "",
"show": "",
"template": "",
"items": []
}' | \
http POST {{baseUrl}}/rundowns \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "title": "",\n "duration": "",\n "planned_duration": "",\n "airtime_time": "",\n "airtime_date": "",\n "show": "",\n "template": "",\n "items": []\n}' \
--output-document \
- {{baseUrl}}/rundowns
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"title": "",
"duration": "",
"planned_duration": "",
"airtime_time": "",
"airtime_date": "",
"show": "",
"template": "",
"items": []
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/rundowns")! 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
{
"title": "Marker // 06:00",
"duration": 3600,
"planned_duration": 3600,
"airtime_time": "06:00",
"airtime_date": "2022-06-20T00:00:00.000Z",
"show": "629864349728636e382c74ce",
"template": "629864349728636e382c74ce"
}
POST
Create Show
{{baseUrl}}/shows
BODY json
{
"title": "",
"description": "",
"planned_duration": "",
"created_by": "",
"last_updated_by": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/shows");
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 \"title\": \"\",\n \"description\": \"\",\n \"planned_duration\": \"\",\n \"created_by\": \"\",\n \"last_updated_by\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/shows" {:content-type :json
:form-params {:title ""
:description ""
:planned_duration ""
:created_by ""
:last_updated_by ""}})
require "http/client"
url = "{{baseUrl}}/shows"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"title\": \"\",\n \"description\": \"\",\n \"planned_duration\": \"\",\n \"created_by\": \"\",\n \"last_updated_by\": \"\"\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}}/shows"),
Content = new StringContent("{\n \"title\": \"\",\n \"description\": \"\",\n \"planned_duration\": \"\",\n \"created_by\": \"\",\n \"last_updated_by\": \"\"\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}}/shows");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"title\": \"\",\n \"description\": \"\",\n \"planned_duration\": \"\",\n \"created_by\": \"\",\n \"last_updated_by\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/shows"
payload := strings.NewReader("{\n \"title\": \"\",\n \"description\": \"\",\n \"planned_duration\": \"\",\n \"created_by\": \"\",\n \"last_updated_by\": \"\"\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/shows HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 109
{
"title": "",
"description": "",
"planned_duration": "",
"created_by": "",
"last_updated_by": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/shows")
.setHeader("content-type", "application/json")
.setBody("{\n \"title\": \"\",\n \"description\": \"\",\n \"planned_duration\": \"\",\n \"created_by\": \"\",\n \"last_updated_by\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/shows"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"title\": \"\",\n \"description\": \"\",\n \"planned_duration\": \"\",\n \"created_by\": \"\",\n \"last_updated_by\": \"\"\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 \"title\": \"\",\n \"description\": \"\",\n \"planned_duration\": \"\",\n \"created_by\": \"\",\n \"last_updated_by\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/shows")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/shows")
.header("content-type", "application/json")
.body("{\n \"title\": \"\",\n \"description\": \"\",\n \"planned_duration\": \"\",\n \"created_by\": \"\",\n \"last_updated_by\": \"\"\n}")
.asString();
const data = JSON.stringify({
title: '',
description: '',
planned_duration: '',
created_by: '',
last_updated_by: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/shows');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/shows',
headers: {'content-type': 'application/json'},
data: {
title: '',
description: '',
planned_duration: '',
created_by: '',
last_updated_by: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/shows';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"title":"","description":"","planned_duration":"","created_by":"","last_updated_by":""}'
};
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}}/shows',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "title": "",\n "description": "",\n "planned_duration": "",\n "created_by": "",\n "last_updated_by": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"title\": \"\",\n \"description\": \"\",\n \"planned_duration\": \"\",\n \"created_by\": \"\",\n \"last_updated_by\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/shows")
.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/shows',
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({
title: '',
description: '',
planned_duration: '',
created_by: '',
last_updated_by: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/shows',
headers: {'content-type': 'application/json'},
body: {
title: '',
description: '',
planned_duration: '',
created_by: '',
last_updated_by: ''
},
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}}/shows');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
title: '',
description: '',
planned_duration: '',
created_by: '',
last_updated_by: ''
});
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}}/shows',
headers: {'content-type': 'application/json'},
data: {
title: '',
description: '',
planned_duration: '',
created_by: '',
last_updated_by: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/shows';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"title":"","description":"","planned_duration":"","created_by":"","last_updated_by":""}'
};
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 = @{ @"title": @"",
@"description": @"",
@"planned_duration": @"",
@"created_by": @"",
@"last_updated_by": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/shows"]
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}}/shows" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"title\": \"\",\n \"description\": \"\",\n \"planned_duration\": \"\",\n \"created_by\": \"\",\n \"last_updated_by\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/shows",
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([
'title' => '',
'description' => '',
'planned_duration' => '',
'created_by' => '',
'last_updated_by' => ''
]),
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}}/shows', [
'body' => '{
"title": "",
"description": "",
"planned_duration": "",
"created_by": "",
"last_updated_by": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/shows');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'title' => '',
'description' => '',
'planned_duration' => '',
'created_by' => '',
'last_updated_by' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'title' => '',
'description' => '',
'planned_duration' => '',
'created_by' => '',
'last_updated_by' => ''
]));
$request->setRequestUrl('{{baseUrl}}/shows');
$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}}/shows' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"title": "",
"description": "",
"planned_duration": "",
"created_by": "",
"last_updated_by": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/shows' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"title": "",
"description": "",
"planned_duration": "",
"created_by": "",
"last_updated_by": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"title\": \"\",\n \"description\": \"\",\n \"planned_duration\": \"\",\n \"created_by\": \"\",\n \"last_updated_by\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/shows", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/shows"
payload = {
"title": "",
"description": "",
"planned_duration": "",
"created_by": "",
"last_updated_by": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/shows"
payload <- "{\n \"title\": \"\",\n \"description\": \"\",\n \"planned_duration\": \"\",\n \"created_by\": \"\",\n \"last_updated_by\": \"\"\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}}/shows")
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 \"title\": \"\",\n \"description\": \"\",\n \"planned_duration\": \"\",\n \"created_by\": \"\",\n \"last_updated_by\": \"\"\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/shows') do |req|
req.body = "{\n \"title\": \"\",\n \"description\": \"\",\n \"planned_duration\": \"\",\n \"created_by\": \"\",\n \"last_updated_by\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/shows";
let payload = json!({
"title": "",
"description": "",
"planned_duration": "",
"created_by": "",
"last_updated_by": ""
});
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}}/shows \
--header 'content-type: application/json' \
--data '{
"title": "",
"description": "",
"planned_duration": "",
"created_by": "",
"last_updated_by": ""
}'
echo '{
"title": "",
"description": "",
"planned_duration": "",
"created_by": "",
"last_updated_by": ""
}' | \
http POST {{baseUrl}}/shows \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "title": "",\n "description": "",\n "planned_duration": "",\n "created_by": "",\n "last_updated_by": ""\n}' \
--output-document \
- {{baseUrl}}/shows
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"title": "",
"description": "",
"planned_duration": "",
"created_by": "",
"last_updated_by": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/shows")! 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
{
"title": "Marker",
"description": "Morning show",
"planned_duration": 3600,
"created_by": "629864349728636e382c74ce",
"last_updated_by": "629864349728636e382c74ce"
}
POST
Create new Template
{{baseUrl}}/shows/:showId/templates
BODY json
{
"title": "",
"airtime_time": "",
"airtime_date": "",
"planned_duration": "",
"repeat": false,
"schedule": {
"freq": "",
"interval": "",
"month": [],
"monthday": [],
"weekday": []
},
"scheduled_on": "",
"title_template": {
"prefix": "",
"separator": "",
"date_format": ""
},
"items": [
{
"title": "",
"item_type": "",
"content": "",
"duration": "",
"planned_duration": "",
"show_part": "",
"additional_notes": "",
"rundown": ""
}
],
"_created": "",
"_updated": "",
"created_by": "",
"last_updated_by": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/shows/:showId/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 \"title\": \"\",\n \"airtime_time\": \"\",\n \"airtime_date\": \"\",\n \"planned_duration\": \"\",\n \"repeat\": false,\n \"schedule\": {\n \"freq\": \"\",\n \"interval\": \"\",\n \"month\": [],\n \"monthday\": [],\n \"weekday\": []\n },\n \"scheduled_on\": \"\",\n \"title_template\": {\n \"prefix\": \"\",\n \"separator\": \"\",\n \"date_format\": \"\"\n },\n \"items\": [\n {\n \"title\": \"\",\n \"item_type\": \"\",\n \"content\": \"\",\n \"duration\": \"\",\n \"planned_duration\": \"\",\n \"show_part\": \"\",\n \"additional_notes\": \"\",\n \"rundown\": \"\"\n }\n ],\n \"_created\": \"\",\n \"_updated\": \"\",\n \"created_by\": \"\",\n \"last_updated_by\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/shows/:showId/templates" {:content-type :json
:form-params {:title ""
:airtime_time ""
:airtime_date ""
:planned_duration ""
:repeat false
:schedule {:freq ""
:interval ""
:month []
:monthday []
:weekday []}
:scheduled_on ""
:title_template {:prefix ""
:separator ""
:date_format ""}
:items [{:title ""
:item_type ""
:content ""
:duration ""
:planned_duration ""
:show_part ""
:additional_notes ""
:rundown ""}]
:_created ""
:_updated ""
:created_by ""
:last_updated_by ""}})
require "http/client"
url = "{{baseUrl}}/shows/:showId/templates"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"title\": \"\",\n \"airtime_time\": \"\",\n \"airtime_date\": \"\",\n \"planned_duration\": \"\",\n \"repeat\": false,\n \"schedule\": {\n \"freq\": \"\",\n \"interval\": \"\",\n \"month\": [],\n \"monthday\": [],\n \"weekday\": []\n },\n \"scheduled_on\": \"\",\n \"title_template\": {\n \"prefix\": \"\",\n \"separator\": \"\",\n \"date_format\": \"\"\n },\n \"items\": [\n {\n \"title\": \"\",\n \"item_type\": \"\",\n \"content\": \"\",\n \"duration\": \"\",\n \"planned_duration\": \"\",\n \"show_part\": \"\",\n \"additional_notes\": \"\",\n \"rundown\": \"\"\n }\n ],\n \"_created\": \"\",\n \"_updated\": \"\",\n \"created_by\": \"\",\n \"last_updated_by\": \"\"\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}}/shows/:showId/templates"),
Content = new StringContent("{\n \"title\": \"\",\n \"airtime_time\": \"\",\n \"airtime_date\": \"\",\n \"planned_duration\": \"\",\n \"repeat\": false,\n \"schedule\": {\n \"freq\": \"\",\n \"interval\": \"\",\n \"month\": [],\n \"monthday\": [],\n \"weekday\": []\n },\n \"scheduled_on\": \"\",\n \"title_template\": {\n \"prefix\": \"\",\n \"separator\": \"\",\n \"date_format\": \"\"\n },\n \"items\": [\n {\n \"title\": \"\",\n \"item_type\": \"\",\n \"content\": \"\",\n \"duration\": \"\",\n \"planned_duration\": \"\",\n \"show_part\": \"\",\n \"additional_notes\": \"\",\n \"rundown\": \"\"\n }\n ],\n \"_created\": \"\",\n \"_updated\": \"\",\n \"created_by\": \"\",\n \"last_updated_by\": \"\"\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}}/shows/:showId/templates");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"title\": \"\",\n \"airtime_time\": \"\",\n \"airtime_date\": \"\",\n \"planned_duration\": \"\",\n \"repeat\": false,\n \"schedule\": {\n \"freq\": \"\",\n \"interval\": \"\",\n \"month\": [],\n \"monthday\": [],\n \"weekday\": []\n },\n \"scheduled_on\": \"\",\n \"title_template\": {\n \"prefix\": \"\",\n \"separator\": \"\",\n \"date_format\": \"\"\n },\n \"items\": [\n {\n \"title\": \"\",\n \"item_type\": \"\",\n \"content\": \"\",\n \"duration\": \"\",\n \"planned_duration\": \"\",\n \"show_part\": \"\",\n \"additional_notes\": \"\",\n \"rundown\": \"\"\n }\n ],\n \"_created\": \"\",\n \"_updated\": \"\",\n \"created_by\": \"\",\n \"last_updated_by\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/shows/:showId/templates"
payload := strings.NewReader("{\n \"title\": \"\",\n \"airtime_time\": \"\",\n \"airtime_date\": \"\",\n \"planned_duration\": \"\",\n \"repeat\": false,\n \"schedule\": {\n \"freq\": \"\",\n \"interval\": \"\",\n \"month\": [],\n \"monthday\": [],\n \"weekday\": []\n },\n \"scheduled_on\": \"\",\n \"title_template\": {\n \"prefix\": \"\",\n \"separator\": \"\",\n \"date_format\": \"\"\n },\n \"items\": [\n {\n \"title\": \"\",\n \"item_type\": \"\",\n \"content\": \"\",\n \"duration\": \"\",\n \"planned_duration\": \"\",\n \"show_part\": \"\",\n \"additional_notes\": \"\",\n \"rundown\": \"\"\n }\n ],\n \"_created\": \"\",\n \"_updated\": \"\",\n \"created_by\": \"\",\n \"last_updated_by\": \"\"\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/shows/:showId/templates HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 627
{
"title": "",
"airtime_time": "",
"airtime_date": "",
"planned_duration": "",
"repeat": false,
"schedule": {
"freq": "",
"interval": "",
"month": [],
"monthday": [],
"weekday": []
},
"scheduled_on": "",
"title_template": {
"prefix": "",
"separator": "",
"date_format": ""
},
"items": [
{
"title": "",
"item_type": "",
"content": "",
"duration": "",
"planned_duration": "",
"show_part": "",
"additional_notes": "",
"rundown": ""
}
],
"_created": "",
"_updated": "",
"created_by": "",
"last_updated_by": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/shows/:showId/templates")
.setHeader("content-type", "application/json")
.setBody("{\n \"title\": \"\",\n \"airtime_time\": \"\",\n \"airtime_date\": \"\",\n \"planned_duration\": \"\",\n \"repeat\": false,\n \"schedule\": {\n \"freq\": \"\",\n \"interval\": \"\",\n \"month\": [],\n \"monthday\": [],\n \"weekday\": []\n },\n \"scheduled_on\": \"\",\n \"title_template\": {\n \"prefix\": \"\",\n \"separator\": \"\",\n \"date_format\": \"\"\n },\n \"items\": [\n {\n \"title\": \"\",\n \"item_type\": \"\",\n \"content\": \"\",\n \"duration\": \"\",\n \"planned_duration\": \"\",\n \"show_part\": \"\",\n \"additional_notes\": \"\",\n \"rundown\": \"\"\n }\n ],\n \"_created\": \"\",\n \"_updated\": \"\",\n \"created_by\": \"\",\n \"last_updated_by\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/shows/:showId/templates"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"title\": \"\",\n \"airtime_time\": \"\",\n \"airtime_date\": \"\",\n \"planned_duration\": \"\",\n \"repeat\": false,\n \"schedule\": {\n \"freq\": \"\",\n \"interval\": \"\",\n \"month\": [],\n \"monthday\": [],\n \"weekday\": []\n },\n \"scheduled_on\": \"\",\n \"title_template\": {\n \"prefix\": \"\",\n \"separator\": \"\",\n \"date_format\": \"\"\n },\n \"items\": [\n {\n \"title\": \"\",\n \"item_type\": \"\",\n \"content\": \"\",\n \"duration\": \"\",\n \"planned_duration\": \"\",\n \"show_part\": \"\",\n \"additional_notes\": \"\",\n \"rundown\": \"\"\n }\n ],\n \"_created\": \"\",\n \"_updated\": \"\",\n \"created_by\": \"\",\n \"last_updated_by\": \"\"\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 \"title\": \"\",\n \"airtime_time\": \"\",\n \"airtime_date\": \"\",\n \"planned_duration\": \"\",\n \"repeat\": false,\n \"schedule\": {\n \"freq\": \"\",\n \"interval\": \"\",\n \"month\": [],\n \"monthday\": [],\n \"weekday\": []\n },\n \"scheduled_on\": \"\",\n \"title_template\": {\n \"prefix\": \"\",\n \"separator\": \"\",\n \"date_format\": \"\"\n },\n \"items\": [\n {\n \"title\": \"\",\n \"item_type\": \"\",\n \"content\": \"\",\n \"duration\": \"\",\n \"planned_duration\": \"\",\n \"show_part\": \"\",\n \"additional_notes\": \"\",\n \"rundown\": \"\"\n }\n ],\n \"_created\": \"\",\n \"_updated\": \"\",\n \"created_by\": \"\",\n \"last_updated_by\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/shows/:showId/templates")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/shows/:showId/templates")
.header("content-type", "application/json")
.body("{\n \"title\": \"\",\n \"airtime_time\": \"\",\n \"airtime_date\": \"\",\n \"planned_duration\": \"\",\n \"repeat\": false,\n \"schedule\": {\n \"freq\": \"\",\n \"interval\": \"\",\n \"month\": [],\n \"monthday\": [],\n \"weekday\": []\n },\n \"scheduled_on\": \"\",\n \"title_template\": {\n \"prefix\": \"\",\n \"separator\": \"\",\n \"date_format\": \"\"\n },\n \"items\": [\n {\n \"title\": \"\",\n \"item_type\": \"\",\n \"content\": \"\",\n \"duration\": \"\",\n \"planned_duration\": \"\",\n \"show_part\": \"\",\n \"additional_notes\": \"\",\n \"rundown\": \"\"\n }\n ],\n \"_created\": \"\",\n \"_updated\": \"\",\n \"created_by\": \"\",\n \"last_updated_by\": \"\"\n}")
.asString();
const data = JSON.stringify({
title: '',
airtime_time: '',
airtime_date: '',
planned_duration: '',
repeat: false,
schedule: {
freq: '',
interval: '',
month: [],
monthday: [],
weekday: []
},
scheduled_on: '',
title_template: {
prefix: '',
separator: '',
date_format: ''
},
items: [
{
title: '',
item_type: '',
content: '',
duration: '',
planned_duration: '',
show_part: '',
additional_notes: '',
rundown: ''
}
],
_created: '',
_updated: '',
created_by: '',
last_updated_by: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/shows/:showId/templates');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/shows/:showId/templates',
headers: {'content-type': 'application/json'},
data: {
title: '',
airtime_time: '',
airtime_date: '',
planned_duration: '',
repeat: false,
schedule: {freq: '', interval: '', month: [], monthday: [], weekday: []},
scheduled_on: '',
title_template: {prefix: '', separator: '', date_format: ''},
items: [
{
title: '',
item_type: '',
content: '',
duration: '',
planned_duration: '',
show_part: '',
additional_notes: '',
rundown: ''
}
],
_created: '',
_updated: '',
created_by: '',
last_updated_by: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/shows/:showId/templates';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"title":"","airtime_time":"","airtime_date":"","planned_duration":"","repeat":false,"schedule":{"freq":"","interval":"","month":[],"monthday":[],"weekday":[]},"scheduled_on":"","title_template":{"prefix":"","separator":"","date_format":""},"items":[{"title":"","item_type":"","content":"","duration":"","planned_duration":"","show_part":"","additional_notes":"","rundown":""}],"_created":"","_updated":"","created_by":"","last_updated_by":""}'
};
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}}/shows/:showId/templates',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "title": "",\n "airtime_time": "",\n "airtime_date": "",\n "planned_duration": "",\n "repeat": false,\n "schedule": {\n "freq": "",\n "interval": "",\n "month": [],\n "monthday": [],\n "weekday": []\n },\n "scheduled_on": "",\n "title_template": {\n "prefix": "",\n "separator": "",\n "date_format": ""\n },\n "items": [\n {\n "title": "",\n "item_type": "",\n "content": "",\n "duration": "",\n "planned_duration": "",\n "show_part": "",\n "additional_notes": "",\n "rundown": ""\n }\n ],\n "_created": "",\n "_updated": "",\n "created_by": "",\n "last_updated_by": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"title\": \"\",\n \"airtime_time\": \"\",\n \"airtime_date\": \"\",\n \"planned_duration\": \"\",\n \"repeat\": false,\n \"schedule\": {\n \"freq\": \"\",\n \"interval\": \"\",\n \"month\": [],\n \"monthday\": [],\n \"weekday\": []\n },\n \"scheduled_on\": \"\",\n \"title_template\": {\n \"prefix\": \"\",\n \"separator\": \"\",\n \"date_format\": \"\"\n },\n \"items\": [\n {\n \"title\": \"\",\n \"item_type\": \"\",\n \"content\": \"\",\n \"duration\": \"\",\n \"planned_duration\": \"\",\n \"show_part\": \"\",\n \"additional_notes\": \"\",\n \"rundown\": \"\"\n }\n ],\n \"_created\": \"\",\n \"_updated\": \"\",\n \"created_by\": \"\",\n \"last_updated_by\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/shows/:showId/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/shows/:showId/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({
title: '',
airtime_time: '',
airtime_date: '',
planned_duration: '',
repeat: false,
schedule: {freq: '', interval: '', month: [], monthday: [], weekday: []},
scheduled_on: '',
title_template: {prefix: '', separator: '', date_format: ''},
items: [
{
title: '',
item_type: '',
content: '',
duration: '',
planned_duration: '',
show_part: '',
additional_notes: '',
rundown: ''
}
],
_created: '',
_updated: '',
created_by: '',
last_updated_by: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/shows/:showId/templates',
headers: {'content-type': 'application/json'},
body: {
title: '',
airtime_time: '',
airtime_date: '',
planned_duration: '',
repeat: false,
schedule: {freq: '', interval: '', month: [], monthday: [], weekday: []},
scheduled_on: '',
title_template: {prefix: '', separator: '', date_format: ''},
items: [
{
title: '',
item_type: '',
content: '',
duration: '',
planned_duration: '',
show_part: '',
additional_notes: '',
rundown: ''
}
],
_created: '',
_updated: '',
created_by: '',
last_updated_by: ''
},
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}}/shows/:showId/templates');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
title: '',
airtime_time: '',
airtime_date: '',
planned_duration: '',
repeat: false,
schedule: {
freq: '',
interval: '',
month: [],
monthday: [],
weekday: []
},
scheduled_on: '',
title_template: {
prefix: '',
separator: '',
date_format: ''
},
items: [
{
title: '',
item_type: '',
content: '',
duration: '',
planned_duration: '',
show_part: '',
additional_notes: '',
rundown: ''
}
],
_created: '',
_updated: '',
created_by: '',
last_updated_by: ''
});
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}}/shows/:showId/templates',
headers: {'content-type': 'application/json'},
data: {
title: '',
airtime_time: '',
airtime_date: '',
planned_duration: '',
repeat: false,
schedule: {freq: '', interval: '', month: [], monthday: [], weekday: []},
scheduled_on: '',
title_template: {prefix: '', separator: '', date_format: ''},
items: [
{
title: '',
item_type: '',
content: '',
duration: '',
planned_duration: '',
show_part: '',
additional_notes: '',
rundown: ''
}
],
_created: '',
_updated: '',
created_by: '',
last_updated_by: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/shows/:showId/templates';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"title":"","airtime_time":"","airtime_date":"","planned_duration":"","repeat":false,"schedule":{"freq":"","interval":"","month":[],"monthday":[],"weekday":[]},"scheduled_on":"","title_template":{"prefix":"","separator":"","date_format":""},"items":[{"title":"","item_type":"","content":"","duration":"","planned_duration":"","show_part":"","additional_notes":"","rundown":""}],"_created":"","_updated":"","created_by":"","last_updated_by":""}'
};
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 = @{ @"title": @"",
@"airtime_time": @"",
@"airtime_date": @"",
@"planned_duration": @"",
@"repeat": @NO,
@"schedule": @{ @"freq": @"", @"interval": @"", @"month": @[ ], @"monthday": @[ ], @"weekday": @[ ] },
@"scheduled_on": @"",
@"title_template": @{ @"prefix": @"", @"separator": @"", @"date_format": @"" },
@"items": @[ @{ @"title": @"", @"item_type": @"", @"content": @"", @"duration": @"", @"planned_duration": @"", @"show_part": @"", @"additional_notes": @"", @"rundown": @"" } ],
@"_created": @"",
@"_updated": @"",
@"created_by": @"",
@"last_updated_by": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/shows/:showId/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}}/shows/:showId/templates" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"title\": \"\",\n \"airtime_time\": \"\",\n \"airtime_date\": \"\",\n \"planned_duration\": \"\",\n \"repeat\": false,\n \"schedule\": {\n \"freq\": \"\",\n \"interval\": \"\",\n \"month\": [],\n \"monthday\": [],\n \"weekday\": []\n },\n \"scheduled_on\": \"\",\n \"title_template\": {\n \"prefix\": \"\",\n \"separator\": \"\",\n \"date_format\": \"\"\n },\n \"items\": [\n {\n \"title\": \"\",\n \"item_type\": \"\",\n \"content\": \"\",\n \"duration\": \"\",\n \"planned_duration\": \"\",\n \"show_part\": \"\",\n \"additional_notes\": \"\",\n \"rundown\": \"\"\n }\n ],\n \"_created\": \"\",\n \"_updated\": \"\",\n \"created_by\": \"\",\n \"last_updated_by\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/shows/:showId/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([
'title' => '',
'airtime_time' => '',
'airtime_date' => '',
'planned_duration' => '',
'repeat' => null,
'schedule' => [
'freq' => '',
'interval' => '',
'month' => [
],
'monthday' => [
],
'weekday' => [
]
],
'scheduled_on' => '',
'title_template' => [
'prefix' => '',
'separator' => '',
'date_format' => ''
],
'items' => [
[
'title' => '',
'item_type' => '',
'content' => '',
'duration' => '',
'planned_duration' => '',
'show_part' => '',
'additional_notes' => '',
'rundown' => ''
]
],
'_created' => '',
'_updated' => '',
'created_by' => '',
'last_updated_by' => ''
]),
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}}/shows/:showId/templates', [
'body' => '{
"title": "",
"airtime_time": "",
"airtime_date": "",
"planned_duration": "",
"repeat": false,
"schedule": {
"freq": "",
"interval": "",
"month": [],
"monthday": [],
"weekday": []
},
"scheduled_on": "",
"title_template": {
"prefix": "",
"separator": "",
"date_format": ""
},
"items": [
{
"title": "",
"item_type": "",
"content": "",
"duration": "",
"planned_duration": "",
"show_part": "",
"additional_notes": "",
"rundown": ""
}
],
"_created": "",
"_updated": "",
"created_by": "",
"last_updated_by": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/shows/:showId/templates');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'title' => '',
'airtime_time' => '',
'airtime_date' => '',
'planned_duration' => '',
'repeat' => null,
'schedule' => [
'freq' => '',
'interval' => '',
'month' => [
],
'monthday' => [
],
'weekday' => [
]
],
'scheduled_on' => '',
'title_template' => [
'prefix' => '',
'separator' => '',
'date_format' => ''
],
'items' => [
[
'title' => '',
'item_type' => '',
'content' => '',
'duration' => '',
'planned_duration' => '',
'show_part' => '',
'additional_notes' => '',
'rundown' => ''
]
],
'_created' => '',
'_updated' => '',
'created_by' => '',
'last_updated_by' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'title' => '',
'airtime_time' => '',
'airtime_date' => '',
'planned_duration' => '',
'repeat' => null,
'schedule' => [
'freq' => '',
'interval' => '',
'month' => [
],
'monthday' => [
],
'weekday' => [
]
],
'scheduled_on' => '',
'title_template' => [
'prefix' => '',
'separator' => '',
'date_format' => ''
],
'items' => [
[
'title' => '',
'item_type' => '',
'content' => '',
'duration' => '',
'planned_duration' => '',
'show_part' => '',
'additional_notes' => '',
'rundown' => ''
]
],
'_created' => '',
'_updated' => '',
'created_by' => '',
'last_updated_by' => ''
]));
$request->setRequestUrl('{{baseUrl}}/shows/:showId/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}}/shows/:showId/templates' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"title": "",
"airtime_time": "",
"airtime_date": "",
"planned_duration": "",
"repeat": false,
"schedule": {
"freq": "",
"interval": "",
"month": [],
"monthday": [],
"weekday": []
},
"scheduled_on": "",
"title_template": {
"prefix": "",
"separator": "",
"date_format": ""
},
"items": [
{
"title": "",
"item_type": "",
"content": "",
"duration": "",
"planned_duration": "",
"show_part": "",
"additional_notes": "",
"rundown": ""
}
],
"_created": "",
"_updated": "",
"created_by": "",
"last_updated_by": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/shows/:showId/templates' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"title": "",
"airtime_time": "",
"airtime_date": "",
"planned_duration": "",
"repeat": false,
"schedule": {
"freq": "",
"interval": "",
"month": [],
"monthday": [],
"weekday": []
},
"scheduled_on": "",
"title_template": {
"prefix": "",
"separator": "",
"date_format": ""
},
"items": [
{
"title": "",
"item_type": "",
"content": "",
"duration": "",
"planned_duration": "",
"show_part": "",
"additional_notes": "",
"rundown": ""
}
],
"_created": "",
"_updated": "",
"created_by": "",
"last_updated_by": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"title\": \"\",\n \"airtime_time\": \"\",\n \"airtime_date\": \"\",\n \"planned_duration\": \"\",\n \"repeat\": false,\n \"schedule\": {\n \"freq\": \"\",\n \"interval\": \"\",\n \"month\": [],\n \"monthday\": [],\n \"weekday\": []\n },\n \"scheduled_on\": \"\",\n \"title_template\": {\n \"prefix\": \"\",\n \"separator\": \"\",\n \"date_format\": \"\"\n },\n \"items\": [\n {\n \"title\": \"\",\n \"item_type\": \"\",\n \"content\": \"\",\n \"duration\": \"\",\n \"planned_duration\": \"\",\n \"show_part\": \"\",\n \"additional_notes\": \"\",\n \"rundown\": \"\"\n }\n ],\n \"_created\": \"\",\n \"_updated\": \"\",\n \"created_by\": \"\",\n \"last_updated_by\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/shows/:showId/templates", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/shows/:showId/templates"
payload = {
"title": "",
"airtime_time": "",
"airtime_date": "",
"planned_duration": "",
"repeat": False,
"schedule": {
"freq": "",
"interval": "",
"month": [],
"monthday": [],
"weekday": []
},
"scheduled_on": "",
"title_template": {
"prefix": "",
"separator": "",
"date_format": ""
},
"items": [
{
"title": "",
"item_type": "",
"content": "",
"duration": "",
"planned_duration": "",
"show_part": "",
"additional_notes": "",
"rundown": ""
}
],
"_created": "",
"_updated": "",
"created_by": "",
"last_updated_by": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/shows/:showId/templates"
payload <- "{\n \"title\": \"\",\n \"airtime_time\": \"\",\n \"airtime_date\": \"\",\n \"planned_duration\": \"\",\n \"repeat\": false,\n \"schedule\": {\n \"freq\": \"\",\n \"interval\": \"\",\n \"month\": [],\n \"monthday\": [],\n \"weekday\": []\n },\n \"scheduled_on\": \"\",\n \"title_template\": {\n \"prefix\": \"\",\n \"separator\": \"\",\n \"date_format\": \"\"\n },\n \"items\": [\n {\n \"title\": \"\",\n \"item_type\": \"\",\n \"content\": \"\",\n \"duration\": \"\",\n \"planned_duration\": \"\",\n \"show_part\": \"\",\n \"additional_notes\": \"\",\n \"rundown\": \"\"\n }\n ],\n \"_created\": \"\",\n \"_updated\": \"\",\n \"created_by\": \"\",\n \"last_updated_by\": \"\"\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}}/shows/:showId/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 \"title\": \"\",\n \"airtime_time\": \"\",\n \"airtime_date\": \"\",\n \"planned_duration\": \"\",\n \"repeat\": false,\n \"schedule\": {\n \"freq\": \"\",\n \"interval\": \"\",\n \"month\": [],\n \"monthday\": [],\n \"weekday\": []\n },\n \"scheduled_on\": \"\",\n \"title_template\": {\n \"prefix\": \"\",\n \"separator\": \"\",\n \"date_format\": \"\"\n },\n \"items\": [\n {\n \"title\": \"\",\n \"item_type\": \"\",\n \"content\": \"\",\n \"duration\": \"\",\n \"planned_duration\": \"\",\n \"show_part\": \"\",\n \"additional_notes\": \"\",\n \"rundown\": \"\"\n }\n ],\n \"_created\": \"\",\n \"_updated\": \"\",\n \"created_by\": \"\",\n \"last_updated_by\": \"\"\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/shows/:showId/templates') do |req|
req.body = "{\n \"title\": \"\",\n \"airtime_time\": \"\",\n \"airtime_date\": \"\",\n \"planned_duration\": \"\",\n \"repeat\": false,\n \"schedule\": {\n \"freq\": \"\",\n \"interval\": \"\",\n \"month\": [],\n \"monthday\": [],\n \"weekday\": []\n },\n \"scheduled_on\": \"\",\n \"title_template\": {\n \"prefix\": \"\",\n \"separator\": \"\",\n \"date_format\": \"\"\n },\n \"items\": [\n {\n \"title\": \"\",\n \"item_type\": \"\",\n \"content\": \"\",\n \"duration\": \"\",\n \"planned_duration\": \"\",\n \"show_part\": \"\",\n \"additional_notes\": \"\",\n \"rundown\": \"\"\n }\n ],\n \"_created\": \"\",\n \"_updated\": \"\",\n \"created_by\": \"\",\n \"last_updated_by\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/shows/:showId/templates";
let payload = json!({
"title": "",
"airtime_time": "",
"airtime_date": "",
"planned_duration": "",
"repeat": false,
"schedule": json!({
"freq": "",
"interval": "",
"month": (),
"monthday": (),
"weekday": ()
}),
"scheduled_on": "",
"title_template": json!({
"prefix": "",
"separator": "",
"date_format": ""
}),
"items": (
json!({
"title": "",
"item_type": "",
"content": "",
"duration": "",
"planned_duration": "",
"show_part": "",
"additional_notes": "",
"rundown": ""
})
),
"_created": "",
"_updated": "",
"created_by": "",
"last_updated_by": ""
});
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}}/shows/:showId/templates \
--header 'content-type: application/json' \
--data '{
"title": "",
"airtime_time": "",
"airtime_date": "",
"planned_duration": "",
"repeat": false,
"schedule": {
"freq": "",
"interval": "",
"month": [],
"monthday": [],
"weekday": []
},
"scheduled_on": "",
"title_template": {
"prefix": "",
"separator": "",
"date_format": ""
},
"items": [
{
"title": "",
"item_type": "",
"content": "",
"duration": "",
"planned_duration": "",
"show_part": "",
"additional_notes": "",
"rundown": ""
}
],
"_created": "",
"_updated": "",
"created_by": "",
"last_updated_by": ""
}'
echo '{
"title": "",
"airtime_time": "",
"airtime_date": "",
"planned_duration": "",
"repeat": false,
"schedule": {
"freq": "",
"interval": "",
"month": [],
"monthday": [],
"weekday": []
},
"scheduled_on": "",
"title_template": {
"prefix": "",
"separator": "",
"date_format": ""
},
"items": [
{
"title": "",
"item_type": "",
"content": "",
"duration": "",
"planned_duration": "",
"show_part": "",
"additional_notes": "",
"rundown": ""
}
],
"_created": "",
"_updated": "",
"created_by": "",
"last_updated_by": ""
}' | \
http POST {{baseUrl}}/shows/:showId/templates \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "title": "",\n "airtime_time": "",\n "airtime_date": "",\n "planned_duration": "",\n "repeat": false,\n "schedule": {\n "freq": "",\n "interval": "",\n "month": [],\n "monthday": [],\n "weekday": []\n },\n "scheduled_on": "",\n "title_template": {\n "prefix": "",\n "separator": "",\n "date_format": ""\n },\n "items": [\n {\n "title": "",\n "item_type": "",\n "content": "",\n "duration": "",\n "planned_duration": "",\n "show_part": "",\n "additional_notes": "",\n "rundown": ""\n }\n ],\n "_created": "",\n "_updated": "",\n "created_by": "",\n "last_updated_by": ""\n}' \
--output-document \
- {{baseUrl}}/shows/:showId/templates
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"title": "",
"airtime_time": "",
"airtime_date": "",
"planned_duration": "",
"repeat": false,
"schedule": [
"freq": "",
"interval": "",
"month": [],
"monthday": [],
"weekday": []
],
"scheduled_on": "",
"title_template": [
"prefix": "",
"separator": "",
"date_format": ""
],
"items": [
[
"title": "",
"item_type": "",
"content": "",
"duration": "",
"planned_duration": "",
"show_part": "",
"additional_notes": "",
"rundown": ""
]
],
"_created": "",
"_updated": "",
"created_by": "",
"last_updated_by": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/shows/:showId/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
{
"title": "Marker Daily",
"airtime_time": "06:00",
"airtime_date": "2022-06-22T00:00:00.000Z",
"planned_duration": 3600,
"repeat": true,
"schedule": {
"month": [
1,
12
],
"monthday": [
1,
30,
-1
],
"weekday": [
0,
1,
2,
3,
4
]
},
"title_template": {
"prefix": "Marker",
"separator": "//",
"date_format": "%d.%m.%Y"
},
"_created": "2022-02-16T13:33:40+0000",
"_updated": "2022-02-16T13:33:40+0000",
"created_by": "629864349728636e382c74ce",
"last_updated_by": "629864349728636e382c74ce"
}
DELETE
Delete Show
{{baseUrl}}/shows/:showId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/shows/:showId");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/delete "{{baseUrl}}/shows/:showId")
require "http/client"
url = "{{baseUrl}}/shows/:showId"
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}}/shows/:showId"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/shows/:showId");
var request = new RestRequest("", Method.Delete);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/shows/:showId"
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/shows/:showId HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/shows/:showId")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/shows/:showId"))
.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}}/shows/:showId")
.delete(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/shows/:showId")
.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}}/shows/:showId');
xhr.send(data);
import axios from 'axios';
const options = {method: 'DELETE', url: '{{baseUrl}}/shows/:showId'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/shows/:showId';
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}}/shows/:showId',
method: 'DELETE',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/shows/:showId")
.delete(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'DELETE',
hostname: 'example.com',
port: null,
path: '/baseUrl/shows/:showId',
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}}/shows/:showId'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('DELETE', '{{baseUrl}}/shows/:showId');
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}}/shows/:showId'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/shows/:showId';
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}}/shows/:showId"]
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}}/shows/:showId" in
Client.call `DELETE uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/shows/:showId",
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}}/shows/:showId');
echo $response->getBody();
setUrl('{{baseUrl}}/shows/:showId');
$request->setMethod(HTTP_METH_DELETE);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/shows/:showId');
$request->setRequestMethod('DELETE');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/shows/:showId' -Method DELETE
$response = Invoke-RestMethod -Uri '{{baseUrl}}/shows/:showId' -Method DELETE
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("DELETE", "/baseUrl/shows/:showId")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/shows/:showId"
response = requests.delete(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/shows/:showId"
response <- VERB("DELETE", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/shows/:showId")
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/shows/:showId') do |req|
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/shows/:showId";
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("DELETE").unwrap(), url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request DELETE \
--url {{baseUrl}}/shows/:showId
http DELETE {{baseUrl}}/shows/:showId
wget --quiet \
--method DELETE \
--output-document \
- {{baseUrl}}/shows/:showId
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/shows/:showId")! 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()
DELETE
Delete Template
{{baseUrl}}/shows/:showId/templates/:templateId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/shows/:showId/templates/:templateId");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/delete "{{baseUrl}}/shows/:showId/templates/:templateId")
require "http/client"
url = "{{baseUrl}}/shows/:showId/templates/: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}}/shows/:showId/templates/:templateId"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/shows/:showId/templates/:templateId");
var request = new RestRequest("", Method.Delete);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/shows/:showId/templates/: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/shows/:showId/templates/:templateId HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/shows/:showId/templates/:templateId")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/shows/:showId/templates/: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}}/shows/:showId/templates/:templateId")
.delete(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/shows/:showId/templates/: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}}/shows/:showId/templates/:templateId');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'DELETE',
url: '{{baseUrl}}/shows/:showId/templates/:templateId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/shows/:showId/templates/: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}}/shows/:showId/templates/:templateId',
method: 'DELETE',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/shows/:showId/templates/: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/shows/:showId/templates/: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}}/shows/:showId/templates/: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}}/shows/:showId/templates/: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}}/shows/:showId/templates/:templateId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/shows/:showId/templates/: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}}/shows/:showId/templates/: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}}/shows/:showId/templates/:templateId" in
Client.call `DELETE uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/shows/:showId/templates/: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}}/shows/:showId/templates/:templateId');
echo $response->getBody();
setUrl('{{baseUrl}}/shows/:showId/templates/:templateId');
$request->setMethod(HTTP_METH_DELETE);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/shows/:showId/templates/:templateId');
$request->setRequestMethod('DELETE');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/shows/:showId/templates/:templateId' -Method DELETE
$response = Invoke-RestMethod -Uri '{{baseUrl}}/shows/:showId/templates/:templateId' -Method DELETE
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("DELETE", "/baseUrl/shows/:showId/templates/:templateId")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/shows/:showId/templates/:templateId"
response = requests.delete(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/shows/:showId/templates/:templateId"
response <- VERB("DELETE", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/shows/:showId/templates/: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/shows/:showId/templates/:templateId') do |req|
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/shows/:showId/templates/:templateId";
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("DELETE").unwrap(), url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request DELETE \
--url {{baseUrl}}/shows/:showId/templates/:templateId
http DELETE {{baseUrl}}/shows/:showId/templates/:templateId
wget --quiet \
--method DELETE \
--output-document \
- {{baseUrl}}/shows/:showId/templates/:templateId
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/shows/:showId/templates/: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()
GET
Get Show
{{baseUrl}}/shows/:showId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/shows/:showId");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/shows/:showId")
require "http/client"
url = "{{baseUrl}}/shows/:showId"
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}}/shows/:showId"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/shows/:showId");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/shows/:showId"
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/shows/:showId HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/shows/:showId")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/shows/:showId"))
.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}}/shows/:showId")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/shows/:showId")
.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}}/shows/:showId');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/shows/:showId'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/shows/:showId';
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}}/shows/:showId',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/shows/:showId")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/shows/:showId',
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}}/shows/:showId'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/shows/:showId');
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}}/shows/:showId'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/shows/:showId';
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}}/shows/:showId"]
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}}/shows/:showId" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/shows/:showId",
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}}/shows/:showId');
echo $response->getBody();
setUrl('{{baseUrl}}/shows/:showId');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/shows/:showId');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/shows/:showId' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/shows/:showId' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/shows/:showId")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/shows/:showId"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/shows/:showId"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/shows/:showId")
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/shows/:showId') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/shows/:showId";
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}}/shows/:showId
http GET {{baseUrl}}/shows/:showId
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/shows/:showId
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/shows/:showId")! 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
{
"title": "Marker",
"description": "Morning show",
"planned_duration": 3600,
"created_by": "629864349728636e382c74ce",
"last_updated_by": "629864349728636e382c74ce"
}
GET
Get Template
{{baseUrl}}/shows/:showId/templates/:templateId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/shows/:showId/templates/:templateId");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/shows/:showId/templates/:templateId")
require "http/client"
url = "{{baseUrl}}/shows/:showId/templates/: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}}/shows/:showId/templates/:templateId"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/shows/:showId/templates/:templateId");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/shows/:showId/templates/: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/shows/:showId/templates/:templateId HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/shows/:showId/templates/:templateId")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/shows/:showId/templates/: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}}/shows/:showId/templates/:templateId")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/shows/:showId/templates/: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}}/shows/:showId/templates/:templateId');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/shows/:showId/templates/:templateId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/shows/:showId/templates/: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}}/shows/:showId/templates/:templateId',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/shows/:showId/templates/:templateId")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/shows/:showId/templates/: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}}/shows/:showId/templates/: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}}/shows/:showId/templates/: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}}/shows/:showId/templates/:templateId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/shows/:showId/templates/: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}}/shows/:showId/templates/: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}}/shows/:showId/templates/:templateId" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/shows/:showId/templates/: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}}/shows/:showId/templates/:templateId');
echo $response->getBody();
setUrl('{{baseUrl}}/shows/:showId/templates/:templateId');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/shows/:showId/templates/:templateId');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/shows/:showId/templates/:templateId' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/shows/:showId/templates/:templateId' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/shows/:showId/templates/:templateId")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/shows/:showId/templates/:templateId"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/shows/:showId/templates/:templateId"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/shows/:showId/templates/: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/shows/:showId/templates/:templateId') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/shows/:showId/templates/:templateId";
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}}/shows/:showId/templates/:templateId
http GET {{baseUrl}}/shows/:showId/templates/:templateId
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/shows/:showId/templates/:templateId
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/shows/:showId/templates/: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
{
"title": "Marker Daily",
"airtime_time": "06:00",
"airtime_date": "2022-06-22T00:00:00.000Z",
"planned_duration": 3600,
"repeat": true,
"schedule": {
"month": [
1,
12
],
"monthday": [
1,
30,
-1
],
"weekday": [
0,
1,
2,
3,
4
]
},
"title_template": {
"prefix": "Marker",
"separator": "//",
"date_format": "%d.%m.%Y"
},
"_created": "2022-02-16T13:33:40+0000",
"_updated": "2022-02-16T13:33:40+0000",
"created_by": "629864349728636e382c74ce",
"last_updated_by": "629864349728636e382c74ce"
}
GET
List Rundown Items
{{baseUrl}}/rundown_items
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/rundown_items");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/rundown_items")
require "http/client"
url = "{{baseUrl}}/rundown_items"
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}}/rundown_items"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/rundown_items");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/rundown_items"
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/rundown_items HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/rundown_items")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/rundown_items"))
.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}}/rundown_items")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/rundown_items")
.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}}/rundown_items');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/rundown_items'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/rundown_items';
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}}/rundown_items',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/rundown_items")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/rundown_items',
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}}/rundown_items'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/rundown_items');
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}}/rundown_items'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/rundown_items';
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}}/rundown_items"]
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}}/rundown_items" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/rundown_items",
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}}/rundown_items');
echo $response->getBody();
setUrl('{{baseUrl}}/rundown_items');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/rundown_items');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/rundown_items' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/rundown_items' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/rundown_items")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/rundown_items"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/rundown_items"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/rundown_items")
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/rundown_items') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/rundown_items";
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}}/rundown_items
http GET {{baseUrl}}/rundown_items
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/rundown_items
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/rundown_items")! 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()
GET
List Rundowns
{{baseUrl}}/rundowns
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/rundowns");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/rundowns")
require "http/client"
url = "{{baseUrl}}/rundowns"
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}}/rundowns"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/rundowns");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/rundowns"
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/rundowns HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/rundowns")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/rundowns"))
.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}}/rundowns")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/rundowns")
.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}}/rundowns');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/rundowns'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/rundowns';
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}}/rundowns',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/rundowns")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/rundowns',
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}}/rundowns'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/rundowns');
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}}/rundowns'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/rundowns';
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}}/rundowns"]
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}}/rundowns" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/rundowns",
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}}/rundowns');
echo $response->getBody();
setUrl('{{baseUrl}}/rundowns');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/rundowns');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/rundowns' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/rundowns' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/rundowns")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/rundowns"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/rundowns"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/rundowns")
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/rundowns') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/rundowns";
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}}/rundowns
http GET {{baseUrl}}/rundowns
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/rundowns
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/rundowns")! 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()
GET
List Shows
{{baseUrl}}/shows
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/shows");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/shows")
require "http/client"
url = "{{baseUrl}}/shows"
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}}/shows"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/shows");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/shows"
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/shows HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/shows")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/shows"))
.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}}/shows")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/shows")
.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}}/shows');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/shows'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/shows';
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}}/shows',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/shows")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/shows',
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}}/shows'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/shows');
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}}/shows'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/shows';
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}}/shows"]
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}}/shows" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/shows",
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}}/shows');
echo $response->getBody();
setUrl('{{baseUrl}}/shows');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/shows');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/shows' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/shows' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/shows")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/shows"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/shows"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/shows")
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/shows') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/shows";
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}}/shows
http GET {{baseUrl}}/shows
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/shows
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/shows")! 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()
GET
List Templates for the Show
{{baseUrl}}/shows/:showId/templates
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/shows/:showId/templates");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/shows/:showId/templates")
require "http/client"
url = "{{baseUrl}}/shows/:showId/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}}/shows/:showId/templates"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/shows/:showId/templates");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/shows/:showId/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/shows/:showId/templates HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/shows/:showId/templates")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/shows/:showId/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}}/shows/:showId/templates")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/shows/:showId/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}}/shows/:showId/templates');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/shows/:showId/templates'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/shows/:showId/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}}/shows/:showId/templates',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/shows/:showId/templates")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/shows/:showId/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}}/shows/:showId/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}}/shows/:showId/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}}/shows/:showId/templates'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/shows/:showId/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}}/shows/:showId/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}}/shows/:showId/templates" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/shows/:showId/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}}/shows/:showId/templates');
echo $response->getBody();
setUrl('{{baseUrl}}/shows/:showId/templates');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/shows/:showId/templates');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/shows/:showId/templates' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/shows/:showId/templates' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/shows/:showId/templates")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/shows/:showId/templates"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/shows/:showId/templates"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/shows/:showId/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/shows/:showId/templates') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/shows/:showId/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}}/shows/:showId/templates
http GET {{baseUrl}}/shows/:showId/templates
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/shows/:showId/templates
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/shows/:showId/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()
PATCH
Update Show
{{baseUrl}}/shows/:showId
BODY json
{
"title": "",
"description": "",
"planned_duration": "",
"created_by": "",
"last_updated_by": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PATCH");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/shows/:showId");
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 \"title\": \"Marker\",\n \"description\": \"Morning show\",\n \"planned_duration\": 3600,\n \"created_by\": \"629864349728636e382c74ce\",\n \"last_updated_by\": \"629864349728636e382c74ce\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/patch "{{baseUrl}}/shows/:showId" {:content-type :json
:form-params {:title "Marker"
:description "Morning show"
:planned_duration 3600
:created_by "629864349728636e382c74ce"
:last_updated_by "629864349728636e382c74ce"}})
require "http/client"
url = "{{baseUrl}}/shows/:showId"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"title\": \"Marker\",\n \"description\": \"Morning show\",\n \"planned_duration\": 3600,\n \"created_by\": \"629864349728636e382c74ce\",\n \"last_updated_by\": \"629864349728636e382c74ce\"\n}"
response = HTTP::Client.patch url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Patch,
RequestUri = new Uri("{{baseUrl}}/shows/:showId"),
Content = new StringContent("{\n \"title\": \"Marker\",\n \"description\": \"Morning show\",\n \"planned_duration\": 3600,\n \"created_by\": \"629864349728636e382c74ce\",\n \"last_updated_by\": \"629864349728636e382c74ce\"\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}}/shows/:showId");
var request = new RestRequest("", Method.Patch);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"title\": \"Marker\",\n \"description\": \"Morning show\",\n \"planned_duration\": 3600,\n \"created_by\": \"629864349728636e382c74ce\",\n \"last_updated_by\": \"629864349728636e382c74ce\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/shows/:showId"
payload := strings.NewReader("{\n \"title\": \"Marker\",\n \"description\": \"Morning show\",\n \"planned_duration\": 3600,\n \"created_by\": \"629864349728636e382c74ce\",\n \"last_updated_by\": \"629864349728636e382c74ce\"\n}")
req, _ := http.NewRequest("PATCH", 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))
}
PATCH /baseUrl/shows/:showId HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 177
{
"title": "Marker",
"description": "Morning show",
"planned_duration": 3600,
"created_by": "629864349728636e382c74ce",
"last_updated_by": "629864349728636e382c74ce"
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PATCH", "{{baseUrl}}/shows/:showId")
.setHeader("content-type", "application/json")
.setBody("{\n \"title\": \"Marker\",\n \"description\": \"Morning show\",\n \"planned_duration\": 3600,\n \"created_by\": \"629864349728636e382c74ce\",\n \"last_updated_by\": \"629864349728636e382c74ce\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/shows/:showId"))
.header("content-type", "application/json")
.method("PATCH", HttpRequest.BodyPublishers.ofString("{\n \"title\": \"Marker\",\n \"description\": \"Morning show\",\n \"planned_duration\": 3600,\n \"created_by\": \"629864349728636e382c74ce\",\n \"last_updated_by\": \"629864349728636e382c74ce\"\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 \"title\": \"Marker\",\n \"description\": \"Morning show\",\n \"planned_duration\": 3600,\n \"created_by\": \"629864349728636e382c74ce\",\n \"last_updated_by\": \"629864349728636e382c74ce\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/shows/:showId")
.patch(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.patch("{{baseUrl}}/shows/:showId")
.header("content-type", "application/json")
.body("{\n \"title\": \"Marker\",\n \"description\": \"Morning show\",\n \"planned_duration\": 3600,\n \"created_by\": \"629864349728636e382c74ce\",\n \"last_updated_by\": \"629864349728636e382c74ce\"\n}")
.asString();
const data = JSON.stringify({
title: 'Marker',
description: 'Morning show',
planned_duration: 3600,
created_by: '629864349728636e382c74ce',
last_updated_by: '629864349728636e382c74ce'
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PATCH', '{{baseUrl}}/shows/:showId');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PATCH',
url: '{{baseUrl}}/shows/:showId',
headers: {'content-type': 'application/json'},
data: {
title: 'Marker',
description: 'Morning show',
planned_duration: 3600,
created_by: '629864349728636e382c74ce',
last_updated_by: '629864349728636e382c74ce'
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/shows/:showId';
const options = {
method: 'PATCH',
headers: {'content-type': 'application/json'},
body: '{"title":"Marker","description":"Morning show","planned_duration":3600,"created_by":"629864349728636e382c74ce","last_updated_by":"629864349728636e382c74ce"}'
};
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}}/shows/:showId',
method: 'PATCH',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "title": "Marker",\n "description": "Morning show",\n "planned_duration": 3600,\n "created_by": "629864349728636e382c74ce",\n "last_updated_by": "629864349728636e382c74ce"\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"title\": \"Marker\",\n \"description\": \"Morning show\",\n \"planned_duration\": 3600,\n \"created_by\": \"629864349728636e382c74ce\",\n \"last_updated_by\": \"629864349728636e382c74ce\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/shows/:showId")
.patch(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PATCH',
hostname: 'example.com',
port: null,
path: '/baseUrl/shows/:showId',
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({
title: 'Marker',
description: 'Morning show',
planned_duration: 3600,
created_by: '629864349728636e382c74ce',
last_updated_by: '629864349728636e382c74ce'
}));
req.end();
const request = require('request');
const options = {
method: 'PATCH',
url: '{{baseUrl}}/shows/:showId',
headers: {'content-type': 'application/json'},
body: {
title: 'Marker',
description: 'Morning show',
planned_duration: 3600,
created_by: '629864349728636e382c74ce',
last_updated_by: '629864349728636e382c74ce'
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PATCH', '{{baseUrl}}/shows/:showId');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
title: 'Marker',
description: 'Morning show',
planned_duration: 3600,
created_by: '629864349728636e382c74ce',
last_updated_by: '629864349728636e382c74ce'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'PATCH',
url: '{{baseUrl}}/shows/:showId',
headers: {'content-type': 'application/json'},
data: {
title: 'Marker',
description: 'Morning show',
planned_duration: 3600,
created_by: '629864349728636e382c74ce',
last_updated_by: '629864349728636e382c74ce'
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/shows/:showId';
const options = {
method: 'PATCH',
headers: {'content-type': 'application/json'},
body: '{"title":"Marker","description":"Morning show","planned_duration":3600,"created_by":"629864349728636e382c74ce","last_updated_by":"629864349728636e382c74ce"}'
};
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 = @{ @"title": @"Marker",
@"description": @"Morning show",
@"planned_duration": @3600,
@"created_by": @"629864349728636e382c74ce",
@"last_updated_by": @"629864349728636e382c74ce" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/shows/:showId"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PATCH"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/shows/:showId" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"title\": \"Marker\",\n \"description\": \"Morning show\",\n \"planned_duration\": 3600,\n \"created_by\": \"629864349728636e382c74ce\",\n \"last_updated_by\": \"629864349728636e382c74ce\"\n}" in
Client.call ~headers ~body `PATCH uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/shows/:showId",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'title' => 'Marker',
'description' => 'Morning show',
'planned_duration' => 3600,
'created_by' => '629864349728636e382c74ce',
'last_updated_by' => '629864349728636e382c74ce'
]),
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('PATCH', '{{baseUrl}}/shows/:showId', [
'body' => '{
"title": "Marker",
"description": "Morning show",
"planned_duration": 3600,
"created_by": "629864349728636e382c74ce",
"last_updated_by": "629864349728636e382c74ce"
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/shows/:showId');
$request->setMethod(HttpRequest::HTTP_METH_PATCH);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'title' => 'Marker',
'description' => 'Morning show',
'planned_duration' => 3600,
'created_by' => '629864349728636e382c74ce',
'last_updated_by' => '629864349728636e382c74ce'
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'title' => 'Marker',
'description' => 'Morning show',
'planned_duration' => 3600,
'created_by' => '629864349728636e382c74ce',
'last_updated_by' => '629864349728636e382c74ce'
]));
$request->setRequestUrl('{{baseUrl}}/shows/:showId');
$request->setRequestMethod('PATCH');
$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}}/shows/:showId' -Method PATCH -Headers $headers -ContentType 'application/json' -Body '{
"title": "Marker",
"description": "Morning show",
"planned_duration": 3600,
"created_by": "629864349728636e382c74ce",
"last_updated_by": "629864349728636e382c74ce"
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/shows/:showId' -Method PATCH -Headers $headers -ContentType 'application/json' -Body '{
"title": "Marker",
"description": "Morning show",
"planned_duration": 3600,
"created_by": "629864349728636e382c74ce",
"last_updated_by": "629864349728636e382c74ce"
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"title\": \"Marker\",\n \"description\": \"Morning show\",\n \"planned_duration\": 3600,\n \"created_by\": \"629864349728636e382c74ce\",\n \"last_updated_by\": \"629864349728636e382c74ce\"\n}"
headers = { 'content-type': "application/json" }
conn.request("PATCH", "/baseUrl/shows/:showId", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/shows/:showId"
payload = {
"title": "Marker",
"description": "Morning show",
"planned_duration": 3600,
"created_by": "629864349728636e382c74ce",
"last_updated_by": "629864349728636e382c74ce"
}
headers = {"content-type": "application/json"}
response = requests.patch(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/shows/:showId"
payload <- "{\n \"title\": \"Marker\",\n \"description\": \"Morning show\",\n \"planned_duration\": 3600,\n \"created_by\": \"629864349728636e382c74ce\",\n \"last_updated_by\": \"629864349728636e382c74ce\"\n}"
encode <- "json"
response <- VERB("PATCH", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/shows/:showId")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"title\": \"Marker\",\n \"description\": \"Morning show\",\n \"planned_duration\": 3600,\n \"created_by\": \"629864349728636e382c74ce\",\n \"last_updated_by\": \"629864349728636e382c74ce\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.patch('/baseUrl/shows/:showId') do |req|
req.body = "{\n \"title\": \"Marker\",\n \"description\": \"Morning show\",\n \"planned_duration\": 3600,\n \"created_by\": \"629864349728636e382c74ce\",\n \"last_updated_by\": \"629864349728636e382c74ce\"\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}}/shows/:showId";
let payload = json!({
"title": "Marker",
"description": "Morning show",
"planned_duration": 3600,
"created_by": "629864349728636e382c74ce",
"last_updated_by": "629864349728636e382c74ce"
});
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("PATCH").unwrap(), url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PATCH \
--url {{baseUrl}}/shows/:showId \
--header 'content-type: application/json' \
--data '{
"title": "Marker",
"description": "Morning show",
"planned_duration": 3600,
"created_by": "629864349728636e382c74ce",
"last_updated_by": "629864349728636e382c74ce"
}'
echo '{
"title": "Marker",
"description": "Morning show",
"planned_duration": 3600,
"created_by": "629864349728636e382c74ce",
"last_updated_by": "629864349728636e382c74ce"
}' | \
http PATCH {{baseUrl}}/shows/:showId \
content-type:application/json
wget --quiet \
--method PATCH \
--header 'content-type: application/json' \
--body-data '{\n "title": "Marker",\n "description": "Morning show",\n "planned_duration": 3600,\n "created_by": "629864349728636e382c74ce",\n "last_updated_by": "629864349728636e382c74ce"\n}' \
--output-document \
- {{baseUrl}}/shows/:showId
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"title": "Marker",
"description": "Morning show",
"planned_duration": 3600,
"created_by": "629864349728636e382c74ce",
"last_updated_by": "629864349728636e382c74ce"
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/shows/:showId")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PATCH"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
PATCH
Update Template
{{baseUrl}}/shows/:showId/templates/:templateId
BODY json
{
"title": "",
"airtime_time": "",
"airtime_date": "",
"planned_duration": "",
"repeat": false,
"schedule": {
"freq": "",
"interval": "",
"month": [],
"monthday": [],
"weekday": []
},
"scheduled_on": "",
"title_template": {
"prefix": "",
"separator": "",
"date_format": ""
},
"items": [
{
"title": "",
"item_type": "",
"content": "",
"duration": "",
"planned_duration": "",
"show_part": "",
"additional_notes": "",
"rundown": ""
}
],
"_created": "",
"_updated": "",
"created_by": "",
"last_updated_by": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PATCH");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/shows/:showId/templates/: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 \"title\": \"\",\n \"airtime_time\": \"\",\n \"airtime_date\": \"\",\n \"planned_duration\": \"\",\n \"repeat\": false,\n \"schedule\": {\n \"freq\": \"\",\n \"interval\": \"\",\n \"month\": [],\n \"monthday\": [],\n \"weekday\": []\n },\n \"scheduled_on\": \"\",\n \"title_template\": {\n \"prefix\": \"\",\n \"separator\": \"\",\n \"date_format\": \"\"\n },\n \"items\": [\n {\n \"title\": \"\",\n \"item_type\": \"\",\n \"content\": \"\",\n \"duration\": \"\",\n \"planned_duration\": \"\",\n \"show_part\": \"\",\n \"additional_notes\": \"\",\n \"rundown\": \"\"\n }\n ],\n \"_created\": \"\",\n \"_updated\": \"\",\n \"created_by\": \"\",\n \"last_updated_by\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/patch "{{baseUrl}}/shows/:showId/templates/:templateId" {:content-type :json
:form-params {:title ""
:airtime_time ""
:airtime_date ""
:planned_duration ""
:repeat false
:schedule {:freq ""
:interval ""
:month []
:monthday []
:weekday []}
:scheduled_on ""
:title_template {:prefix ""
:separator ""
:date_format ""}
:items [{:title ""
:item_type ""
:content ""
:duration ""
:planned_duration ""
:show_part ""
:additional_notes ""
:rundown ""}]
:_created ""
:_updated ""
:created_by ""
:last_updated_by ""}})
require "http/client"
url = "{{baseUrl}}/shows/:showId/templates/:templateId"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"title\": \"\",\n \"airtime_time\": \"\",\n \"airtime_date\": \"\",\n \"planned_duration\": \"\",\n \"repeat\": false,\n \"schedule\": {\n \"freq\": \"\",\n \"interval\": \"\",\n \"month\": [],\n \"monthday\": [],\n \"weekday\": []\n },\n \"scheduled_on\": \"\",\n \"title_template\": {\n \"prefix\": \"\",\n \"separator\": \"\",\n \"date_format\": \"\"\n },\n \"items\": [\n {\n \"title\": \"\",\n \"item_type\": \"\",\n \"content\": \"\",\n \"duration\": \"\",\n \"planned_duration\": \"\",\n \"show_part\": \"\",\n \"additional_notes\": \"\",\n \"rundown\": \"\"\n }\n ],\n \"_created\": \"\",\n \"_updated\": \"\",\n \"created_by\": \"\",\n \"last_updated_by\": \"\"\n}"
response = HTTP::Client.patch url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Patch,
RequestUri = new Uri("{{baseUrl}}/shows/:showId/templates/:templateId"),
Content = new StringContent("{\n \"title\": \"\",\n \"airtime_time\": \"\",\n \"airtime_date\": \"\",\n \"planned_duration\": \"\",\n \"repeat\": false,\n \"schedule\": {\n \"freq\": \"\",\n \"interval\": \"\",\n \"month\": [],\n \"monthday\": [],\n \"weekday\": []\n },\n \"scheduled_on\": \"\",\n \"title_template\": {\n \"prefix\": \"\",\n \"separator\": \"\",\n \"date_format\": \"\"\n },\n \"items\": [\n {\n \"title\": \"\",\n \"item_type\": \"\",\n \"content\": \"\",\n \"duration\": \"\",\n \"planned_duration\": \"\",\n \"show_part\": \"\",\n \"additional_notes\": \"\",\n \"rundown\": \"\"\n }\n ],\n \"_created\": \"\",\n \"_updated\": \"\",\n \"created_by\": \"\",\n \"last_updated_by\": \"\"\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}}/shows/:showId/templates/:templateId");
var request = new RestRequest("", Method.Patch);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"title\": \"\",\n \"airtime_time\": \"\",\n \"airtime_date\": \"\",\n \"planned_duration\": \"\",\n \"repeat\": false,\n \"schedule\": {\n \"freq\": \"\",\n \"interval\": \"\",\n \"month\": [],\n \"monthday\": [],\n \"weekday\": []\n },\n \"scheduled_on\": \"\",\n \"title_template\": {\n \"prefix\": \"\",\n \"separator\": \"\",\n \"date_format\": \"\"\n },\n \"items\": [\n {\n \"title\": \"\",\n \"item_type\": \"\",\n \"content\": \"\",\n \"duration\": \"\",\n \"planned_duration\": \"\",\n \"show_part\": \"\",\n \"additional_notes\": \"\",\n \"rundown\": \"\"\n }\n ],\n \"_created\": \"\",\n \"_updated\": \"\",\n \"created_by\": \"\",\n \"last_updated_by\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/shows/:showId/templates/:templateId"
payload := strings.NewReader("{\n \"title\": \"\",\n \"airtime_time\": \"\",\n \"airtime_date\": \"\",\n \"planned_duration\": \"\",\n \"repeat\": false,\n \"schedule\": {\n \"freq\": \"\",\n \"interval\": \"\",\n \"month\": [],\n \"monthday\": [],\n \"weekday\": []\n },\n \"scheduled_on\": \"\",\n \"title_template\": {\n \"prefix\": \"\",\n \"separator\": \"\",\n \"date_format\": \"\"\n },\n \"items\": [\n {\n \"title\": \"\",\n \"item_type\": \"\",\n \"content\": \"\",\n \"duration\": \"\",\n \"planned_duration\": \"\",\n \"show_part\": \"\",\n \"additional_notes\": \"\",\n \"rundown\": \"\"\n }\n ],\n \"_created\": \"\",\n \"_updated\": \"\",\n \"created_by\": \"\",\n \"last_updated_by\": \"\"\n}")
req, _ := http.NewRequest("PATCH", 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))
}
PATCH /baseUrl/shows/:showId/templates/:templateId HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 627
{
"title": "",
"airtime_time": "",
"airtime_date": "",
"planned_duration": "",
"repeat": false,
"schedule": {
"freq": "",
"interval": "",
"month": [],
"monthday": [],
"weekday": []
},
"scheduled_on": "",
"title_template": {
"prefix": "",
"separator": "",
"date_format": ""
},
"items": [
{
"title": "",
"item_type": "",
"content": "",
"duration": "",
"planned_duration": "",
"show_part": "",
"additional_notes": "",
"rundown": ""
}
],
"_created": "",
"_updated": "",
"created_by": "",
"last_updated_by": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PATCH", "{{baseUrl}}/shows/:showId/templates/:templateId")
.setHeader("content-type", "application/json")
.setBody("{\n \"title\": \"\",\n \"airtime_time\": \"\",\n \"airtime_date\": \"\",\n \"planned_duration\": \"\",\n \"repeat\": false,\n \"schedule\": {\n \"freq\": \"\",\n \"interval\": \"\",\n \"month\": [],\n \"monthday\": [],\n \"weekday\": []\n },\n \"scheduled_on\": \"\",\n \"title_template\": {\n \"prefix\": \"\",\n \"separator\": \"\",\n \"date_format\": \"\"\n },\n \"items\": [\n {\n \"title\": \"\",\n \"item_type\": \"\",\n \"content\": \"\",\n \"duration\": \"\",\n \"planned_duration\": \"\",\n \"show_part\": \"\",\n \"additional_notes\": \"\",\n \"rundown\": \"\"\n }\n ],\n \"_created\": \"\",\n \"_updated\": \"\",\n \"created_by\": \"\",\n \"last_updated_by\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/shows/:showId/templates/:templateId"))
.header("content-type", "application/json")
.method("PATCH", HttpRequest.BodyPublishers.ofString("{\n \"title\": \"\",\n \"airtime_time\": \"\",\n \"airtime_date\": \"\",\n \"planned_duration\": \"\",\n \"repeat\": false,\n \"schedule\": {\n \"freq\": \"\",\n \"interval\": \"\",\n \"month\": [],\n \"monthday\": [],\n \"weekday\": []\n },\n \"scheduled_on\": \"\",\n \"title_template\": {\n \"prefix\": \"\",\n \"separator\": \"\",\n \"date_format\": \"\"\n },\n \"items\": [\n {\n \"title\": \"\",\n \"item_type\": \"\",\n \"content\": \"\",\n \"duration\": \"\",\n \"planned_duration\": \"\",\n \"show_part\": \"\",\n \"additional_notes\": \"\",\n \"rundown\": \"\"\n }\n ],\n \"_created\": \"\",\n \"_updated\": \"\",\n \"created_by\": \"\",\n \"last_updated_by\": \"\"\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 \"title\": \"\",\n \"airtime_time\": \"\",\n \"airtime_date\": \"\",\n \"planned_duration\": \"\",\n \"repeat\": false,\n \"schedule\": {\n \"freq\": \"\",\n \"interval\": \"\",\n \"month\": [],\n \"monthday\": [],\n \"weekday\": []\n },\n \"scheduled_on\": \"\",\n \"title_template\": {\n \"prefix\": \"\",\n \"separator\": \"\",\n \"date_format\": \"\"\n },\n \"items\": [\n {\n \"title\": \"\",\n \"item_type\": \"\",\n \"content\": \"\",\n \"duration\": \"\",\n \"planned_duration\": \"\",\n \"show_part\": \"\",\n \"additional_notes\": \"\",\n \"rundown\": \"\"\n }\n ],\n \"_created\": \"\",\n \"_updated\": \"\",\n \"created_by\": \"\",\n \"last_updated_by\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/shows/:showId/templates/:templateId")
.patch(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.patch("{{baseUrl}}/shows/:showId/templates/:templateId")
.header("content-type", "application/json")
.body("{\n \"title\": \"\",\n \"airtime_time\": \"\",\n \"airtime_date\": \"\",\n \"planned_duration\": \"\",\n \"repeat\": false,\n \"schedule\": {\n \"freq\": \"\",\n \"interval\": \"\",\n \"month\": [],\n \"monthday\": [],\n \"weekday\": []\n },\n \"scheduled_on\": \"\",\n \"title_template\": {\n \"prefix\": \"\",\n \"separator\": \"\",\n \"date_format\": \"\"\n },\n \"items\": [\n {\n \"title\": \"\",\n \"item_type\": \"\",\n \"content\": \"\",\n \"duration\": \"\",\n \"planned_duration\": \"\",\n \"show_part\": \"\",\n \"additional_notes\": \"\",\n \"rundown\": \"\"\n }\n ],\n \"_created\": \"\",\n \"_updated\": \"\",\n \"created_by\": \"\",\n \"last_updated_by\": \"\"\n}")
.asString();
const data = JSON.stringify({
title: '',
airtime_time: '',
airtime_date: '',
planned_duration: '',
repeat: false,
schedule: {
freq: '',
interval: '',
month: [],
monthday: [],
weekday: []
},
scheduled_on: '',
title_template: {
prefix: '',
separator: '',
date_format: ''
},
items: [
{
title: '',
item_type: '',
content: '',
duration: '',
planned_duration: '',
show_part: '',
additional_notes: '',
rundown: ''
}
],
_created: '',
_updated: '',
created_by: '',
last_updated_by: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PATCH', '{{baseUrl}}/shows/:showId/templates/:templateId');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PATCH',
url: '{{baseUrl}}/shows/:showId/templates/:templateId',
headers: {'content-type': 'application/json'},
data: {
title: '',
airtime_time: '',
airtime_date: '',
planned_duration: '',
repeat: false,
schedule: {freq: '', interval: '', month: [], monthday: [], weekday: []},
scheduled_on: '',
title_template: {prefix: '', separator: '', date_format: ''},
items: [
{
title: '',
item_type: '',
content: '',
duration: '',
planned_duration: '',
show_part: '',
additional_notes: '',
rundown: ''
}
],
_created: '',
_updated: '',
created_by: '',
last_updated_by: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/shows/:showId/templates/:templateId';
const options = {
method: 'PATCH',
headers: {'content-type': 'application/json'},
body: '{"title":"","airtime_time":"","airtime_date":"","planned_duration":"","repeat":false,"schedule":{"freq":"","interval":"","month":[],"monthday":[],"weekday":[]},"scheduled_on":"","title_template":{"prefix":"","separator":"","date_format":""},"items":[{"title":"","item_type":"","content":"","duration":"","planned_duration":"","show_part":"","additional_notes":"","rundown":""}],"_created":"","_updated":"","created_by":"","last_updated_by":""}'
};
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}}/shows/:showId/templates/:templateId',
method: 'PATCH',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "title": "",\n "airtime_time": "",\n "airtime_date": "",\n "planned_duration": "",\n "repeat": false,\n "schedule": {\n "freq": "",\n "interval": "",\n "month": [],\n "monthday": [],\n "weekday": []\n },\n "scheduled_on": "",\n "title_template": {\n "prefix": "",\n "separator": "",\n "date_format": ""\n },\n "items": [\n {\n "title": "",\n "item_type": "",\n "content": "",\n "duration": "",\n "planned_duration": "",\n "show_part": "",\n "additional_notes": "",\n "rundown": ""\n }\n ],\n "_created": "",\n "_updated": "",\n "created_by": "",\n "last_updated_by": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"title\": \"\",\n \"airtime_time\": \"\",\n \"airtime_date\": \"\",\n \"planned_duration\": \"\",\n \"repeat\": false,\n \"schedule\": {\n \"freq\": \"\",\n \"interval\": \"\",\n \"month\": [],\n \"monthday\": [],\n \"weekday\": []\n },\n \"scheduled_on\": \"\",\n \"title_template\": {\n \"prefix\": \"\",\n \"separator\": \"\",\n \"date_format\": \"\"\n },\n \"items\": [\n {\n \"title\": \"\",\n \"item_type\": \"\",\n \"content\": \"\",\n \"duration\": \"\",\n \"planned_duration\": \"\",\n \"show_part\": \"\",\n \"additional_notes\": \"\",\n \"rundown\": \"\"\n }\n ],\n \"_created\": \"\",\n \"_updated\": \"\",\n \"created_by\": \"\",\n \"last_updated_by\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/shows/:showId/templates/:templateId")
.patch(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PATCH',
hostname: 'example.com',
port: null,
path: '/baseUrl/shows/:showId/templates/: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({
title: '',
airtime_time: '',
airtime_date: '',
planned_duration: '',
repeat: false,
schedule: {freq: '', interval: '', month: [], monthday: [], weekday: []},
scheduled_on: '',
title_template: {prefix: '', separator: '', date_format: ''},
items: [
{
title: '',
item_type: '',
content: '',
duration: '',
planned_duration: '',
show_part: '',
additional_notes: '',
rundown: ''
}
],
_created: '',
_updated: '',
created_by: '',
last_updated_by: ''
}));
req.end();
const request = require('request');
const options = {
method: 'PATCH',
url: '{{baseUrl}}/shows/:showId/templates/:templateId',
headers: {'content-type': 'application/json'},
body: {
title: '',
airtime_time: '',
airtime_date: '',
planned_duration: '',
repeat: false,
schedule: {freq: '', interval: '', month: [], monthday: [], weekday: []},
scheduled_on: '',
title_template: {prefix: '', separator: '', date_format: ''},
items: [
{
title: '',
item_type: '',
content: '',
duration: '',
planned_duration: '',
show_part: '',
additional_notes: '',
rundown: ''
}
],
_created: '',
_updated: '',
created_by: '',
last_updated_by: ''
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PATCH', '{{baseUrl}}/shows/:showId/templates/:templateId');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
title: '',
airtime_time: '',
airtime_date: '',
planned_duration: '',
repeat: false,
schedule: {
freq: '',
interval: '',
month: [],
monthday: [],
weekday: []
},
scheduled_on: '',
title_template: {
prefix: '',
separator: '',
date_format: ''
},
items: [
{
title: '',
item_type: '',
content: '',
duration: '',
planned_duration: '',
show_part: '',
additional_notes: '',
rundown: ''
}
],
_created: '',
_updated: '',
created_by: '',
last_updated_by: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'PATCH',
url: '{{baseUrl}}/shows/:showId/templates/:templateId',
headers: {'content-type': 'application/json'},
data: {
title: '',
airtime_time: '',
airtime_date: '',
planned_duration: '',
repeat: false,
schedule: {freq: '', interval: '', month: [], monthday: [], weekday: []},
scheduled_on: '',
title_template: {prefix: '', separator: '', date_format: ''},
items: [
{
title: '',
item_type: '',
content: '',
duration: '',
planned_duration: '',
show_part: '',
additional_notes: '',
rundown: ''
}
],
_created: '',
_updated: '',
created_by: '',
last_updated_by: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/shows/:showId/templates/:templateId';
const options = {
method: 'PATCH',
headers: {'content-type': 'application/json'},
body: '{"title":"","airtime_time":"","airtime_date":"","planned_duration":"","repeat":false,"schedule":{"freq":"","interval":"","month":[],"monthday":[],"weekday":[]},"scheduled_on":"","title_template":{"prefix":"","separator":"","date_format":""},"items":[{"title":"","item_type":"","content":"","duration":"","planned_duration":"","show_part":"","additional_notes":"","rundown":""}],"_created":"","_updated":"","created_by":"","last_updated_by":""}'
};
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 = @{ @"title": @"",
@"airtime_time": @"",
@"airtime_date": @"",
@"planned_duration": @"",
@"repeat": @NO,
@"schedule": @{ @"freq": @"", @"interval": @"", @"month": @[ ], @"monthday": @[ ], @"weekday": @[ ] },
@"scheduled_on": @"",
@"title_template": @{ @"prefix": @"", @"separator": @"", @"date_format": @"" },
@"items": @[ @{ @"title": @"", @"item_type": @"", @"content": @"", @"duration": @"", @"planned_duration": @"", @"show_part": @"", @"additional_notes": @"", @"rundown": @"" } ],
@"_created": @"",
@"_updated": @"",
@"created_by": @"",
@"last_updated_by": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/shows/:showId/templates/:templateId"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PATCH"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/shows/:showId/templates/:templateId" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"title\": \"\",\n \"airtime_time\": \"\",\n \"airtime_date\": \"\",\n \"planned_duration\": \"\",\n \"repeat\": false,\n \"schedule\": {\n \"freq\": \"\",\n \"interval\": \"\",\n \"month\": [],\n \"monthday\": [],\n \"weekday\": []\n },\n \"scheduled_on\": \"\",\n \"title_template\": {\n \"prefix\": \"\",\n \"separator\": \"\",\n \"date_format\": \"\"\n },\n \"items\": [\n {\n \"title\": \"\",\n \"item_type\": \"\",\n \"content\": \"\",\n \"duration\": \"\",\n \"planned_duration\": \"\",\n \"show_part\": \"\",\n \"additional_notes\": \"\",\n \"rundown\": \"\"\n }\n ],\n \"_created\": \"\",\n \"_updated\": \"\",\n \"created_by\": \"\",\n \"last_updated_by\": \"\"\n}" in
Client.call ~headers ~body `PATCH uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/shows/:showId/templates/:templateId",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'title' => '',
'airtime_time' => '',
'airtime_date' => '',
'planned_duration' => '',
'repeat' => null,
'schedule' => [
'freq' => '',
'interval' => '',
'month' => [
],
'monthday' => [
],
'weekday' => [
]
],
'scheduled_on' => '',
'title_template' => [
'prefix' => '',
'separator' => '',
'date_format' => ''
],
'items' => [
[
'title' => '',
'item_type' => '',
'content' => '',
'duration' => '',
'planned_duration' => '',
'show_part' => '',
'additional_notes' => '',
'rundown' => ''
]
],
'_created' => '',
'_updated' => '',
'created_by' => '',
'last_updated_by' => ''
]),
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('PATCH', '{{baseUrl}}/shows/:showId/templates/:templateId', [
'body' => '{
"title": "",
"airtime_time": "",
"airtime_date": "",
"planned_duration": "",
"repeat": false,
"schedule": {
"freq": "",
"interval": "",
"month": [],
"monthday": [],
"weekday": []
},
"scheduled_on": "",
"title_template": {
"prefix": "",
"separator": "",
"date_format": ""
},
"items": [
{
"title": "",
"item_type": "",
"content": "",
"duration": "",
"planned_duration": "",
"show_part": "",
"additional_notes": "",
"rundown": ""
}
],
"_created": "",
"_updated": "",
"created_by": "",
"last_updated_by": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/shows/:showId/templates/:templateId');
$request->setMethod(HttpRequest::HTTP_METH_PATCH);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'title' => '',
'airtime_time' => '',
'airtime_date' => '',
'planned_duration' => '',
'repeat' => null,
'schedule' => [
'freq' => '',
'interval' => '',
'month' => [
],
'monthday' => [
],
'weekday' => [
]
],
'scheduled_on' => '',
'title_template' => [
'prefix' => '',
'separator' => '',
'date_format' => ''
],
'items' => [
[
'title' => '',
'item_type' => '',
'content' => '',
'duration' => '',
'planned_duration' => '',
'show_part' => '',
'additional_notes' => '',
'rundown' => ''
]
],
'_created' => '',
'_updated' => '',
'created_by' => '',
'last_updated_by' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'title' => '',
'airtime_time' => '',
'airtime_date' => '',
'planned_duration' => '',
'repeat' => null,
'schedule' => [
'freq' => '',
'interval' => '',
'month' => [
],
'monthday' => [
],
'weekday' => [
]
],
'scheduled_on' => '',
'title_template' => [
'prefix' => '',
'separator' => '',
'date_format' => ''
],
'items' => [
[
'title' => '',
'item_type' => '',
'content' => '',
'duration' => '',
'planned_duration' => '',
'show_part' => '',
'additional_notes' => '',
'rundown' => ''
]
],
'_created' => '',
'_updated' => '',
'created_by' => '',
'last_updated_by' => ''
]));
$request->setRequestUrl('{{baseUrl}}/shows/:showId/templates/:templateId');
$request->setRequestMethod('PATCH');
$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}}/shows/:showId/templates/:templateId' -Method PATCH -Headers $headers -ContentType 'application/json' -Body '{
"title": "",
"airtime_time": "",
"airtime_date": "",
"planned_duration": "",
"repeat": false,
"schedule": {
"freq": "",
"interval": "",
"month": [],
"monthday": [],
"weekday": []
},
"scheduled_on": "",
"title_template": {
"prefix": "",
"separator": "",
"date_format": ""
},
"items": [
{
"title": "",
"item_type": "",
"content": "",
"duration": "",
"planned_duration": "",
"show_part": "",
"additional_notes": "",
"rundown": ""
}
],
"_created": "",
"_updated": "",
"created_by": "",
"last_updated_by": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/shows/:showId/templates/:templateId' -Method PATCH -Headers $headers -ContentType 'application/json' -Body '{
"title": "",
"airtime_time": "",
"airtime_date": "",
"planned_duration": "",
"repeat": false,
"schedule": {
"freq": "",
"interval": "",
"month": [],
"monthday": [],
"weekday": []
},
"scheduled_on": "",
"title_template": {
"prefix": "",
"separator": "",
"date_format": ""
},
"items": [
{
"title": "",
"item_type": "",
"content": "",
"duration": "",
"planned_duration": "",
"show_part": "",
"additional_notes": "",
"rundown": ""
}
],
"_created": "",
"_updated": "",
"created_by": "",
"last_updated_by": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"title\": \"\",\n \"airtime_time\": \"\",\n \"airtime_date\": \"\",\n \"planned_duration\": \"\",\n \"repeat\": false,\n \"schedule\": {\n \"freq\": \"\",\n \"interval\": \"\",\n \"month\": [],\n \"monthday\": [],\n \"weekday\": []\n },\n \"scheduled_on\": \"\",\n \"title_template\": {\n \"prefix\": \"\",\n \"separator\": \"\",\n \"date_format\": \"\"\n },\n \"items\": [\n {\n \"title\": \"\",\n \"item_type\": \"\",\n \"content\": \"\",\n \"duration\": \"\",\n \"planned_duration\": \"\",\n \"show_part\": \"\",\n \"additional_notes\": \"\",\n \"rundown\": \"\"\n }\n ],\n \"_created\": \"\",\n \"_updated\": \"\",\n \"created_by\": \"\",\n \"last_updated_by\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("PATCH", "/baseUrl/shows/:showId/templates/:templateId", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/shows/:showId/templates/:templateId"
payload = {
"title": "",
"airtime_time": "",
"airtime_date": "",
"planned_duration": "",
"repeat": False,
"schedule": {
"freq": "",
"interval": "",
"month": [],
"monthday": [],
"weekday": []
},
"scheduled_on": "",
"title_template": {
"prefix": "",
"separator": "",
"date_format": ""
},
"items": [
{
"title": "",
"item_type": "",
"content": "",
"duration": "",
"planned_duration": "",
"show_part": "",
"additional_notes": "",
"rundown": ""
}
],
"_created": "",
"_updated": "",
"created_by": "",
"last_updated_by": ""
}
headers = {"content-type": "application/json"}
response = requests.patch(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/shows/:showId/templates/:templateId"
payload <- "{\n \"title\": \"\",\n \"airtime_time\": \"\",\n \"airtime_date\": \"\",\n \"planned_duration\": \"\",\n \"repeat\": false,\n \"schedule\": {\n \"freq\": \"\",\n \"interval\": \"\",\n \"month\": [],\n \"monthday\": [],\n \"weekday\": []\n },\n \"scheduled_on\": \"\",\n \"title_template\": {\n \"prefix\": \"\",\n \"separator\": \"\",\n \"date_format\": \"\"\n },\n \"items\": [\n {\n \"title\": \"\",\n \"item_type\": \"\",\n \"content\": \"\",\n \"duration\": \"\",\n \"planned_duration\": \"\",\n \"show_part\": \"\",\n \"additional_notes\": \"\",\n \"rundown\": \"\"\n }\n ],\n \"_created\": \"\",\n \"_updated\": \"\",\n \"created_by\": \"\",\n \"last_updated_by\": \"\"\n}"
encode <- "json"
response <- VERB("PATCH", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/shows/:showId/templates/:templateId")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"title\": \"\",\n \"airtime_time\": \"\",\n \"airtime_date\": \"\",\n \"planned_duration\": \"\",\n \"repeat\": false,\n \"schedule\": {\n \"freq\": \"\",\n \"interval\": \"\",\n \"month\": [],\n \"monthday\": [],\n \"weekday\": []\n },\n \"scheduled_on\": \"\",\n \"title_template\": {\n \"prefix\": \"\",\n \"separator\": \"\",\n \"date_format\": \"\"\n },\n \"items\": [\n {\n \"title\": \"\",\n \"item_type\": \"\",\n \"content\": \"\",\n \"duration\": \"\",\n \"planned_duration\": \"\",\n \"show_part\": \"\",\n \"additional_notes\": \"\",\n \"rundown\": \"\"\n }\n ],\n \"_created\": \"\",\n \"_updated\": \"\",\n \"created_by\": \"\",\n \"last_updated_by\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.patch('/baseUrl/shows/:showId/templates/:templateId') do |req|
req.body = "{\n \"title\": \"\",\n \"airtime_time\": \"\",\n \"airtime_date\": \"\",\n \"planned_duration\": \"\",\n \"repeat\": false,\n \"schedule\": {\n \"freq\": \"\",\n \"interval\": \"\",\n \"month\": [],\n \"monthday\": [],\n \"weekday\": []\n },\n \"scheduled_on\": \"\",\n \"title_template\": {\n \"prefix\": \"\",\n \"separator\": \"\",\n \"date_format\": \"\"\n },\n \"items\": [\n {\n \"title\": \"\",\n \"item_type\": \"\",\n \"content\": \"\",\n \"duration\": \"\",\n \"planned_duration\": \"\",\n \"show_part\": \"\",\n \"additional_notes\": \"\",\n \"rundown\": \"\"\n }\n ],\n \"_created\": \"\",\n \"_updated\": \"\",\n \"created_by\": \"\",\n \"last_updated_by\": \"\"\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}}/shows/:showId/templates/:templateId";
let payload = json!({
"title": "",
"airtime_time": "",
"airtime_date": "",
"planned_duration": "",
"repeat": false,
"schedule": json!({
"freq": "",
"interval": "",
"month": (),
"monthday": (),
"weekday": ()
}),
"scheduled_on": "",
"title_template": json!({
"prefix": "",
"separator": "",
"date_format": ""
}),
"items": (
json!({
"title": "",
"item_type": "",
"content": "",
"duration": "",
"planned_duration": "",
"show_part": "",
"additional_notes": "",
"rundown": ""
})
),
"_created": "",
"_updated": "",
"created_by": "",
"last_updated_by": ""
});
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("PATCH").unwrap(), url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PATCH \
--url {{baseUrl}}/shows/:showId/templates/:templateId \
--header 'content-type: application/json' \
--data '{
"title": "",
"airtime_time": "",
"airtime_date": "",
"planned_duration": "",
"repeat": false,
"schedule": {
"freq": "",
"interval": "",
"month": [],
"monthday": [],
"weekday": []
},
"scheduled_on": "",
"title_template": {
"prefix": "",
"separator": "",
"date_format": ""
},
"items": [
{
"title": "",
"item_type": "",
"content": "",
"duration": "",
"planned_duration": "",
"show_part": "",
"additional_notes": "",
"rundown": ""
}
],
"_created": "",
"_updated": "",
"created_by": "",
"last_updated_by": ""
}'
echo '{
"title": "",
"airtime_time": "",
"airtime_date": "",
"planned_duration": "",
"repeat": false,
"schedule": {
"freq": "",
"interval": "",
"month": [],
"monthday": [],
"weekday": []
},
"scheduled_on": "",
"title_template": {
"prefix": "",
"separator": "",
"date_format": ""
},
"items": [
{
"title": "",
"item_type": "",
"content": "",
"duration": "",
"planned_duration": "",
"show_part": "",
"additional_notes": "",
"rundown": ""
}
],
"_created": "",
"_updated": "",
"created_by": "",
"last_updated_by": ""
}' | \
http PATCH {{baseUrl}}/shows/:showId/templates/:templateId \
content-type:application/json
wget --quiet \
--method PATCH \
--header 'content-type: application/json' \
--body-data '{\n "title": "",\n "airtime_time": "",\n "airtime_date": "",\n "planned_duration": "",\n "repeat": false,\n "schedule": {\n "freq": "",\n "interval": "",\n "month": [],\n "monthday": [],\n "weekday": []\n },\n "scheduled_on": "",\n "title_template": {\n "prefix": "",\n "separator": "",\n "date_format": ""\n },\n "items": [\n {\n "title": "",\n "item_type": "",\n "content": "",\n "duration": "",\n "planned_duration": "",\n "show_part": "",\n "additional_notes": "",\n "rundown": ""\n }\n ],\n "_created": "",\n "_updated": "",\n "created_by": "",\n "last_updated_by": ""\n}' \
--output-document \
- {{baseUrl}}/shows/:showId/templates/:templateId
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"title": "",
"airtime_time": "",
"airtime_date": "",
"planned_duration": "",
"repeat": false,
"schedule": [
"freq": "",
"interval": "",
"month": [],
"monthday": [],
"weekday": []
],
"scheduled_on": "",
"title_template": [
"prefix": "",
"separator": "",
"date_format": ""
],
"items": [
[
"title": "",
"item_type": "",
"content": "",
"duration": "",
"planned_duration": "",
"show_part": "",
"additional_notes": "",
"rundown": ""
]
],
"_created": "",
"_updated": "",
"created_by": "",
"last_updated_by": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/shows/:showId/templates/:templateId")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PATCH"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"title": "Marker Daily",
"airtime_time": "06:00",
"airtime_date": "2022-06-22T00:00:00.000Z",
"planned_duration": 3600,
"repeat": true,
"schedule": {
"month": [
1,
12
],
"monthday": [
1,
30,
-1
],
"weekday": [
0,
1,
2,
3,
4
]
},
"title_template": {
"prefix": "Marker",
"separator": "//",
"date_format": "%d.%m.%Y"
},
"_created": "2022-02-16T13:33:40+0000",
"_updated": "2022-02-16T13:33:40+0000",
"created_by": "629864349728636e382c74ce",
"last_updated_by": "629864349728636e382c74ce"
}