YouTube Data API v3
POST
youtube.abuseReports.insert
{{baseUrl}}/youtube/v3/abuseReports
QUERY PARAMS
part
BODY json
{
"abuseTypes": [
{
"id": ""
}
],
"description": "",
"relatedEntities": [
{
"entity": {
"id": "",
"typeId": "",
"url": ""
}
}
],
"subject": {}
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/youtube/v3/abuseReports?part=");
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 \"abuseTypes\": [\n {\n \"id\": \"\"\n }\n ],\n \"description\": \"\",\n \"relatedEntities\": [\n {\n \"entity\": {\n \"id\": \"\",\n \"typeId\": \"\",\n \"url\": \"\"\n }\n }\n ],\n \"subject\": {}\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/youtube/v3/abuseReports" {:query-params {:part ""}
:content-type :json
:form-params {:abuseTypes [{:id ""}]
:description ""
:relatedEntities [{:entity {:id ""
:typeId ""
:url ""}}]
:subject {}}})
require "http/client"
url = "{{baseUrl}}/youtube/v3/abuseReports?part="
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"abuseTypes\": [\n {\n \"id\": \"\"\n }\n ],\n \"description\": \"\",\n \"relatedEntities\": [\n {\n \"entity\": {\n \"id\": \"\",\n \"typeId\": \"\",\n \"url\": \"\"\n }\n }\n ],\n \"subject\": {}\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}}/youtube/v3/abuseReports?part="),
Content = new StringContent("{\n \"abuseTypes\": [\n {\n \"id\": \"\"\n }\n ],\n \"description\": \"\",\n \"relatedEntities\": [\n {\n \"entity\": {\n \"id\": \"\",\n \"typeId\": \"\",\n \"url\": \"\"\n }\n }\n ],\n \"subject\": {}\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}}/youtube/v3/abuseReports?part=");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"abuseTypes\": [\n {\n \"id\": \"\"\n }\n ],\n \"description\": \"\",\n \"relatedEntities\": [\n {\n \"entity\": {\n \"id\": \"\",\n \"typeId\": \"\",\n \"url\": \"\"\n }\n }\n ],\n \"subject\": {}\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/youtube/v3/abuseReports?part="
payload := strings.NewReader("{\n \"abuseTypes\": [\n {\n \"id\": \"\"\n }\n ],\n \"description\": \"\",\n \"relatedEntities\": [\n {\n \"entity\": {\n \"id\": \"\",\n \"typeId\": \"\",\n \"url\": \"\"\n }\n }\n ],\n \"subject\": {}\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/youtube/v3/abuseReports?part= HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 214
{
"abuseTypes": [
{
"id": ""
}
],
"description": "",
"relatedEntities": [
{
"entity": {
"id": "",
"typeId": "",
"url": ""
}
}
],
"subject": {}
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/youtube/v3/abuseReports?part=")
.setHeader("content-type", "application/json")
.setBody("{\n \"abuseTypes\": [\n {\n \"id\": \"\"\n }\n ],\n \"description\": \"\",\n \"relatedEntities\": [\n {\n \"entity\": {\n \"id\": \"\",\n \"typeId\": \"\",\n \"url\": \"\"\n }\n }\n ],\n \"subject\": {}\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/youtube/v3/abuseReports?part="))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"abuseTypes\": [\n {\n \"id\": \"\"\n }\n ],\n \"description\": \"\",\n \"relatedEntities\": [\n {\n \"entity\": {\n \"id\": \"\",\n \"typeId\": \"\",\n \"url\": \"\"\n }\n }\n ],\n \"subject\": {}\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 \"abuseTypes\": [\n {\n \"id\": \"\"\n }\n ],\n \"description\": \"\",\n \"relatedEntities\": [\n {\n \"entity\": {\n \"id\": \"\",\n \"typeId\": \"\",\n \"url\": \"\"\n }\n }\n ],\n \"subject\": {}\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/youtube/v3/abuseReports?part=")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/youtube/v3/abuseReports?part=")
.header("content-type", "application/json")
.body("{\n \"abuseTypes\": [\n {\n \"id\": \"\"\n }\n ],\n \"description\": \"\",\n \"relatedEntities\": [\n {\n \"entity\": {\n \"id\": \"\",\n \"typeId\": \"\",\n \"url\": \"\"\n }\n }\n ],\n \"subject\": {}\n}")
.asString();
const data = JSON.stringify({
abuseTypes: [
{
id: ''
}
],
description: '',
relatedEntities: [
{
entity: {
id: '',
typeId: '',
url: ''
}
}
],
subject: {}
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/youtube/v3/abuseReports?part=');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/youtube/v3/abuseReports',
params: {part: ''},
headers: {'content-type': 'application/json'},
data: {
abuseTypes: [{id: ''}],
description: '',
relatedEntities: [{entity: {id: '', typeId: '', url: ''}}],
subject: {}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/youtube/v3/abuseReports?part=';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"abuseTypes":[{"id":""}],"description":"","relatedEntities":[{"entity":{"id":"","typeId":"","url":""}}],"subject":{}}'
};
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}}/youtube/v3/abuseReports?part=',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "abuseTypes": [\n {\n "id": ""\n }\n ],\n "description": "",\n "relatedEntities": [\n {\n "entity": {\n "id": "",\n "typeId": "",\n "url": ""\n }\n }\n ],\n "subject": {}\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"abuseTypes\": [\n {\n \"id\": \"\"\n }\n ],\n \"description\": \"\",\n \"relatedEntities\": [\n {\n \"entity\": {\n \"id\": \"\",\n \"typeId\": \"\",\n \"url\": \"\"\n }\n }\n ],\n \"subject\": {}\n}")
val request = Request.Builder()
.url("{{baseUrl}}/youtube/v3/abuseReports?part=")
.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/youtube/v3/abuseReports?part=',
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({
abuseTypes: [{id: ''}],
description: '',
relatedEntities: [{entity: {id: '', typeId: '', url: ''}}],
subject: {}
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/youtube/v3/abuseReports',
qs: {part: ''},
headers: {'content-type': 'application/json'},
body: {
abuseTypes: [{id: ''}],
description: '',
relatedEntities: [{entity: {id: '', typeId: '', url: ''}}],
subject: {}
},
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}}/youtube/v3/abuseReports');
req.query({
part: ''
});
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
abuseTypes: [
{
id: ''
}
],
description: '',
relatedEntities: [
{
entity: {
id: '',
typeId: '',
url: ''
}
}
],
subject: {}
});
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}}/youtube/v3/abuseReports',
params: {part: ''},
headers: {'content-type': 'application/json'},
data: {
abuseTypes: [{id: ''}],
description: '',
relatedEntities: [{entity: {id: '', typeId: '', url: ''}}],
subject: {}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/youtube/v3/abuseReports?part=';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"abuseTypes":[{"id":""}],"description":"","relatedEntities":[{"entity":{"id":"","typeId":"","url":""}}],"subject":{}}'
};
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 = @{ @"abuseTypes": @[ @{ @"id": @"" } ],
@"description": @"",
@"relatedEntities": @[ @{ @"entity": @{ @"id": @"", @"typeId": @"", @"url": @"" } } ],
@"subject": @{ } };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/youtube/v3/abuseReports?part="]
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}}/youtube/v3/abuseReports?part=" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"abuseTypes\": [\n {\n \"id\": \"\"\n }\n ],\n \"description\": \"\",\n \"relatedEntities\": [\n {\n \"entity\": {\n \"id\": \"\",\n \"typeId\": \"\",\n \"url\": \"\"\n }\n }\n ],\n \"subject\": {}\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/youtube/v3/abuseReports?part=",
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([
'abuseTypes' => [
[
'id' => ''
]
],
'description' => '',
'relatedEntities' => [
[
'entity' => [
'id' => '',
'typeId' => '',
'url' => ''
]
]
],
'subject' => [
]
]),
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}}/youtube/v3/abuseReports?part=', [
'body' => '{
"abuseTypes": [
{
"id": ""
}
],
"description": "",
"relatedEntities": [
{
"entity": {
"id": "",
"typeId": "",
"url": ""
}
}
],
"subject": {}
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/youtube/v3/abuseReports');
$request->setMethod(HTTP_METH_POST);
$request->setQueryData([
'part' => ''
]);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'abuseTypes' => [
[
'id' => ''
]
],
'description' => '',
'relatedEntities' => [
[
'entity' => [
'id' => '',
'typeId' => '',
'url' => ''
]
]
],
'subject' => [
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'abuseTypes' => [
[
'id' => ''
]
],
'description' => '',
'relatedEntities' => [
[
'entity' => [
'id' => '',
'typeId' => '',
'url' => ''
]
]
],
'subject' => [
]
]));
$request->setRequestUrl('{{baseUrl}}/youtube/v3/abuseReports');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setQuery(new http\QueryString([
'part' => ''
]));
$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}}/youtube/v3/abuseReports?part=' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"abuseTypes": [
{
"id": ""
}
],
"description": "",
"relatedEntities": [
{
"entity": {
"id": "",
"typeId": "",
"url": ""
}
}
],
"subject": {}
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/youtube/v3/abuseReports?part=' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"abuseTypes": [
{
"id": ""
}
],
"description": "",
"relatedEntities": [
{
"entity": {
"id": "",
"typeId": "",
"url": ""
}
}
],
"subject": {}
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"abuseTypes\": [\n {\n \"id\": \"\"\n }\n ],\n \"description\": \"\",\n \"relatedEntities\": [\n {\n \"entity\": {\n \"id\": \"\",\n \"typeId\": \"\",\n \"url\": \"\"\n }\n }\n ],\n \"subject\": {}\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/youtube/v3/abuseReports?part=", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/youtube/v3/abuseReports"
querystring = {"part":""}
payload = {
"abuseTypes": [{ "id": "" }],
"description": "",
"relatedEntities": [{ "entity": {
"id": "",
"typeId": "",
"url": ""
} }],
"subject": {}
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/youtube/v3/abuseReports"
queryString <- list(part = "")
payload <- "{\n \"abuseTypes\": [\n {\n \"id\": \"\"\n }\n ],\n \"description\": \"\",\n \"relatedEntities\": [\n {\n \"entity\": {\n \"id\": \"\",\n \"typeId\": \"\",\n \"url\": \"\"\n }\n }\n ],\n \"subject\": {}\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, query = queryString, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/youtube/v3/abuseReports?part=")
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 \"abuseTypes\": [\n {\n \"id\": \"\"\n }\n ],\n \"description\": \"\",\n \"relatedEntities\": [\n {\n \"entity\": {\n \"id\": \"\",\n \"typeId\": \"\",\n \"url\": \"\"\n }\n }\n ],\n \"subject\": {}\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/youtube/v3/abuseReports') do |req|
req.params['part'] = ''
req.body = "{\n \"abuseTypes\": [\n {\n \"id\": \"\"\n }\n ],\n \"description\": \"\",\n \"relatedEntities\": [\n {\n \"entity\": {\n \"id\": \"\",\n \"typeId\": \"\",\n \"url\": \"\"\n }\n }\n ],\n \"subject\": {}\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/youtube/v3/abuseReports";
let querystring = [
("part", ""),
];
let payload = json!({
"abuseTypes": (json!({"id": ""})),
"description": "",
"relatedEntities": (json!({"entity": json!({
"id": "",
"typeId": "",
"url": ""
})})),
"subject": json!({})
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.query(&querystring)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/youtube/v3/abuseReports?part=' \
--header 'content-type: application/json' \
--data '{
"abuseTypes": [
{
"id": ""
}
],
"description": "",
"relatedEntities": [
{
"entity": {
"id": "",
"typeId": "",
"url": ""
}
}
],
"subject": {}
}'
echo '{
"abuseTypes": [
{
"id": ""
}
],
"description": "",
"relatedEntities": [
{
"entity": {
"id": "",
"typeId": "",
"url": ""
}
}
],
"subject": {}
}' | \
http POST '{{baseUrl}}/youtube/v3/abuseReports?part=' \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "abuseTypes": [\n {\n "id": ""\n }\n ],\n "description": "",\n "relatedEntities": [\n {\n "entity": {\n "id": "",\n "typeId": "",\n "url": ""\n }\n }\n ],\n "subject": {}\n}' \
--output-document \
- '{{baseUrl}}/youtube/v3/abuseReports?part='
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"abuseTypes": [["id": ""]],
"description": "",
"relatedEntities": [["entity": [
"id": "",
"typeId": "",
"url": ""
]]],
"subject": []
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/youtube/v3/abuseReports?part=")! 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()
GET
youtube.activities.list
{{baseUrl}}/youtube/v3/activities
QUERY PARAMS
part
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/youtube/v3/activities?part=");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/youtube/v3/activities" {:query-params {:part ""}})
require "http/client"
url = "{{baseUrl}}/youtube/v3/activities?part="
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}}/youtube/v3/activities?part="),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/youtube/v3/activities?part=");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/youtube/v3/activities?part="
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/youtube/v3/activities?part= HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/youtube/v3/activities?part=")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/youtube/v3/activities?part="))
.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}}/youtube/v3/activities?part=")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/youtube/v3/activities?part=")
.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}}/youtube/v3/activities?part=');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/youtube/v3/activities',
params: {part: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/youtube/v3/activities?part=';
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}}/youtube/v3/activities?part=',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/youtube/v3/activities?part=")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/youtube/v3/activities?part=',
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}}/youtube/v3/activities',
qs: {part: ''}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/youtube/v3/activities');
req.query({
part: ''
});
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}}/youtube/v3/activities',
params: {part: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/youtube/v3/activities?part=';
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}}/youtube/v3/activities?part="]
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}}/youtube/v3/activities?part=" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/youtube/v3/activities?part=",
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}}/youtube/v3/activities?part=');
echo $response->getBody();
setUrl('{{baseUrl}}/youtube/v3/activities');
$request->setMethod(HTTP_METH_GET);
$request->setQueryData([
'part' => ''
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/youtube/v3/activities');
$request->setRequestMethod('GET');
$request->setQuery(new http\QueryString([
'part' => ''
]));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/youtube/v3/activities?part=' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/youtube/v3/activities?part=' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/youtube/v3/activities?part=")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/youtube/v3/activities"
querystring = {"part":""}
response = requests.get(url, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/youtube/v3/activities"
queryString <- list(part = "")
response <- VERB("GET", url, query = queryString, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/youtube/v3/activities?part=")
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/youtube/v3/activities') do |req|
req.params['part'] = ''
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/youtube/v3/activities";
let querystring = [
("part", ""),
];
let client = reqwest::Client::new();
let response = client.get(url)
.query(&querystring)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url '{{baseUrl}}/youtube/v3/activities?part='
http GET '{{baseUrl}}/youtube/v3/activities?part='
wget --quiet \
--method GET \
--output-document \
- '{{baseUrl}}/youtube/v3/activities?part='
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/youtube/v3/activities?part=")! 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()
DELETE
youtube.captions.delete
{{baseUrl}}/youtube/v3/captions
QUERY PARAMS
id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/youtube/v3/captions?id=");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/delete "{{baseUrl}}/youtube/v3/captions" {:query-params {:id ""}})
require "http/client"
url = "{{baseUrl}}/youtube/v3/captions?id="
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}}/youtube/v3/captions?id="),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/youtube/v3/captions?id=");
var request = new RestRequest("", Method.Delete);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/youtube/v3/captions?id="
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/youtube/v3/captions?id= HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/youtube/v3/captions?id=")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/youtube/v3/captions?id="))
.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}}/youtube/v3/captions?id=")
.delete(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/youtube/v3/captions?id=")
.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}}/youtube/v3/captions?id=');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'DELETE',
url: '{{baseUrl}}/youtube/v3/captions',
params: {id: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/youtube/v3/captions?id=';
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}}/youtube/v3/captions?id=',
method: 'DELETE',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/youtube/v3/captions?id=")
.delete(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'DELETE',
hostname: 'example.com',
port: null,
path: '/baseUrl/youtube/v3/captions?id=',
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}}/youtube/v3/captions',
qs: {id: ''}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('DELETE', '{{baseUrl}}/youtube/v3/captions');
req.query({
id: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'DELETE',
url: '{{baseUrl}}/youtube/v3/captions',
params: {id: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/youtube/v3/captions?id=';
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}}/youtube/v3/captions?id="]
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}}/youtube/v3/captions?id=" in
Client.call `DELETE uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/youtube/v3/captions?id=",
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}}/youtube/v3/captions?id=');
echo $response->getBody();
setUrl('{{baseUrl}}/youtube/v3/captions');
$request->setMethod(HTTP_METH_DELETE);
$request->setQueryData([
'id' => ''
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/youtube/v3/captions');
$request->setRequestMethod('DELETE');
$request->setQuery(new http\QueryString([
'id' => ''
]));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/youtube/v3/captions?id=' -Method DELETE
$response = Invoke-RestMethod -Uri '{{baseUrl}}/youtube/v3/captions?id=' -Method DELETE
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("DELETE", "/baseUrl/youtube/v3/captions?id=")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/youtube/v3/captions"
querystring = {"id":""}
response = requests.delete(url, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/youtube/v3/captions"
queryString <- list(id = "")
response <- VERB("DELETE", url, query = queryString, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/youtube/v3/captions?id=")
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/youtube/v3/captions') do |req|
req.params['id'] = ''
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/youtube/v3/captions";
let querystring = [
("id", ""),
];
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("DELETE").unwrap(), url)
.query(&querystring)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request DELETE \
--url '{{baseUrl}}/youtube/v3/captions?id='
http DELETE '{{baseUrl}}/youtube/v3/captions?id='
wget --quiet \
--method DELETE \
--output-document \
- '{{baseUrl}}/youtube/v3/captions?id='
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/youtube/v3/captions?id=")! 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
youtube.captions.download
{{baseUrl}}/youtube/v3/captions/:id
QUERY PARAMS
id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/youtube/v3/captions/:id");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/youtube/v3/captions/:id")
require "http/client"
url = "{{baseUrl}}/youtube/v3/captions/:id"
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}}/youtube/v3/captions/:id"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/youtube/v3/captions/:id");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/youtube/v3/captions/:id"
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/youtube/v3/captions/:id HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/youtube/v3/captions/:id")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/youtube/v3/captions/:id"))
.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}}/youtube/v3/captions/:id")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/youtube/v3/captions/:id")
.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}}/youtube/v3/captions/:id');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/youtube/v3/captions/:id'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/youtube/v3/captions/:id';
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}}/youtube/v3/captions/:id',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/youtube/v3/captions/:id")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/youtube/v3/captions/:id',
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}}/youtube/v3/captions/:id'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/youtube/v3/captions/:id');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {method: 'GET', url: '{{baseUrl}}/youtube/v3/captions/:id'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/youtube/v3/captions/:id';
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}}/youtube/v3/captions/:id"]
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}}/youtube/v3/captions/:id" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/youtube/v3/captions/:id",
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}}/youtube/v3/captions/:id');
echo $response->getBody();
setUrl('{{baseUrl}}/youtube/v3/captions/:id');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/youtube/v3/captions/:id');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/youtube/v3/captions/:id' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/youtube/v3/captions/:id' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/youtube/v3/captions/:id")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/youtube/v3/captions/:id"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/youtube/v3/captions/:id"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/youtube/v3/captions/:id")
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/youtube/v3/captions/:id') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/youtube/v3/captions/:id";
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}}/youtube/v3/captions/:id
http GET {{baseUrl}}/youtube/v3/captions/:id
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/youtube/v3/captions/:id
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/youtube/v3/captions/:id")! 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()
POST
youtube.captions.insert
{{baseUrl}}/youtube/v3/captions
QUERY PARAMS
part
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/youtube/v3/captions?part=");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/youtube/v3/captions" {:query-params {:part ""}})
require "http/client"
url = "{{baseUrl}}/youtube/v3/captions?part="
response = HTTP::Client.post url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/youtube/v3/captions?part="),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/youtube/v3/captions?part=");
var request = new RestRequest("", Method.Post);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/youtube/v3/captions?part="
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/youtube/v3/captions?part= HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/youtube/v3/captions?part=")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/youtube/v3/captions?part="))
.method("POST", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/youtube/v3/captions?part=")
.post(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/youtube/v3/captions?part=")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/youtube/v3/captions?part=');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/youtube/v3/captions',
params: {part: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/youtube/v3/captions?part=';
const options = {method: 'POST'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/youtube/v3/captions?part=',
method: 'POST',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/youtube/v3/captions?part=")
.post(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/youtube/v3/captions?part=',
headers: {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/youtube/v3/captions',
qs: {part: ''}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/youtube/v3/captions');
req.query({
part: ''
});
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}}/youtube/v3/captions',
params: {part: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/youtube/v3/captions?part=';
const options = {method: 'POST'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/youtube/v3/captions?part="]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/youtube/v3/captions?part=" in
Client.call `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/youtube/v3/captions?part=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/youtube/v3/captions?part=');
echo $response->getBody();
setUrl('{{baseUrl}}/youtube/v3/captions');
$request->setMethod(HTTP_METH_POST);
$request->setQueryData([
'part' => ''
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/youtube/v3/captions');
$request->setRequestMethod('POST');
$request->setQuery(new http\QueryString([
'part' => ''
]));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/youtube/v3/captions?part=' -Method POST
$response = Invoke-RestMethod -Uri '{{baseUrl}}/youtube/v3/captions?part=' -Method POST
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("POST", "/baseUrl/youtube/v3/captions?part=")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/youtube/v3/captions"
querystring = {"part":""}
response = requests.post(url, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/youtube/v3/captions"
queryString <- list(part = "")
response <- VERB("POST", url, query = queryString, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/youtube/v3/captions?part=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.post('/baseUrl/youtube/v3/captions') do |req|
req.params['part'] = ''
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/youtube/v3/captions";
let querystring = [
("part", ""),
];
let client = reqwest::Client::new();
let response = client.post(url)
.query(&querystring)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/youtube/v3/captions?part='
http POST '{{baseUrl}}/youtube/v3/captions?part='
wget --quiet \
--method POST \
--output-document \
- '{{baseUrl}}/youtube/v3/captions?part='
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/youtube/v3/captions?part=")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
youtube.captions.list
{{baseUrl}}/youtube/v3/captions
QUERY PARAMS
part
videoId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/youtube/v3/captions?part=&videoId=");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/youtube/v3/captions" {:query-params {:part ""
:videoId ""}})
require "http/client"
url = "{{baseUrl}}/youtube/v3/captions?part=&videoId="
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}}/youtube/v3/captions?part=&videoId="),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/youtube/v3/captions?part=&videoId=");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/youtube/v3/captions?part=&videoId="
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/youtube/v3/captions?part=&videoId= HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/youtube/v3/captions?part=&videoId=")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/youtube/v3/captions?part=&videoId="))
.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}}/youtube/v3/captions?part=&videoId=")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/youtube/v3/captions?part=&videoId=")
.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}}/youtube/v3/captions?part=&videoId=');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/youtube/v3/captions',
params: {part: '', videoId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/youtube/v3/captions?part=&videoId=';
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}}/youtube/v3/captions?part=&videoId=',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/youtube/v3/captions?part=&videoId=")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/youtube/v3/captions?part=&videoId=',
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}}/youtube/v3/captions',
qs: {part: '', videoId: ''}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/youtube/v3/captions');
req.query({
part: '',
videoId: ''
});
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}}/youtube/v3/captions',
params: {part: '', videoId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/youtube/v3/captions?part=&videoId=';
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}}/youtube/v3/captions?part=&videoId="]
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}}/youtube/v3/captions?part=&videoId=" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/youtube/v3/captions?part=&videoId=",
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}}/youtube/v3/captions?part=&videoId=');
echo $response->getBody();
setUrl('{{baseUrl}}/youtube/v3/captions');
$request->setMethod(HTTP_METH_GET);
$request->setQueryData([
'part' => '',
'videoId' => ''
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/youtube/v3/captions');
$request->setRequestMethod('GET');
$request->setQuery(new http\QueryString([
'part' => '',
'videoId' => ''
]));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/youtube/v3/captions?part=&videoId=' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/youtube/v3/captions?part=&videoId=' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/youtube/v3/captions?part=&videoId=")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/youtube/v3/captions"
querystring = {"part":"","videoId":""}
response = requests.get(url, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/youtube/v3/captions"
queryString <- list(
part = "",
videoId = ""
)
response <- VERB("GET", url, query = queryString, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/youtube/v3/captions?part=&videoId=")
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/youtube/v3/captions') do |req|
req.params['part'] = ''
req.params['videoId'] = ''
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/youtube/v3/captions";
let querystring = [
("part", ""),
("videoId", ""),
];
let client = reqwest::Client::new();
let response = client.get(url)
.query(&querystring)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url '{{baseUrl}}/youtube/v3/captions?part=&videoId='
http GET '{{baseUrl}}/youtube/v3/captions?part=&videoId='
wget --quiet \
--method GET \
--output-document \
- '{{baseUrl}}/youtube/v3/captions?part=&videoId='
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/youtube/v3/captions?part=&videoId=")! 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()
PUT
youtube.captions.update
{{baseUrl}}/youtube/v3/captions
QUERY PARAMS
part
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/youtube/v3/captions?part=");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/youtube/v3/captions" {:query-params {:part ""}})
require "http/client"
url = "{{baseUrl}}/youtube/v3/captions?part="
response = HTTP::Client.put url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Put,
RequestUri = new Uri("{{baseUrl}}/youtube/v3/captions?part="),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/youtube/v3/captions?part=");
var request = new RestRequest("", Method.Put);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/youtube/v3/captions?part="
req, _ := http.NewRequest("PUT", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PUT /baseUrl/youtube/v3/captions?part= HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/youtube/v3/captions?part=")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/youtube/v3/captions?part="))
.method("PUT", 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}}/youtube/v3/captions?part=")
.put(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/youtube/v3/captions?part=")
.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('PUT', '{{baseUrl}}/youtube/v3/captions?part=');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/youtube/v3/captions',
params: {part: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/youtube/v3/captions?part=';
const options = {method: 'PUT'};
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}}/youtube/v3/captions?part=',
method: 'PUT',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/youtube/v3/captions?part=")
.put(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PUT',
hostname: 'example.com',
port: null,
path: '/baseUrl/youtube/v3/captions?part=',
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: 'PUT',
url: '{{baseUrl}}/youtube/v3/captions',
qs: {part: ''}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PUT', '{{baseUrl}}/youtube/v3/captions');
req.query({
part: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'PUT',
url: '{{baseUrl}}/youtube/v3/captions',
params: {part: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/youtube/v3/captions?part=';
const options = {method: 'PUT'};
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}}/youtube/v3/captions?part="]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PUT"];
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}}/youtube/v3/captions?part=" in
Client.call `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/youtube/v3/captions?part=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('PUT', '{{baseUrl}}/youtube/v3/captions?part=');
echo $response->getBody();
setUrl('{{baseUrl}}/youtube/v3/captions');
$request->setMethod(HTTP_METH_PUT);
$request->setQueryData([
'part' => ''
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/youtube/v3/captions');
$request->setRequestMethod('PUT');
$request->setQuery(new http\QueryString([
'part' => ''
]));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/youtube/v3/captions?part=' -Method PUT
$response = Invoke-RestMethod -Uri '{{baseUrl}}/youtube/v3/captions?part=' -Method PUT
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("PUT", "/baseUrl/youtube/v3/captions?part=")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/youtube/v3/captions"
querystring = {"part":""}
response = requests.put(url, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/youtube/v3/captions"
queryString <- list(part = "")
response <- VERB("PUT", url, query = queryString, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/youtube/v3/captions?part=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.put('/baseUrl/youtube/v3/captions') do |req|
req.params['part'] = ''
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/youtube/v3/captions";
let querystring = [
("part", ""),
];
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PUT").unwrap(), url)
.query(&querystring)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PUT \
--url '{{baseUrl}}/youtube/v3/captions?part='
http PUT '{{baseUrl}}/youtube/v3/captions?part='
wget --quiet \
--method PUT \
--output-document \
- '{{baseUrl}}/youtube/v3/captions?part='
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/youtube/v3/captions?part=")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PUT"
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()
POST
youtube.channelBanners.insert
{{baseUrl}}/youtube/v3/channelBanners/insert
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/youtube/v3/channelBanners/insert");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/youtube/v3/channelBanners/insert")
require "http/client"
url = "{{baseUrl}}/youtube/v3/channelBanners/insert"
response = HTTP::Client.post url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/youtube/v3/channelBanners/insert"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/youtube/v3/channelBanners/insert");
var request = new RestRequest("", Method.Post);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/youtube/v3/channelBanners/insert"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/youtube/v3/channelBanners/insert HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/youtube/v3/channelBanners/insert")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/youtube/v3/channelBanners/insert"))
.method("POST", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/youtube/v3/channelBanners/insert")
.post(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/youtube/v3/channelBanners/insert")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/youtube/v3/channelBanners/insert');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/youtube/v3/channelBanners/insert'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/youtube/v3/channelBanners/insert';
const options = {method: 'POST'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/youtube/v3/channelBanners/insert',
method: 'POST',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/youtube/v3/channelBanners/insert")
.post(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/youtube/v3/channelBanners/insert',
headers: {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/youtube/v3/channelBanners/insert'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/youtube/v3/channelBanners/insert');
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}}/youtube/v3/channelBanners/insert'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/youtube/v3/channelBanners/insert';
const options = {method: 'POST'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/youtube/v3/channelBanners/insert"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/youtube/v3/channelBanners/insert" in
Client.call `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/youtube/v3/channelBanners/insert",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/youtube/v3/channelBanners/insert');
echo $response->getBody();
setUrl('{{baseUrl}}/youtube/v3/channelBanners/insert');
$request->setMethod(HTTP_METH_POST);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/youtube/v3/channelBanners/insert');
$request->setRequestMethod('POST');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/youtube/v3/channelBanners/insert' -Method POST
$response = Invoke-RestMethod -Uri '{{baseUrl}}/youtube/v3/channelBanners/insert' -Method POST
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("POST", "/baseUrl/youtube/v3/channelBanners/insert")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/youtube/v3/channelBanners/insert"
response = requests.post(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/youtube/v3/channelBanners/insert"
response <- VERB("POST", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/youtube/v3/channelBanners/insert")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.post('/baseUrl/youtube/v3/channelBanners/insert') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/youtube/v3/channelBanners/insert";
let client = reqwest::Client::new();
let response = client.post(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/youtube/v3/channelBanners/insert
http POST {{baseUrl}}/youtube/v3/channelBanners/insert
wget --quiet \
--method POST \
--output-document \
- {{baseUrl}}/youtube/v3/channelBanners/insert
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/youtube/v3/channelBanners/insert")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
youtube.channels.list
{{baseUrl}}/youtube/v3/channels
QUERY PARAMS
part
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/youtube/v3/channels?part=");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/youtube/v3/channels" {:query-params {:part ""}})
require "http/client"
url = "{{baseUrl}}/youtube/v3/channels?part="
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}}/youtube/v3/channels?part="),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/youtube/v3/channels?part=");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/youtube/v3/channels?part="
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/youtube/v3/channels?part= HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/youtube/v3/channels?part=")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/youtube/v3/channels?part="))
.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}}/youtube/v3/channels?part=")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/youtube/v3/channels?part=")
.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}}/youtube/v3/channels?part=');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/youtube/v3/channels',
params: {part: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/youtube/v3/channels?part=';
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}}/youtube/v3/channels?part=',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/youtube/v3/channels?part=")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/youtube/v3/channels?part=',
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}}/youtube/v3/channels',
qs: {part: ''}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/youtube/v3/channels');
req.query({
part: ''
});
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}}/youtube/v3/channels',
params: {part: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/youtube/v3/channels?part=';
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}}/youtube/v3/channels?part="]
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}}/youtube/v3/channels?part=" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/youtube/v3/channels?part=",
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}}/youtube/v3/channels?part=');
echo $response->getBody();
setUrl('{{baseUrl}}/youtube/v3/channels');
$request->setMethod(HTTP_METH_GET);
$request->setQueryData([
'part' => ''
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/youtube/v3/channels');
$request->setRequestMethod('GET');
$request->setQuery(new http\QueryString([
'part' => ''
]));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/youtube/v3/channels?part=' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/youtube/v3/channels?part=' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/youtube/v3/channels?part=")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/youtube/v3/channels"
querystring = {"part":""}
response = requests.get(url, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/youtube/v3/channels"
queryString <- list(part = "")
response <- VERB("GET", url, query = queryString, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/youtube/v3/channels?part=")
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/youtube/v3/channels') do |req|
req.params['part'] = ''
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/youtube/v3/channels";
let querystring = [
("part", ""),
];
let client = reqwest::Client::new();
let response = client.get(url)
.query(&querystring)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url '{{baseUrl}}/youtube/v3/channels?part='
http GET '{{baseUrl}}/youtube/v3/channels?part='
wget --quiet \
--method GET \
--output-document \
- '{{baseUrl}}/youtube/v3/channels?part='
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/youtube/v3/channels?part=")! 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()
PUT
youtube.channels.update
{{baseUrl}}/youtube/v3/channels
QUERY PARAMS
part
BODY json
{
"auditDetails": {
"communityGuidelinesGoodStanding": false,
"contentIdClaimsGoodStanding": false,
"copyrightStrikesGoodStanding": false
},
"brandingSettings": {
"channel": {
"country": "",
"defaultLanguage": "",
"defaultTab": "",
"description": "",
"featuredChannelsTitle": "",
"featuredChannelsUrls": [],
"keywords": "",
"moderateComments": false,
"profileColor": "",
"showBrowseView": false,
"showRelatedChannels": false,
"title": "",
"trackingAnalyticsAccountId": "",
"unsubscribedTrailer": ""
},
"hints": [
{
"property": "",
"value": ""
}
],
"image": {
"backgroundImageUrl": {
"defaultLanguage": {
"value": ""
},
"localized": [
{
"language": "",
"value": ""
}
]
},
"bannerExternalUrl": "",
"bannerImageUrl": "",
"bannerMobileExtraHdImageUrl": "",
"bannerMobileHdImageUrl": "",
"bannerMobileImageUrl": "",
"bannerMobileLowImageUrl": "",
"bannerMobileMediumHdImageUrl": "",
"bannerTabletExtraHdImageUrl": "",
"bannerTabletHdImageUrl": "",
"bannerTabletImageUrl": "",
"bannerTabletLowImageUrl": "",
"bannerTvHighImageUrl": "",
"bannerTvImageUrl": "",
"bannerTvLowImageUrl": "",
"bannerTvMediumImageUrl": "",
"largeBrandedBannerImageImapScript": {},
"largeBrandedBannerImageUrl": {},
"smallBrandedBannerImageImapScript": {},
"smallBrandedBannerImageUrl": {},
"trackingImageUrl": "",
"watchIconImageUrl": ""
},
"watch": {
"backgroundColor": "",
"featuredPlaylistId": "",
"textColor": ""
}
},
"contentDetails": {
"relatedPlaylists": {
"favorites": "",
"likes": "",
"uploads": "",
"watchHistory": "",
"watchLater": ""
}
},
"contentOwnerDetails": {
"contentOwner": "",
"timeLinked": ""
},
"conversionPings": {
"pings": [
{
"context": "",
"conversionUrl": ""
}
]
},
"etag": "",
"id": "",
"kind": "",
"localizations": {},
"snippet": {
"country": "",
"customUrl": "",
"defaultLanguage": "",
"description": "",
"localized": {
"description": "",
"title": ""
},
"publishedAt": "",
"thumbnails": {
"high": {
"height": 0,
"url": "",
"width": 0
},
"maxres": {},
"medium": {},
"standard": {}
},
"title": ""
},
"statistics": {
"commentCount": "",
"hiddenSubscriberCount": false,
"subscriberCount": "",
"videoCount": "",
"viewCount": ""
},
"status": {
"isLinked": false,
"longUploadsStatus": "",
"madeForKids": false,
"privacyStatus": "",
"selfDeclaredMadeForKids": false
},
"topicDetails": {
"topicCategories": [],
"topicIds": []
}
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/youtube/v3/channels?part=");
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 \"auditDetails\": {\n \"communityGuidelinesGoodStanding\": false,\n \"contentIdClaimsGoodStanding\": false,\n \"copyrightStrikesGoodStanding\": false\n },\n \"brandingSettings\": {\n \"channel\": {\n \"country\": \"\",\n \"defaultLanguage\": \"\",\n \"defaultTab\": \"\",\n \"description\": \"\",\n \"featuredChannelsTitle\": \"\",\n \"featuredChannelsUrls\": [],\n \"keywords\": \"\",\n \"moderateComments\": false,\n \"profileColor\": \"\",\n \"showBrowseView\": false,\n \"showRelatedChannels\": false,\n \"title\": \"\",\n \"trackingAnalyticsAccountId\": \"\",\n \"unsubscribedTrailer\": \"\"\n },\n \"hints\": [\n {\n \"property\": \"\",\n \"value\": \"\"\n }\n ],\n \"image\": {\n \"backgroundImageUrl\": {\n \"defaultLanguage\": {\n \"value\": \"\"\n },\n \"localized\": [\n {\n \"language\": \"\",\n \"value\": \"\"\n }\n ]\n },\n \"bannerExternalUrl\": \"\",\n \"bannerImageUrl\": \"\",\n \"bannerMobileExtraHdImageUrl\": \"\",\n \"bannerMobileHdImageUrl\": \"\",\n \"bannerMobileImageUrl\": \"\",\n \"bannerMobileLowImageUrl\": \"\",\n \"bannerMobileMediumHdImageUrl\": \"\",\n \"bannerTabletExtraHdImageUrl\": \"\",\n \"bannerTabletHdImageUrl\": \"\",\n \"bannerTabletImageUrl\": \"\",\n \"bannerTabletLowImageUrl\": \"\",\n \"bannerTvHighImageUrl\": \"\",\n \"bannerTvImageUrl\": \"\",\n \"bannerTvLowImageUrl\": \"\",\n \"bannerTvMediumImageUrl\": \"\",\n \"largeBrandedBannerImageImapScript\": {},\n \"largeBrandedBannerImageUrl\": {},\n \"smallBrandedBannerImageImapScript\": {},\n \"smallBrandedBannerImageUrl\": {},\n \"trackingImageUrl\": \"\",\n \"watchIconImageUrl\": \"\"\n },\n \"watch\": {\n \"backgroundColor\": \"\",\n \"featuredPlaylistId\": \"\",\n \"textColor\": \"\"\n }\n },\n \"contentDetails\": {\n \"relatedPlaylists\": {\n \"favorites\": \"\",\n \"likes\": \"\",\n \"uploads\": \"\",\n \"watchHistory\": \"\",\n \"watchLater\": \"\"\n }\n },\n \"contentOwnerDetails\": {\n \"contentOwner\": \"\",\n \"timeLinked\": \"\"\n },\n \"conversionPings\": {\n \"pings\": [\n {\n \"context\": \"\",\n \"conversionUrl\": \"\"\n }\n ]\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"localizations\": {},\n \"snippet\": {\n \"country\": \"\",\n \"customUrl\": \"\",\n \"defaultLanguage\": \"\",\n \"description\": \"\",\n \"localized\": {\n \"description\": \"\",\n \"title\": \"\"\n },\n \"publishedAt\": \"\",\n \"thumbnails\": {\n \"high\": {\n \"height\": 0,\n \"url\": \"\",\n \"width\": 0\n },\n \"maxres\": {},\n \"medium\": {},\n \"standard\": {}\n },\n \"title\": \"\"\n },\n \"statistics\": {\n \"commentCount\": \"\",\n \"hiddenSubscriberCount\": false,\n \"subscriberCount\": \"\",\n \"videoCount\": \"\",\n \"viewCount\": \"\"\n },\n \"status\": {\n \"isLinked\": false,\n \"longUploadsStatus\": \"\",\n \"madeForKids\": false,\n \"privacyStatus\": \"\",\n \"selfDeclaredMadeForKids\": false\n },\n \"topicDetails\": {\n \"topicCategories\": [],\n \"topicIds\": []\n }\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/youtube/v3/channels" {:query-params {:part ""}
:content-type :json
:form-params {:auditDetails {:communityGuidelinesGoodStanding false
:contentIdClaimsGoodStanding false
:copyrightStrikesGoodStanding false}
:brandingSettings {:channel {:country ""
:defaultLanguage ""
:defaultTab ""
:description ""
:featuredChannelsTitle ""
:featuredChannelsUrls []
:keywords ""
:moderateComments false
:profileColor ""
:showBrowseView false
:showRelatedChannels false
:title ""
:trackingAnalyticsAccountId ""
:unsubscribedTrailer ""}
:hints [{:property ""
:value ""}]
:image {:backgroundImageUrl {:defaultLanguage {:value ""}
:localized [{:language ""
:value ""}]}
:bannerExternalUrl ""
:bannerImageUrl ""
:bannerMobileExtraHdImageUrl ""
:bannerMobileHdImageUrl ""
:bannerMobileImageUrl ""
:bannerMobileLowImageUrl ""
:bannerMobileMediumHdImageUrl ""
:bannerTabletExtraHdImageUrl ""
:bannerTabletHdImageUrl ""
:bannerTabletImageUrl ""
:bannerTabletLowImageUrl ""
:bannerTvHighImageUrl ""
:bannerTvImageUrl ""
:bannerTvLowImageUrl ""
:bannerTvMediumImageUrl ""
:largeBrandedBannerImageImapScript {}
:largeBrandedBannerImageUrl {}
:smallBrandedBannerImageImapScript {}
:smallBrandedBannerImageUrl {}
:trackingImageUrl ""
:watchIconImageUrl ""}
:watch {:backgroundColor ""
:featuredPlaylistId ""
:textColor ""}}
:contentDetails {:relatedPlaylists {:favorites ""
:likes ""
:uploads ""
:watchHistory ""
:watchLater ""}}
:contentOwnerDetails {:contentOwner ""
:timeLinked ""}
:conversionPings {:pings [{:context ""
:conversionUrl ""}]}
:etag ""
:id ""
:kind ""
:localizations {}
:snippet {:country ""
:customUrl ""
:defaultLanguage ""
:description ""
:localized {:description ""
:title ""}
:publishedAt ""
:thumbnails {:high {:height 0
:url ""
:width 0}
:maxres {}
:medium {}
:standard {}}
:title ""}
:statistics {:commentCount ""
:hiddenSubscriberCount false
:subscriberCount ""
:videoCount ""
:viewCount ""}
:status {:isLinked false
:longUploadsStatus ""
:madeForKids false
:privacyStatus ""
:selfDeclaredMadeForKids false}
:topicDetails {:topicCategories []
:topicIds []}}})
require "http/client"
url = "{{baseUrl}}/youtube/v3/channels?part="
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"auditDetails\": {\n \"communityGuidelinesGoodStanding\": false,\n \"contentIdClaimsGoodStanding\": false,\n \"copyrightStrikesGoodStanding\": false\n },\n \"brandingSettings\": {\n \"channel\": {\n \"country\": \"\",\n \"defaultLanguage\": \"\",\n \"defaultTab\": \"\",\n \"description\": \"\",\n \"featuredChannelsTitle\": \"\",\n \"featuredChannelsUrls\": [],\n \"keywords\": \"\",\n \"moderateComments\": false,\n \"profileColor\": \"\",\n \"showBrowseView\": false,\n \"showRelatedChannels\": false,\n \"title\": \"\",\n \"trackingAnalyticsAccountId\": \"\",\n \"unsubscribedTrailer\": \"\"\n },\n \"hints\": [\n {\n \"property\": \"\",\n \"value\": \"\"\n }\n ],\n \"image\": {\n \"backgroundImageUrl\": {\n \"defaultLanguage\": {\n \"value\": \"\"\n },\n \"localized\": [\n {\n \"language\": \"\",\n \"value\": \"\"\n }\n ]\n },\n \"bannerExternalUrl\": \"\",\n \"bannerImageUrl\": \"\",\n \"bannerMobileExtraHdImageUrl\": \"\",\n \"bannerMobileHdImageUrl\": \"\",\n \"bannerMobileImageUrl\": \"\",\n \"bannerMobileLowImageUrl\": \"\",\n \"bannerMobileMediumHdImageUrl\": \"\",\n \"bannerTabletExtraHdImageUrl\": \"\",\n \"bannerTabletHdImageUrl\": \"\",\n \"bannerTabletImageUrl\": \"\",\n \"bannerTabletLowImageUrl\": \"\",\n \"bannerTvHighImageUrl\": \"\",\n \"bannerTvImageUrl\": \"\",\n \"bannerTvLowImageUrl\": \"\",\n \"bannerTvMediumImageUrl\": \"\",\n \"largeBrandedBannerImageImapScript\": {},\n \"largeBrandedBannerImageUrl\": {},\n \"smallBrandedBannerImageImapScript\": {},\n \"smallBrandedBannerImageUrl\": {},\n \"trackingImageUrl\": \"\",\n \"watchIconImageUrl\": \"\"\n },\n \"watch\": {\n \"backgroundColor\": \"\",\n \"featuredPlaylistId\": \"\",\n \"textColor\": \"\"\n }\n },\n \"contentDetails\": {\n \"relatedPlaylists\": {\n \"favorites\": \"\",\n \"likes\": \"\",\n \"uploads\": \"\",\n \"watchHistory\": \"\",\n \"watchLater\": \"\"\n }\n },\n \"contentOwnerDetails\": {\n \"contentOwner\": \"\",\n \"timeLinked\": \"\"\n },\n \"conversionPings\": {\n \"pings\": [\n {\n \"context\": \"\",\n \"conversionUrl\": \"\"\n }\n ]\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"localizations\": {},\n \"snippet\": {\n \"country\": \"\",\n \"customUrl\": \"\",\n \"defaultLanguage\": \"\",\n \"description\": \"\",\n \"localized\": {\n \"description\": \"\",\n \"title\": \"\"\n },\n \"publishedAt\": \"\",\n \"thumbnails\": {\n \"high\": {\n \"height\": 0,\n \"url\": \"\",\n \"width\": 0\n },\n \"maxres\": {},\n \"medium\": {},\n \"standard\": {}\n },\n \"title\": \"\"\n },\n \"statistics\": {\n \"commentCount\": \"\",\n \"hiddenSubscriberCount\": false,\n \"subscriberCount\": \"\",\n \"videoCount\": \"\",\n \"viewCount\": \"\"\n },\n \"status\": {\n \"isLinked\": false,\n \"longUploadsStatus\": \"\",\n \"madeForKids\": false,\n \"privacyStatus\": \"\",\n \"selfDeclaredMadeForKids\": false\n },\n \"topicDetails\": {\n \"topicCategories\": [],\n \"topicIds\": []\n }\n}"
response = HTTP::Client.put url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Put,
RequestUri = new Uri("{{baseUrl}}/youtube/v3/channels?part="),
Content = new StringContent("{\n \"auditDetails\": {\n \"communityGuidelinesGoodStanding\": false,\n \"contentIdClaimsGoodStanding\": false,\n \"copyrightStrikesGoodStanding\": false\n },\n \"brandingSettings\": {\n \"channel\": {\n \"country\": \"\",\n \"defaultLanguage\": \"\",\n \"defaultTab\": \"\",\n \"description\": \"\",\n \"featuredChannelsTitle\": \"\",\n \"featuredChannelsUrls\": [],\n \"keywords\": \"\",\n \"moderateComments\": false,\n \"profileColor\": \"\",\n \"showBrowseView\": false,\n \"showRelatedChannels\": false,\n \"title\": \"\",\n \"trackingAnalyticsAccountId\": \"\",\n \"unsubscribedTrailer\": \"\"\n },\n \"hints\": [\n {\n \"property\": \"\",\n \"value\": \"\"\n }\n ],\n \"image\": {\n \"backgroundImageUrl\": {\n \"defaultLanguage\": {\n \"value\": \"\"\n },\n \"localized\": [\n {\n \"language\": \"\",\n \"value\": \"\"\n }\n ]\n },\n \"bannerExternalUrl\": \"\",\n \"bannerImageUrl\": \"\",\n \"bannerMobileExtraHdImageUrl\": \"\",\n \"bannerMobileHdImageUrl\": \"\",\n \"bannerMobileImageUrl\": \"\",\n \"bannerMobileLowImageUrl\": \"\",\n \"bannerMobileMediumHdImageUrl\": \"\",\n \"bannerTabletExtraHdImageUrl\": \"\",\n \"bannerTabletHdImageUrl\": \"\",\n \"bannerTabletImageUrl\": \"\",\n \"bannerTabletLowImageUrl\": \"\",\n \"bannerTvHighImageUrl\": \"\",\n \"bannerTvImageUrl\": \"\",\n \"bannerTvLowImageUrl\": \"\",\n \"bannerTvMediumImageUrl\": \"\",\n \"largeBrandedBannerImageImapScript\": {},\n \"largeBrandedBannerImageUrl\": {},\n \"smallBrandedBannerImageImapScript\": {},\n \"smallBrandedBannerImageUrl\": {},\n \"trackingImageUrl\": \"\",\n \"watchIconImageUrl\": \"\"\n },\n \"watch\": {\n \"backgroundColor\": \"\",\n \"featuredPlaylistId\": \"\",\n \"textColor\": \"\"\n }\n },\n \"contentDetails\": {\n \"relatedPlaylists\": {\n \"favorites\": \"\",\n \"likes\": \"\",\n \"uploads\": \"\",\n \"watchHistory\": \"\",\n \"watchLater\": \"\"\n }\n },\n \"contentOwnerDetails\": {\n \"contentOwner\": \"\",\n \"timeLinked\": \"\"\n },\n \"conversionPings\": {\n \"pings\": [\n {\n \"context\": \"\",\n \"conversionUrl\": \"\"\n }\n ]\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"localizations\": {},\n \"snippet\": {\n \"country\": \"\",\n \"customUrl\": \"\",\n \"defaultLanguage\": \"\",\n \"description\": \"\",\n \"localized\": {\n \"description\": \"\",\n \"title\": \"\"\n },\n \"publishedAt\": \"\",\n \"thumbnails\": {\n \"high\": {\n \"height\": 0,\n \"url\": \"\",\n \"width\": 0\n },\n \"maxres\": {},\n \"medium\": {},\n \"standard\": {}\n },\n \"title\": \"\"\n },\n \"statistics\": {\n \"commentCount\": \"\",\n \"hiddenSubscriberCount\": false,\n \"subscriberCount\": \"\",\n \"videoCount\": \"\",\n \"viewCount\": \"\"\n },\n \"status\": {\n \"isLinked\": false,\n \"longUploadsStatus\": \"\",\n \"madeForKids\": false,\n \"privacyStatus\": \"\",\n \"selfDeclaredMadeForKids\": false\n },\n \"topicDetails\": {\n \"topicCategories\": [],\n \"topicIds\": []\n }\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/youtube/v3/channels?part=");
var request = new RestRequest("", Method.Put);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"auditDetails\": {\n \"communityGuidelinesGoodStanding\": false,\n \"contentIdClaimsGoodStanding\": false,\n \"copyrightStrikesGoodStanding\": false\n },\n \"brandingSettings\": {\n \"channel\": {\n \"country\": \"\",\n \"defaultLanguage\": \"\",\n \"defaultTab\": \"\",\n \"description\": \"\",\n \"featuredChannelsTitle\": \"\",\n \"featuredChannelsUrls\": [],\n \"keywords\": \"\",\n \"moderateComments\": false,\n \"profileColor\": \"\",\n \"showBrowseView\": false,\n \"showRelatedChannels\": false,\n \"title\": \"\",\n \"trackingAnalyticsAccountId\": \"\",\n \"unsubscribedTrailer\": \"\"\n },\n \"hints\": [\n {\n \"property\": \"\",\n \"value\": \"\"\n }\n ],\n \"image\": {\n \"backgroundImageUrl\": {\n \"defaultLanguage\": {\n \"value\": \"\"\n },\n \"localized\": [\n {\n \"language\": \"\",\n \"value\": \"\"\n }\n ]\n },\n \"bannerExternalUrl\": \"\",\n \"bannerImageUrl\": \"\",\n \"bannerMobileExtraHdImageUrl\": \"\",\n \"bannerMobileHdImageUrl\": \"\",\n \"bannerMobileImageUrl\": \"\",\n \"bannerMobileLowImageUrl\": \"\",\n \"bannerMobileMediumHdImageUrl\": \"\",\n \"bannerTabletExtraHdImageUrl\": \"\",\n \"bannerTabletHdImageUrl\": \"\",\n \"bannerTabletImageUrl\": \"\",\n \"bannerTabletLowImageUrl\": \"\",\n \"bannerTvHighImageUrl\": \"\",\n \"bannerTvImageUrl\": \"\",\n \"bannerTvLowImageUrl\": \"\",\n \"bannerTvMediumImageUrl\": \"\",\n \"largeBrandedBannerImageImapScript\": {},\n \"largeBrandedBannerImageUrl\": {},\n \"smallBrandedBannerImageImapScript\": {},\n \"smallBrandedBannerImageUrl\": {},\n \"trackingImageUrl\": \"\",\n \"watchIconImageUrl\": \"\"\n },\n \"watch\": {\n \"backgroundColor\": \"\",\n \"featuredPlaylistId\": \"\",\n \"textColor\": \"\"\n }\n },\n \"contentDetails\": {\n \"relatedPlaylists\": {\n \"favorites\": \"\",\n \"likes\": \"\",\n \"uploads\": \"\",\n \"watchHistory\": \"\",\n \"watchLater\": \"\"\n }\n },\n \"contentOwnerDetails\": {\n \"contentOwner\": \"\",\n \"timeLinked\": \"\"\n },\n \"conversionPings\": {\n \"pings\": [\n {\n \"context\": \"\",\n \"conversionUrl\": \"\"\n }\n ]\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"localizations\": {},\n \"snippet\": {\n \"country\": \"\",\n \"customUrl\": \"\",\n \"defaultLanguage\": \"\",\n \"description\": \"\",\n \"localized\": {\n \"description\": \"\",\n \"title\": \"\"\n },\n \"publishedAt\": \"\",\n \"thumbnails\": {\n \"high\": {\n \"height\": 0,\n \"url\": \"\",\n \"width\": 0\n },\n \"maxres\": {},\n \"medium\": {},\n \"standard\": {}\n },\n \"title\": \"\"\n },\n \"statistics\": {\n \"commentCount\": \"\",\n \"hiddenSubscriberCount\": false,\n \"subscriberCount\": \"\",\n \"videoCount\": \"\",\n \"viewCount\": \"\"\n },\n \"status\": {\n \"isLinked\": false,\n \"longUploadsStatus\": \"\",\n \"madeForKids\": false,\n \"privacyStatus\": \"\",\n \"selfDeclaredMadeForKids\": false\n },\n \"topicDetails\": {\n \"topicCategories\": [],\n \"topicIds\": []\n }\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/youtube/v3/channels?part="
payload := strings.NewReader("{\n \"auditDetails\": {\n \"communityGuidelinesGoodStanding\": false,\n \"contentIdClaimsGoodStanding\": false,\n \"copyrightStrikesGoodStanding\": false\n },\n \"brandingSettings\": {\n \"channel\": {\n \"country\": \"\",\n \"defaultLanguage\": \"\",\n \"defaultTab\": \"\",\n \"description\": \"\",\n \"featuredChannelsTitle\": \"\",\n \"featuredChannelsUrls\": [],\n \"keywords\": \"\",\n \"moderateComments\": false,\n \"profileColor\": \"\",\n \"showBrowseView\": false,\n \"showRelatedChannels\": false,\n \"title\": \"\",\n \"trackingAnalyticsAccountId\": \"\",\n \"unsubscribedTrailer\": \"\"\n },\n \"hints\": [\n {\n \"property\": \"\",\n \"value\": \"\"\n }\n ],\n \"image\": {\n \"backgroundImageUrl\": {\n \"defaultLanguage\": {\n \"value\": \"\"\n },\n \"localized\": [\n {\n \"language\": \"\",\n \"value\": \"\"\n }\n ]\n },\n \"bannerExternalUrl\": \"\",\n \"bannerImageUrl\": \"\",\n \"bannerMobileExtraHdImageUrl\": \"\",\n \"bannerMobileHdImageUrl\": \"\",\n \"bannerMobileImageUrl\": \"\",\n \"bannerMobileLowImageUrl\": \"\",\n \"bannerMobileMediumHdImageUrl\": \"\",\n \"bannerTabletExtraHdImageUrl\": \"\",\n \"bannerTabletHdImageUrl\": \"\",\n \"bannerTabletImageUrl\": \"\",\n \"bannerTabletLowImageUrl\": \"\",\n \"bannerTvHighImageUrl\": \"\",\n \"bannerTvImageUrl\": \"\",\n \"bannerTvLowImageUrl\": \"\",\n \"bannerTvMediumImageUrl\": \"\",\n \"largeBrandedBannerImageImapScript\": {},\n \"largeBrandedBannerImageUrl\": {},\n \"smallBrandedBannerImageImapScript\": {},\n \"smallBrandedBannerImageUrl\": {},\n \"trackingImageUrl\": \"\",\n \"watchIconImageUrl\": \"\"\n },\n \"watch\": {\n \"backgroundColor\": \"\",\n \"featuredPlaylistId\": \"\",\n \"textColor\": \"\"\n }\n },\n \"contentDetails\": {\n \"relatedPlaylists\": {\n \"favorites\": \"\",\n \"likes\": \"\",\n \"uploads\": \"\",\n \"watchHistory\": \"\",\n \"watchLater\": \"\"\n }\n },\n \"contentOwnerDetails\": {\n \"contentOwner\": \"\",\n \"timeLinked\": \"\"\n },\n \"conversionPings\": {\n \"pings\": [\n {\n \"context\": \"\",\n \"conversionUrl\": \"\"\n }\n ]\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"localizations\": {},\n \"snippet\": {\n \"country\": \"\",\n \"customUrl\": \"\",\n \"defaultLanguage\": \"\",\n \"description\": \"\",\n \"localized\": {\n \"description\": \"\",\n \"title\": \"\"\n },\n \"publishedAt\": \"\",\n \"thumbnails\": {\n \"high\": {\n \"height\": 0,\n \"url\": \"\",\n \"width\": 0\n },\n \"maxres\": {},\n \"medium\": {},\n \"standard\": {}\n },\n \"title\": \"\"\n },\n \"statistics\": {\n \"commentCount\": \"\",\n \"hiddenSubscriberCount\": false,\n \"subscriberCount\": \"\",\n \"videoCount\": \"\",\n \"viewCount\": \"\"\n },\n \"status\": {\n \"isLinked\": false,\n \"longUploadsStatus\": \"\",\n \"madeForKids\": false,\n \"privacyStatus\": \"\",\n \"selfDeclaredMadeForKids\": false\n },\n \"topicDetails\": {\n \"topicCategories\": [],\n \"topicIds\": []\n }\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PUT /baseUrl/youtube/v3/channels?part= HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 2998
{
"auditDetails": {
"communityGuidelinesGoodStanding": false,
"contentIdClaimsGoodStanding": false,
"copyrightStrikesGoodStanding": false
},
"brandingSettings": {
"channel": {
"country": "",
"defaultLanguage": "",
"defaultTab": "",
"description": "",
"featuredChannelsTitle": "",
"featuredChannelsUrls": [],
"keywords": "",
"moderateComments": false,
"profileColor": "",
"showBrowseView": false,
"showRelatedChannels": false,
"title": "",
"trackingAnalyticsAccountId": "",
"unsubscribedTrailer": ""
},
"hints": [
{
"property": "",
"value": ""
}
],
"image": {
"backgroundImageUrl": {
"defaultLanguage": {
"value": ""
},
"localized": [
{
"language": "",
"value": ""
}
]
},
"bannerExternalUrl": "",
"bannerImageUrl": "",
"bannerMobileExtraHdImageUrl": "",
"bannerMobileHdImageUrl": "",
"bannerMobileImageUrl": "",
"bannerMobileLowImageUrl": "",
"bannerMobileMediumHdImageUrl": "",
"bannerTabletExtraHdImageUrl": "",
"bannerTabletHdImageUrl": "",
"bannerTabletImageUrl": "",
"bannerTabletLowImageUrl": "",
"bannerTvHighImageUrl": "",
"bannerTvImageUrl": "",
"bannerTvLowImageUrl": "",
"bannerTvMediumImageUrl": "",
"largeBrandedBannerImageImapScript": {},
"largeBrandedBannerImageUrl": {},
"smallBrandedBannerImageImapScript": {},
"smallBrandedBannerImageUrl": {},
"trackingImageUrl": "",
"watchIconImageUrl": ""
},
"watch": {
"backgroundColor": "",
"featuredPlaylistId": "",
"textColor": ""
}
},
"contentDetails": {
"relatedPlaylists": {
"favorites": "",
"likes": "",
"uploads": "",
"watchHistory": "",
"watchLater": ""
}
},
"contentOwnerDetails": {
"contentOwner": "",
"timeLinked": ""
},
"conversionPings": {
"pings": [
{
"context": "",
"conversionUrl": ""
}
]
},
"etag": "",
"id": "",
"kind": "",
"localizations": {},
"snippet": {
"country": "",
"customUrl": "",
"defaultLanguage": "",
"description": "",
"localized": {
"description": "",
"title": ""
},
"publishedAt": "",
"thumbnails": {
"high": {
"height": 0,
"url": "",
"width": 0
},
"maxres": {},
"medium": {},
"standard": {}
},
"title": ""
},
"statistics": {
"commentCount": "",
"hiddenSubscriberCount": false,
"subscriberCount": "",
"videoCount": "",
"viewCount": ""
},
"status": {
"isLinked": false,
"longUploadsStatus": "",
"madeForKids": false,
"privacyStatus": "",
"selfDeclaredMadeForKids": false
},
"topicDetails": {
"topicCategories": [],
"topicIds": []
}
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/youtube/v3/channels?part=")
.setHeader("content-type", "application/json")
.setBody("{\n \"auditDetails\": {\n \"communityGuidelinesGoodStanding\": false,\n \"contentIdClaimsGoodStanding\": false,\n \"copyrightStrikesGoodStanding\": false\n },\n \"brandingSettings\": {\n \"channel\": {\n \"country\": \"\",\n \"defaultLanguage\": \"\",\n \"defaultTab\": \"\",\n \"description\": \"\",\n \"featuredChannelsTitle\": \"\",\n \"featuredChannelsUrls\": [],\n \"keywords\": \"\",\n \"moderateComments\": false,\n \"profileColor\": \"\",\n \"showBrowseView\": false,\n \"showRelatedChannels\": false,\n \"title\": \"\",\n \"trackingAnalyticsAccountId\": \"\",\n \"unsubscribedTrailer\": \"\"\n },\n \"hints\": [\n {\n \"property\": \"\",\n \"value\": \"\"\n }\n ],\n \"image\": {\n \"backgroundImageUrl\": {\n \"defaultLanguage\": {\n \"value\": \"\"\n },\n \"localized\": [\n {\n \"language\": \"\",\n \"value\": \"\"\n }\n ]\n },\n \"bannerExternalUrl\": \"\",\n \"bannerImageUrl\": \"\",\n \"bannerMobileExtraHdImageUrl\": \"\",\n \"bannerMobileHdImageUrl\": \"\",\n \"bannerMobileImageUrl\": \"\",\n \"bannerMobileLowImageUrl\": \"\",\n \"bannerMobileMediumHdImageUrl\": \"\",\n \"bannerTabletExtraHdImageUrl\": \"\",\n \"bannerTabletHdImageUrl\": \"\",\n \"bannerTabletImageUrl\": \"\",\n \"bannerTabletLowImageUrl\": \"\",\n \"bannerTvHighImageUrl\": \"\",\n \"bannerTvImageUrl\": \"\",\n \"bannerTvLowImageUrl\": \"\",\n \"bannerTvMediumImageUrl\": \"\",\n \"largeBrandedBannerImageImapScript\": {},\n \"largeBrandedBannerImageUrl\": {},\n \"smallBrandedBannerImageImapScript\": {},\n \"smallBrandedBannerImageUrl\": {},\n \"trackingImageUrl\": \"\",\n \"watchIconImageUrl\": \"\"\n },\n \"watch\": {\n \"backgroundColor\": \"\",\n \"featuredPlaylistId\": \"\",\n \"textColor\": \"\"\n }\n },\n \"contentDetails\": {\n \"relatedPlaylists\": {\n \"favorites\": \"\",\n \"likes\": \"\",\n \"uploads\": \"\",\n \"watchHistory\": \"\",\n \"watchLater\": \"\"\n }\n },\n \"contentOwnerDetails\": {\n \"contentOwner\": \"\",\n \"timeLinked\": \"\"\n },\n \"conversionPings\": {\n \"pings\": [\n {\n \"context\": \"\",\n \"conversionUrl\": \"\"\n }\n ]\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"localizations\": {},\n \"snippet\": {\n \"country\": \"\",\n \"customUrl\": \"\",\n \"defaultLanguage\": \"\",\n \"description\": \"\",\n \"localized\": {\n \"description\": \"\",\n \"title\": \"\"\n },\n \"publishedAt\": \"\",\n \"thumbnails\": {\n \"high\": {\n \"height\": 0,\n \"url\": \"\",\n \"width\": 0\n },\n \"maxres\": {},\n \"medium\": {},\n \"standard\": {}\n },\n \"title\": \"\"\n },\n \"statistics\": {\n \"commentCount\": \"\",\n \"hiddenSubscriberCount\": false,\n \"subscriberCount\": \"\",\n \"videoCount\": \"\",\n \"viewCount\": \"\"\n },\n \"status\": {\n \"isLinked\": false,\n \"longUploadsStatus\": \"\",\n \"madeForKids\": false,\n \"privacyStatus\": \"\",\n \"selfDeclaredMadeForKids\": false\n },\n \"topicDetails\": {\n \"topicCategories\": [],\n \"topicIds\": []\n }\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/youtube/v3/channels?part="))
.header("content-type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString("{\n \"auditDetails\": {\n \"communityGuidelinesGoodStanding\": false,\n \"contentIdClaimsGoodStanding\": false,\n \"copyrightStrikesGoodStanding\": false\n },\n \"brandingSettings\": {\n \"channel\": {\n \"country\": \"\",\n \"defaultLanguage\": \"\",\n \"defaultTab\": \"\",\n \"description\": \"\",\n \"featuredChannelsTitle\": \"\",\n \"featuredChannelsUrls\": [],\n \"keywords\": \"\",\n \"moderateComments\": false,\n \"profileColor\": \"\",\n \"showBrowseView\": false,\n \"showRelatedChannels\": false,\n \"title\": \"\",\n \"trackingAnalyticsAccountId\": \"\",\n \"unsubscribedTrailer\": \"\"\n },\n \"hints\": [\n {\n \"property\": \"\",\n \"value\": \"\"\n }\n ],\n \"image\": {\n \"backgroundImageUrl\": {\n \"defaultLanguage\": {\n \"value\": \"\"\n },\n \"localized\": [\n {\n \"language\": \"\",\n \"value\": \"\"\n }\n ]\n },\n \"bannerExternalUrl\": \"\",\n \"bannerImageUrl\": \"\",\n \"bannerMobileExtraHdImageUrl\": \"\",\n \"bannerMobileHdImageUrl\": \"\",\n \"bannerMobileImageUrl\": \"\",\n \"bannerMobileLowImageUrl\": \"\",\n \"bannerMobileMediumHdImageUrl\": \"\",\n \"bannerTabletExtraHdImageUrl\": \"\",\n \"bannerTabletHdImageUrl\": \"\",\n \"bannerTabletImageUrl\": \"\",\n \"bannerTabletLowImageUrl\": \"\",\n \"bannerTvHighImageUrl\": \"\",\n \"bannerTvImageUrl\": \"\",\n \"bannerTvLowImageUrl\": \"\",\n \"bannerTvMediumImageUrl\": \"\",\n \"largeBrandedBannerImageImapScript\": {},\n \"largeBrandedBannerImageUrl\": {},\n \"smallBrandedBannerImageImapScript\": {},\n \"smallBrandedBannerImageUrl\": {},\n \"trackingImageUrl\": \"\",\n \"watchIconImageUrl\": \"\"\n },\n \"watch\": {\n \"backgroundColor\": \"\",\n \"featuredPlaylistId\": \"\",\n \"textColor\": \"\"\n }\n },\n \"contentDetails\": {\n \"relatedPlaylists\": {\n \"favorites\": \"\",\n \"likes\": \"\",\n \"uploads\": \"\",\n \"watchHistory\": \"\",\n \"watchLater\": \"\"\n }\n },\n \"contentOwnerDetails\": {\n \"contentOwner\": \"\",\n \"timeLinked\": \"\"\n },\n \"conversionPings\": {\n \"pings\": [\n {\n \"context\": \"\",\n \"conversionUrl\": \"\"\n }\n ]\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"localizations\": {},\n \"snippet\": {\n \"country\": \"\",\n \"customUrl\": \"\",\n \"defaultLanguage\": \"\",\n \"description\": \"\",\n \"localized\": {\n \"description\": \"\",\n \"title\": \"\"\n },\n \"publishedAt\": \"\",\n \"thumbnails\": {\n \"high\": {\n \"height\": 0,\n \"url\": \"\",\n \"width\": 0\n },\n \"maxres\": {},\n \"medium\": {},\n \"standard\": {}\n },\n \"title\": \"\"\n },\n \"statistics\": {\n \"commentCount\": \"\",\n \"hiddenSubscriberCount\": false,\n \"subscriberCount\": \"\",\n \"videoCount\": \"\",\n \"viewCount\": \"\"\n },\n \"status\": {\n \"isLinked\": false,\n \"longUploadsStatus\": \"\",\n \"madeForKids\": false,\n \"privacyStatus\": \"\",\n \"selfDeclaredMadeForKids\": false\n },\n \"topicDetails\": {\n \"topicCategories\": [],\n \"topicIds\": []\n }\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"auditDetails\": {\n \"communityGuidelinesGoodStanding\": false,\n \"contentIdClaimsGoodStanding\": false,\n \"copyrightStrikesGoodStanding\": false\n },\n \"brandingSettings\": {\n \"channel\": {\n \"country\": \"\",\n \"defaultLanguage\": \"\",\n \"defaultTab\": \"\",\n \"description\": \"\",\n \"featuredChannelsTitle\": \"\",\n \"featuredChannelsUrls\": [],\n \"keywords\": \"\",\n \"moderateComments\": false,\n \"profileColor\": \"\",\n \"showBrowseView\": false,\n \"showRelatedChannels\": false,\n \"title\": \"\",\n \"trackingAnalyticsAccountId\": \"\",\n \"unsubscribedTrailer\": \"\"\n },\n \"hints\": [\n {\n \"property\": \"\",\n \"value\": \"\"\n }\n ],\n \"image\": {\n \"backgroundImageUrl\": {\n \"defaultLanguage\": {\n \"value\": \"\"\n },\n \"localized\": [\n {\n \"language\": \"\",\n \"value\": \"\"\n }\n ]\n },\n \"bannerExternalUrl\": \"\",\n \"bannerImageUrl\": \"\",\n \"bannerMobileExtraHdImageUrl\": \"\",\n \"bannerMobileHdImageUrl\": \"\",\n \"bannerMobileImageUrl\": \"\",\n \"bannerMobileLowImageUrl\": \"\",\n \"bannerMobileMediumHdImageUrl\": \"\",\n \"bannerTabletExtraHdImageUrl\": \"\",\n \"bannerTabletHdImageUrl\": \"\",\n \"bannerTabletImageUrl\": \"\",\n \"bannerTabletLowImageUrl\": \"\",\n \"bannerTvHighImageUrl\": \"\",\n \"bannerTvImageUrl\": \"\",\n \"bannerTvLowImageUrl\": \"\",\n \"bannerTvMediumImageUrl\": \"\",\n \"largeBrandedBannerImageImapScript\": {},\n \"largeBrandedBannerImageUrl\": {},\n \"smallBrandedBannerImageImapScript\": {},\n \"smallBrandedBannerImageUrl\": {},\n \"trackingImageUrl\": \"\",\n \"watchIconImageUrl\": \"\"\n },\n \"watch\": {\n \"backgroundColor\": \"\",\n \"featuredPlaylistId\": \"\",\n \"textColor\": \"\"\n }\n },\n \"contentDetails\": {\n \"relatedPlaylists\": {\n \"favorites\": \"\",\n \"likes\": \"\",\n \"uploads\": \"\",\n \"watchHistory\": \"\",\n \"watchLater\": \"\"\n }\n },\n \"contentOwnerDetails\": {\n \"contentOwner\": \"\",\n \"timeLinked\": \"\"\n },\n \"conversionPings\": {\n \"pings\": [\n {\n \"context\": \"\",\n \"conversionUrl\": \"\"\n }\n ]\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"localizations\": {},\n \"snippet\": {\n \"country\": \"\",\n \"customUrl\": \"\",\n \"defaultLanguage\": \"\",\n \"description\": \"\",\n \"localized\": {\n \"description\": \"\",\n \"title\": \"\"\n },\n \"publishedAt\": \"\",\n \"thumbnails\": {\n \"high\": {\n \"height\": 0,\n \"url\": \"\",\n \"width\": 0\n },\n \"maxres\": {},\n \"medium\": {},\n \"standard\": {}\n },\n \"title\": \"\"\n },\n \"statistics\": {\n \"commentCount\": \"\",\n \"hiddenSubscriberCount\": false,\n \"subscriberCount\": \"\",\n \"videoCount\": \"\",\n \"viewCount\": \"\"\n },\n \"status\": {\n \"isLinked\": false,\n \"longUploadsStatus\": \"\",\n \"madeForKids\": false,\n \"privacyStatus\": \"\",\n \"selfDeclaredMadeForKids\": false\n },\n \"topicDetails\": {\n \"topicCategories\": [],\n \"topicIds\": []\n }\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/youtube/v3/channels?part=")
.put(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/youtube/v3/channels?part=")
.header("content-type", "application/json")
.body("{\n \"auditDetails\": {\n \"communityGuidelinesGoodStanding\": false,\n \"contentIdClaimsGoodStanding\": false,\n \"copyrightStrikesGoodStanding\": false\n },\n \"brandingSettings\": {\n \"channel\": {\n \"country\": \"\",\n \"defaultLanguage\": \"\",\n \"defaultTab\": \"\",\n \"description\": \"\",\n \"featuredChannelsTitle\": \"\",\n \"featuredChannelsUrls\": [],\n \"keywords\": \"\",\n \"moderateComments\": false,\n \"profileColor\": \"\",\n \"showBrowseView\": false,\n \"showRelatedChannels\": false,\n \"title\": \"\",\n \"trackingAnalyticsAccountId\": \"\",\n \"unsubscribedTrailer\": \"\"\n },\n \"hints\": [\n {\n \"property\": \"\",\n \"value\": \"\"\n }\n ],\n \"image\": {\n \"backgroundImageUrl\": {\n \"defaultLanguage\": {\n \"value\": \"\"\n },\n \"localized\": [\n {\n \"language\": \"\",\n \"value\": \"\"\n }\n ]\n },\n \"bannerExternalUrl\": \"\",\n \"bannerImageUrl\": \"\",\n \"bannerMobileExtraHdImageUrl\": \"\",\n \"bannerMobileHdImageUrl\": \"\",\n \"bannerMobileImageUrl\": \"\",\n \"bannerMobileLowImageUrl\": \"\",\n \"bannerMobileMediumHdImageUrl\": \"\",\n \"bannerTabletExtraHdImageUrl\": \"\",\n \"bannerTabletHdImageUrl\": \"\",\n \"bannerTabletImageUrl\": \"\",\n \"bannerTabletLowImageUrl\": \"\",\n \"bannerTvHighImageUrl\": \"\",\n \"bannerTvImageUrl\": \"\",\n \"bannerTvLowImageUrl\": \"\",\n \"bannerTvMediumImageUrl\": \"\",\n \"largeBrandedBannerImageImapScript\": {},\n \"largeBrandedBannerImageUrl\": {},\n \"smallBrandedBannerImageImapScript\": {},\n \"smallBrandedBannerImageUrl\": {},\n \"trackingImageUrl\": \"\",\n \"watchIconImageUrl\": \"\"\n },\n \"watch\": {\n \"backgroundColor\": \"\",\n \"featuredPlaylistId\": \"\",\n \"textColor\": \"\"\n }\n },\n \"contentDetails\": {\n \"relatedPlaylists\": {\n \"favorites\": \"\",\n \"likes\": \"\",\n \"uploads\": \"\",\n \"watchHistory\": \"\",\n \"watchLater\": \"\"\n }\n },\n \"contentOwnerDetails\": {\n \"contentOwner\": \"\",\n \"timeLinked\": \"\"\n },\n \"conversionPings\": {\n \"pings\": [\n {\n \"context\": \"\",\n \"conversionUrl\": \"\"\n }\n ]\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"localizations\": {},\n \"snippet\": {\n \"country\": \"\",\n \"customUrl\": \"\",\n \"defaultLanguage\": \"\",\n \"description\": \"\",\n \"localized\": {\n \"description\": \"\",\n \"title\": \"\"\n },\n \"publishedAt\": \"\",\n \"thumbnails\": {\n \"high\": {\n \"height\": 0,\n \"url\": \"\",\n \"width\": 0\n },\n \"maxres\": {},\n \"medium\": {},\n \"standard\": {}\n },\n \"title\": \"\"\n },\n \"statistics\": {\n \"commentCount\": \"\",\n \"hiddenSubscriberCount\": false,\n \"subscriberCount\": \"\",\n \"videoCount\": \"\",\n \"viewCount\": \"\"\n },\n \"status\": {\n \"isLinked\": false,\n \"longUploadsStatus\": \"\",\n \"madeForKids\": false,\n \"privacyStatus\": \"\",\n \"selfDeclaredMadeForKids\": false\n },\n \"topicDetails\": {\n \"topicCategories\": [],\n \"topicIds\": []\n }\n}")
.asString();
const data = JSON.stringify({
auditDetails: {
communityGuidelinesGoodStanding: false,
contentIdClaimsGoodStanding: false,
copyrightStrikesGoodStanding: false
},
brandingSettings: {
channel: {
country: '',
defaultLanguage: '',
defaultTab: '',
description: '',
featuredChannelsTitle: '',
featuredChannelsUrls: [],
keywords: '',
moderateComments: false,
profileColor: '',
showBrowseView: false,
showRelatedChannels: false,
title: '',
trackingAnalyticsAccountId: '',
unsubscribedTrailer: ''
},
hints: [
{
property: '',
value: ''
}
],
image: {
backgroundImageUrl: {
defaultLanguage: {
value: ''
},
localized: [
{
language: '',
value: ''
}
]
},
bannerExternalUrl: '',
bannerImageUrl: '',
bannerMobileExtraHdImageUrl: '',
bannerMobileHdImageUrl: '',
bannerMobileImageUrl: '',
bannerMobileLowImageUrl: '',
bannerMobileMediumHdImageUrl: '',
bannerTabletExtraHdImageUrl: '',
bannerTabletHdImageUrl: '',
bannerTabletImageUrl: '',
bannerTabletLowImageUrl: '',
bannerTvHighImageUrl: '',
bannerTvImageUrl: '',
bannerTvLowImageUrl: '',
bannerTvMediumImageUrl: '',
largeBrandedBannerImageImapScript: {},
largeBrandedBannerImageUrl: {},
smallBrandedBannerImageImapScript: {},
smallBrandedBannerImageUrl: {},
trackingImageUrl: '',
watchIconImageUrl: ''
},
watch: {
backgroundColor: '',
featuredPlaylistId: '',
textColor: ''
}
},
contentDetails: {
relatedPlaylists: {
favorites: '',
likes: '',
uploads: '',
watchHistory: '',
watchLater: ''
}
},
contentOwnerDetails: {
contentOwner: '',
timeLinked: ''
},
conversionPings: {
pings: [
{
context: '',
conversionUrl: ''
}
]
},
etag: '',
id: '',
kind: '',
localizations: {},
snippet: {
country: '',
customUrl: '',
defaultLanguage: '',
description: '',
localized: {
description: '',
title: ''
},
publishedAt: '',
thumbnails: {
high: {
height: 0,
url: '',
width: 0
},
maxres: {},
medium: {},
standard: {}
},
title: ''
},
statistics: {
commentCount: '',
hiddenSubscriberCount: false,
subscriberCount: '',
videoCount: '',
viewCount: ''
},
status: {
isLinked: false,
longUploadsStatus: '',
madeForKids: false,
privacyStatus: '',
selfDeclaredMadeForKids: false
},
topicDetails: {
topicCategories: [],
topicIds: []
}
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/youtube/v3/channels?part=');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/youtube/v3/channels',
params: {part: ''},
headers: {'content-type': 'application/json'},
data: {
auditDetails: {
communityGuidelinesGoodStanding: false,
contentIdClaimsGoodStanding: false,
copyrightStrikesGoodStanding: false
},
brandingSettings: {
channel: {
country: '',
defaultLanguage: '',
defaultTab: '',
description: '',
featuredChannelsTitle: '',
featuredChannelsUrls: [],
keywords: '',
moderateComments: false,
profileColor: '',
showBrowseView: false,
showRelatedChannels: false,
title: '',
trackingAnalyticsAccountId: '',
unsubscribedTrailer: ''
},
hints: [{property: '', value: ''}],
image: {
backgroundImageUrl: {defaultLanguage: {value: ''}, localized: [{language: '', value: ''}]},
bannerExternalUrl: '',
bannerImageUrl: '',
bannerMobileExtraHdImageUrl: '',
bannerMobileHdImageUrl: '',
bannerMobileImageUrl: '',
bannerMobileLowImageUrl: '',
bannerMobileMediumHdImageUrl: '',
bannerTabletExtraHdImageUrl: '',
bannerTabletHdImageUrl: '',
bannerTabletImageUrl: '',
bannerTabletLowImageUrl: '',
bannerTvHighImageUrl: '',
bannerTvImageUrl: '',
bannerTvLowImageUrl: '',
bannerTvMediumImageUrl: '',
largeBrandedBannerImageImapScript: {},
largeBrandedBannerImageUrl: {},
smallBrandedBannerImageImapScript: {},
smallBrandedBannerImageUrl: {},
trackingImageUrl: '',
watchIconImageUrl: ''
},
watch: {backgroundColor: '', featuredPlaylistId: '', textColor: ''}
},
contentDetails: {
relatedPlaylists: {favorites: '', likes: '', uploads: '', watchHistory: '', watchLater: ''}
},
contentOwnerDetails: {contentOwner: '', timeLinked: ''},
conversionPings: {pings: [{context: '', conversionUrl: ''}]},
etag: '',
id: '',
kind: '',
localizations: {},
snippet: {
country: '',
customUrl: '',
defaultLanguage: '',
description: '',
localized: {description: '', title: ''},
publishedAt: '',
thumbnails: {high: {height: 0, url: '', width: 0}, maxres: {}, medium: {}, standard: {}},
title: ''
},
statistics: {
commentCount: '',
hiddenSubscriberCount: false,
subscriberCount: '',
videoCount: '',
viewCount: ''
},
status: {
isLinked: false,
longUploadsStatus: '',
madeForKids: false,
privacyStatus: '',
selfDeclaredMadeForKids: false
},
topicDetails: {topicCategories: [], topicIds: []}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/youtube/v3/channels?part=';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"auditDetails":{"communityGuidelinesGoodStanding":false,"contentIdClaimsGoodStanding":false,"copyrightStrikesGoodStanding":false},"brandingSettings":{"channel":{"country":"","defaultLanguage":"","defaultTab":"","description":"","featuredChannelsTitle":"","featuredChannelsUrls":[],"keywords":"","moderateComments":false,"profileColor":"","showBrowseView":false,"showRelatedChannels":false,"title":"","trackingAnalyticsAccountId":"","unsubscribedTrailer":""},"hints":[{"property":"","value":""}],"image":{"backgroundImageUrl":{"defaultLanguage":{"value":""},"localized":[{"language":"","value":""}]},"bannerExternalUrl":"","bannerImageUrl":"","bannerMobileExtraHdImageUrl":"","bannerMobileHdImageUrl":"","bannerMobileImageUrl":"","bannerMobileLowImageUrl":"","bannerMobileMediumHdImageUrl":"","bannerTabletExtraHdImageUrl":"","bannerTabletHdImageUrl":"","bannerTabletImageUrl":"","bannerTabletLowImageUrl":"","bannerTvHighImageUrl":"","bannerTvImageUrl":"","bannerTvLowImageUrl":"","bannerTvMediumImageUrl":"","largeBrandedBannerImageImapScript":{},"largeBrandedBannerImageUrl":{},"smallBrandedBannerImageImapScript":{},"smallBrandedBannerImageUrl":{},"trackingImageUrl":"","watchIconImageUrl":""},"watch":{"backgroundColor":"","featuredPlaylistId":"","textColor":""}},"contentDetails":{"relatedPlaylists":{"favorites":"","likes":"","uploads":"","watchHistory":"","watchLater":""}},"contentOwnerDetails":{"contentOwner":"","timeLinked":""},"conversionPings":{"pings":[{"context":"","conversionUrl":""}]},"etag":"","id":"","kind":"","localizations":{},"snippet":{"country":"","customUrl":"","defaultLanguage":"","description":"","localized":{"description":"","title":""},"publishedAt":"","thumbnails":{"high":{"height":0,"url":"","width":0},"maxres":{},"medium":{},"standard":{}},"title":""},"statistics":{"commentCount":"","hiddenSubscriberCount":false,"subscriberCount":"","videoCount":"","viewCount":""},"status":{"isLinked":false,"longUploadsStatus":"","madeForKids":false,"privacyStatus":"","selfDeclaredMadeForKids":false},"topicDetails":{"topicCategories":[],"topicIds":[]}}'
};
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}}/youtube/v3/channels?part=',
method: 'PUT',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "auditDetails": {\n "communityGuidelinesGoodStanding": false,\n "contentIdClaimsGoodStanding": false,\n "copyrightStrikesGoodStanding": false\n },\n "brandingSettings": {\n "channel": {\n "country": "",\n "defaultLanguage": "",\n "defaultTab": "",\n "description": "",\n "featuredChannelsTitle": "",\n "featuredChannelsUrls": [],\n "keywords": "",\n "moderateComments": false,\n "profileColor": "",\n "showBrowseView": false,\n "showRelatedChannels": false,\n "title": "",\n "trackingAnalyticsAccountId": "",\n "unsubscribedTrailer": ""\n },\n "hints": [\n {\n "property": "",\n "value": ""\n }\n ],\n "image": {\n "backgroundImageUrl": {\n "defaultLanguage": {\n "value": ""\n },\n "localized": [\n {\n "language": "",\n "value": ""\n }\n ]\n },\n "bannerExternalUrl": "",\n "bannerImageUrl": "",\n "bannerMobileExtraHdImageUrl": "",\n "bannerMobileHdImageUrl": "",\n "bannerMobileImageUrl": "",\n "bannerMobileLowImageUrl": "",\n "bannerMobileMediumHdImageUrl": "",\n "bannerTabletExtraHdImageUrl": "",\n "bannerTabletHdImageUrl": "",\n "bannerTabletImageUrl": "",\n "bannerTabletLowImageUrl": "",\n "bannerTvHighImageUrl": "",\n "bannerTvImageUrl": "",\n "bannerTvLowImageUrl": "",\n "bannerTvMediumImageUrl": "",\n "largeBrandedBannerImageImapScript": {},\n "largeBrandedBannerImageUrl": {},\n "smallBrandedBannerImageImapScript": {},\n "smallBrandedBannerImageUrl": {},\n "trackingImageUrl": "",\n "watchIconImageUrl": ""\n },\n "watch": {\n "backgroundColor": "",\n "featuredPlaylistId": "",\n "textColor": ""\n }\n },\n "contentDetails": {\n "relatedPlaylists": {\n "favorites": "",\n "likes": "",\n "uploads": "",\n "watchHistory": "",\n "watchLater": ""\n }\n },\n "contentOwnerDetails": {\n "contentOwner": "",\n "timeLinked": ""\n },\n "conversionPings": {\n "pings": [\n {\n "context": "",\n "conversionUrl": ""\n }\n ]\n },\n "etag": "",\n "id": "",\n "kind": "",\n "localizations": {},\n "snippet": {\n "country": "",\n "customUrl": "",\n "defaultLanguage": "",\n "description": "",\n "localized": {\n "description": "",\n "title": ""\n },\n "publishedAt": "",\n "thumbnails": {\n "high": {\n "height": 0,\n "url": "",\n "width": 0\n },\n "maxres": {},\n "medium": {},\n "standard": {}\n },\n "title": ""\n },\n "statistics": {\n "commentCount": "",\n "hiddenSubscriberCount": false,\n "subscriberCount": "",\n "videoCount": "",\n "viewCount": ""\n },\n "status": {\n "isLinked": false,\n "longUploadsStatus": "",\n "madeForKids": false,\n "privacyStatus": "",\n "selfDeclaredMadeForKids": false\n },\n "topicDetails": {\n "topicCategories": [],\n "topicIds": []\n }\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"auditDetails\": {\n \"communityGuidelinesGoodStanding\": false,\n \"contentIdClaimsGoodStanding\": false,\n \"copyrightStrikesGoodStanding\": false\n },\n \"brandingSettings\": {\n \"channel\": {\n \"country\": \"\",\n \"defaultLanguage\": \"\",\n \"defaultTab\": \"\",\n \"description\": \"\",\n \"featuredChannelsTitle\": \"\",\n \"featuredChannelsUrls\": [],\n \"keywords\": \"\",\n \"moderateComments\": false,\n \"profileColor\": \"\",\n \"showBrowseView\": false,\n \"showRelatedChannels\": false,\n \"title\": \"\",\n \"trackingAnalyticsAccountId\": \"\",\n \"unsubscribedTrailer\": \"\"\n },\n \"hints\": [\n {\n \"property\": \"\",\n \"value\": \"\"\n }\n ],\n \"image\": {\n \"backgroundImageUrl\": {\n \"defaultLanguage\": {\n \"value\": \"\"\n },\n \"localized\": [\n {\n \"language\": \"\",\n \"value\": \"\"\n }\n ]\n },\n \"bannerExternalUrl\": \"\",\n \"bannerImageUrl\": \"\",\n \"bannerMobileExtraHdImageUrl\": \"\",\n \"bannerMobileHdImageUrl\": \"\",\n \"bannerMobileImageUrl\": \"\",\n \"bannerMobileLowImageUrl\": \"\",\n \"bannerMobileMediumHdImageUrl\": \"\",\n \"bannerTabletExtraHdImageUrl\": \"\",\n \"bannerTabletHdImageUrl\": \"\",\n \"bannerTabletImageUrl\": \"\",\n \"bannerTabletLowImageUrl\": \"\",\n \"bannerTvHighImageUrl\": \"\",\n \"bannerTvImageUrl\": \"\",\n \"bannerTvLowImageUrl\": \"\",\n \"bannerTvMediumImageUrl\": \"\",\n \"largeBrandedBannerImageImapScript\": {},\n \"largeBrandedBannerImageUrl\": {},\n \"smallBrandedBannerImageImapScript\": {},\n \"smallBrandedBannerImageUrl\": {},\n \"trackingImageUrl\": \"\",\n \"watchIconImageUrl\": \"\"\n },\n \"watch\": {\n \"backgroundColor\": \"\",\n \"featuredPlaylistId\": \"\",\n \"textColor\": \"\"\n }\n },\n \"contentDetails\": {\n \"relatedPlaylists\": {\n \"favorites\": \"\",\n \"likes\": \"\",\n \"uploads\": \"\",\n \"watchHistory\": \"\",\n \"watchLater\": \"\"\n }\n },\n \"contentOwnerDetails\": {\n \"contentOwner\": \"\",\n \"timeLinked\": \"\"\n },\n \"conversionPings\": {\n \"pings\": [\n {\n \"context\": \"\",\n \"conversionUrl\": \"\"\n }\n ]\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"localizations\": {},\n \"snippet\": {\n \"country\": \"\",\n \"customUrl\": \"\",\n \"defaultLanguage\": \"\",\n \"description\": \"\",\n \"localized\": {\n \"description\": \"\",\n \"title\": \"\"\n },\n \"publishedAt\": \"\",\n \"thumbnails\": {\n \"high\": {\n \"height\": 0,\n \"url\": \"\",\n \"width\": 0\n },\n \"maxres\": {},\n \"medium\": {},\n \"standard\": {}\n },\n \"title\": \"\"\n },\n \"statistics\": {\n \"commentCount\": \"\",\n \"hiddenSubscriberCount\": false,\n \"subscriberCount\": \"\",\n \"videoCount\": \"\",\n \"viewCount\": \"\"\n },\n \"status\": {\n \"isLinked\": false,\n \"longUploadsStatus\": \"\",\n \"madeForKids\": false,\n \"privacyStatus\": \"\",\n \"selfDeclaredMadeForKids\": false\n },\n \"topicDetails\": {\n \"topicCategories\": [],\n \"topicIds\": []\n }\n}")
val request = Request.Builder()
.url("{{baseUrl}}/youtube/v3/channels?part=")
.put(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PUT',
hostname: 'example.com',
port: null,
path: '/baseUrl/youtube/v3/channels?part=',
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({
auditDetails: {
communityGuidelinesGoodStanding: false,
contentIdClaimsGoodStanding: false,
copyrightStrikesGoodStanding: false
},
brandingSettings: {
channel: {
country: '',
defaultLanguage: '',
defaultTab: '',
description: '',
featuredChannelsTitle: '',
featuredChannelsUrls: [],
keywords: '',
moderateComments: false,
profileColor: '',
showBrowseView: false,
showRelatedChannels: false,
title: '',
trackingAnalyticsAccountId: '',
unsubscribedTrailer: ''
},
hints: [{property: '', value: ''}],
image: {
backgroundImageUrl: {defaultLanguage: {value: ''}, localized: [{language: '', value: ''}]},
bannerExternalUrl: '',
bannerImageUrl: '',
bannerMobileExtraHdImageUrl: '',
bannerMobileHdImageUrl: '',
bannerMobileImageUrl: '',
bannerMobileLowImageUrl: '',
bannerMobileMediumHdImageUrl: '',
bannerTabletExtraHdImageUrl: '',
bannerTabletHdImageUrl: '',
bannerTabletImageUrl: '',
bannerTabletLowImageUrl: '',
bannerTvHighImageUrl: '',
bannerTvImageUrl: '',
bannerTvLowImageUrl: '',
bannerTvMediumImageUrl: '',
largeBrandedBannerImageImapScript: {},
largeBrandedBannerImageUrl: {},
smallBrandedBannerImageImapScript: {},
smallBrandedBannerImageUrl: {},
trackingImageUrl: '',
watchIconImageUrl: ''
},
watch: {backgroundColor: '', featuredPlaylistId: '', textColor: ''}
},
contentDetails: {
relatedPlaylists: {favorites: '', likes: '', uploads: '', watchHistory: '', watchLater: ''}
},
contentOwnerDetails: {contentOwner: '', timeLinked: ''},
conversionPings: {pings: [{context: '', conversionUrl: ''}]},
etag: '',
id: '',
kind: '',
localizations: {},
snippet: {
country: '',
customUrl: '',
defaultLanguage: '',
description: '',
localized: {description: '', title: ''},
publishedAt: '',
thumbnails: {high: {height: 0, url: '', width: 0}, maxres: {}, medium: {}, standard: {}},
title: ''
},
statistics: {
commentCount: '',
hiddenSubscriberCount: false,
subscriberCount: '',
videoCount: '',
viewCount: ''
},
status: {
isLinked: false,
longUploadsStatus: '',
madeForKids: false,
privacyStatus: '',
selfDeclaredMadeForKids: false
},
topicDetails: {topicCategories: [], topicIds: []}
}));
req.end();
const request = require('request');
const options = {
method: 'PUT',
url: '{{baseUrl}}/youtube/v3/channels',
qs: {part: ''},
headers: {'content-type': 'application/json'},
body: {
auditDetails: {
communityGuidelinesGoodStanding: false,
contentIdClaimsGoodStanding: false,
copyrightStrikesGoodStanding: false
},
brandingSettings: {
channel: {
country: '',
defaultLanguage: '',
defaultTab: '',
description: '',
featuredChannelsTitle: '',
featuredChannelsUrls: [],
keywords: '',
moderateComments: false,
profileColor: '',
showBrowseView: false,
showRelatedChannels: false,
title: '',
trackingAnalyticsAccountId: '',
unsubscribedTrailer: ''
},
hints: [{property: '', value: ''}],
image: {
backgroundImageUrl: {defaultLanguage: {value: ''}, localized: [{language: '', value: ''}]},
bannerExternalUrl: '',
bannerImageUrl: '',
bannerMobileExtraHdImageUrl: '',
bannerMobileHdImageUrl: '',
bannerMobileImageUrl: '',
bannerMobileLowImageUrl: '',
bannerMobileMediumHdImageUrl: '',
bannerTabletExtraHdImageUrl: '',
bannerTabletHdImageUrl: '',
bannerTabletImageUrl: '',
bannerTabletLowImageUrl: '',
bannerTvHighImageUrl: '',
bannerTvImageUrl: '',
bannerTvLowImageUrl: '',
bannerTvMediumImageUrl: '',
largeBrandedBannerImageImapScript: {},
largeBrandedBannerImageUrl: {},
smallBrandedBannerImageImapScript: {},
smallBrandedBannerImageUrl: {},
trackingImageUrl: '',
watchIconImageUrl: ''
},
watch: {backgroundColor: '', featuredPlaylistId: '', textColor: ''}
},
contentDetails: {
relatedPlaylists: {favorites: '', likes: '', uploads: '', watchHistory: '', watchLater: ''}
},
contentOwnerDetails: {contentOwner: '', timeLinked: ''},
conversionPings: {pings: [{context: '', conversionUrl: ''}]},
etag: '',
id: '',
kind: '',
localizations: {},
snippet: {
country: '',
customUrl: '',
defaultLanguage: '',
description: '',
localized: {description: '', title: ''},
publishedAt: '',
thumbnails: {high: {height: 0, url: '', width: 0}, maxres: {}, medium: {}, standard: {}},
title: ''
},
statistics: {
commentCount: '',
hiddenSubscriberCount: false,
subscriberCount: '',
videoCount: '',
viewCount: ''
},
status: {
isLinked: false,
longUploadsStatus: '',
madeForKids: false,
privacyStatus: '',
selfDeclaredMadeForKids: false
},
topicDetails: {topicCategories: [], topicIds: []}
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PUT', '{{baseUrl}}/youtube/v3/channels');
req.query({
part: ''
});
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
auditDetails: {
communityGuidelinesGoodStanding: false,
contentIdClaimsGoodStanding: false,
copyrightStrikesGoodStanding: false
},
brandingSettings: {
channel: {
country: '',
defaultLanguage: '',
defaultTab: '',
description: '',
featuredChannelsTitle: '',
featuredChannelsUrls: [],
keywords: '',
moderateComments: false,
profileColor: '',
showBrowseView: false,
showRelatedChannels: false,
title: '',
trackingAnalyticsAccountId: '',
unsubscribedTrailer: ''
},
hints: [
{
property: '',
value: ''
}
],
image: {
backgroundImageUrl: {
defaultLanguage: {
value: ''
},
localized: [
{
language: '',
value: ''
}
]
},
bannerExternalUrl: '',
bannerImageUrl: '',
bannerMobileExtraHdImageUrl: '',
bannerMobileHdImageUrl: '',
bannerMobileImageUrl: '',
bannerMobileLowImageUrl: '',
bannerMobileMediumHdImageUrl: '',
bannerTabletExtraHdImageUrl: '',
bannerTabletHdImageUrl: '',
bannerTabletImageUrl: '',
bannerTabletLowImageUrl: '',
bannerTvHighImageUrl: '',
bannerTvImageUrl: '',
bannerTvLowImageUrl: '',
bannerTvMediumImageUrl: '',
largeBrandedBannerImageImapScript: {},
largeBrandedBannerImageUrl: {},
smallBrandedBannerImageImapScript: {},
smallBrandedBannerImageUrl: {},
trackingImageUrl: '',
watchIconImageUrl: ''
},
watch: {
backgroundColor: '',
featuredPlaylistId: '',
textColor: ''
}
},
contentDetails: {
relatedPlaylists: {
favorites: '',
likes: '',
uploads: '',
watchHistory: '',
watchLater: ''
}
},
contentOwnerDetails: {
contentOwner: '',
timeLinked: ''
},
conversionPings: {
pings: [
{
context: '',
conversionUrl: ''
}
]
},
etag: '',
id: '',
kind: '',
localizations: {},
snippet: {
country: '',
customUrl: '',
defaultLanguage: '',
description: '',
localized: {
description: '',
title: ''
},
publishedAt: '',
thumbnails: {
high: {
height: 0,
url: '',
width: 0
},
maxres: {},
medium: {},
standard: {}
},
title: ''
},
statistics: {
commentCount: '',
hiddenSubscriberCount: false,
subscriberCount: '',
videoCount: '',
viewCount: ''
},
status: {
isLinked: false,
longUploadsStatus: '',
madeForKids: false,
privacyStatus: '',
selfDeclaredMadeForKids: false
},
topicDetails: {
topicCategories: [],
topicIds: []
}
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'PUT',
url: '{{baseUrl}}/youtube/v3/channels',
params: {part: ''},
headers: {'content-type': 'application/json'},
data: {
auditDetails: {
communityGuidelinesGoodStanding: false,
contentIdClaimsGoodStanding: false,
copyrightStrikesGoodStanding: false
},
brandingSettings: {
channel: {
country: '',
defaultLanguage: '',
defaultTab: '',
description: '',
featuredChannelsTitle: '',
featuredChannelsUrls: [],
keywords: '',
moderateComments: false,
profileColor: '',
showBrowseView: false,
showRelatedChannels: false,
title: '',
trackingAnalyticsAccountId: '',
unsubscribedTrailer: ''
},
hints: [{property: '', value: ''}],
image: {
backgroundImageUrl: {defaultLanguage: {value: ''}, localized: [{language: '', value: ''}]},
bannerExternalUrl: '',
bannerImageUrl: '',
bannerMobileExtraHdImageUrl: '',
bannerMobileHdImageUrl: '',
bannerMobileImageUrl: '',
bannerMobileLowImageUrl: '',
bannerMobileMediumHdImageUrl: '',
bannerTabletExtraHdImageUrl: '',
bannerTabletHdImageUrl: '',
bannerTabletImageUrl: '',
bannerTabletLowImageUrl: '',
bannerTvHighImageUrl: '',
bannerTvImageUrl: '',
bannerTvLowImageUrl: '',
bannerTvMediumImageUrl: '',
largeBrandedBannerImageImapScript: {},
largeBrandedBannerImageUrl: {},
smallBrandedBannerImageImapScript: {},
smallBrandedBannerImageUrl: {},
trackingImageUrl: '',
watchIconImageUrl: ''
},
watch: {backgroundColor: '', featuredPlaylistId: '', textColor: ''}
},
contentDetails: {
relatedPlaylists: {favorites: '', likes: '', uploads: '', watchHistory: '', watchLater: ''}
},
contentOwnerDetails: {contentOwner: '', timeLinked: ''},
conversionPings: {pings: [{context: '', conversionUrl: ''}]},
etag: '',
id: '',
kind: '',
localizations: {},
snippet: {
country: '',
customUrl: '',
defaultLanguage: '',
description: '',
localized: {description: '', title: ''},
publishedAt: '',
thumbnails: {high: {height: 0, url: '', width: 0}, maxres: {}, medium: {}, standard: {}},
title: ''
},
statistics: {
commentCount: '',
hiddenSubscriberCount: false,
subscriberCount: '',
videoCount: '',
viewCount: ''
},
status: {
isLinked: false,
longUploadsStatus: '',
madeForKids: false,
privacyStatus: '',
selfDeclaredMadeForKids: false
},
topicDetails: {topicCategories: [], topicIds: []}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/youtube/v3/channels?part=';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"auditDetails":{"communityGuidelinesGoodStanding":false,"contentIdClaimsGoodStanding":false,"copyrightStrikesGoodStanding":false},"brandingSettings":{"channel":{"country":"","defaultLanguage":"","defaultTab":"","description":"","featuredChannelsTitle":"","featuredChannelsUrls":[],"keywords":"","moderateComments":false,"profileColor":"","showBrowseView":false,"showRelatedChannels":false,"title":"","trackingAnalyticsAccountId":"","unsubscribedTrailer":""},"hints":[{"property":"","value":""}],"image":{"backgroundImageUrl":{"defaultLanguage":{"value":""},"localized":[{"language":"","value":""}]},"bannerExternalUrl":"","bannerImageUrl":"","bannerMobileExtraHdImageUrl":"","bannerMobileHdImageUrl":"","bannerMobileImageUrl":"","bannerMobileLowImageUrl":"","bannerMobileMediumHdImageUrl":"","bannerTabletExtraHdImageUrl":"","bannerTabletHdImageUrl":"","bannerTabletImageUrl":"","bannerTabletLowImageUrl":"","bannerTvHighImageUrl":"","bannerTvImageUrl":"","bannerTvLowImageUrl":"","bannerTvMediumImageUrl":"","largeBrandedBannerImageImapScript":{},"largeBrandedBannerImageUrl":{},"smallBrandedBannerImageImapScript":{},"smallBrandedBannerImageUrl":{},"trackingImageUrl":"","watchIconImageUrl":""},"watch":{"backgroundColor":"","featuredPlaylistId":"","textColor":""}},"contentDetails":{"relatedPlaylists":{"favorites":"","likes":"","uploads":"","watchHistory":"","watchLater":""}},"contentOwnerDetails":{"contentOwner":"","timeLinked":""},"conversionPings":{"pings":[{"context":"","conversionUrl":""}]},"etag":"","id":"","kind":"","localizations":{},"snippet":{"country":"","customUrl":"","defaultLanguage":"","description":"","localized":{"description":"","title":""},"publishedAt":"","thumbnails":{"high":{"height":0,"url":"","width":0},"maxres":{},"medium":{},"standard":{}},"title":""},"statistics":{"commentCount":"","hiddenSubscriberCount":false,"subscriberCount":"","videoCount":"","viewCount":""},"status":{"isLinked":false,"longUploadsStatus":"","madeForKids":false,"privacyStatus":"","selfDeclaredMadeForKids":false},"topicDetails":{"topicCategories":[],"topicIds":[]}}'
};
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 = @{ @"auditDetails": @{ @"communityGuidelinesGoodStanding": @NO, @"contentIdClaimsGoodStanding": @NO, @"copyrightStrikesGoodStanding": @NO },
@"brandingSettings": @{ @"channel": @{ @"country": @"", @"defaultLanguage": @"", @"defaultTab": @"", @"description": @"", @"featuredChannelsTitle": @"", @"featuredChannelsUrls": @[ ], @"keywords": @"", @"moderateComments": @NO, @"profileColor": @"", @"showBrowseView": @NO, @"showRelatedChannels": @NO, @"title": @"", @"trackingAnalyticsAccountId": @"", @"unsubscribedTrailer": @"" }, @"hints": @[ @{ @"property": @"", @"value": @"" } ], @"image": @{ @"backgroundImageUrl": @{ @"defaultLanguage": @{ @"value": @"" }, @"localized": @[ @{ @"language": @"", @"value": @"" } ] }, @"bannerExternalUrl": @"", @"bannerImageUrl": @"", @"bannerMobileExtraHdImageUrl": @"", @"bannerMobileHdImageUrl": @"", @"bannerMobileImageUrl": @"", @"bannerMobileLowImageUrl": @"", @"bannerMobileMediumHdImageUrl": @"", @"bannerTabletExtraHdImageUrl": @"", @"bannerTabletHdImageUrl": @"", @"bannerTabletImageUrl": @"", @"bannerTabletLowImageUrl": @"", @"bannerTvHighImageUrl": @"", @"bannerTvImageUrl": @"", @"bannerTvLowImageUrl": @"", @"bannerTvMediumImageUrl": @"", @"largeBrandedBannerImageImapScript": @{ }, @"largeBrandedBannerImageUrl": @{ }, @"smallBrandedBannerImageImapScript": @{ }, @"smallBrandedBannerImageUrl": @{ }, @"trackingImageUrl": @"", @"watchIconImageUrl": @"" }, @"watch": @{ @"backgroundColor": @"", @"featuredPlaylistId": @"", @"textColor": @"" } },
@"contentDetails": @{ @"relatedPlaylists": @{ @"favorites": @"", @"likes": @"", @"uploads": @"", @"watchHistory": @"", @"watchLater": @"" } },
@"contentOwnerDetails": @{ @"contentOwner": @"", @"timeLinked": @"" },
@"conversionPings": @{ @"pings": @[ @{ @"context": @"", @"conversionUrl": @"" } ] },
@"etag": @"",
@"id": @"",
@"kind": @"",
@"localizations": @{ },
@"snippet": @{ @"country": @"", @"customUrl": @"", @"defaultLanguage": @"", @"description": @"", @"localized": @{ @"description": @"", @"title": @"" }, @"publishedAt": @"", @"thumbnails": @{ @"high": @{ @"height": @0, @"url": @"", @"width": @0 }, @"maxres": @{ }, @"medium": @{ }, @"standard": @{ } }, @"title": @"" },
@"statistics": @{ @"commentCount": @"", @"hiddenSubscriberCount": @NO, @"subscriberCount": @"", @"videoCount": @"", @"viewCount": @"" },
@"status": @{ @"isLinked": @NO, @"longUploadsStatus": @"", @"madeForKids": @NO, @"privacyStatus": @"", @"selfDeclaredMadeForKids": @NO },
@"topicDetails": @{ @"topicCategories": @[ ], @"topicIds": @[ ] } };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/youtube/v3/channels?part="]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PUT"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/youtube/v3/channels?part=" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"auditDetails\": {\n \"communityGuidelinesGoodStanding\": false,\n \"contentIdClaimsGoodStanding\": false,\n \"copyrightStrikesGoodStanding\": false\n },\n \"brandingSettings\": {\n \"channel\": {\n \"country\": \"\",\n \"defaultLanguage\": \"\",\n \"defaultTab\": \"\",\n \"description\": \"\",\n \"featuredChannelsTitle\": \"\",\n \"featuredChannelsUrls\": [],\n \"keywords\": \"\",\n \"moderateComments\": false,\n \"profileColor\": \"\",\n \"showBrowseView\": false,\n \"showRelatedChannels\": false,\n \"title\": \"\",\n \"trackingAnalyticsAccountId\": \"\",\n \"unsubscribedTrailer\": \"\"\n },\n \"hints\": [\n {\n \"property\": \"\",\n \"value\": \"\"\n }\n ],\n \"image\": {\n \"backgroundImageUrl\": {\n \"defaultLanguage\": {\n \"value\": \"\"\n },\n \"localized\": [\n {\n \"language\": \"\",\n \"value\": \"\"\n }\n ]\n },\n \"bannerExternalUrl\": \"\",\n \"bannerImageUrl\": \"\",\n \"bannerMobileExtraHdImageUrl\": \"\",\n \"bannerMobileHdImageUrl\": \"\",\n \"bannerMobileImageUrl\": \"\",\n \"bannerMobileLowImageUrl\": \"\",\n \"bannerMobileMediumHdImageUrl\": \"\",\n \"bannerTabletExtraHdImageUrl\": \"\",\n \"bannerTabletHdImageUrl\": \"\",\n \"bannerTabletImageUrl\": \"\",\n \"bannerTabletLowImageUrl\": \"\",\n \"bannerTvHighImageUrl\": \"\",\n \"bannerTvImageUrl\": \"\",\n \"bannerTvLowImageUrl\": \"\",\n \"bannerTvMediumImageUrl\": \"\",\n \"largeBrandedBannerImageImapScript\": {},\n \"largeBrandedBannerImageUrl\": {},\n \"smallBrandedBannerImageImapScript\": {},\n \"smallBrandedBannerImageUrl\": {},\n \"trackingImageUrl\": \"\",\n \"watchIconImageUrl\": \"\"\n },\n \"watch\": {\n \"backgroundColor\": \"\",\n \"featuredPlaylistId\": \"\",\n \"textColor\": \"\"\n }\n },\n \"contentDetails\": {\n \"relatedPlaylists\": {\n \"favorites\": \"\",\n \"likes\": \"\",\n \"uploads\": \"\",\n \"watchHistory\": \"\",\n \"watchLater\": \"\"\n }\n },\n \"contentOwnerDetails\": {\n \"contentOwner\": \"\",\n \"timeLinked\": \"\"\n },\n \"conversionPings\": {\n \"pings\": [\n {\n \"context\": \"\",\n \"conversionUrl\": \"\"\n }\n ]\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"localizations\": {},\n \"snippet\": {\n \"country\": \"\",\n \"customUrl\": \"\",\n \"defaultLanguage\": \"\",\n \"description\": \"\",\n \"localized\": {\n \"description\": \"\",\n \"title\": \"\"\n },\n \"publishedAt\": \"\",\n \"thumbnails\": {\n \"high\": {\n \"height\": 0,\n \"url\": \"\",\n \"width\": 0\n },\n \"maxres\": {},\n \"medium\": {},\n \"standard\": {}\n },\n \"title\": \"\"\n },\n \"statistics\": {\n \"commentCount\": \"\",\n \"hiddenSubscriberCount\": false,\n \"subscriberCount\": \"\",\n \"videoCount\": \"\",\n \"viewCount\": \"\"\n },\n \"status\": {\n \"isLinked\": false,\n \"longUploadsStatus\": \"\",\n \"madeForKids\": false,\n \"privacyStatus\": \"\",\n \"selfDeclaredMadeForKids\": false\n },\n \"topicDetails\": {\n \"topicCategories\": [],\n \"topicIds\": []\n }\n}" in
Client.call ~headers ~body `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/youtube/v3/channels?part=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'auditDetails' => [
'communityGuidelinesGoodStanding' => null,
'contentIdClaimsGoodStanding' => null,
'copyrightStrikesGoodStanding' => null
],
'brandingSettings' => [
'channel' => [
'country' => '',
'defaultLanguage' => '',
'defaultTab' => '',
'description' => '',
'featuredChannelsTitle' => '',
'featuredChannelsUrls' => [
],
'keywords' => '',
'moderateComments' => null,
'profileColor' => '',
'showBrowseView' => null,
'showRelatedChannels' => null,
'title' => '',
'trackingAnalyticsAccountId' => '',
'unsubscribedTrailer' => ''
],
'hints' => [
[
'property' => '',
'value' => ''
]
],
'image' => [
'backgroundImageUrl' => [
'defaultLanguage' => [
'value' => ''
],
'localized' => [
[
'language' => '',
'value' => ''
]
]
],
'bannerExternalUrl' => '',
'bannerImageUrl' => '',
'bannerMobileExtraHdImageUrl' => '',
'bannerMobileHdImageUrl' => '',
'bannerMobileImageUrl' => '',
'bannerMobileLowImageUrl' => '',
'bannerMobileMediumHdImageUrl' => '',
'bannerTabletExtraHdImageUrl' => '',
'bannerTabletHdImageUrl' => '',
'bannerTabletImageUrl' => '',
'bannerTabletLowImageUrl' => '',
'bannerTvHighImageUrl' => '',
'bannerTvImageUrl' => '',
'bannerTvLowImageUrl' => '',
'bannerTvMediumImageUrl' => '',
'largeBrandedBannerImageImapScript' => [
],
'largeBrandedBannerImageUrl' => [
],
'smallBrandedBannerImageImapScript' => [
],
'smallBrandedBannerImageUrl' => [
],
'trackingImageUrl' => '',
'watchIconImageUrl' => ''
],
'watch' => [
'backgroundColor' => '',
'featuredPlaylistId' => '',
'textColor' => ''
]
],
'contentDetails' => [
'relatedPlaylists' => [
'favorites' => '',
'likes' => '',
'uploads' => '',
'watchHistory' => '',
'watchLater' => ''
]
],
'contentOwnerDetails' => [
'contentOwner' => '',
'timeLinked' => ''
],
'conversionPings' => [
'pings' => [
[
'context' => '',
'conversionUrl' => ''
]
]
],
'etag' => '',
'id' => '',
'kind' => '',
'localizations' => [
],
'snippet' => [
'country' => '',
'customUrl' => '',
'defaultLanguage' => '',
'description' => '',
'localized' => [
'description' => '',
'title' => ''
],
'publishedAt' => '',
'thumbnails' => [
'high' => [
'height' => 0,
'url' => '',
'width' => 0
],
'maxres' => [
],
'medium' => [
],
'standard' => [
]
],
'title' => ''
],
'statistics' => [
'commentCount' => '',
'hiddenSubscriberCount' => null,
'subscriberCount' => '',
'videoCount' => '',
'viewCount' => ''
],
'status' => [
'isLinked' => null,
'longUploadsStatus' => '',
'madeForKids' => null,
'privacyStatus' => '',
'selfDeclaredMadeForKids' => null
],
'topicDetails' => [
'topicCategories' => [
],
'topicIds' => [
]
]
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('PUT', '{{baseUrl}}/youtube/v3/channels?part=', [
'body' => '{
"auditDetails": {
"communityGuidelinesGoodStanding": false,
"contentIdClaimsGoodStanding": false,
"copyrightStrikesGoodStanding": false
},
"brandingSettings": {
"channel": {
"country": "",
"defaultLanguage": "",
"defaultTab": "",
"description": "",
"featuredChannelsTitle": "",
"featuredChannelsUrls": [],
"keywords": "",
"moderateComments": false,
"profileColor": "",
"showBrowseView": false,
"showRelatedChannels": false,
"title": "",
"trackingAnalyticsAccountId": "",
"unsubscribedTrailer": ""
},
"hints": [
{
"property": "",
"value": ""
}
],
"image": {
"backgroundImageUrl": {
"defaultLanguage": {
"value": ""
},
"localized": [
{
"language": "",
"value": ""
}
]
},
"bannerExternalUrl": "",
"bannerImageUrl": "",
"bannerMobileExtraHdImageUrl": "",
"bannerMobileHdImageUrl": "",
"bannerMobileImageUrl": "",
"bannerMobileLowImageUrl": "",
"bannerMobileMediumHdImageUrl": "",
"bannerTabletExtraHdImageUrl": "",
"bannerTabletHdImageUrl": "",
"bannerTabletImageUrl": "",
"bannerTabletLowImageUrl": "",
"bannerTvHighImageUrl": "",
"bannerTvImageUrl": "",
"bannerTvLowImageUrl": "",
"bannerTvMediumImageUrl": "",
"largeBrandedBannerImageImapScript": {},
"largeBrandedBannerImageUrl": {},
"smallBrandedBannerImageImapScript": {},
"smallBrandedBannerImageUrl": {},
"trackingImageUrl": "",
"watchIconImageUrl": ""
},
"watch": {
"backgroundColor": "",
"featuredPlaylistId": "",
"textColor": ""
}
},
"contentDetails": {
"relatedPlaylists": {
"favorites": "",
"likes": "",
"uploads": "",
"watchHistory": "",
"watchLater": ""
}
},
"contentOwnerDetails": {
"contentOwner": "",
"timeLinked": ""
},
"conversionPings": {
"pings": [
{
"context": "",
"conversionUrl": ""
}
]
},
"etag": "",
"id": "",
"kind": "",
"localizations": {},
"snippet": {
"country": "",
"customUrl": "",
"defaultLanguage": "",
"description": "",
"localized": {
"description": "",
"title": ""
},
"publishedAt": "",
"thumbnails": {
"high": {
"height": 0,
"url": "",
"width": 0
},
"maxres": {},
"medium": {},
"standard": {}
},
"title": ""
},
"statistics": {
"commentCount": "",
"hiddenSubscriberCount": false,
"subscriberCount": "",
"videoCount": "",
"viewCount": ""
},
"status": {
"isLinked": false,
"longUploadsStatus": "",
"madeForKids": false,
"privacyStatus": "",
"selfDeclaredMadeForKids": false
},
"topicDetails": {
"topicCategories": [],
"topicIds": []
}
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/youtube/v3/channels');
$request->setMethod(HTTP_METH_PUT);
$request->setQueryData([
'part' => ''
]);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'auditDetails' => [
'communityGuidelinesGoodStanding' => null,
'contentIdClaimsGoodStanding' => null,
'copyrightStrikesGoodStanding' => null
],
'brandingSettings' => [
'channel' => [
'country' => '',
'defaultLanguage' => '',
'defaultTab' => '',
'description' => '',
'featuredChannelsTitle' => '',
'featuredChannelsUrls' => [
],
'keywords' => '',
'moderateComments' => null,
'profileColor' => '',
'showBrowseView' => null,
'showRelatedChannels' => null,
'title' => '',
'trackingAnalyticsAccountId' => '',
'unsubscribedTrailer' => ''
],
'hints' => [
[
'property' => '',
'value' => ''
]
],
'image' => [
'backgroundImageUrl' => [
'defaultLanguage' => [
'value' => ''
],
'localized' => [
[
'language' => '',
'value' => ''
]
]
],
'bannerExternalUrl' => '',
'bannerImageUrl' => '',
'bannerMobileExtraHdImageUrl' => '',
'bannerMobileHdImageUrl' => '',
'bannerMobileImageUrl' => '',
'bannerMobileLowImageUrl' => '',
'bannerMobileMediumHdImageUrl' => '',
'bannerTabletExtraHdImageUrl' => '',
'bannerTabletHdImageUrl' => '',
'bannerTabletImageUrl' => '',
'bannerTabletLowImageUrl' => '',
'bannerTvHighImageUrl' => '',
'bannerTvImageUrl' => '',
'bannerTvLowImageUrl' => '',
'bannerTvMediumImageUrl' => '',
'largeBrandedBannerImageImapScript' => [
],
'largeBrandedBannerImageUrl' => [
],
'smallBrandedBannerImageImapScript' => [
],
'smallBrandedBannerImageUrl' => [
],
'trackingImageUrl' => '',
'watchIconImageUrl' => ''
],
'watch' => [
'backgroundColor' => '',
'featuredPlaylistId' => '',
'textColor' => ''
]
],
'contentDetails' => [
'relatedPlaylists' => [
'favorites' => '',
'likes' => '',
'uploads' => '',
'watchHistory' => '',
'watchLater' => ''
]
],
'contentOwnerDetails' => [
'contentOwner' => '',
'timeLinked' => ''
],
'conversionPings' => [
'pings' => [
[
'context' => '',
'conversionUrl' => ''
]
]
],
'etag' => '',
'id' => '',
'kind' => '',
'localizations' => [
],
'snippet' => [
'country' => '',
'customUrl' => '',
'defaultLanguage' => '',
'description' => '',
'localized' => [
'description' => '',
'title' => ''
],
'publishedAt' => '',
'thumbnails' => [
'high' => [
'height' => 0,
'url' => '',
'width' => 0
],
'maxres' => [
],
'medium' => [
],
'standard' => [
]
],
'title' => ''
],
'statistics' => [
'commentCount' => '',
'hiddenSubscriberCount' => null,
'subscriberCount' => '',
'videoCount' => '',
'viewCount' => ''
],
'status' => [
'isLinked' => null,
'longUploadsStatus' => '',
'madeForKids' => null,
'privacyStatus' => '',
'selfDeclaredMadeForKids' => null
],
'topicDetails' => [
'topicCategories' => [
],
'topicIds' => [
]
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'auditDetails' => [
'communityGuidelinesGoodStanding' => null,
'contentIdClaimsGoodStanding' => null,
'copyrightStrikesGoodStanding' => null
],
'brandingSettings' => [
'channel' => [
'country' => '',
'defaultLanguage' => '',
'defaultTab' => '',
'description' => '',
'featuredChannelsTitle' => '',
'featuredChannelsUrls' => [
],
'keywords' => '',
'moderateComments' => null,
'profileColor' => '',
'showBrowseView' => null,
'showRelatedChannels' => null,
'title' => '',
'trackingAnalyticsAccountId' => '',
'unsubscribedTrailer' => ''
],
'hints' => [
[
'property' => '',
'value' => ''
]
],
'image' => [
'backgroundImageUrl' => [
'defaultLanguage' => [
'value' => ''
],
'localized' => [
[
'language' => '',
'value' => ''
]
]
],
'bannerExternalUrl' => '',
'bannerImageUrl' => '',
'bannerMobileExtraHdImageUrl' => '',
'bannerMobileHdImageUrl' => '',
'bannerMobileImageUrl' => '',
'bannerMobileLowImageUrl' => '',
'bannerMobileMediumHdImageUrl' => '',
'bannerTabletExtraHdImageUrl' => '',
'bannerTabletHdImageUrl' => '',
'bannerTabletImageUrl' => '',
'bannerTabletLowImageUrl' => '',
'bannerTvHighImageUrl' => '',
'bannerTvImageUrl' => '',
'bannerTvLowImageUrl' => '',
'bannerTvMediumImageUrl' => '',
'largeBrandedBannerImageImapScript' => [
],
'largeBrandedBannerImageUrl' => [
],
'smallBrandedBannerImageImapScript' => [
],
'smallBrandedBannerImageUrl' => [
],
'trackingImageUrl' => '',
'watchIconImageUrl' => ''
],
'watch' => [
'backgroundColor' => '',
'featuredPlaylistId' => '',
'textColor' => ''
]
],
'contentDetails' => [
'relatedPlaylists' => [
'favorites' => '',
'likes' => '',
'uploads' => '',
'watchHistory' => '',
'watchLater' => ''
]
],
'contentOwnerDetails' => [
'contentOwner' => '',
'timeLinked' => ''
],
'conversionPings' => [
'pings' => [
[
'context' => '',
'conversionUrl' => ''
]
]
],
'etag' => '',
'id' => '',
'kind' => '',
'localizations' => [
],
'snippet' => [
'country' => '',
'customUrl' => '',
'defaultLanguage' => '',
'description' => '',
'localized' => [
'description' => '',
'title' => ''
],
'publishedAt' => '',
'thumbnails' => [
'high' => [
'height' => 0,
'url' => '',
'width' => 0
],
'maxres' => [
],
'medium' => [
],
'standard' => [
]
],
'title' => ''
],
'statistics' => [
'commentCount' => '',
'hiddenSubscriberCount' => null,
'subscriberCount' => '',
'videoCount' => '',
'viewCount' => ''
],
'status' => [
'isLinked' => null,
'longUploadsStatus' => '',
'madeForKids' => null,
'privacyStatus' => '',
'selfDeclaredMadeForKids' => null
],
'topicDetails' => [
'topicCategories' => [
],
'topicIds' => [
]
]
]));
$request->setRequestUrl('{{baseUrl}}/youtube/v3/channels');
$request->setRequestMethod('PUT');
$request->setBody($body);
$request->setQuery(new http\QueryString([
'part' => ''
]));
$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}}/youtube/v3/channels?part=' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"auditDetails": {
"communityGuidelinesGoodStanding": false,
"contentIdClaimsGoodStanding": false,
"copyrightStrikesGoodStanding": false
},
"brandingSettings": {
"channel": {
"country": "",
"defaultLanguage": "",
"defaultTab": "",
"description": "",
"featuredChannelsTitle": "",
"featuredChannelsUrls": [],
"keywords": "",
"moderateComments": false,
"profileColor": "",
"showBrowseView": false,
"showRelatedChannels": false,
"title": "",
"trackingAnalyticsAccountId": "",
"unsubscribedTrailer": ""
},
"hints": [
{
"property": "",
"value": ""
}
],
"image": {
"backgroundImageUrl": {
"defaultLanguage": {
"value": ""
},
"localized": [
{
"language": "",
"value": ""
}
]
},
"bannerExternalUrl": "",
"bannerImageUrl": "",
"bannerMobileExtraHdImageUrl": "",
"bannerMobileHdImageUrl": "",
"bannerMobileImageUrl": "",
"bannerMobileLowImageUrl": "",
"bannerMobileMediumHdImageUrl": "",
"bannerTabletExtraHdImageUrl": "",
"bannerTabletHdImageUrl": "",
"bannerTabletImageUrl": "",
"bannerTabletLowImageUrl": "",
"bannerTvHighImageUrl": "",
"bannerTvImageUrl": "",
"bannerTvLowImageUrl": "",
"bannerTvMediumImageUrl": "",
"largeBrandedBannerImageImapScript": {},
"largeBrandedBannerImageUrl": {},
"smallBrandedBannerImageImapScript": {},
"smallBrandedBannerImageUrl": {},
"trackingImageUrl": "",
"watchIconImageUrl": ""
},
"watch": {
"backgroundColor": "",
"featuredPlaylistId": "",
"textColor": ""
}
},
"contentDetails": {
"relatedPlaylists": {
"favorites": "",
"likes": "",
"uploads": "",
"watchHistory": "",
"watchLater": ""
}
},
"contentOwnerDetails": {
"contentOwner": "",
"timeLinked": ""
},
"conversionPings": {
"pings": [
{
"context": "",
"conversionUrl": ""
}
]
},
"etag": "",
"id": "",
"kind": "",
"localizations": {},
"snippet": {
"country": "",
"customUrl": "",
"defaultLanguage": "",
"description": "",
"localized": {
"description": "",
"title": ""
},
"publishedAt": "",
"thumbnails": {
"high": {
"height": 0,
"url": "",
"width": 0
},
"maxres": {},
"medium": {},
"standard": {}
},
"title": ""
},
"statistics": {
"commentCount": "",
"hiddenSubscriberCount": false,
"subscriberCount": "",
"videoCount": "",
"viewCount": ""
},
"status": {
"isLinked": false,
"longUploadsStatus": "",
"madeForKids": false,
"privacyStatus": "",
"selfDeclaredMadeForKids": false
},
"topicDetails": {
"topicCategories": [],
"topicIds": []
}
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/youtube/v3/channels?part=' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"auditDetails": {
"communityGuidelinesGoodStanding": false,
"contentIdClaimsGoodStanding": false,
"copyrightStrikesGoodStanding": false
},
"brandingSettings": {
"channel": {
"country": "",
"defaultLanguage": "",
"defaultTab": "",
"description": "",
"featuredChannelsTitle": "",
"featuredChannelsUrls": [],
"keywords": "",
"moderateComments": false,
"profileColor": "",
"showBrowseView": false,
"showRelatedChannels": false,
"title": "",
"trackingAnalyticsAccountId": "",
"unsubscribedTrailer": ""
},
"hints": [
{
"property": "",
"value": ""
}
],
"image": {
"backgroundImageUrl": {
"defaultLanguage": {
"value": ""
},
"localized": [
{
"language": "",
"value": ""
}
]
},
"bannerExternalUrl": "",
"bannerImageUrl": "",
"bannerMobileExtraHdImageUrl": "",
"bannerMobileHdImageUrl": "",
"bannerMobileImageUrl": "",
"bannerMobileLowImageUrl": "",
"bannerMobileMediumHdImageUrl": "",
"bannerTabletExtraHdImageUrl": "",
"bannerTabletHdImageUrl": "",
"bannerTabletImageUrl": "",
"bannerTabletLowImageUrl": "",
"bannerTvHighImageUrl": "",
"bannerTvImageUrl": "",
"bannerTvLowImageUrl": "",
"bannerTvMediumImageUrl": "",
"largeBrandedBannerImageImapScript": {},
"largeBrandedBannerImageUrl": {},
"smallBrandedBannerImageImapScript": {},
"smallBrandedBannerImageUrl": {},
"trackingImageUrl": "",
"watchIconImageUrl": ""
},
"watch": {
"backgroundColor": "",
"featuredPlaylistId": "",
"textColor": ""
}
},
"contentDetails": {
"relatedPlaylists": {
"favorites": "",
"likes": "",
"uploads": "",
"watchHistory": "",
"watchLater": ""
}
},
"contentOwnerDetails": {
"contentOwner": "",
"timeLinked": ""
},
"conversionPings": {
"pings": [
{
"context": "",
"conversionUrl": ""
}
]
},
"etag": "",
"id": "",
"kind": "",
"localizations": {},
"snippet": {
"country": "",
"customUrl": "",
"defaultLanguage": "",
"description": "",
"localized": {
"description": "",
"title": ""
},
"publishedAt": "",
"thumbnails": {
"high": {
"height": 0,
"url": "",
"width": 0
},
"maxres": {},
"medium": {},
"standard": {}
},
"title": ""
},
"statistics": {
"commentCount": "",
"hiddenSubscriberCount": false,
"subscriberCount": "",
"videoCount": "",
"viewCount": ""
},
"status": {
"isLinked": false,
"longUploadsStatus": "",
"madeForKids": false,
"privacyStatus": "",
"selfDeclaredMadeForKids": false
},
"topicDetails": {
"topicCategories": [],
"topicIds": []
}
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"auditDetails\": {\n \"communityGuidelinesGoodStanding\": false,\n \"contentIdClaimsGoodStanding\": false,\n \"copyrightStrikesGoodStanding\": false\n },\n \"brandingSettings\": {\n \"channel\": {\n \"country\": \"\",\n \"defaultLanguage\": \"\",\n \"defaultTab\": \"\",\n \"description\": \"\",\n \"featuredChannelsTitle\": \"\",\n \"featuredChannelsUrls\": [],\n \"keywords\": \"\",\n \"moderateComments\": false,\n \"profileColor\": \"\",\n \"showBrowseView\": false,\n \"showRelatedChannels\": false,\n \"title\": \"\",\n \"trackingAnalyticsAccountId\": \"\",\n \"unsubscribedTrailer\": \"\"\n },\n \"hints\": [\n {\n \"property\": \"\",\n \"value\": \"\"\n }\n ],\n \"image\": {\n \"backgroundImageUrl\": {\n \"defaultLanguage\": {\n \"value\": \"\"\n },\n \"localized\": [\n {\n \"language\": \"\",\n \"value\": \"\"\n }\n ]\n },\n \"bannerExternalUrl\": \"\",\n \"bannerImageUrl\": \"\",\n \"bannerMobileExtraHdImageUrl\": \"\",\n \"bannerMobileHdImageUrl\": \"\",\n \"bannerMobileImageUrl\": \"\",\n \"bannerMobileLowImageUrl\": \"\",\n \"bannerMobileMediumHdImageUrl\": \"\",\n \"bannerTabletExtraHdImageUrl\": \"\",\n \"bannerTabletHdImageUrl\": \"\",\n \"bannerTabletImageUrl\": \"\",\n \"bannerTabletLowImageUrl\": \"\",\n \"bannerTvHighImageUrl\": \"\",\n \"bannerTvImageUrl\": \"\",\n \"bannerTvLowImageUrl\": \"\",\n \"bannerTvMediumImageUrl\": \"\",\n \"largeBrandedBannerImageImapScript\": {},\n \"largeBrandedBannerImageUrl\": {},\n \"smallBrandedBannerImageImapScript\": {},\n \"smallBrandedBannerImageUrl\": {},\n \"trackingImageUrl\": \"\",\n \"watchIconImageUrl\": \"\"\n },\n \"watch\": {\n \"backgroundColor\": \"\",\n \"featuredPlaylistId\": \"\",\n \"textColor\": \"\"\n }\n },\n \"contentDetails\": {\n \"relatedPlaylists\": {\n \"favorites\": \"\",\n \"likes\": \"\",\n \"uploads\": \"\",\n \"watchHistory\": \"\",\n \"watchLater\": \"\"\n }\n },\n \"contentOwnerDetails\": {\n \"contentOwner\": \"\",\n \"timeLinked\": \"\"\n },\n \"conversionPings\": {\n \"pings\": [\n {\n \"context\": \"\",\n \"conversionUrl\": \"\"\n }\n ]\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"localizations\": {},\n \"snippet\": {\n \"country\": \"\",\n \"customUrl\": \"\",\n \"defaultLanguage\": \"\",\n \"description\": \"\",\n \"localized\": {\n \"description\": \"\",\n \"title\": \"\"\n },\n \"publishedAt\": \"\",\n \"thumbnails\": {\n \"high\": {\n \"height\": 0,\n \"url\": \"\",\n \"width\": 0\n },\n \"maxres\": {},\n \"medium\": {},\n \"standard\": {}\n },\n \"title\": \"\"\n },\n \"statistics\": {\n \"commentCount\": \"\",\n \"hiddenSubscriberCount\": false,\n \"subscriberCount\": \"\",\n \"videoCount\": \"\",\n \"viewCount\": \"\"\n },\n \"status\": {\n \"isLinked\": false,\n \"longUploadsStatus\": \"\",\n \"madeForKids\": false,\n \"privacyStatus\": \"\",\n \"selfDeclaredMadeForKids\": false\n },\n \"topicDetails\": {\n \"topicCategories\": [],\n \"topicIds\": []\n }\n}"
headers = { 'content-type': "application/json" }
conn.request("PUT", "/baseUrl/youtube/v3/channels?part=", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/youtube/v3/channels"
querystring = {"part":""}
payload = {
"auditDetails": {
"communityGuidelinesGoodStanding": False,
"contentIdClaimsGoodStanding": False,
"copyrightStrikesGoodStanding": False
},
"brandingSettings": {
"channel": {
"country": "",
"defaultLanguage": "",
"defaultTab": "",
"description": "",
"featuredChannelsTitle": "",
"featuredChannelsUrls": [],
"keywords": "",
"moderateComments": False,
"profileColor": "",
"showBrowseView": False,
"showRelatedChannels": False,
"title": "",
"trackingAnalyticsAccountId": "",
"unsubscribedTrailer": ""
},
"hints": [
{
"property": "",
"value": ""
}
],
"image": {
"backgroundImageUrl": {
"defaultLanguage": { "value": "" },
"localized": [
{
"language": "",
"value": ""
}
]
},
"bannerExternalUrl": "",
"bannerImageUrl": "",
"bannerMobileExtraHdImageUrl": "",
"bannerMobileHdImageUrl": "",
"bannerMobileImageUrl": "",
"bannerMobileLowImageUrl": "",
"bannerMobileMediumHdImageUrl": "",
"bannerTabletExtraHdImageUrl": "",
"bannerTabletHdImageUrl": "",
"bannerTabletImageUrl": "",
"bannerTabletLowImageUrl": "",
"bannerTvHighImageUrl": "",
"bannerTvImageUrl": "",
"bannerTvLowImageUrl": "",
"bannerTvMediumImageUrl": "",
"largeBrandedBannerImageImapScript": {},
"largeBrandedBannerImageUrl": {},
"smallBrandedBannerImageImapScript": {},
"smallBrandedBannerImageUrl": {},
"trackingImageUrl": "",
"watchIconImageUrl": ""
},
"watch": {
"backgroundColor": "",
"featuredPlaylistId": "",
"textColor": ""
}
},
"contentDetails": { "relatedPlaylists": {
"favorites": "",
"likes": "",
"uploads": "",
"watchHistory": "",
"watchLater": ""
} },
"contentOwnerDetails": {
"contentOwner": "",
"timeLinked": ""
},
"conversionPings": { "pings": [
{
"context": "",
"conversionUrl": ""
}
] },
"etag": "",
"id": "",
"kind": "",
"localizations": {},
"snippet": {
"country": "",
"customUrl": "",
"defaultLanguage": "",
"description": "",
"localized": {
"description": "",
"title": ""
},
"publishedAt": "",
"thumbnails": {
"high": {
"height": 0,
"url": "",
"width": 0
},
"maxres": {},
"medium": {},
"standard": {}
},
"title": ""
},
"statistics": {
"commentCount": "",
"hiddenSubscriberCount": False,
"subscriberCount": "",
"videoCount": "",
"viewCount": ""
},
"status": {
"isLinked": False,
"longUploadsStatus": "",
"madeForKids": False,
"privacyStatus": "",
"selfDeclaredMadeForKids": False
},
"topicDetails": {
"topicCategories": [],
"topicIds": []
}
}
headers = {"content-type": "application/json"}
response = requests.put(url, json=payload, headers=headers, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/youtube/v3/channels"
queryString <- list(part = "")
payload <- "{\n \"auditDetails\": {\n \"communityGuidelinesGoodStanding\": false,\n \"contentIdClaimsGoodStanding\": false,\n \"copyrightStrikesGoodStanding\": false\n },\n \"brandingSettings\": {\n \"channel\": {\n \"country\": \"\",\n \"defaultLanguage\": \"\",\n \"defaultTab\": \"\",\n \"description\": \"\",\n \"featuredChannelsTitle\": \"\",\n \"featuredChannelsUrls\": [],\n \"keywords\": \"\",\n \"moderateComments\": false,\n \"profileColor\": \"\",\n \"showBrowseView\": false,\n \"showRelatedChannels\": false,\n \"title\": \"\",\n \"trackingAnalyticsAccountId\": \"\",\n \"unsubscribedTrailer\": \"\"\n },\n \"hints\": [\n {\n \"property\": \"\",\n \"value\": \"\"\n }\n ],\n \"image\": {\n \"backgroundImageUrl\": {\n \"defaultLanguage\": {\n \"value\": \"\"\n },\n \"localized\": [\n {\n \"language\": \"\",\n \"value\": \"\"\n }\n ]\n },\n \"bannerExternalUrl\": \"\",\n \"bannerImageUrl\": \"\",\n \"bannerMobileExtraHdImageUrl\": \"\",\n \"bannerMobileHdImageUrl\": \"\",\n \"bannerMobileImageUrl\": \"\",\n \"bannerMobileLowImageUrl\": \"\",\n \"bannerMobileMediumHdImageUrl\": \"\",\n \"bannerTabletExtraHdImageUrl\": \"\",\n \"bannerTabletHdImageUrl\": \"\",\n \"bannerTabletImageUrl\": \"\",\n \"bannerTabletLowImageUrl\": \"\",\n \"bannerTvHighImageUrl\": \"\",\n \"bannerTvImageUrl\": \"\",\n \"bannerTvLowImageUrl\": \"\",\n \"bannerTvMediumImageUrl\": \"\",\n \"largeBrandedBannerImageImapScript\": {},\n \"largeBrandedBannerImageUrl\": {},\n \"smallBrandedBannerImageImapScript\": {},\n \"smallBrandedBannerImageUrl\": {},\n \"trackingImageUrl\": \"\",\n \"watchIconImageUrl\": \"\"\n },\n \"watch\": {\n \"backgroundColor\": \"\",\n \"featuredPlaylistId\": \"\",\n \"textColor\": \"\"\n }\n },\n \"contentDetails\": {\n \"relatedPlaylists\": {\n \"favorites\": \"\",\n \"likes\": \"\",\n \"uploads\": \"\",\n \"watchHistory\": \"\",\n \"watchLater\": \"\"\n }\n },\n \"contentOwnerDetails\": {\n \"contentOwner\": \"\",\n \"timeLinked\": \"\"\n },\n \"conversionPings\": {\n \"pings\": [\n {\n \"context\": \"\",\n \"conversionUrl\": \"\"\n }\n ]\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"localizations\": {},\n \"snippet\": {\n \"country\": \"\",\n \"customUrl\": \"\",\n \"defaultLanguage\": \"\",\n \"description\": \"\",\n \"localized\": {\n \"description\": \"\",\n \"title\": \"\"\n },\n \"publishedAt\": \"\",\n \"thumbnails\": {\n \"high\": {\n \"height\": 0,\n \"url\": \"\",\n \"width\": 0\n },\n \"maxres\": {},\n \"medium\": {},\n \"standard\": {}\n },\n \"title\": \"\"\n },\n \"statistics\": {\n \"commentCount\": \"\",\n \"hiddenSubscriberCount\": false,\n \"subscriberCount\": \"\",\n \"videoCount\": \"\",\n \"viewCount\": \"\"\n },\n \"status\": {\n \"isLinked\": false,\n \"longUploadsStatus\": \"\",\n \"madeForKids\": false,\n \"privacyStatus\": \"\",\n \"selfDeclaredMadeForKids\": false\n },\n \"topicDetails\": {\n \"topicCategories\": [],\n \"topicIds\": []\n }\n}"
encode <- "json"
response <- VERB("PUT", url, body = payload, query = queryString, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/youtube/v3/channels?part=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"auditDetails\": {\n \"communityGuidelinesGoodStanding\": false,\n \"contentIdClaimsGoodStanding\": false,\n \"copyrightStrikesGoodStanding\": false\n },\n \"brandingSettings\": {\n \"channel\": {\n \"country\": \"\",\n \"defaultLanguage\": \"\",\n \"defaultTab\": \"\",\n \"description\": \"\",\n \"featuredChannelsTitle\": \"\",\n \"featuredChannelsUrls\": [],\n \"keywords\": \"\",\n \"moderateComments\": false,\n \"profileColor\": \"\",\n \"showBrowseView\": false,\n \"showRelatedChannels\": false,\n \"title\": \"\",\n \"trackingAnalyticsAccountId\": \"\",\n \"unsubscribedTrailer\": \"\"\n },\n \"hints\": [\n {\n \"property\": \"\",\n \"value\": \"\"\n }\n ],\n \"image\": {\n \"backgroundImageUrl\": {\n \"defaultLanguage\": {\n \"value\": \"\"\n },\n \"localized\": [\n {\n \"language\": \"\",\n \"value\": \"\"\n }\n ]\n },\n \"bannerExternalUrl\": \"\",\n \"bannerImageUrl\": \"\",\n \"bannerMobileExtraHdImageUrl\": \"\",\n \"bannerMobileHdImageUrl\": \"\",\n \"bannerMobileImageUrl\": \"\",\n \"bannerMobileLowImageUrl\": \"\",\n \"bannerMobileMediumHdImageUrl\": \"\",\n \"bannerTabletExtraHdImageUrl\": \"\",\n \"bannerTabletHdImageUrl\": \"\",\n \"bannerTabletImageUrl\": \"\",\n \"bannerTabletLowImageUrl\": \"\",\n \"bannerTvHighImageUrl\": \"\",\n \"bannerTvImageUrl\": \"\",\n \"bannerTvLowImageUrl\": \"\",\n \"bannerTvMediumImageUrl\": \"\",\n \"largeBrandedBannerImageImapScript\": {},\n \"largeBrandedBannerImageUrl\": {},\n \"smallBrandedBannerImageImapScript\": {},\n \"smallBrandedBannerImageUrl\": {},\n \"trackingImageUrl\": \"\",\n \"watchIconImageUrl\": \"\"\n },\n \"watch\": {\n \"backgroundColor\": \"\",\n \"featuredPlaylistId\": \"\",\n \"textColor\": \"\"\n }\n },\n \"contentDetails\": {\n \"relatedPlaylists\": {\n \"favorites\": \"\",\n \"likes\": \"\",\n \"uploads\": \"\",\n \"watchHistory\": \"\",\n \"watchLater\": \"\"\n }\n },\n \"contentOwnerDetails\": {\n \"contentOwner\": \"\",\n \"timeLinked\": \"\"\n },\n \"conversionPings\": {\n \"pings\": [\n {\n \"context\": \"\",\n \"conversionUrl\": \"\"\n }\n ]\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"localizations\": {},\n \"snippet\": {\n \"country\": \"\",\n \"customUrl\": \"\",\n \"defaultLanguage\": \"\",\n \"description\": \"\",\n \"localized\": {\n \"description\": \"\",\n \"title\": \"\"\n },\n \"publishedAt\": \"\",\n \"thumbnails\": {\n \"high\": {\n \"height\": 0,\n \"url\": \"\",\n \"width\": 0\n },\n \"maxres\": {},\n \"medium\": {},\n \"standard\": {}\n },\n \"title\": \"\"\n },\n \"statistics\": {\n \"commentCount\": \"\",\n \"hiddenSubscriberCount\": false,\n \"subscriberCount\": \"\",\n \"videoCount\": \"\",\n \"viewCount\": \"\"\n },\n \"status\": {\n \"isLinked\": false,\n \"longUploadsStatus\": \"\",\n \"madeForKids\": false,\n \"privacyStatus\": \"\",\n \"selfDeclaredMadeForKids\": false\n },\n \"topicDetails\": {\n \"topicCategories\": [],\n \"topicIds\": []\n }\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.put('/baseUrl/youtube/v3/channels') do |req|
req.params['part'] = ''
req.body = "{\n \"auditDetails\": {\n \"communityGuidelinesGoodStanding\": false,\n \"contentIdClaimsGoodStanding\": false,\n \"copyrightStrikesGoodStanding\": false\n },\n \"brandingSettings\": {\n \"channel\": {\n \"country\": \"\",\n \"defaultLanguage\": \"\",\n \"defaultTab\": \"\",\n \"description\": \"\",\n \"featuredChannelsTitle\": \"\",\n \"featuredChannelsUrls\": [],\n \"keywords\": \"\",\n \"moderateComments\": false,\n \"profileColor\": \"\",\n \"showBrowseView\": false,\n \"showRelatedChannels\": false,\n \"title\": \"\",\n \"trackingAnalyticsAccountId\": \"\",\n \"unsubscribedTrailer\": \"\"\n },\n \"hints\": [\n {\n \"property\": \"\",\n \"value\": \"\"\n }\n ],\n \"image\": {\n \"backgroundImageUrl\": {\n \"defaultLanguage\": {\n \"value\": \"\"\n },\n \"localized\": [\n {\n \"language\": \"\",\n \"value\": \"\"\n }\n ]\n },\n \"bannerExternalUrl\": \"\",\n \"bannerImageUrl\": \"\",\n \"bannerMobileExtraHdImageUrl\": \"\",\n \"bannerMobileHdImageUrl\": \"\",\n \"bannerMobileImageUrl\": \"\",\n \"bannerMobileLowImageUrl\": \"\",\n \"bannerMobileMediumHdImageUrl\": \"\",\n \"bannerTabletExtraHdImageUrl\": \"\",\n \"bannerTabletHdImageUrl\": \"\",\n \"bannerTabletImageUrl\": \"\",\n \"bannerTabletLowImageUrl\": \"\",\n \"bannerTvHighImageUrl\": \"\",\n \"bannerTvImageUrl\": \"\",\n \"bannerTvLowImageUrl\": \"\",\n \"bannerTvMediumImageUrl\": \"\",\n \"largeBrandedBannerImageImapScript\": {},\n \"largeBrandedBannerImageUrl\": {},\n \"smallBrandedBannerImageImapScript\": {},\n \"smallBrandedBannerImageUrl\": {},\n \"trackingImageUrl\": \"\",\n \"watchIconImageUrl\": \"\"\n },\n \"watch\": {\n \"backgroundColor\": \"\",\n \"featuredPlaylistId\": \"\",\n \"textColor\": \"\"\n }\n },\n \"contentDetails\": {\n \"relatedPlaylists\": {\n \"favorites\": \"\",\n \"likes\": \"\",\n \"uploads\": \"\",\n \"watchHistory\": \"\",\n \"watchLater\": \"\"\n }\n },\n \"contentOwnerDetails\": {\n \"contentOwner\": \"\",\n \"timeLinked\": \"\"\n },\n \"conversionPings\": {\n \"pings\": [\n {\n \"context\": \"\",\n \"conversionUrl\": \"\"\n }\n ]\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"localizations\": {},\n \"snippet\": {\n \"country\": \"\",\n \"customUrl\": \"\",\n \"defaultLanguage\": \"\",\n \"description\": \"\",\n \"localized\": {\n \"description\": \"\",\n \"title\": \"\"\n },\n \"publishedAt\": \"\",\n \"thumbnails\": {\n \"high\": {\n \"height\": 0,\n \"url\": \"\",\n \"width\": 0\n },\n \"maxres\": {},\n \"medium\": {},\n \"standard\": {}\n },\n \"title\": \"\"\n },\n \"statistics\": {\n \"commentCount\": \"\",\n \"hiddenSubscriberCount\": false,\n \"subscriberCount\": \"\",\n \"videoCount\": \"\",\n \"viewCount\": \"\"\n },\n \"status\": {\n \"isLinked\": false,\n \"longUploadsStatus\": \"\",\n \"madeForKids\": false,\n \"privacyStatus\": \"\",\n \"selfDeclaredMadeForKids\": false\n },\n \"topicDetails\": {\n \"topicCategories\": [],\n \"topicIds\": []\n }\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}}/youtube/v3/channels";
let querystring = [
("part", ""),
];
let payload = json!({
"auditDetails": json!({
"communityGuidelinesGoodStanding": false,
"contentIdClaimsGoodStanding": false,
"copyrightStrikesGoodStanding": false
}),
"brandingSettings": json!({
"channel": json!({
"country": "",
"defaultLanguage": "",
"defaultTab": "",
"description": "",
"featuredChannelsTitle": "",
"featuredChannelsUrls": (),
"keywords": "",
"moderateComments": false,
"profileColor": "",
"showBrowseView": false,
"showRelatedChannels": false,
"title": "",
"trackingAnalyticsAccountId": "",
"unsubscribedTrailer": ""
}),
"hints": (
json!({
"property": "",
"value": ""
})
),
"image": json!({
"backgroundImageUrl": json!({
"defaultLanguage": json!({"value": ""}),
"localized": (
json!({
"language": "",
"value": ""
})
)
}),
"bannerExternalUrl": "",
"bannerImageUrl": "",
"bannerMobileExtraHdImageUrl": "",
"bannerMobileHdImageUrl": "",
"bannerMobileImageUrl": "",
"bannerMobileLowImageUrl": "",
"bannerMobileMediumHdImageUrl": "",
"bannerTabletExtraHdImageUrl": "",
"bannerTabletHdImageUrl": "",
"bannerTabletImageUrl": "",
"bannerTabletLowImageUrl": "",
"bannerTvHighImageUrl": "",
"bannerTvImageUrl": "",
"bannerTvLowImageUrl": "",
"bannerTvMediumImageUrl": "",
"largeBrandedBannerImageImapScript": json!({}),
"largeBrandedBannerImageUrl": json!({}),
"smallBrandedBannerImageImapScript": json!({}),
"smallBrandedBannerImageUrl": json!({}),
"trackingImageUrl": "",
"watchIconImageUrl": ""
}),
"watch": json!({
"backgroundColor": "",
"featuredPlaylistId": "",
"textColor": ""
})
}),
"contentDetails": json!({"relatedPlaylists": json!({
"favorites": "",
"likes": "",
"uploads": "",
"watchHistory": "",
"watchLater": ""
})}),
"contentOwnerDetails": json!({
"contentOwner": "",
"timeLinked": ""
}),
"conversionPings": json!({"pings": (
json!({
"context": "",
"conversionUrl": ""
})
)}),
"etag": "",
"id": "",
"kind": "",
"localizations": json!({}),
"snippet": json!({
"country": "",
"customUrl": "",
"defaultLanguage": "",
"description": "",
"localized": json!({
"description": "",
"title": ""
}),
"publishedAt": "",
"thumbnails": json!({
"high": json!({
"height": 0,
"url": "",
"width": 0
}),
"maxres": json!({}),
"medium": json!({}),
"standard": json!({})
}),
"title": ""
}),
"statistics": json!({
"commentCount": "",
"hiddenSubscriberCount": false,
"subscriberCount": "",
"videoCount": "",
"viewCount": ""
}),
"status": json!({
"isLinked": false,
"longUploadsStatus": "",
"madeForKids": false,
"privacyStatus": "",
"selfDeclaredMadeForKids": false
}),
"topicDetails": json!({
"topicCategories": (),
"topicIds": ()
})
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PUT").unwrap(), url)
.query(&querystring)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PUT \
--url '{{baseUrl}}/youtube/v3/channels?part=' \
--header 'content-type: application/json' \
--data '{
"auditDetails": {
"communityGuidelinesGoodStanding": false,
"contentIdClaimsGoodStanding": false,
"copyrightStrikesGoodStanding": false
},
"brandingSettings": {
"channel": {
"country": "",
"defaultLanguage": "",
"defaultTab": "",
"description": "",
"featuredChannelsTitle": "",
"featuredChannelsUrls": [],
"keywords": "",
"moderateComments": false,
"profileColor": "",
"showBrowseView": false,
"showRelatedChannels": false,
"title": "",
"trackingAnalyticsAccountId": "",
"unsubscribedTrailer": ""
},
"hints": [
{
"property": "",
"value": ""
}
],
"image": {
"backgroundImageUrl": {
"defaultLanguage": {
"value": ""
},
"localized": [
{
"language": "",
"value": ""
}
]
},
"bannerExternalUrl": "",
"bannerImageUrl": "",
"bannerMobileExtraHdImageUrl": "",
"bannerMobileHdImageUrl": "",
"bannerMobileImageUrl": "",
"bannerMobileLowImageUrl": "",
"bannerMobileMediumHdImageUrl": "",
"bannerTabletExtraHdImageUrl": "",
"bannerTabletHdImageUrl": "",
"bannerTabletImageUrl": "",
"bannerTabletLowImageUrl": "",
"bannerTvHighImageUrl": "",
"bannerTvImageUrl": "",
"bannerTvLowImageUrl": "",
"bannerTvMediumImageUrl": "",
"largeBrandedBannerImageImapScript": {},
"largeBrandedBannerImageUrl": {},
"smallBrandedBannerImageImapScript": {},
"smallBrandedBannerImageUrl": {},
"trackingImageUrl": "",
"watchIconImageUrl": ""
},
"watch": {
"backgroundColor": "",
"featuredPlaylistId": "",
"textColor": ""
}
},
"contentDetails": {
"relatedPlaylists": {
"favorites": "",
"likes": "",
"uploads": "",
"watchHistory": "",
"watchLater": ""
}
},
"contentOwnerDetails": {
"contentOwner": "",
"timeLinked": ""
},
"conversionPings": {
"pings": [
{
"context": "",
"conversionUrl": ""
}
]
},
"etag": "",
"id": "",
"kind": "",
"localizations": {},
"snippet": {
"country": "",
"customUrl": "",
"defaultLanguage": "",
"description": "",
"localized": {
"description": "",
"title": ""
},
"publishedAt": "",
"thumbnails": {
"high": {
"height": 0,
"url": "",
"width": 0
},
"maxres": {},
"medium": {},
"standard": {}
},
"title": ""
},
"statistics": {
"commentCount": "",
"hiddenSubscriberCount": false,
"subscriberCount": "",
"videoCount": "",
"viewCount": ""
},
"status": {
"isLinked": false,
"longUploadsStatus": "",
"madeForKids": false,
"privacyStatus": "",
"selfDeclaredMadeForKids": false
},
"topicDetails": {
"topicCategories": [],
"topicIds": []
}
}'
echo '{
"auditDetails": {
"communityGuidelinesGoodStanding": false,
"contentIdClaimsGoodStanding": false,
"copyrightStrikesGoodStanding": false
},
"brandingSettings": {
"channel": {
"country": "",
"defaultLanguage": "",
"defaultTab": "",
"description": "",
"featuredChannelsTitle": "",
"featuredChannelsUrls": [],
"keywords": "",
"moderateComments": false,
"profileColor": "",
"showBrowseView": false,
"showRelatedChannels": false,
"title": "",
"trackingAnalyticsAccountId": "",
"unsubscribedTrailer": ""
},
"hints": [
{
"property": "",
"value": ""
}
],
"image": {
"backgroundImageUrl": {
"defaultLanguage": {
"value": ""
},
"localized": [
{
"language": "",
"value": ""
}
]
},
"bannerExternalUrl": "",
"bannerImageUrl": "",
"bannerMobileExtraHdImageUrl": "",
"bannerMobileHdImageUrl": "",
"bannerMobileImageUrl": "",
"bannerMobileLowImageUrl": "",
"bannerMobileMediumHdImageUrl": "",
"bannerTabletExtraHdImageUrl": "",
"bannerTabletHdImageUrl": "",
"bannerTabletImageUrl": "",
"bannerTabletLowImageUrl": "",
"bannerTvHighImageUrl": "",
"bannerTvImageUrl": "",
"bannerTvLowImageUrl": "",
"bannerTvMediumImageUrl": "",
"largeBrandedBannerImageImapScript": {},
"largeBrandedBannerImageUrl": {},
"smallBrandedBannerImageImapScript": {},
"smallBrandedBannerImageUrl": {},
"trackingImageUrl": "",
"watchIconImageUrl": ""
},
"watch": {
"backgroundColor": "",
"featuredPlaylistId": "",
"textColor": ""
}
},
"contentDetails": {
"relatedPlaylists": {
"favorites": "",
"likes": "",
"uploads": "",
"watchHistory": "",
"watchLater": ""
}
},
"contentOwnerDetails": {
"contentOwner": "",
"timeLinked": ""
},
"conversionPings": {
"pings": [
{
"context": "",
"conversionUrl": ""
}
]
},
"etag": "",
"id": "",
"kind": "",
"localizations": {},
"snippet": {
"country": "",
"customUrl": "",
"defaultLanguage": "",
"description": "",
"localized": {
"description": "",
"title": ""
},
"publishedAt": "",
"thumbnails": {
"high": {
"height": 0,
"url": "",
"width": 0
},
"maxres": {},
"medium": {},
"standard": {}
},
"title": ""
},
"statistics": {
"commentCount": "",
"hiddenSubscriberCount": false,
"subscriberCount": "",
"videoCount": "",
"viewCount": ""
},
"status": {
"isLinked": false,
"longUploadsStatus": "",
"madeForKids": false,
"privacyStatus": "",
"selfDeclaredMadeForKids": false
},
"topicDetails": {
"topicCategories": [],
"topicIds": []
}
}' | \
http PUT '{{baseUrl}}/youtube/v3/channels?part=' \
content-type:application/json
wget --quiet \
--method PUT \
--header 'content-type: application/json' \
--body-data '{\n "auditDetails": {\n "communityGuidelinesGoodStanding": false,\n "contentIdClaimsGoodStanding": false,\n "copyrightStrikesGoodStanding": false\n },\n "brandingSettings": {\n "channel": {\n "country": "",\n "defaultLanguage": "",\n "defaultTab": "",\n "description": "",\n "featuredChannelsTitle": "",\n "featuredChannelsUrls": [],\n "keywords": "",\n "moderateComments": false,\n "profileColor": "",\n "showBrowseView": false,\n "showRelatedChannels": false,\n "title": "",\n "trackingAnalyticsAccountId": "",\n "unsubscribedTrailer": ""\n },\n "hints": [\n {\n "property": "",\n "value": ""\n }\n ],\n "image": {\n "backgroundImageUrl": {\n "defaultLanguage": {\n "value": ""\n },\n "localized": [\n {\n "language": "",\n "value": ""\n }\n ]\n },\n "bannerExternalUrl": "",\n "bannerImageUrl": "",\n "bannerMobileExtraHdImageUrl": "",\n "bannerMobileHdImageUrl": "",\n "bannerMobileImageUrl": "",\n "bannerMobileLowImageUrl": "",\n "bannerMobileMediumHdImageUrl": "",\n "bannerTabletExtraHdImageUrl": "",\n "bannerTabletHdImageUrl": "",\n "bannerTabletImageUrl": "",\n "bannerTabletLowImageUrl": "",\n "bannerTvHighImageUrl": "",\n "bannerTvImageUrl": "",\n "bannerTvLowImageUrl": "",\n "bannerTvMediumImageUrl": "",\n "largeBrandedBannerImageImapScript": {},\n "largeBrandedBannerImageUrl": {},\n "smallBrandedBannerImageImapScript": {},\n "smallBrandedBannerImageUrl": {},\n "trackingImageUrl": "",\n "watchIconImageUrl": ""\n },\n "watch": {\n "backgroundColor": "",\n "featuredPlaylistId": "",\n "textColor": ""\n }\n },\n "contentDetails": {\n "relatedPlaylists": {\n "favorites": "",\n "likes": "",\n "uploads": "",\n "watchHistory": "",\n "watchLater": ""\n }\n },\n "contentOwnerDetails": {\n "contentOwner": "",\n "timeLinked": ""\n },\n "conversionPings": {\n "pings": [\n {\n "context": "",\n "conversionUrl": ""\n }\n ]\n },\n "etag": "",\n "id": "",\n "kind": "",\n "localizations": {},\n "snippet": {\n "country": "",\n "customUrl": "",\n "defaultLanguage": "",\n "description": "",\n "localized": {\n "description": "",\n "title": ""\n },\n "publishedAt": "",\n "thumbnails": {\n "high": {\n "height": 0,\n "url": "",\n "width": 0\n },\n "maxres": {},\n "medium": {},\n "standard": {}\n },\n "title": ""\n },\n "statistics": {\n "commentCount": "",\n "hiddenSubscriberCount": false,\n "subscriberCount": "",\n "videoCount": "",\n "viewCount": ""\n },\n "status": {\n "isLinked": false,\n "longUploadsStatus": "",\n "madeForKids": false,\n "privacyStatus": "",\n "selfDeclaredMadeForKids": false\n },\n "topicDetails": {\n "topicCategories": [],\n "topicIds": []\n }\n}' \
--output-document \
- '{{baseUrl}}/youtube/v3/channels?part='
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"auditDetails": [
"communityGuidelinesGoodStanding": false,
"contentIdClaimsGoodStanding": false,
"copyrightStrikesGoodStanding": false
],
"brandingSettings": [
"channel": [
"country": "",
"defaultLanguage": "",
"defaultTab": "",
"description": "",
"featuredChannelsTitle": "",
"featuredChannelsUrls": [],
"keywords": "",
"moderateComments": false,
"profileColor": "",
"showBrowseView": false,
"showRelatedChannels": false,
"title": "",
"trackingAnalyticsAccountId": "",
"unsubscribedTrailer": ""
],
"hints": [
[
"property": "",
"value": ""
]
],
"image": [
"backgroundImageUrl": [
"defaultLanguage": ["value": ""],
"localized": [
[
"language": "",
"value": ""
]
]
],
"bannerExternalUrl": "",
"bannerImageUrl": "",
"bannerMobileExtraHdImageUrl": "",
"bannerMobileHdImageUrl": "",
"bannerMobileImageUrl": "",
"bannerMobileLowImageUrl": "",
"bannerMobileMediumHdImageUrl": "",
"bannerTabletExtraHdImageUrl": "",
"bannerTabletHdImageUrl": "",
"bannerTabletImageUrl": "",
"bannerTabletLowImageUrl": "",
"bannerTvHighImageUrl": "",
"bannerTvImageUrl": "",
"bannerTvLowImageUrl": "",
"bannerTvMediumImageUrl": "",
"largeBrandedBannerImageImapScript": [],
"largeBrandedBannerImageUrl": [],
"smallBrandedBannerImageImapScript": [],
"smallBrandedBannerImageUrl": [],
"trackingImageUrl": "",
"watchIconImageUrl": ""
],
"watch": [
"backgroundColor": "",
"featuredPlaylistId": "",
"textColor": ""
]
],
"contentDetails": ["relatedPlaylists": [
"favorites": "",
"likes": "",
"uploads": "",
"watchHistory": "",
"watchLater": ""
]],
"contentOwnerDetails": [
"contentOwner": "",
"timeLinked": ""
],
"conversionPings": ["pings": [
[
"context": "",
"conversionUrl": ""
]
]],
"etag": "",
"id": "",
"kind": "",
"localizations": [],
"snippet": [
"country": "",
"customUrl": "",
"defaultLanguage": "",
"description": "",
"localized": [
"description": "",
"title": ""
],
"publishedAt": "",
"thumbnails": [
"high": [
"height": 0,
"url": "",
"width": 0
],
"maxres": [],
"medium": [],
"standard": []
],
"title": ""
],
"statistics": [
"commentCount": "",
"hiddenSubscriberCount": false,
"subscriberCount": "",
"videoCount": "",
"viewCount": ""
],
"status": [
"isLinked": false,
"longUploadsStatus": "",
"madeForKids": false,
"privacyStatus": "",
"selfDeclaredMadeForKids": false
],
"topicDetails": [
"topicCategories": [],
"topicIds": []
]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/youtube/v3/channels?part=")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
DELETE
youtube.channelSections.delete
{{baseUrl}}/youtube/v3/channelSections
QUERY PARAMS
id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/youtube/v3/channelSections?id=");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/delete "{{baseUrl}}/youtube/v3/channelSections" {:query-params {:id ""}})
require "http/client"
url = "{{baseUrl}}/youtube/v3/channelSections?id="
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}}/youtube/v3/channelSections?id="),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/youtube/v3/channelSections?id=");
var request = new RestRequest("", Method.Delete);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/youtube/v3/channelSections?id="
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/youtube/v3/channelSections?id= HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/youtube/v3/channelSections?id=")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/youtube/v3/channelSections?id="))
.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}}/youtube/v3/channelSections?id=")
.delete(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/youtube/v3/channelSections?id=")
.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}}/youtube/v3/channelSections?id=');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'DELETE',
url: '{{baseUrl}}/youtube/v3/channelSections',
params: {id: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/youtube/v3/channelSections?id=';
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}}/youtube/v3/channelSections?id=',
method: 'DELETE',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/youtube/v3/channelSections?id=")
.delete(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'DELETE',
hostname: 'example.com',
port: null,
path: '/baseUrl/youtube/v3/channelSections?id=',
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}}/youtube/v3/channelSections',
qs: {id: ''}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('DELETE', '{{baseUrl}}/youtube/v3/channelSections');
req.query({
id: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'DELETE',
url: '{{baseUrl}}/youtube/v3/channelSections',
params: {id: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/youtube/v3/channelSections?id=';
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}}/youtube/v3/channelSections?id="]
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}}/youtube/v3/channelSections?id=" in
Client.call `DELETE uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/youtube/v3/channelSections?id=",
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}}/youtube/v3/channelSections?id=');
echo $response->getBody();
setUrl('{{baseUrl}}/youtube/v3/channelSections');
$request->setMethod(HTTP_METH_DELETE);
$request->setQueryData([
'id' => ''
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/youtube/v3/channelSections');
$request->setRequestMethod('DELETE');
$request->setQuery(new http\QueryString([
'id' => ''
]));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/youtube/v3/channelSections?id=' -Method DELETE
$response = Invoke-RestMethod -Uri '{{baseUrl}}/youtube/v3/channelSections?id=' -Method DELETE
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("DELETE", "/baseUrl/youtube/v3/channelSections?id=")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/youtube/v3/channelSections"
querystring = {"id":""}
response = requests.delete(url, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/youtube/v3/channelSections"
queryString <- list(id = "")
response <- VERB("DELETE", url, query = queryString, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/youtube/v3/channelSections?id=")
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/youtube/v3/channelSections') do |req|
req.params['id'] = ''
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/youtube/v3/channelSections";
let querystring = [
("id", ""),
];
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("DELETE").unwrap(), url)
.query(&querystring)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request DELETE \
--url '{{baseUrl}}/youtube/v3/channelSections?id='
http DELETE '{{baseUrl}}/youtube/v3/channelSections?id='
wget --quiet \
--method DELETE \
--output-document \
- '{{baseUrl}}/youtube/v3/channelSections?id='
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/youtube/v3/channelSections?id=")! 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()
POST
youtube.channelSections.insert
{{baseUrl}}/youtube/v3/channelSections
QUERY PARAMS
part
BODY json
{
"contentDetails": {
"channels": [],
"playlists": []
},
"etag": "",
"id": "",
"kind": "",
"localizations": {},
"snippet": {
"channelId": "",
"defaultLanguage": "",
"localized": {
"title": ""
},
"position": 0,
"style": "",
"title": "",
"type": ""
},
"targeting": {
"countries": [],
"languages": [],
"regions": []
}
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/youtube/v3/channelSections?part=");
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 \"contentDetails\": {\n \"channels\": [],\n \"playlists\": []\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"localizations\": {},\n \"snippet\": {\n \"channelId\": \"\",\n \"defaultLanguage\": \"\",\n \"localized\": {\n \"title\": \"\"\n },\n \"position\": 0,\n \"style\": \"\",\n \"title\": \"\",\n \"type\": \"\"\n },\n \"targeting\": {\n \"countries\": [],\n \"languages\": [],\n \"regions\": []\n }\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/youtube/v3/channelSections" {:query-params {:part ""}
:content-type :json
:form-params {:contentDetails {:channels []
:playlists []}
:etag ""
:id ""
:kind ""
:localizations {}
:snippet {:channelId ""
:defaultLanguage ""
:localized {:title ""}
:position 0
:style ""
:title ""
:type ""}
:targeting {:countries []
:languages []
:regions []}}})
require "http/client"
url = "{{baseUrl}}/youtube/v3/channelSections?part="
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"contentDetails\": {\n \"channels\": [],\n \"playlists\": []\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"localizations\": {},\n \"snippet\": {\n \"channelId\": \"\",\n \"defaultLanguage\": \"\",\n \"localized\": {\n \"title\": \"\"\n },\n \"position\": 0,\n \"style\": \"\",\n \"title\": \"\",\n \"type\": \"\"\n },\n \"targeting\": {\n \"countries\": [],\n \"languages\": [],\n \"regions\": []\n }\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/youtube/v3/channelSections?part="),
Content = new StringContent("{\n \"contentDetails\": {\n \"channels\": [],\n \"playlists\": []\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"localizations\": {},\n \"snippet\": {\n \"channelId\": \"\",\n \"defaultLanguage\": \"\",\n \"localized\": {\n \"title\": \"\"\n },\n \"position\": 0,\n \"style\": \"\",\n \"title\": \"\",\n \"type\": \"\"\n },\n \"targeting\": {\n \"countries\": [],\n \"languages\": [],\n \"regions\": []\n }\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/youtube/v3/channelSections?part=");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"contentDetails\": {\n \"channels\": [],\n \"playlists\": []\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"localizations\": {},\n \"snippet\": {\n \"channelId\": \"\",\n \"defaultLanguage\": \"\",\n \"localized\": {\n \"title\": \"\"\n },\n \"position\": 0,\n \"style\": \"\",\n \"title\": \"\",\n \"type\": \"\"\n },\n \"targeting\": {\n \"countries\": [],\n \"languages\": [],\n \"regions\": []\n }\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/youtube/v3/channelSections?part="
payload := strings.NewReader("{\n \"contentDetails\": {\n \"channels\": [],\n \"playlists\": []\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"localizations\": {},\n \"snippet\": {\n \"channelId\": \"\",\n \"defaultLanguage\": \"\",\n \"localized\": {\n \"title\": \"\"\n },\n \"position\": 0,\n \"style\": \"\",\n \"title\": \"\",\n \"type\": \"\"\n },\n \"targeting\": {\n \"countries\": [],\n \"languages\": [],\n \"regions\": []\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/youtube/v3/channelSections?part= HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 394
{
"contentDetails": {
"channels": [],
"playlists": []
},
"etag": "",
"id": "",
"kind": "",
"localizations": {},
"snippet": {
"channelId": "",
"defaultLanguage": "",
"localized": {
"title": ""
},
"position": 0,
"style": "",
"title": "",
"type": ""
},
"targeting": {
"countries": [],
"languages": [],
"regions": []
}
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/youtube/v3/channelSections?part=")
.setHeader("content-type", "application/json")
.setBody("{\n \"contentDetails\": {\n \"channels\": [],\n \"playlists\": []\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"localizations\": {},\n \"snippet\": {\n \"channelId\": \"\",\n \"defaultLanguage\": \"\",\n \"localized\": {\n \"title\": \"\"\n },\n \"position\": 0,\n \"style\": \"\",\n \"title\": \"\",\n \"type\": \"\"\n },\n \"targeting\": {\n \"countries\": [],\n \"languages\": [],\n \"regions\": []\n }\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/youtube/v3/channelSections?part="))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"contentDetails\": {\n \"channels\": [],\n \"playlists\": []\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"localizations\": {},\n \"snippet\": {\n \"channelId\": \"\",\n \"defaultLanguage\": \"\",\n \"localized\": {\n \"title\": \"\"\n },\n \"position\": 0,\n \"style\": \"\",\n \"title\": \"\",\n \"type\": \"\"\n },\n \"targeting\": {\n \"countries\": [],\n \"languages\": [],\n \"regions\": []\n }\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"contentDetails\": {\n \"channels\": [],\n \"playlists\": []\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"localizations\": {},\n \"snippet\": {\n \"channelId\": \"\",\n \"defaultLanguage\": \"\",\n \"localized\": {\n \"title\": \"\"\n },\n \"position\": 0,\n \"style\": \"\",\n \"title\": \"\",\n \"type\": \"\"\n },\n \"targeting\": {\n \"countries\": [],\n \"languages\": [],\n \"regions\": []\n }\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/youtube/v3/channelSections?part=")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/youtube/v3/channelSections?part=")
.header("content-type", "application/json")
.body("{\n \"contentDetails\": {\n \"channels\": [],\n \"playlists\": []\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"localizations\": {},\n \"snippet\": {\n \"channelId\": \"\",\n \"defaultLanguage\": \"\",\n \"localized\": {\n \"title\": \"\"\n },\n \"position\": 0,\n \"style\": \"\",\n \"title\": \"\",\n \"type\": \"\"\n },\n \"targeting\": {\n \"countries\": [],\n \"languages\": [],\n \"regions\": []\n }\n}")
.asString();
const data = JSON.stringify({
contentDetails: {
channels: [],
playlists: []
},
etag: '',
id: '',
kind: '',
localizations: {},
snippet: {
channelId: '',
defaultLanguage: '',
localized: {
title: ''
},
position: 0,
style: '',
title: '',
type: ''
},
targeting: {
countries: [],
languages: [],
regions: []
}
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/youtube/v3/channelSections?part=');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/youtube/v3/channelSections',
params: {part: ''},
headers: {'content-type': 'application/json'},
data: {
contentDetails: {channels: [], playlists: []},
etag: '',
id: '',
kind: '',
localizations: {},
snippet: {
channelId: '',
defaultLanguage: '',
localized: {title: ''},
position: 0,
style: '',
title: '',
type: ''
},
targeting: {countries: [], languages: [], regions: []}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/youtube/v3/channelSections?part=';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"contentDetails":{"channels":[],"playlists":[]},"etag":"","id":"","kind":"","localizations":{},"snippet":{"channelId":"","defaultLanguage":"","localized":{"title":""},"position":0,"style":"","title":"","type":""},"targeting":{"countries":[],"languages":[],"regions":[]}}'
};
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}}/youtube/v3/channelSections?part=',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "contentDetails": {\n "channels": [],\n "playlists": []\n },\n "etag": "",\n "id": "",\n "kind": "",\n "localizations": {},\n "snippet": {\n "channelId": "",\n "defaultLanguage": "",\n "localized": {\n "title": ""\n },\n "position": 0,\n "style": "",\n "title": "",\n "type": ""\n },\n "targeting": {\n "countries": [],\n "languages": [],\n "regions": []\n }\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"contentDetails\": {\n \"channels\": [],\n \"playlists\": []\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"localizations\": {},\n \"snippet\": {\n \"channelId\": \"\",\n \"defaultLanguage\": \"\",\n \"localized\": {\n \"title\": \"\"\n },\n \"position\": 0,\n \"style\": \"\",\n \"title\": \"\",\n \"type\": \"\"\n },\n \"targeting\": {\n \"countries\": [],\n \"languages\": [],\n \"regions\": []\n }\n}")
val request = Request.Builder()
.url("{{baseUrl}}/youtube/v3/channelSections?part=")
.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/youtube/v3/channelSections?part=',
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({
contentDetails: {channels: [], playlists: []},
etag: '',
id: '',
kind: '',
localizations: {},
snippet: {
channelId: '',
defaultLanguage: '',
localized: {title: ''},
position: 0,
style: '',
title: '',
type: ''
},
targeting: {countries: [], languages: [], regions: []}
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/youtube/v3/channelSections',
qs: {part: ''},
headers: {'content-type': 'application/json'},
body: {
contentDetails: {channels: [], playlists: []},
etag: '',
id: '',
kind: '',
localizations: {},
snippet: {
channelId: '',
defaultLanguage: '',
localized: {title: ''},
position: 0,
style: '',
title: '',
type: ''
},
targeting: {countries: [], languages: [], regions: []}
},
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}}/youtube/v3/channelSections');
req.query({
part: ''
});
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
contentDetails: {
channels: [],
playlists: []
},
etag: '',
id: '',
kind: '',
localizations: {},
snippet: {
channelId: '',
defaultLanguage: '',
localized: {
title: ''
},
position: 0,
style: '',
title: '',
type: ''
},
targeting: {
countries: [],
languages: [],
regions: []
}
});
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}}/youtube/v3/channelSections',
params: {part: ''},
headers: {'content-type': 'application/json'},
data: {
contentDetails: {channels: [], playlists: []},
etag: '',
id: '',
kind: '',
localizations: {},
snippet: {
channelId: '',
defaultLanguage: '',
localized: {title: ''},
position: 0,
style: '',
title: '',
type: ''
},
targeting: {countries: [], languages: [], regions: []}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/youtube/v3/channelSections?part=';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"contentDetails":{"channels":[],"playlists":[]},"etag":"","id":"","kind":"","localizations":{},"snippet":{"channelId":"","defaultLanguage":"","localized":{"title":""},"position":0,"style":"","title":"","type":""},"targeting":{"countries":[],"languages":[],"regions":[]}}'
};
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 = @{ @"contentDetails": @{ @"channels": @[ ], @"playlists": @[ ] },
@"etag": @"",
@"id": @"",
@"kind": @"",
@"localizations": @{ },
@"snippet": @{ @"channelId": @"", @"defaultLanguage": @"", @"localized": @{ @"title": @"" }, @"position": @0, @"style": @"", @"title": @"", @"type": @"" },
@"targeting": @{ @"countries": @[ ], @"languages": @[ ], @"regions": @[ ] } };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/youtube/v3/channelSections?part="]
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}}/youtube/v3/channelSections?part=" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"contentDetails\": {\n \"channels\": [],\n \"playlists\": []\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"localizations\": {},\n \"snippet\": {\n \"channelId\": \"\",\n \"defaultLanguage\": \"\",\n \"localized\": {\n \"title\": \"\"\n },\n \"position\": 0,\n \"style\": \"\",\n \"title\": \"\",\n \"type\": \"\"\n },\n \"targeting\": {\n \"countries\": [],\n \"languages\": [],\n \"regions\": []\n }\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/youtube/v3/channelSections?part=",
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([
'contentDetails' => [
'channels' => [
],
'playlists' => [
]
],
'etag' => '',
'id' => '',
'kind' => '',
'localizations' => [
],
'snippet' => [
'channelId' => '',
'defaultLanguage' => '',
'localized' => [
'title' => ''
],
'position' => 0,
'style' => '',
'title' => '',
'type' => ''
],
'targeting' => [
'countries' => [
],
'languages' => [
],
'regions' => [
]
]
]),
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}}/youtube/v3/channelSections?part=', [
'body' => '{
"contentDetails": {
"channels": [],
"playlists": []
},
"etag": "",
"id": "",
"kind": "",
"localizations": {},
"snippet": {
"channelId": "",
"defaultLanguage": "",
"localized": {
"title": ""
},
"position": 0,
"style": "",
"title": "",
"type": ""
},
"targeting": {
"countries": [],
"languages": [],
"regions": []
}
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/youtube/v3/channelSections');
$request->setMethod(HTTP_METH_POST);
$request->setQueryData([
'part' => ''
]);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'contentDetails' => [
'channels' => [
],
'playlists' => [
]
],
'etag' => '',
'id' => '',
'kind' => '',
'localizations' => [
],
'snippet' => [
'channelId' => '',
'defaultLanguage' => '',
'localized' => [
'title' => ''
],
'position' => 0,
'style' => '',
'title' => '',
'type' => ''
],
'targeting' => [
'countries' => [
],
'languages' => [
],
'regions' => [
]
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'contentDetails' => [
'channels' => [
],
'playlists' => [
]
],
'etag' => '',
'id' => '',
'kind' => '',
'localizations' => [
],
'snippet' => [
'channelId' => '',
'defaultLanguage' => '',
'localized' => [
'title' => ''
],
'position' => 0,
'style' => '',
'title' => '',
'type' => ''
],
'targeting' => [
'countries' => [
],
'languages' => [
],
'regions' => [
]
]
]));
$request->setRequestUrl('{{baseUrl}}/youtube/v3/channelSections');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setQuery(new http\QueryString([
'part' => ''
]));
$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}}/youtube/v3/channelSections?part=' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"contentDetails": {
"channels": [],
"playlists": []
},
"etag": "",
"id": "",
"kind": "",
"localizations": {},
"snippet": {
"channelId": "",
"defaultLanguage": "",
"localized": {
"title": ""
},
"position": 0,
"style": "",
"title": "",
"type": ""
},
"targeting": {
"countries": [],
"languages": [],
"regions": []
}
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/youtube/v3/channelSections?part=' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"contentDetails": {
"channels": [],
"playlists": []
},
"etag": "",
"id": "",
"kind": "",
"localizations": {},
"snippet": {
"channelId": "",
"defaultLanguage": "",
"localized": {
"title": ""
},
"position": 0,
"style": "",
"title": "",
"type": ""
},
"targeting": {
"countries": [],
"languages": [],
"regions": []
}
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"contentDetails\": {\n \"channels\": [],\n \"playlists\": []\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"localizations\": {},\n \"snippet\": {\n \"channelId\": \"\",\n \"defaultLanguage\": \"\",\n \"localized\": {\n \"title\": \"\"\n },\n \"position\": 0,\n \"style\": \"\",\n \"title\": \"\",\n \"type\": \"\"\n },\n \"targeting\": {\n \"countries\": [],\n \"languages\": [],\n \"regions\": []\n }\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/youtube/v3/channelSections?part=", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/youtube/v3/channelSections"
querystring = {"part":""}
payload = {
"contentDetails": {
"channels": [],
"playlists": []
},
"etag": "",
"id": "",
"kind": "",
"localizations": {},
"snippet": {
"channelId": "",
"defaultLanguage": "",
"localized": { "title": "" },
"position": 0,
"style": "",
"title": "",
"type": ""
},
"targeting": {
"countries": [],
"languages": [],
"regions": []
}
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/youtube/v3/channelSections"
queryString <- list(part = "")
payload <- "{\n \"contentDetails\": {\n \"channels\": [],\n \"playlists\": []\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"localizations\": {},\n \"snippet\": {\n \"channelId\": \"\",\n \"defaultLanguage\": \"\",\n \"localized\": {\n \"title\": \"\"\n },\n \"position\": 0,\n \"style\": \"\",\n \"title\": \"\",\n \"type\": \"\"\n },\n \"targeting\": {\n \"countries\": [],\n \"languages\": [],\n \"regions\": []\n }\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, query = queryString, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/youtube/v3/channelSections?part=")
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 \"contentDetails\": {\n \"channels\": [],\n \"playlists\": []\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"localizations\": {},\n \"snippet\": {\n \"channelId\": \"\",\n \"defaultLanguage\": \"\",\n \"localized\": {\n \"title\": \"\"\n },\n \"position\": 0,\n \"style\": \"\",\n \"title\": \"\",\n \"type\": \"\"\n },\n \"targeting\": {\n \"countries\": [],\n \"languages\": [],\n \"regions\": []\n }\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/youtube/v3/channelSections') do |req|
req.params['part'] = ''
req.body = "{\n \"contentDetails\": {\n \"channels\": [],\n \"playlists\": []\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"localizations\": {},\n \"snippet\": {\n \"channelId\": \"\",\n \"defaultLanguage\": \"\",\n \"localized\": {\n \"title\": \"\"\n },\n \"position\": 0,\n \"style\": \"\",\n \"title\": \"\",\n \"type\": \"\"\n },\n \"targeting\": {\n \"countries\": [],\n \"languages\": [],\n \"regions\": []\n }\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/youtube/v3/channelSections";
let querystring = [
("part", ""),
];
let payload = json!({
"contentDetails": json!({
"channels": (),
"playlists": ()
}),
"etag": "",
"id": "",
"kind": "",
"localizations": json!({}),
"snippet": json!({
"channelId": "",
"defaultLanguage": "",
"localized": json!({"title": ""}),
"position": 0,
"style": "",
"title": "",
"type": ""
}),
"targeting": json!({
"countries": (),
"languages": (),
"regions": ()
})
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.query(&querystring)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/youtube/v3/channelSections?part=' \
--header 'content-type: application/json' \
--data '{
"contentDetails": {
"channels": [],
"playlists": []
},
"etag": "",
"id": "",
"kind": "",
"localizations": {},
"snippet": {
"channelId": "",
"defaultLanguage": "",
"localized": {
"title": ""
},
"position": 0,
"style": "",
"title": "",
"type": ""
},
"targeting": {
"countries": [],
"languages": [],
"regions": []
}
}'
echo '{
"contentDetails": {
"channels": [],
"playlists": []
},
"etag": "",
"id": "",
"kind": "",
"localizations": {},
"snippet": {
"channelId": "",
"defaultLanguage": "",
"localized": {
"title": ""
},
"position": 0,
"style": "",
"title": "",
"type": ""
},
"targeting": {
"countries": [],
"languages": [],
"regions": []
}
}' | \
http POST '{{baseUrl}}/youtube/v3/channelSections?part=' \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "contentDetails": {\n "channels": [],\n "playlists": []\n },\n "etag": "",\n "id": "",\n "kind": "",\n "localizations": {},\n "snippet": {\n "channelId": "",\n "defaultLanguage": "",\n "localized": {\n "title": ""\n },\n "position": 0,\n "style": "",\n "title": "",\n "type": ""\n },\n "targeting": {\n "countries": [],\n "languages": [],\n "regions": []\n }\n}' \
--output-document \
- '{{baseUrl}}/youtube/v3/channelSections?part='
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"contentDetails": [
"channels": [],
"playlists": []
],
"etag": "",
"id": "",
"kind": "",
"localizations": [],
"snippet": [
"channelId": "",
"defaultLanguage": "",
"localized": ["title": ""],
"position": 0,
"style": "",
"title": "",
"type": ""
],
"targeting": [
"countries": [],
"languages": [],
"regions": []
]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/youtube/v3/channelSections?part=")! 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()
GET
youtube.channelSections.list
{{baseUrl}}/youtube/v3/channelSections
QUERY PARAMS
part
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/youtube/v3/channelSections?part=");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/youtube/v3/channelSections" {:query-params {:part ""}})
require "http/client"
url = "{{baseUrl}}/youtube/v3/channelSections?part="
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}}/youtube/v3/channelSections?part="),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/youtube/v3/channelSections?part=");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/youtube/v3/channelSections?part="
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/youtube/v3/channelSections?part= HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/youtube/v3/channelSections?part=")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/youtube/v3/channelSections?part="))
.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}}/youtube/v3/channelSections?part=")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/youtube/v3/channelSections?part=")
.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}}/youtube/v3/channelSections?part=');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/youtube/v3/channelSections',
params: {part: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/youtube/v3/channelSections?part=';
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}}/youtube/v3/channelSections?part=',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/youtube/v3/channelSections?part=")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/youtube/v3/channelSections?part=',
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}}/youtube/v3/channelSections',
qs: {part: ''}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/youtube/v3/channelSections');
req.query({
part: ''
});
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}}/youtube/v3/channelSections',
params: {part: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/youtube/v3/channelSections?part=';
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}}/youtube/v3/channelSections?part="]
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}}/youtube/v3/channelSections?part=" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/youtube/v3/channelSections?part=",
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}}/youtube/v3/channelSections?part=');
echo $response->getBody();
setUrl('{{baseUrl}}/youtube/v3/channelSections');
$request->setMethod(HTTP_METH_GET);
$request->setQueryData([
'part' => ''
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/youtube/v3/channelSections');
$request->setRequestMethod('GET');
$request->setQuery(new http\QueryString([
'part' => ''
]));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/youtube/v3/channelSections?part=' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/youtube/v3/channelSections?part=' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/youtube/v3/channelSections?part=")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/youtube/v3/channelSections"
querystring = {"part":""}
response = requests.get(url, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/youtube/v3/channelSections"
queryString <- list(part = "")
response <- VERB("GET", url, query = queryString, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/youtube/v3/channelSections?part=")
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/youtube/v3/channelSections') do |req|
req.params['part'] = ''
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/youtube/v3/channelSections";
let querystring = [
("part", ""),
];
let client = reqwest::Client::new();
let response = client.get(url)
.query(&querystring)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url '{{baseUrl}}/youtube/v3/channelSections?part='
http GET '{{baseUrl}}/youtube/v3/channelSections?part='
wget --quiet \
--method GET \
--output-document \
- '{{baseUrl}}/youtube/v3/channelSections?part='
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/youtube/v3/channelSections?part=")! 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()
PUT
youtube.channelSections.update
{{baseUrl}}/youtube/v3/channelSections
QUERY PARAMS
part
BODY json
{
"contentDetails": {
"channels": [],
"playlists": []
},
"etag": "",
"id": "",
"kind": "",
"localizations": {},
"snippet": {
"channelId": "",
"defaultLanguage": "",
"localized": {
"title": ""
},
"position": 0,
"style": "",
"title": "",
"type": ""
},
"targeting": {
"countries": [],
"languages": [],
"regions": []
}
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/youtube/v3/channelSections?part=");
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 \"contentDetails\": {\n \"channels\": [],\n \"playlists\": []\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"localizations\": {},\n \"snippet\": {\n \"channelId\": \"\",\n \"defaultLanguage\": \"\",\n \"localized\": {\n \"title\": \"\"\n },\n \"position\": 0,\n \"style\": \"\",\n \"title\": \"\",\n \"type\": \"\"\n },\n \"targeting\": {\n \"countries\": [],\n \"languages\": [],\n \"regions\": []\n }\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/youtube/v3/channelSections" {:query-params {:part ""}
:content-type :json
:form-params {:contentDetails {:channels []
:playlists []}
:etag ""
:id ""
:kind ""
:localizations {}
:snippet {:channelId ""
:defaultLanguage ""
:localized {:title ""}
:position 0
:style ""
:title ""
:type ""}
:targeting {:countries []
:languages []
:regions []}}})
require "http/client"
url = "{{baseUrl}}/youtube/v3/channelSections?part="
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"contentDetails\": {\n \"channels\": [],\n \"playlists\": []\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"localizations\": {},\n \"snippet\": {\n \"channelId\": \"\",\n \"defaultLanguage\": \"\",\n \"localized\": {\n \"title\": \"\"\n },\n \"position\": 0,\n \"style\": \"\",\n \"title\": \"\",\n \"type\": \"\"\n },\n \"targeting\": {\n \"countries\": [],\n \"languages\": [],\n \"regions\": []\n }\n}"
response = HTTP::Client.put url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Put,
RequestUri = new Uri("{{baseUrl}}/youtube/v3/channelSections?part="),
Content = new StringContent("{\n \"contentDetails\": {\n \"channels\": [],\n \"playlists\": []\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"localizations\": {},\n \"snippet\": {\n \"channelId\": \"\",\n \"defaultLanguage\": \"\",\n \"localized\": {\n \"title\": \"\"\n },\n \"position\": 0,\n \"style\": \"\",\n \"title\": \"\",\n \"type\": \"\"\n },\n \"targeting\": {\n \"countries\": [],\n \"languages\": [],\n \"regions\": []\n }\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/youtube/v3/channelSections?part=");
var request = new RestRequest("", Method.Put);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"contentDetails\": {\n \"channels\": [],\n \"playlists\": []\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"localizations\": {},\n \"snippet\": {\n \"channelId\": \"\",\n \"defaultLanguage\": \"\",\n \"localized\": {\n \"title\": \"\"\n },\n \"position\": 0,\n \"style\": \"\",\n \"title\": \"\",\n \"type\": \"\"\n },\n \"targeting\": {\n \"countries\": [],\n \"languages\": [],\n \"regions\": []\n }\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/youtube/v3/channelSections?part="
payload := strings.NewReader("{\n \"contentDetails\": {\n \"channels\": [],\n \"playlists\": []\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"localizations\": {},\n \"snippet\": {\n \"channelId\": \"\",\n \"defaultLanguage\": \"\",\n \"localized\": {\n \"title\": \"\"\n },\n \"position\": 0,\n \"style\": \"\",\n \"title\": \"\",\n \"type\": \"\"\n },\n \"targeting\": {\n \"countries\": [],\n \"languages\": [],\n \"regions\": []\n }\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PUT /baseUrl/youtube/v3/channelSections?part= HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 394
{
"contentDetails": {
"channels": [],
"playlists": []
},
"etag": "",
"id": "",
"kind": "",
"localizations": {},
"snippet": {
"channelId": "",
"defaultLanguage": "",
"localized": {
"title": ""
},
"position": 0,
"style": "",
"title": "",
"type": ""
},
"targeting": {
"countries": [],
"languages": [],
"regions": []
}
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/youtube/v3/channelSections?part=")
.setHeader("content-type", "application/json")
.setBody("{\n \"contentDetails\": {\n \"channels\": [],\n \"playlists\": []\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"localizations\": {},\n \"snippet\": {\n \"channelId\": \"\",\n \"defaultLanguage\": \"\",\n \"localized\": {\n \"title\": \"\"\n },\n \"position\": 0,\n \"style\": \"\",\n \"title\": \"\",\n \"type\": \"\"\n },\n \"targeting\": {\n \"countries\": [],\n \"languages\": [],\n \"regions\": []\n }\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/youtube/v3/channelSections?part="))
.header("content-type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString("{\n \"contentDetails\": {\n \"channels\": [],\n \"playlists\": []\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"localizations\": {},\n \"snippet\": {\n \"channelId\": \"\",\n \"defaultLanguage\": \"\",\n \"localized\": {\n \"title\": \"\"\n },\n \"position\": 0,\n \"style\": \"\",\n \"title\": \"\",\n \"type\": \"\"\n },\n \"targeting\": {\n \"countries\": [],\n \"languages\": [],\n \"regions\": []\n }\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"contentDetails\": {\n \"channels\": [],\n \"playlists\": []\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"localizations\": {},\n \"snippet\": {\n \"channelId\": \"\",\n \"defaultLanguage\": \"\",\n \"localized\": {\n \"title\": \"\"\n },\n \"position\": 0,\n \"style\": \"\",\n \"title\": \"\",\n \"type\": \"\"\n },\n \"targeting\": {\n \"countries\": [],\n \"languages\": [],\n \"regions\": []\n }\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/youtube/v3/channelSections?part=")
.put(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/youtube/v3/channelSections?part=")
.header("content-type", "application/json")
.body("{\n \"contentDetails\": {\n \"channels\": [],\n \"playlists\": []\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"localizations\": {},\n \"snippet\": {\n \"channelId\": \"\",\n \"defaultLanguage\": \"\",\n \"localized\": {\n \"title\": \"\"\n },\n \"position\": 0,\n \"style\": \"\",\n \"title\": \"\",\n \"type\": \"\"\n },\n \"targeting\": {\n \"countries\": [],\n \"languages\": [],\n \"regions\": []\n }\n}")
.asString();
const data = JSON.stringify({
contentDetails: {
channels: [],
playlists: []
},
etag: '',
id: '',
kind: '',
localizations: {},
snippet: {
channelId: '',
defaultLanguage: '',
localized: {
title: ''
},
position: 0,
style: '',
title: '',
type: ''
},
targeting: {
countries: [],
languages: [],
regions: []
}
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/youtube/v3/channelSections?part=');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/youtube/v3/channelSections',
params: {part: ''},
headers: {'content-type': 'application/json'},
data: {
contentDetails: {channels: [], playlists: []},
etag: '',
id: '',
kind: '',
localizations: {},
snippet: {
channelId: '',
defaultLanguage: '',
localized: {title: ''},
position: 0,
style: '',
title: '',
type: ''
},
targeting: {countries: [], languages: [], regions: []}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/youtube/v3/channelSections?part=';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"contentDetails":{"channels":[],"playlists":[]},"etag":"","id":"","kind":"","localizations":{},"snippet":{"channelId":"","defaultLanguage":"","localized":{"title":""},"position":0,"style":"","title":"","type":""},"targeting":{"countries":[],"languages":[],"regions":[]}}'
};
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}}/youtube/v3/channelSections?part=',
method: 'PUT',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "contentDetails": {\n "channels": [],\n "playlists": []\n },\n "etag": "",\n "id": "",\n "kind": "",\n "localizations": {},\n "snippet": {\n "channelId": "",\n "defaultLanguage": "",\n "localized": {\n "title": ""\n },\n "position": 0,\n "style": "",\n "title": "",\n "type": ""\n },\n "targeting": {\n "countries": [],\n "languages": [],\n "regions": []\n }\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"contentDetails\": {\n \"channels\": [],\n \"playlists\": []\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"localizations\": {},\n \"snippet\": {\n \"channelId\": \"\",\n \"defaultLanguage\": \"\",\n \"localized\": {\n \"title\": \"\"\n },\n \"position\": 0,\n \"style\": \"\",\n \"title\": \"\",\n \"type\": \"\"\n },\n \"targeting\": {\n \"countries\": [],\n \"languages\": [],\n \"regions\": []\n }\n}")
val request = Request.Builder()
.url("{{baseUrl}}/youtube/v3/channelSections?part=")
.put(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PUT',
hostname: 'example.com',
port: null,
path: '/baseUrl/youtube/v3/channelSections?part=',
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({
contentDetails: {channels: [], playlists: []},
etag: '',
id: '',
kind: '',
localizations: {},
snippet: {
channelId: '',
defaultLanguage: '',
localized: {title: ''},
position: 0,
style: '',
title: '',
type: ''
},
targeting: {countries: [], languages: [], regions: []}
}));
req.end();
const request = require('request');
const options = {
method: 'PUT',
url: '{{baseUrl}}/youtube/v3/channelSections',
qs: {part: ''},
headers: {'content-type': 'application/json'},
body: {
contentDetails: {channels: [], playlists: []},
etag: '',
id: '',
kind: '',
localizations: {},
snippet: {
channelId: '',
defaultLanguage: '',
localized: {title: ''},
position: 0,
style: '',
title: '',
type: ''
},
targeting: {countries: [], languages: [], regions: []}
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PUT', '{{baseUrl}}/youtube/v3/channelSections');
req.query({
part: ''
});
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
contentDetails: {
channels: [],
playlists: []
},
etag: '',
id: '',
kind: '',
localizations: {},
snippet: {
channelId: '',
defaultLanguage: '',
localized: {
title: ''
},
position: 0,
style: '',
title: '',
type: ''
},
targeting: {
countries: [],
languages: [],
regions: []
}
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'PUT',
url: '{{baseUrl}}/youtube/v3/channelSections',
params: {part: ''},
headers: {'content-type': 'application/json'},
data: {
contentDetails: {channels: [], playlists: []},
etag: '',
id: '',
kind: '',
localizations: {},
snippet: {
channelId: '',
defaultLanguage: '',
localized: {title: ''},
position: 0,
style: '',
title: '',
type: ''
},
targeting: {countries: [], languages: [], regions: []}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/youtube/v3/channelSections?part=';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"contentDetails":{"channels":[],"playlists":[]},"etag":"","id":"","kind":"","localizations":{},"snippet":{"channelId":"","defaultLanguage":"","localized":{"title":""},"position":0,"style":"","title":"","type":""},"targeting":{"countries":[],"languages":[],"regions":[]}}'
};
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 = @{ @"contentDetails": @{ @"channels": @[ ], @"playlists": @[ ] },
@"etag": @"",
@"id": @"",
@"kind": @"",
@"localizations": @{ },
@"snippet": @{ @"channelId": @"", @"defaultLanguage": @"", @"localized": @{ @"title": @"" }, @"position": @0, @"style": @"", @"title": @"", @"type": @"" },
@"targeting": @{ @"countries": @[ ], @"languages": @[ ], @"regions": @[ ] } };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/youtube/v3/channelSections?part="]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PUT"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/youtube/v3/channelSections?part=" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"contentDetails\": {\n \"channels\": [],\n \"playlists\": []\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"localizations\": {},\n \"snippet\": {\n \"channelId\": \"\",\n \"defaultLanguage\": \"\",\n \"localized\": {\n \"title\": \"\"\n },\n \"position\": 0,\n \"style\": \"\",\n \"title\": \"\",\n \"type\": \"\"\n },\n \"targeting\": {\n \"countries\": [],\n \"languages\": [],\n \"regions\": []\n }\n}" in
Client.call ~headers ~body `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/youtube/v3/channelSections?part=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'contentDetails' => [
'channels' => [
],
'playlists' => [
]
],
'etag' => '',
'id' => '',
'kind' => '',
'localizations' => [
],
'snippet' => [
'channelId' => '',
'defaultLanguage' => '',
'localized' => [
'title' => ''
],
'position' => 0,
'style' => '',
'title' => '',
'type' => ''
],
'targeting' => [
'countries' => [
],
'languages' => [
],
'regions' => [
]
]
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('PUT', '{{baseUrl}}/youtube/v3/channelSections?part=', [
'body' => '{
"contentDetails": {
"channels": [],
"playlists": []
},
"etag": "",
"id": "",
"kind": "",
"localizations": {},
"snippet": {
"channelId": "",
"defaultLanguage": "",
"localized": {
"title": ""
},
"position": 0,
"style": "",
"title": "",
"type": ""
},
"targeting": {
"countries": [],
"languages": [],
"regions": []
}
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/youtube/v3/channelSections');
$request->setMethod(HTTP_METH_PUT);
$request->setQueryData([
'part' => ''
]);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'contentDetails' => [
'channels' => [
],
'playlists' => [
]
],
'etag' => '',
'id' => '',
'kind' => '',
'localizations' => [
],
'snippet' => [
'channelId' => '',
'defaultLanguage' => '',
'localized' => [
'title' => ''
],
'position' => 0,
'style' => '',
'title' => '',
'type' => ''
],
'targeting' => [
'countries' => [
],
'languages' => [
],
'regions' => [
]
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'contentDetails' => [
'channels' => [
],
'playlists' => [
]
],
'etag' => '',
'id' => '',
'kind' => '',
'localizations' => [
],
'snippet' => [
'channelId' => '',
'defaultLanguage' => '',
'localized' => [
'title' => ''
],
'position' => 0,
'style' => '',
'title' => '',
'type' => ''
],
'targeting' => [
'countries' => [
],
'languages' => [
],
'regions' => [
]
]
]));
$request->setRequestUrl('{{baseUrl}}/youtube/v3/channelSections');
$request->setRequestMethod('PUT');
$request->setBody($body);
$request->setQuery(new http\QueryString([
'part' => ''
]));
$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}}/youtube/v3/channelSections?part=' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"contentDetails": {
"channels": [],
"playlists": []
},
"etag": "",
"id": "",
"kind": "",
"localizations": {},
"snippet": {
"channelId": "",
"defaultLanguage": "",
"localized": {
"title": ""
},
"position": 0,
"style": "",
"title": "",
"type": ""
},
"targeting": {
"countries": [],
"languages": [],
"regions": []
}
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/youtube/v3/channelSections?part=' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"contentDetails": {
"channels": [],
"playlists": []
},
"etag": "",
"id": "",
"kind": "",
"localizations": {},
"snippet": {
"channelId": "",
"defaultLanguage": "",
"localized": {
"title": ""
},
"position": 0,
"style": "",
"title": "",
"type": ""
},
"targeting": {
"countries": [],
"languages": [],
"regions": []
}
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"contentDetails\": {\n \"channels\": [],\n \"playlists\": []\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"localizations\": {},\n \"snippet\": {\n \"channelId\": \"\",\n \"defaultLanguage\": \"\",\n \"localized\": {\n \"title\": \"\"\n },\n \"position\": 0,\n \"style\": \"\",\n \"title\": \"\",\n \"type\": \"\"\n },\n \"targeting\": {\n \"countries\": [],\n \"languages\": [],\n \"regions\": []\n }\n}"
headers = { 'content-type': "application/json" }
conn.request("PUT", "/baseUrl/youtube/v3/channelSections?part=", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/youtube/v3/channelSections"
querystring = {"part":""}
payload = {
"contentDetails": {
"channels": [],
"playlists": []
},
"etag": "",
"id": "",
"kind": "",
"localizations": {},
"snippet": {
"channelId": "",
"defaultLanguage": "",
"localized": { "title": "" },
"position": 0,
"style": "",
"title": "",
"type": ""
},
"targeting": {
"countries": [],
"languages": [],
"regions": []
}
}
headers = {"content-type": "application/json"}
response = requests.put(url, json=payload, headers=headers, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/youtube/v3/channelSections"
queryString <- list(part = "")
payload <- "{\n \"contentDetails\": {\n \"channels\": [],\n \"playlists\": []\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"localizations\": {},\n \"snippet\": {\n \"channelId\": \"\",\n \"defaultLanguage\": \"\",\n \"localized\": {\n \"title\": \"\"\n },\n \"position\": 0,\n \"style\": \"\",\n \"title\": \"\",\n \"type\": \"\"\n },\n \"targeting\": {\n \"countries\": [],\n \"languages\": [],\n \"regions\": []\n }\n}"
encode <- "json"
response <- VERB("PUT", url, body = payload, query = queryString, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/youtube/v3/channelSections?part=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"contentDetails\": {\n \"channels\": [],\n \"playlists\": []\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"localizations\": {},\n \"snippet\": {\n \"channelId\": \"\",\n \"defaultLanguage\": \"\",\n \"localized\": {\n \"title\": \"\"\n },\n \"position\": 0,\n \"style\": \"\",\n \"title\": \"\",\n \"type\": \"\"\n },\n \"targeting\": {\n \"countries\": [],\n \"languages\": [],\n \"regions\": []\n }\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.put('/baseUrl/youtube/v3/channelSections') do |req|
req.params['part'] = ''
req.body = "{\n \"contentDetails\": {\n \"channels\": [],\n \"playlists\": []\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"localizations\": {},\n \"snippet\": {\n \"channelId\": \"\",\n \"defaultLanguage\": \"\",\n \"localized\": {\n \"title\": \"\"\n },\n \"position\": 0,\n \"style\": \"\",\n \"title\": \"\",\n \"type\": \"\"\n },\n \"targeting\": {\n \"countries\": [],\n \"languages\": [],\n \"regions\": []\n }\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}}/youtube/v3/channelSections";
let querystring = [
("part", ""),
];
let payload = json!({
"contentDetails": json!({
"channels": (),
"playlists": ()
}),
"etag": "",
"id": "",
"kind": "",
"localizations": json!({}),
"snippet": json!({
"channelId": "",
"defaultLanguage": "",
"localized": json!({"title": ""}),
"position": 0,
"style": "",
"title": "",
"type": ""
}),
"targeting": json!({
"countries": (),
"languages": (),
"regions": ()
})
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PUT").unwrap(), url)
.query(&querystring)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PUT \
--url '{{baseUrl}}/youtube/v3/channelSections?part=' \
--header 'content-type: application/json' \
--data '{
"contentDetails": {
"channels": [],
"playlists": []
},
"etag": "",
"id": "",
"kind": "",
"localizations": {},
"snippet": {
"channelId": "",
"defaultLanguage": "",
"localized": {
"title": ""
},
"position": 0,
"style": "",
"title": "",
"type": ""
},
"targeting": {
"countries": [],
"languages": [],
"regions": []
}
}'
echo '{
"contentDetails": {
"channels": [],
"playlists": []
},
"etag": "",
"id": "",
"kind": "",
"localizations": {},
"snippet": {
"channelId": "",
"defaultLanguage": "",
"localized": {
"title": ""
},
"position": 0,
"style": "",
"title": "",
"type": ""
},
"targeting": {
"countries": [],
"languages": [],
"regions": []
}
}' | \
http PUT '{{baseUrl}}/youtube/v3/channelSections?part=' \
content-type:application/json
wget --quiet \
--method PUT \
--header 'content-type: application/json' \
--body-data '{\n "contentDetails": {\n "channels": [],\n "playlists": []\n },\n "etag": "",\n "id": "",\n "kind": "",\n "localizations": {},\n "snippet": {\n "channelId": "",\n "defaultLanguage": "",\n "localized": {\n "title": ""\n },\n "position": 0,\n "style": "",\n "title": "",\n "type": ""\n },\n "targeting": {\n "countries": [],\n "languages": [],\n "regions": []\n }\n}' \
--output-document \
- '{{baseUrl}}/youtube/v3/channelSections?part='
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"contentDetails": [
"channels": [],
"playlists": []
],
"etag": "",
"id": "",
"kind": "",
"localizations": [],
"snippet": [
"channelId": "",
"defaultLanguage": "",
"localized": ["title": ""],
"position": 0,
"style": "",
"title": "",
"type": ""
],
"targeting": [
"countries": [],
"languages": [],
"regions": []
]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/youtube/v3/channelSections?part=")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
DELETE
youtube.comments.delete
{{baseUrl}}/youtube/v3/comments
QUERY PARAMS
id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/youtube/v3/comments?id=");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/delete "{{baseUrl}}/youtube/v3/comments" {:query-params {:id ""}})
require "http/client"
url = "{{baseUrl}}/youtube/v3/comments?id="
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}}/youtube/v3/comments?id="),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/youtube/v3/comments?id=");
var request = new RestRequest("", Method.Delete);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/youtube/v3/comments?id="
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/youtube/v3/comments?id= HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/youtube/v3/comments?id=")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/youtube/v3/comments?id="))
.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}}/youtube/v3/comments?id=")
.delete(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/youtube/v3/comments?id=")
.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}}/youtube/v3/comments?id=');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'DELETE',
url: '{{baseUrl}}/youtube/v3/comments',
params: {id: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/youtube/v3/comments?id=';
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}}/youtube/v3/comments?id=',
method: 'DELETE',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/youtube/v3/comments?id=")
.delete(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'DELETE',
hostname: 'example.com',
port: null,
path: '/baseUrl/youtube/v3/comments?id=',
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}}/youtube/v3/comments',
qs: {id: ''}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('DELETE', '{{baseUrl}}/youtube/v3/comments');
req.query({
id: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'DELETE',
url: '{{baseUrl}}/youtube/v3/comments',
params: {id: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/youtube/v3/comments?id=';
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}}/youtube/v3/comments?id="]
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}}/youtube/v3/comments?id=" in
Client.call `DELETE uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/youtube/v3/comments?id=",
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}}/youtube/v3/comments?id=');
echo $response->getBody();
setUrl('{{baseUrl}}/youtube/v3/comments');
$request->setMethod(HTTP_METH_DELETE);
$request->setQueryData([
'id' => ''
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/youtube/v3/comments');
$request->setRequestMethod('DELETE');
$request->setQuery(new http\QueryString([
'id' => ''
]));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/youtube/v3/comments?id=' -Method DELETE
$response = Invoke-RestMethod -Uri '{{baseUrl}}/youtube/v3/comments?id=' -Method DELETE
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("DELETE", "/baseUrl/youtube/v3/comments?id=")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/youtube/v3/comments"
querystring = {"id":""}
response = requests.delete(url, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/youtube/v3/comments"
queryString <- list(id = "")
response <- VERB("DELETE", url, query = queryString, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/youtube/v3/comments?id=")
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/youtube/v3/comments') do |req|
req.params['id'] = ''
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/youtube/v3/comments";
let querystring = [
("id", ""),
];
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("DELETE").unwrap(), url)
.query(&querystring)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request DELETE \
--url '{{baseUrl}}/youtube/v3/comments?id='
http DELETE '{{baseUrl}}/youtube/v3/comments?id='
wget --quiet \
--method DELETE \
--output-document \
- '{{baseUrl}}/youtube/v3/comments?id='
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/youtube/v3/comments?id=")! 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()
POST
youtube.comments.insert
{{baseUrl}}/youtube/v3/comments
QUERY PARAMS
part
BODY json
{
"etag": "",
"id": "",
"kind": "",
"snippet": {
"authorChannelId": {
"value": ""
},
"authorChannelUrl": "",
"authorDisplayName": "",
"authorProfileImageUrl": "",
"canRate": false,
"channelId": "",
"likeCount": 0,
"moderationStatus": "",
"parentId": "",
"publishedAt": "",
"textDisplay": "",
"textOriginal": "",
"updatedAt": "",
"videoId": "",
"viewerRating": ""
}
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/youtube/v3/comments?part=");
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 \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"authorChannelId\": {\n \"value\": \"\"\n },\n \"authorChannelUrl\": \"\",\n \"authorDisplayName\": \"\",\n \"authorProfileImageUrl\": \"\",\n \"canRate\": false,\n \"channelId\": \"\",\n \"likeCount\": 0,\n \"moderationStatus\": \"\",\n \"parentId\": \"\",\n \"publishedAt\": \"\",\n \"textDisplay\": \"\",\n \"textOriginal\": \"\",\n \"updatedAt\": \"\",\n \"videoId\": \"\",\n \"viewerRating\": \"\"\n }\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/youtube/v3/comments" {:query-params {:part ""}
:content-type :json
:form-params {:etag ""
:id ""
:kind ""
:snippet {:authorChannelId {:value ""}
:authorChannelUrl ""
:authorDisplayName ""
:authorProfileImageUrl ""
:canRate false
:channelId ""
:likeCount 0
:moderationStatus ""
:parentId ""
:publishedAt ""
:textDisplay ""
:textOriginal ""
:updatedAt ""
:videoId ""
:viewerRating ""}}})
require "http/client"
url = "{{baseUrl}}/youtube/v3/comments?part="
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"authorChannelId\": {\n \"value\": \"\"\n },\n \"authorChannelUrl\": \"\",\n \"authorDisplayName\": \"\",\n \"authorProfileImageUrl\": \"\",\n \"canRate\": false,\n \"channelId\": \"\",\n \"likeCount\": 0,\n \"moderationStatus\": \"\",\n \"parentId\": \"\",\n \"publishedAt\": \"\",\n \"textDisplay\": \"\",\n \"textOriginal\": \"\",\n \"updatedAt\": \"\",\n \"videoId\": \"\",\n \"viewerRating\": \"\"\n }\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/youtube/v3/comments?part="),
Content = new StringContent("{\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"authorChannelId\": {\n \"value\": \"\"\n },\n \"authorChannelUrl\": \"\",\n \"authorDisplayName\": \"\",\n \"authorProfileImageUrl\": \"\",\n \"canRate\": false,\n \"channelId\": \"\",\n \"likeCount\": 0,\n \"moderationStatus\": \"\",\n \"parentId\": \"\",\n \"publishedAt\": \"\",\n \"textDisplay\": \"\",\n \"textOriginal\": \"\",\n \"updatedAt\": \"\",\n \"videoId\": \"\",\n \"viewerRating\": \"\"\n }\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/youtube/v3/comments?part=");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"authorChannelId\": {\n \"value\": \"\"\n },\n \"authorChannelUrl\": \"\",\n \"authorDisplayName\": \"\",\n \"authorProfileImageUrl\": \"\",\n \"canRate\": false,\n \"channelId\": \"\",\n \"likeCount\": 0,\n \"moderationStatus\": \"\",\n \"parentId\": \"\",\n \"publishedAt\": \"\",\n \"textDisplay\": \"\",\n \"textOriginal\": \"\",\n \"updatedAt\": \"\",\n \"videoId\": \"\",\n \"viewerRating\": \"\"\n }\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/youtube/v3/comments?part="
payload := strings.NewReader("{\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"authorChannelId\": {\n \"value\": \"\"\n },\n \"authorChannelUrl\": \"\",\n \"authorDisplayName\": \"\",\n \"authorProfileImageUrl\": \"\",\n \"canRate\": false,\n \"channelId\": \"\",\n \"likeCount\": 0,\n \"moderationStatus\": \"\",\n \"parentId\": \"\",\n \"publishedAt\": \"\",\n \"textDisplay\": \"\",\n \"textOriginal\": \"\",\n \"updatedAt\": \"\",\n \"videoId\": \"\",\n \"viewerRating\": \"\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/youtube/v3/comments?part= HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 446
{
"etag": "",
"id": "",
"kind": "",
"snippet": {
"authorChannelId": {
"value": ""
},
"authorChannelUrl": "",
"authorDisplayName": "",
"authorProfileImageUrl": "",
"canRate": false,
"channelId": "",
"likeCount": 0,
"moderationStatus": "",
"parentId": "",
"publishedAt": "",
"textDisplay": "",
"textOriginal": "",
"updatedAt": "",
"videoId": "",
"viewerRating": ""
}
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/youtube/v3/comments?part=")
.setHeader("content-type", "application/json")
.setBody("{\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"authorChannelId\": {\n \"value\": \"\"\n },\n \"authorChannelUrl\": \"\",\n \"authorDisplayName\": \"\",\n \"authorProfileImageUrl\": \"\",\n \"canRate\": false,\n \"channelId\": \"\",\n \"likeCount\": 0,\n \"moderationStatus\": \"\",\n \"parentId\": \"\",\n \"publishedAt\": \"\",\n \"textDisplay\": \"\",\n \"textOriginal\": \"\",\n \"updatedAt\": \"\",\n \"videoId\": \"\",\n \"viewerRating\": \"\"\n }\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/youtube/v3/comments?part="))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"authorChannelId\": {\n \"value\": \"\"\n },\n \"authorChannelUrl\": \"\",\n \"authorDisplayName\": \"\",\n \"authorProfileImageUrl\": \"\",\n \"canRate\": false,\n \"channelId\": \"\",\n \"likeCount\": 0,\n \"moderationStatus\": \"\",\n \"parentId\": \"\",\n \"publishedAt\": \"\",\n \"textDisplay\": \"\",\n \"textOriginal\": \"\",\n \"updatedAt\": \"\",\n \"videoId\": \"\",\n \"viewerRating\": \"\"\n }\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"authorChannelId\": {\n \"value\": \"\"\n },\n \"authorChannelUrl\": \"\",\n \"authorDisplayName\": \"\",\n \"authorProfileImageUrl\": \"\",\n \"canRate\": false,\n \"channelId\": \"\",\n \"likeCount\": 0,\n \"moderationStatus\": \"\",\n \"parentId\": \"\",\n \"publishedAt\": \"\",\n \"textDisplay\": \"\",\n \"textOriginal\": \"\",\n \"updatedAt\": \"\",\n \"videoId\": \"\",\n \"viewerRating\": \"\"\n }\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/youtube/v3/comments?part=")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/youtube/v3/comments?part=")
.header("content-type", "application/json")
.body("{\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"authorChannelId\": {\n \"value\": \"\"\n },\n \"authorChannelUrl\": \"\",\n \"authorDisplayName\": \"\",\n \"authorProfileImageUrl\": \"\",\n \"canRate\": false,\n \"channelId\": \"\",\n \"likeCount\": 0,\n \"moderationStatus\": \"\",\n \"parentId\": \"\",\n \"publishedAt\": \"\",\n \"textDisplay\": \"\",\n \"textOriginal\": \"\",\n \"updatedAt\": \"\",\n \"videoId\": \"\",\n \"viewerRating\": \"\"\n }\n}")
.asString();
const data = JSON.stringify({
etag: '',
id: '',
kind: '',
snippet: {
authorChannelId: {
value: ''
},
authorChannelUrl: '',
authorDisplayName: '',
authorProfileImageUrl: '',
canRate: false,
channelId: '',
likeCount: 0,
moderationStatus: '',
parentId: '',
publishedAt: '',
textDisplay: '',
textOriginal: '',
updatedAt: '',
videoId: '',
viewerRating: ''
}
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/youtube/v3/comments?part=');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/youtube/v3/comments',
params: {part: ''},
headers: {'content-type': 'application/json'},
data: {
etag: '',
id: '',
kind: '',
snippet: {
authorChannelId: {value: ''},
authorChannelUrl: '',
authorDisplayName: '',
authorProfileImageUrl: '',
canRate: false,
channelId: '',
likeCount: 0,
moderationStatus: '',
parentId: '',
publishedAt: '',
textDisplay: '',
textOriginal: '',
updatedAt: '',
videoId: '',
viewerRating: ''
}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/youtube/v3/comments?part=';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"etag":"","id":"","kind":"","snippet":{"authorChannelId":{"value":""},"authorChannelUrl":"","authorDisplayName":"","authorProfileImageUrl":"","canRate":false,"channelId":"","likeCount":0,"moderationStatus":"","parentId":"","publishedAt":"","textDisplay":"","textOriginal":"","updatedAt":"","videoId":"","viewerRating":""}}'
};
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}}/youtube/v3/comments?part=',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "etag": "",\n "id": "",\n "kind": "",\n "snippet": {\n "authorChannelId": {\n "value": ""\n },\n "authorChannelUrl": "",\n "authorDisplayName": "",\n "authorProfileImageUrl": "",\n "canRate": false,\n "channelId": "",\n "likeCount": 0,\n "moderationStatus": "",\n "parentId": "",\n "publishedAt": "",\n "textDisplay": "",\n "textOriginal": "",\n "updatedAt": "",\n "videoId": "",\n "viewerRating": ""\n }\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"authorChannelId\": {\n \"value\": \"\"\n },\n \"authorChannelUrl\": \"\",\n \"authorDisplayName\": \"\",\n \"authorProfileImageUrl\": \"\",\n \"canRate\": false,\n \"channelId\": \"\",\n \"likeCount\": 0,\n \"moderationStatus\": \"\",\n \"parentId\": \"\",\n \"publishedAt\": \"\",\n \"textDisplay\": \"\",\n \"textOriginal\": \"\",\n \"updatedAt\": \"\",\n \"videoId\": \"\",\n \"viewerRating\": \"\"\n }\n}")
val request = Request.Builder()
.url("{{baseUrl}}/youtube/v3/comments?part=")
.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/youtube/v3/comments?part=',
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({
etag: '',
id: '',
kind: '',
snippet: {
authorChannelId: {value: ''},
authorChannelUrl: '',
authorDisplayName: '',
authorProfileImageUrl: '',
canRate: false,
channelId: '',
likeCount: 0,
moderationStatus: '',
parentId: '',
publishedAt: '',
textDisplay: '',
textOriginal: '',
updatedAt: '',
videoId: '',
viewerRating: ''
}
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/youtube/v3/comments',
qs: {part: ''},
headers: {'content-type': 'application/json'},
body: {
etag: '',
id: '',
kind: '',
snippet: {
authorChannelId: {value: ''},
authorChannelUrl: '',
authorDisplayName: '',
authorProfileImageUrl: '',
canRate: false,
channelId: '',
likeCount: 0,
moderationStatus: '',
parentId: '',
publishedAt: '',
textDisplay: '',
textOriginal: '',
updatedAt: '',
videoId: '',
viewerRating: ''
}
},
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}}/youtube/v3/comments');
req.query({
part: ''
});
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
etag: '',
id: '',
kind: '',
snippet: {
authorChannelId: {
value: ''
},
authorChannelUrl: '',
authorDisplayName: '',
authorProfileImageUrl: '',
canRate: false,
channelId: '',
likeCount: 0,
moderationStatus: '',
parentId: '',
publishedAt: '',
textDisplay: '',
textOriginal: '',
updatedAt: '',
videoId: '',
viewerRating: ''
}
});
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}}/youtube/v3/comments',
params: {part: ''},
headers: {'content-type': 'application/json'},
data: {
etag: '',
id: '',
kind: '',
snippet: {
authorChannelId: {value: ''},
authorChannelUrl: '',
authorDisplayName: '',
authorProfileImageUrl: '',
canRate: false,
channelId: '',
likeCount: 0,
moderationStatus: '',
parentId: '',
publishedAt: '',
textDisplay: '',
textOriginal: '',
updatedAt: '',
videoId: '',
viewerRating: ''
}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/youtube/v3/comments?part=';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"etag":"","id":"","kind":"","snippet":{"authorChannelId":{"value":""},"authorChannelUrl":"","authorDisplayName":"","authorProfileImageUrl":"","canRate":false,"channelId":"","likeCount":0,"moderationStatus":"","parentId":"","publishedAt":"","textDisplay":"","textOriginal":"","updatedAt":"","videoId":"","viewerRating":""}}'
};
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 = @{ @"etag": @"",
@"id": @"",
@"kind": @"",
@"snippet": @{ @"authorChannelId": @{ @"value": @"" }, @"authorChannelUrl": @"", @"authorDisplayName": @"", @"authorProfileImageUrl": @"", @"canRate": @NO, @"channelId": @"", @"likeCount": @0, @"moderationStatus": @"", @"parentId": @"", @"publishedAt": @"", @"textDisplay": @"", @"textOriginal": @"", @"updatedAt": @"", @"videoId": @"", @"viewerRating": @"" } };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/youtube/v3/comments?part="]
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}}/youtube/v3/comments?part=" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"authorChannelId\": {\n \"value\": \"\"\n },\n \"authorChannelUrl\": \"\",\n \"authorDisplayName\": \"\",\n \"authorProfileImageUrl\": \"\",\n \"canRate\": false,\n \"channelId\": \"\",\n \"likeCount\": 0,\n \"moderationStatus\": \"\",\n \"parentId\": \"\",\n \"publishedAt\": \"\",\n \"textDisplay\": \"\",\n \"textOriginal\": \"\",\n \"updatedAt\": \"\",\n \"videoId\": \"\",\n \"viewerRating\": \"\"\n }\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/youtube/v3/comments?part=",
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([
'etag' => '',
'id' => '',
'kind' => '',
'snippet' => [
'authorChannelId' => [
'value' => ''
],
'authorChannelUrl' => '',
'authorDisplayName' => '',
'authorProfileImageUrl' => '',
'canRate' => null,
'channelId' => '',
'likeCount' => 0,
'moderationStatus' => '',
'parentId' => '',
'publishedAt' => '',
'textDisplay' => '',
'textOriginal' => '',
'updatedAt' => '',
'videoId' => '',
'viewerRating' => ''
]
]),
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}}/youtube/v3/comments?part=', [
'body' => '{
"etag": "",
"id": "",
"kind": "",
"snippet": {
"authorChannelId": {
"value": ""
},
"authorChannelUrl": "",
"authorDisplayName": "",
"authorProfileImageUrl": "",
"canRate": false,
"channelId": "",
"likeCount": 0,
"moderationStatus": "",
"parentId": "",
"publishedAt": "",
"textDisplay": "",
"textOriginal": "",
"updatedAt": "",
"videoId": "",
"viewerRating": ""
}
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/youtube/v3/comments');
$request->setMethod(HTTP_METH_POST);
$request->setQueryData([
'part' => ''
]);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'etag' => '',
'id' => '',
'kind' => '',
'snippet' => [
'authorChannelId' => [
'value' => ''
],
'authorChannelUrl' => '',
'authorDisplayName' => '',
'authorProfileImageUrl' => '',
'canRate' => null,
'channelId' => '',
'likeCount' => 0,
'moderationStatus' => '',
'parentId' => '',
'publishedAt' => '',
'textDisplay' => '',
'textOriginal' => '',
'updatedAt' => '',
'videoId' => '',
'viewerRating' => ''
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'etag' => '',
'id' => '',
'kind' => '',
'snippet' => [
'authorChannelId' => [
'value' => ''
],
'authorChannelUrl' => '',
'authorDisplayName' => '',
'authorProfileImageUrl' => '',
'canRate' => null,
'channelId' => '',
'likeCount' => 0,
'moderationStatus' => '',
'parentId' => '',
'publishedAt' => '',
'textDisplay' => '',
'textOriginal' => '',
'updatedAt' => '',
'videoId' => '',
'viewerRating' => ''
]
]));
$request->setRequestUrl('{{baseUrl}}/youtube/v3/comments');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setQuery(new http\QueryString([
'part' => ''
]));
$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}}/youtube/v3/comments?part=' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"etag": "",
"id": "",
"kind": "",
"snippet": {
"authorChannelId": {
"value": ""
},
"authorChannelUrl": "",
"authorDisplayName": "",
"authorProfileImageUrl": "",
"canRate": false,
"channelId": "",
"likeCount": 0,
"moderationStatus": "",
"parentId": "",
"publishedAt": "",
"textDisplay": "",
"textOriginal": "",
"updatedAt": "",
"videoId": "",
"viewerRating": ""
}
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/youtube/v3/comments?part=' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"etag": "",
"id": "",
"kind": "",
"snippet": {
"authorChannelId": {
"value": ""
},
"authorChannelUrl": "",
"authorDisplayName": "",
"authorProfileImageUrl": "",
"canRate": false,
"channelId": "",
"likeCount": 0,
"moderationStatus": "",
"parentId": "",
"publishedAt": "",
"textDisplay": "",
"textOriginal": "",
"updatedAt": "",
"videoId": "",
"viewerRating": ""
}
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"authorChannelId\": {\n \"value\": \"\"\n },\n \"authorChannelUrl\": \"\",\n \"authorDisplayName\": \"\",\n \"authorProfileImageUrl\": \"\",\n \"canRate\": false,\n \"channelId\": \"\",\n \"likeCount\": 0,\n \"moderationStatus\": \"\",\n \"parentId\": \"\",\n \"publishedAt\": \"\",\n \"textDisplay\": \"\",\n \"textOriginal\": \"\",\n \"updatedAt\": \"\",\n \"videoId\": \"\",\n \"viewerRating\": \"\"\n }\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/youtube/v3/comments?part=", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/youtube/v3/comments"
querystring = {"part":""}
payload = {
"etag": "",
"id": "",
"kind": "",
"snippet": {
"authorChannelId": { "value": "" },
"authorChannelUrl": "",
"authorDisplayName": "",
"authorProfileImageUrl": "",
"canRate": False,
"channelId": "",
"likeCount": 0,
"moderationStatus": "",
"parentId": "",
"publishedAt": "",
"textDisplay": "",
"textOriginal": "",
"updatedAt": "",
"videoId": "",
"viewerRating": ""
}
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/youtube/v3/comments"
queryString <- list(part = "")
payload <- "{\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"authorChannelId\": {\n \"value\": \"\"\n },\n \"authorChannelUrl\": \"\",\n \"authorDisplayName\": \"\",\n \"authorProfileImageUrl\": \"\",\n \"canRate\": false,\n \"channelId\": \"\",\n \"likeCount\": 0,\n \"moderationStatus\": \"\",\n \"parentId\": \"\",\n \"publishedAt\": \"\",\n \"textDisplay\": \"\",\n \"textOriginal\": \"\",\n \"updatedAt\": \"\",\n \"videoId\": \"\",\n \"viewerRating\": \"\"\n }\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, query = queryString, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/youtube/v3/comments?part=")
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 \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"authorChannelId\": {\n \"value\": \"\"\n },\n \"authorChannelUrl\": \"\",\n \"authorDisplayName\": \"\",\n \"authorProfileImageUrl\": \"\",\n \"canRate\": false,\n \"channelId\": \"\",\n \"likeCount\": 0,\n \"moderationStatus\": \"\",\n \"parentId\": \"\",\n \"publishedAt\": \"\",\n \"textDisplay\": \"\",\n \"textOriginal\": \"\",\n \"updatedAt\": \"\",\n \"videoId\": \"\",\n \"viewerRating\": \"\"\n }\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/youtube/v3/comments') do |req|
req.params['part'] = ''
req.body = "{\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"authorChannelId\": {\n \"value\": \"\"\n },\n \"authorChannelUrl\": \"\",\n \"authorDisplayName\": \"\",\n \"authorProfileImageUrl\": \"\",\n \"canRate\": false,\n \"channelId\": \"\",\n \"likeCount\": 0,\n \"moderationStatus\": \"\",\n \"parentId\": \"\",\n \"publishedAt\": \"\",\n \"textDisplay\": \"\",\n \"textOriginal\": \"\",\n \"updatedAt\": \"\",\n \"videoId\": \"\",\n \"viewerRating\": \"\"\n }\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/youtube/v3/comments";
let querystring = [
("part", ""),
];
let payload = json!({
"etag": "",
"id": "",
"kind": "",
"snippet": json!({
"authorChannelId": json!({"value": ""}),
"authorChannelUrl": "",
"authorDisplayName": "",
"authorProfileImageUrl": "",
"canRate": false,
"channelId": "",
"likeCount": 0,
"moderationStatus": "",
"parentId": "",
"publishedAt": "",
"textDisplay": "",
"textOriginal": "",
"updatedAt": "",
"videoId": "",
"viewerRating": ""
})
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.query(&querystring)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/youtube/v3/comments?part=' \
--header 'content-type: application/json' \
--data '{
"etag": "",
"id": "",
"kind": "",
"snippet": {
"authorChannelId": {
"value": ""
},
"authorChannelUrl": "",
"authorDisplayName": "",
"authorProfileImageUrl": "",
"canRate": false,
"channelId": "",
"likeCount": 0,
"moderationStatus": "",
"parentId": "",
"publishedAt": "",
"textDisplay": "",
"textOriginal": "",
"updatedAt": "",
"videoId": "",
"viewerRating": ""
}
}'
echo '{
"etag": "",
"id": "",
"kind": "",
"snippet": {
"authorChannelId": {
"value": ""
},
"authorChannelUrl": "",
"authorDisplayName": "",
"authorProfileImageUrl": "",
"canRate": false,
"channelId": "",
"likeCount": 0,
"moderationStatus": "",
"parentId": "",
"publishedAt": "",
"textDisplay": "",
"textOriginal": "",
"updatedAt": "",
"videoId": "",
"viewerRating": ""
}
}' | \
http POST '{{baseUrl}}/youtube/v3/comments?part=' \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "etag": "",\n "id": "",\n "kind": "",\n "snippet": {\n "authorChannelId": {\n "value": ""\n },\n "authorChannelUrl": "",\n "authorDisplayName": "",\n "authorProfileImageUrl": "",\n "canRate": false,\n "channelId": "",\n "likeCount": 0,\n "moderationStatus": "",\n "parentId": "",\n "publishedAt": "",\n "textDisplay": "",\n "textOriginal": "",\n "updatedAt": "",\n "videoId": "",\n "viewerRating": ""\n }\n}' \
--output-document \
- '{{baseUrl}}/youtube/v3/comments?part='
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"etag": "",
"id": "",
"kind": "",
"snippet": [
"authorChannelId": ["value": ""],
"authorChannelUrl": "",
"authorDisplayName": "",
"authorProfileImageUrl": "",
"canRate": false,
"channelId": "",
"likeCount": 0,
"moderationStatus": "",
"parentId": "",
"publishedAt": "",
"textDisplay": "",
"textOriginal": "",
"updatedAt": "",
"videoId": "",
"viewerRating": ""
]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/youtube/v3/comments?part=")! 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()
GET
youtube.comments.list
{{baseUrl}}/youtube/v3/comments
QUERY PARAMS
part
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/youtube/v3/comments?part=");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/youtube/v3/comments" {:query-params {:part ""}})
require "http/client"
url = "{{baseUrl}}/youtube/v3/comments?part="
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}}/youtube/v3/comments?part="),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/youtube/v3/comments?part=");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/youtube/v3/comments?part="
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/youtube/v3/comments?part= HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/youtube/v3/comments?part=")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/youtube/v3/comments?part="))
.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}}/youtube/v3/comments?part=")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/youtube/v3/comments?part=")
.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}}/youtube/v3/comments?part=');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/youtube/v3/comments',
params: {part: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/youtube/v3/comments?part=';
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}}/youtube/v3/comments?part=',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/youtube/v3/comments?part=")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/youtube/v3/comments?part=',
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}}/youtube/v3/comments',
qs: {part: ''}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/youtube/v3/comments');
req.query({
part: ''
});
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}}/youtube/v3/comments',
params: {part: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/youtube/v3/comments?part=';
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}}/youtube/v3/comments?part="]
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}}/youtube/v3/comments?part=" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/youtube/v3/comments?part=",
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}}/youtube/v3/comments?part=');
echo $response->getBody();
setUrl('{{baseUrl}}/youtube/v3/comments');
$request->setMethod(HTTP_METH_GET);
$request->setQueryData([
'part' => ''
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/youtube/v3/comments');
$request->setRequestMethod('GET');
$request->setQuery(new http\QueryString([
'part' => ''
]));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/youtube/v3/comments?part=' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/youtube/v3/comments?part=' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/youtube/v3/comments?part=")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/youtube/v3/comments"
querystring = {"part":""}
response = requests.get(url, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/youtube/v3/comments"
queryString <- list(part = "")
response <- VERB("GET", url, query = queryString, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/youtube/v3/comments?part=")
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/youtube/v3/comments') do |req|
req.params['part'] = ''
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/youtube/v3/comments";
let querystring = [
("part", ""),
];
let client = reqwest::Client::new();
let response = client.get(url)
.query(&querystring)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url '{{baseUrl}}/youtube/v3/comments?part='
http GET '{{baseUrl}}/youtube/v3/comments?part='
wget --quiet \
--method GET \
--output-document \
- '{{baseUrl}}/youtube/v3/comments?part='
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/youtube/v3/comments?part=")! 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()
POST
youtube.comments.markAsSpam
{{baseUrl}}/youtube/v3/comments/markAsSpam
QUERY PARAMS
id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/youtube/v3/comments/markAsSpam?id=");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/youtube/v3/comments/markAsSpam" {:query-params {:id ""}})
require "http/client"
url = "{{baseUrl}}/youtube/v3/comments/markAsSpam?id="
response = HTTP::Client.post url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/youtube/v3/comments/markAsSpam?id="),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/youtube/v3/comments/markAsSpam?id=");
var request = new RestRequest("", Method.Post);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/youtube/v3/comments/markAsSpam?id="
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/youtube/v3/comments/markAsSpam?id= HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/youtube/v3/comments/markAsSpam?id=")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/youtube/v3/comments/markAsSpam?id="))
.method("POST", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/youtube/v3/comments/markAsSpam?id=")
.post(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/youtube/v3/comments/markAsSpam?id=")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/youtube/v3/comments/markAsSpam?id=');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/youtube/v3/comments/markAsSpam',
params: {id: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/youtube/v3/comments/markAsSpam?id=';
const options = {method: 'POST'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/youtube/v3/comments/markAsSpam?id=',
method: 'POST',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/youtube/v3/comments/markAsSpam?id=")
.post(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/youtube/v3/comments/markAsSpam?id=',
headers: {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/youtube/v3/comments/markAsSpam',
qs: {id: ''}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/youtube/v3/comments/markAsSpam');
req.query({
id: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/youtube/v3/comments/markAsSpam',
params: {id: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/youtube/v3/comments/markAsSpam?id=';
const options = {method: 'POST'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/youtube/v3/comments/markAsSpam?id="]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/youtube/v3/comments/markAsSpam?id=" in
Client.call `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/youtube/v3/comments/markAsSpam?id=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/youtube/v3/comments/markAsSpam?id=');
echo $response->getBody();
setUrl('{{baseUrl}}/youtube/v3/comments/markAsSpam');
$request->setMethod(HTTP_METH_POST);
$request->setQueryData([
'id' => ''
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/youtube/v3/comments/markAsSpam');
$request->setRequestMethod('POST');
$request->setQuery(new http\QueryString([
'id' => ''
]));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/youtube/v3/comments/markAsSpam?id=' -Method POST
$response = Invoke-RestMethod -Uri '{{baseUrl}}/youtube/v3/comments/markAsSpam?id=' -Method POST
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("POST", "/baseUrl/youtube/v3/comments/markAsSpam?id=")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/youtube/v3/comments/markAsSpam"
querystring = {"id":""}
response = requests.post(url, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/youtube/v3/comments/markAsSpam"
queryString <- list(id = "")
response <- VERB("POST", url, query = queryString, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/youtube/v3/comments/markAsSpam?id=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.post('/baseUrl/youtube/v3/comments/markAsSpam') do |req|
req.params['id'] = ''
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/youtube/v3/comments/markAsSpam";
let querystring = [
("id", ""),
];
let client = reqwest::Client::new();
let response = client.post(url)
.query(&querystring)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/youtube/v3/comments/markAsSpam?id='
http POST '{{baseUrl}}/youtube/v3/comments/markAsSpam?id='
wget --quiet \
--method POST \
--output-document \
- '{{baseUrl}}/youtube/v3/comments/markAsSpam?id='
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/youtube/v3/comments/markAsSpam?id=")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
youtube.comments.setModerationStatus
{{baseUrl}}/youtube/v3/comments/setModerationStatus
QUERY PARAMS
id
moderationStatus
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/youtube/v3/comments/setModerationStatus?id=&moderationStatus=");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/youtube/v3/comments/setModerationStatus" {:query-params {:id ""
:moderationStatus ""}})
require "http/client"
url = "{{baseUrl}}/youtube/v3/comments/setModerationStatus?id=&moderationStatus="
response = HTTP::Client.post url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/youtube/v3/comments/setModerationStatus?id=&moderationStatus="),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/youtube/v3/comments/setModerationStatus?id=&moderationStatus=");
var request = new RestRequest("", Method.Post);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/youtube/v3/comments/setModerationStatus?id=&moderationStatus="
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/youtube/v3/comments/setModerationStatus?id=&moderationStatus= HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/youtube/v3/comments/setModerationStatus?id=&moderationStatus=")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/youtube/v3/comments/setModerationStatus?id=&moderationStatus="))
.method("POST", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/youtube/v3/comments/setModerationStatus?id=&moderationStatus=")
.post(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/youtube/v3/comments/setModerationStatus?id=&moderationStatus=")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/youtube/v3/comments/setModerationStatus?id=&moderationStatus=');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/youtube/v3/comments/setModerationStatus',
params: {id: '', moderationStatus: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/youtube/v3/comments/setModerationStatus?id=&moderationStatus=';
const options = {method: 'POST'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/youtube/v3/comments/setModerationStatus?id=&moderationStatus=',
method: 'POST',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/youtube/v3/comments/setModerationStatus?id=&moderationStatus=")
.post(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/youtube/v3/comments/setModerationStatus?id=&moderationStatus=',
headers: {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/youtube/v3/comments/setModerationStatus',
qs: {id: '', moderationStatus: ''}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/youtube/v3/comments/setModerationStatus');
req.query({
id: '',
moderationStatus: ''
});
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}}/youtube/v3/comments/setModerationStatus',
params: {id: '', moderationStatus: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/youtube/v3/comments/setModerationStatus?id=&moderationStatus=';
const options = {method: 'POST'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/youtube/v3/comments/setModerationStatus?id=&moderationStatus="]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/youtube/v3/comments/setModerationStatus?id=&moderationStatus=" in
Client.call `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/youtube/v3/comments/setModerationStatus?id=&moderationStatus=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/youtube/v3/comments/setModerationStatus?id=&moderationStatus=');
echo $response->getBody();
setUrl('{{baseUrl}}/youtube/v3/comments/setModerationStatus');
$request->setMethod(HTTP_METH_POST);
$request->setQueryData([
'id' => '',
'moderationStatus' => ''
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/youtube/v3/comments/setModerationStatus');
$request->setRequestMethod('POST');
$request->setQuery(new http\QueryString([
'id' => '',
'moderationStatus' => ''
]));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/youtube/v3/comments/setModerationStatus?id=&moderationStatus=' -Method POST
$response = Invoke-RestMethod -Uri '{{baseUrl}}/youtube/v3/comments/setModerationStatus?id=&moderationStatus=' -Method POST
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("POST", "/baseUrl/youtube/v3/comments/setModerationStatus?id=&moderationStatus=")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/youtube/v3/comments/setModerationStatus"
querystring = {"id":"","moderationStatus":""}
response = requests.post(url, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/youtube/v3/comments/setModerationStatus"
queryString <- list(
id = "",
moderationStatus = ""
)
response <- VERB("POST", url, query = queryString, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/youtube/v3/comments/setModerationStatus?id=&moderationStatus=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.post('/baseUrl/youtube/v3/comments/setModerationStatus') do |req|
req.params['id'] = ''
req.params['moderationStatus'] = ''
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/youtube/v3/comments/setModerationStatus";
let querystring = [
("id", ""),
("moderationStatus", ""),
];
let client = reqwest::Client::new();
let response = client.post(url)
.query(&querystring)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/youtube/v3/comments/setModerationStatus?id=&moderationStatus='
http POST '{{baseUrl}}/youtube/v3/comments/setModerationStatus?id=&moderationStatus='
wget --quiet \
--method POST \
--output-document \
- '{{baseUrl}}/youtube/v3/comments/setModerationStatus?id=&moderationStatus='
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/youtube/v3/comments/setModerationStatus?id=&moderationStatus=")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
PUT
youtube.comments.update
{{baseUrl}}/youtube/v3/comments
QUERY PARAMS
part
BODY json
{
"etag": "",
"id": "",
"kind": "",
"snippet": {
"authorChannelId": {
"value": ""
},
"authorChannelUrl": "",
"authorDisplayName": "",
"authorProfileImageUrl": "",
"canRate": false,
"channelId": "",
"likeCount": 0,
"moderationStatus": "",
"parentId": "",
"publishedAt": "",
"textDisplay": "",
"textOriginal": "",
"updatedAt": "",
"videoId": "",
"viewerRating": ""
}
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/youtube/v3/comments?part=");
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 \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"authorChannelId\": {\n \"value\": \"\"\n },\n \"authorChannelUrl\": \"\",\n \"authorDisplayName\": \"\",\n \"authorProfileImageUrl\": \"\",\n \"canRate\": false,\n \"channelId\": \"\",\n \"likeCount\": 0,\n \"moderationStatus\": \"\",\n \"parentId\": \"\",\n \"publishedAt\": \"\",\n \"textDisplay\": \"\",\n \"textOriginal\": \"\",\n \"updatedAt\": \"\",\n \"videoId\": \"\",\n \"viewerRating\": \"\"\n }\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/youtube/v3/comments" {:query-params {:part ""}
:content-type :json
:form-params {:etag ""
:id ""
:kind ""
:snippet {:authorChannelId {:value ""}
:authorChannelUrl ""
:authorDisplayName ""
:authorProfileImageUrl ""
:canRate false
:channelId ""
:likeCount 0
:moderationStatus ""
:parentId ""
:publishedAt ""
:textDisplay ""
:textOriginal ""
:updatedAt ""
:videoId ""
:viewerRating ""}}})
require "http/client"
url = "{{baseUrl}}/youtube/v3/comments?part="
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"authorChannelId\": {\n \"value\": \"\"\n },\n \"authorChannelUrl\": \"\",\n \"authorDisplayName\": \"\",\n \"authorProfileImageUrl\": \"\",\n \"canRate\": false,\n \"channelId\": \"\",\n \"likeCount\": 0,\n \"moderationStatus\": \"\",\n \"parentId\": \"\",\n \"publishedAt\": \"\",\n \"textDisplay\": \"\",\n \"textOriginal\": \"\",\n \"updatedAt\": \"\",\n \"videoId\": \"\",\n \"viewerRating\": \"\"\n }\n}"
response = HTTP::Client.put url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Put,
RequestUri = new Uri("{{baseUrl}}/youtube/v3/comments?part="),
Content = new StringContent("{\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"authorChannelId\": {\n \"value\": \"\"\n },\n \"authorChannelUrl\": \"\",\n \"authorDisplayName\": \"\",\n \"authorProfileImageUrl\": \"\",\n \"canRate\": false,\n \"channelId\": \"\",\n \"likeCount\": 0,\n \"moderationStatus\": \"\",\n \"parentId\": \"\",\n \"publishedAt\": \"\",\n \"textDisplay\": \"\",\n \"textOriginal\": \"\",\n \"updatedAt\": \"\",\n \"videoId\": \"\",\n \"viewerRating\": \"\"\n }\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/youtube/v3/comments?part=");
var request = new RestRequest("", Method.Put);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"authorChannelId\": {\n \"value\": \"\"\n },\n \"authorChannelUrl\": \"\",\n \"authorDisplayName\": \"\",\n \"authorProfileImageUrl\": \"\",\n \"canRate\": false,\n \"channelId\": \"\",\n \"likeCount\": 0,\n \"moderationStatus\": \"\",\n \"parentId\": \"\",\n \"publishedAt\": \"\",\n \"textDisplay\": \"\",\n \"textOriginal\": \"\",\n \"updatedAt\": \"\",\n \"videoId\": \"\",\n \"viewerRating\": \"\"\n }\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/youtube/v3/comments?part="
payload := strings.NewReader("{\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"authorChannelId\": {\n \"value\": \"\"\n },\n \"authorChannelUrl\": \"\",\n \"authorDisplayName\": \"\",\n \"authorProfileImageUrl\": \"\",\n \"canRate\": false,\n \"channelId\": \"\",\n \"likeCount\": 0,\n \"moderationStatus\": \"\",\n \"parentId\": \"\",\n \"publishedAt\": \"\",\n \"textDisplay\": \"\",\n \"textOriginal\": \"\",\n \"updatedAt\": \"\",\n \"videoId\": \"\",\n \"viewerRating\": \"\"\n }\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PUT /baseUrl/youtube/v3/comments?part= HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 446
{
"etag": "",
"id": "",
"kind": "",
"snippet": {
"authorChannelId": {
"value": ""
},
"authorChannelUrl": "",
"authorDisplayName": "",
"authorProfileImageUrl": "",
"canRate": false,
"channelId": "",
"likeCount": 0,
"moderationStatus": "",
"parentId": "",
"publishedAt": "",
"textDisplay": "",
"textOriginal": "",
"updatedAt": "",
"videoId": "",
"viewerRating": ""
}
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/youtube/v3/comments?part=")
.setHeader("content-type", "application/json")
.setBody("{\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"authorChannelId\": {\n \"value\": \"\"\n },\n \"authorChannelUrl\": \"\",\n \"authorDisplayName\": \"\",\n \"authorProfileImageUrl\": \"\",\n \"canRate\": false,\n \"channelId\": \"\",\n \"likeCount\": 0,\n \"moderationStatus\": \"\",\n \"parentId\": \"\",\n \"publishedAt\": \"\",\n \"textDisplay\": \"\",\n \"textOriginal\": \"\",\n \"updatedAt\": \"\",\n \"videoId\": \"\",\n \"viewerRating\": \"\"\n }\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/youtube/v3/comments?part="))
.header("content-type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString("{\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"authorChannelId\": {\n \"value\": \"\"\n },\n \"authorChannelUrl\": \"\",\n \"authorDisplayName\": \"\",\n \"authorProfileImageUrl\": \"\",\n \"canRate\": false,\n \"channelId\": \"\",\n \"likeCount\": 0,\n \"moderationStatus\": \"\",\n \"parentId\": \"\",\n \"publishedAt\": \"\",\n \"textDisplay\": \"\",\n \"textOriginal\": \"\",\n \"updatedAt\": \"\",\n \"videoId\": \"\",\n \"viewerRating\": \"\"\n }\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"authorChannelId\": {\n \"value\": \"\"\n },\n \"authorChannelUrl\": \"\",\n \"authorDisplayName\": \"\",\n \"authorProfileImageUrl\": \"\",\n \"canRate\": false,\n \"channelId\": \"\",\n \"likeCount\": 0,\n \"moderationStatus\": \"\",\n \"parentId\": \"\",\n \"publishedAt\": \"\",\n \"textDisplay\": \"\",\n \"textOriginal\": \"\",\n \"updatedAt\": \"\",\n \"videoId\": \"\",\n \"viewerRating\": \"\"\n }\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/youtube/v3/comments?part=")
.put(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/youtube/v3/comments?part=")
.header("content-type", "application/json")
.body("{\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"authorChannelId\": {\n \"value\": \"\"\n },\n \"authorChannelUrl\": \"\",\n \"authorDisplayName\": \"\",\n \"authorProfileImageUrl\": \"\",\n \"canRate\": false,\n \"channelId\": \"\",\n \"likeCount\": 0,\n \"moderationStatus\": \"\",\n \"parentId\": \"\",\n \"publishedAt\": \"\",\n \"textDisplay\": \"\",\n \"textOriginal\": \"\",\n \"updatedAt\": \"\",\n \"videoId\": \"\",\n \"viewerRating\": \"\"\n }\n}")
.asString();
const data = JSON.stringify({
etag: '',
id: '',
kind: '',
snippet: {
authorChannelId: {
value: ''
},
authorChannelUrl: '',
authorDisplayName: '',
authorProfileImageUrl: '',
canRate: false,
channelId: '',
likeCount: 0,
moderationStatus: '',
parentId: '',
publishedAt: '',
textDisplay: '',
textOriginal: '',
updatedAt: '',
videoId: '',
viewerRating: ''
}
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/youtube/v3/comments?part=');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/youtube/v3/comments',
params: {part: ''},
headers: {'content-type': 'application/json'},
data: {
etag: '',
id: '',
kind: '',
snippet: {
authorChannelId: {value: ''},
authorChannelUrl: '',
authorDisplayName: '',
authorProfileImageUrl: '',
canRate: false,
channelId: '',
likeCount: 0,
moderationStatus: '',
parentId: '',
publishedAt: '',
textDisplay: '',
textOriginal: '',
updatedAt: '',
videoId: '',
viewerRating: ''
}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/youtube/v3/comments?part=';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"etag":"","id":"","kind":"","snippet":{"authorChannelId":{"value":""},"authorChannelUrl":"","authorDisplayName":"","authorProfileImageUrl":"","canRate":false,"channelId":"","likeCount":0,"moderationStatus":"","parentId":"","publishedAt":"","textDisplay":"","textOriginal":"","updatedAt":"","videoId":"","viewerRating":""}}'
};
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}}/youtube/v3/comments?part=',
method: 'PUT',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "etag": "",\n "id": "",\n "kind": "",\n "snippet": {\n "authorChannelId": {\n "value": ""\n },\n "authorChannelUrl": "",\n "authorDisplayName": "",\n "authorProfileImageUrl": "",\n "canRate": false,\n "channelId": "",\n "likeCount": 0,\n "moderationStatus": "",\n "parentId": "",\n "publishedAt": "",\n "textDisplay": "",\n "textOriginal": "",\n "updatedAt": "",\n "videoId": "",\n "viewerRating": ""\n }\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"authorChannelId\": {\n \"value\": \"\"\n },\n \"authorChannelUrl\": \"\",\n \"authorDisplayName\": \"\",\n \"authorProfileImageUrl\": \"\",\n \"canRate\": false,\n \"channelId\": \"\",\n \"likeCount\": 0,\n \"moderationStatus\": \"\",\n \"parentId\": \"\",\n \"publishedAt\": \"\",\n \"textDisplay\": \"\",\n \"textOriginal\": \"\",\n \"updatedAt\": \"\",\n \"videoId\": \"\",\n \"viewerRating\": \"\"\n }\n}")
val request = Request.Builder()
.url("{{baseUrl}}/youtube/v3/comments?part=")
.put(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PUT',
hostname: 'example.com',
port: null,
path: '/baseUrl/youtube/v3/comments?part=',
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({
etag: '',
id: '',
kind: '',
snippet: {
authorChannelId: {value: ''},
authorChannelUrl: '',
authorDisplayName: '',
authorProfileImageUrl: '',
canRate: false,
channelId: '',
likeCount: 0,
moderationStatus: '',
parentId: '',
publishedAt: '',
textDisplay: '',
textOriginal: '',
updatedAt: '',
videoId: '',
viewerRating: ''
}
}));
req.end();
const request = require('request');
const options = {
method: 'PUT',
url: '{{baseUrl}}/youtube/v3/comments',
qs: {part: ''},
headers: {'content-type': 'application/json'},
body: {
etag: '',
id: '',
kind: '',
snippet: {
authorChannelId: {value: ''},
authorChannelUrl: '',
authorDisplayName: '',
authorProfileImageUrl: '',
canRate: false,
channelId: '',
likeCount: 0,
moderationStatus: '',
parentId: '',
publishedAt: '',
textDisplay: '',
textOriginal: '',
updatedAt: '',
videoId: '',
viewerRating: ''
}
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PUT', '{{baseUrl}}/youtube/v3/comments');
req.query({
part: ''
});
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
etag: '',
id: '',
kind: '',
snippet: {
authorChannelId: {
value: ''
},
authorChannelUrl: '',
authorDisplayName: '',
authorProfileImageUrl: '',
canRate: false,
channelId: '',
likeCount: 0,
moderationStatus: '',
parentId: '',
publishedAt: '',
textDisplay: '',
textOriginal: '',
updatedAt: '',
videoId: '',
viewerRating: ''
}
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'PUT',
url: '{{baseUrl}}/youtube/v3/comments',
params: {part: ''},
headers: {'content-type': 'application/json'},
data: {
etag: '',
id: '',
kind: '',
snippet: {
authorChannelId: {value: ''},
authorChannelUrl: '',
authorDisplayName: '',
authorProfileImageUrl: '',
canRate: false,
channelId: '',
likeCount: 0,
moderationStatus: '',
parentId: '',
publishedAt: '',
textDisplay: '',
textOriginal: '',
updatedAt: '',
videoId: '',
viewerRating: ''
}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/youtube/v3/comments?part=';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"etag":"","id":"","kind":"","snippet":{"authorChannelId":{"value":""},"authorChannelUrl":"","authorDisplayName":"","authorProfileImageUrl":"","canRate":false,"channelId":"","likeCount":0,"moderationStatus":"","parentId":"","publishedAt":"","textDisplay":"","textOriginal":"","updatedAt":"","videoId":"","viewerRating":""}}'
};
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 = @{ @"etag": @"",
@"id": @"",
@"kind": @"",
@"snippet": @{ @"authorChannelId": @{ @"value": @"" }, @"authorChannelUrl": @"", @"authorDisplayName": @"", @"authorProfileImageUrl": @"", @"canRate": @NO, @"channelId": @"", @"likeCount": @0, @"moderationStatus": @"", @"parentId": @"", @"publishedAt": @"", @"textDisplay": @"", @"textOriginal": @"", @"updatedAt": @"", @"videoId": @"", @"viewerRating": @"" } };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/youtube/v3/comments?part="]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PUT"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/youtube/v3/comments?part=" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"authorChannelId\": {\n \"value\": \"\"\n },\n \"authorChannelUrl\": \"\",\n \"authorDisplayName\": \"\",\n \"authorProfileImageUrl\": \"\",\n \"canRate\": false,\n \"channelId\": \"\",\n \"likeCount\": 0,\n \"moderationStatus\": \"\",\n \"parentId\": \"\",\n \"publishedAt\": \"\",\n \"textDisplay\": \"\",\n \"textOriginal\": \"\",\n \"updatedAt\": \"\",\n \"videoId\": \"\",\n \"viewerRating\": \"\"\n }\n}" in
Client.call ~headers ~body `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/youtube/v3/comments?part=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'etag' => '',
'id' => '',
'kind' => '',
'snippet' => [
'authorChannelId' => [
'value' => ''
],
'authorChannelUrl' => '',
'authorDisplayName' => '',
'authorProfileImageUrl' => '',
'canRate' => null,
'channelId' => '',
'likeCount' => 0,
'moderationStatus' => '',
'parentId' => '',
'publishedAt' => '',
'textDisplay' => '',
'textOriginal' => '',
'updatedAt' => '',
'videoId' => '',
'viewerRating' => ''
]
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('PUT', '{{baseUrl}}/youtube/v3/comments?part=', [
'body' => '{
"etag": "",
"id": "",
"kind": "",
"snippet": {
"authorChannelId": {
"value": ""
},
"authorChannelUrl": "",
"authorDisplayName": "",
"authorProfileImageUrl": "",
"canRate": false,
"channelId": "",
"likeCount": 0,
"moderationStatus": "",
"parentId": "",
"publishedAt": "",
"textDisplay": "",
"textOriginal": "",
"updatedAt": "",
"videoId": "",
"viewerRating": ""
}
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/youtube/v3/comments');
$request->setMethod(HTTP_METH_PUT);
$request->setQueryData([
'part' => ''
]);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'etag' => '',
'id' => '',
'kind' => '',
'snippet' => [
'authorChannelId' => [
'value' => ''
],
'authorChannelUrl' => '',
'authorDisplayName' => '',
'authorProfileImageUrl' => '',
'canRate' => null,
'channelId' => '',
'likeCount' => 0,
'moderationStatus' => '',
'parentId' => '',
'publishedAt' => '',
'textDisplay' => '',
'textOriginal' => '',
'updatedAt' => '',
'videoId' => '',
'viewerRating' => ''
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'etag' => '',
'id' => '',
'kind' => '',
'snippet' => [
'authorChannelId' => [
'value' => ''
],
'authorChannelUrl' => '',
'authorDisplayName' => '',
'authorProfileImageUrl' => '',
'canRate' => null,
'channelId' => '',
'likeCount' => 0,
'moderationStatus' => '',
'parentId' => '',
'publishedAt' => '',
'textDisplay' => '',
'textOriginal' => '',
'updatedAt' => '',
'videoId' => '',
'viewerRating' => ''
]
]));
$request->setRequestUrl('{{baseUrl}}/youtube/v3/comments');
$request->setRequestMethod('PUT');
$request->setBody($body);
$request->setQuery(new http\QueryString([
'part' => ''
]));
$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}}/youtube/v3/comments?part=' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"etag": "",
"id": "",
"kind": "",
"snippet": {
"authorChannelId": {
"value": ""
},
"authorChannelUrl": "",
"authorDisplayName": "",
"authorProfileImageUrl": "",
"canRate": false,
"channelId": "",
"likeCount": 0,
"moderationStatus": "",
"parentId": "",
"publishedAt": "",
"textDisplay": "",
"textOriginal": "",
"updatedAt": "",
"videoId": "",
"viewerRating": ""
}
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/youtube/v3/comments?part=' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"etag": "",
"id": "",
"kind": "",
"snippet": {
"authorChannelId": {
"value": ""
},
"authorChannelUrl": "",
"authorDisplayName": "",
"authorProfileImageUrl": "",
"canRate": false,
"channelId": "",
"likeCount": 0,
"moderationStatus": "",
"parentId": "",
"publishedAt": "",
"textDisplay": "",
"textOriginal": "",
"updatedAt": "",
"videoId": "",
"viewerRating": ""
}
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"authorChannelId\": {\n \"value\": \"\"\n },\n \"authorChannelUrl\": \"\",\n \"authorDisplayName\": \"\",\n \"authorProfileImageUrl\": \"\",\n \"canRate\": false,\n \"channelId\": \"\",\n \"likeCount\": 0,\n \"moderationStatus\": \"\",\n \"parentId\": \"\",\n \"publishedAt\": \"\",\n \"textDisplay\": \"\",\n \"textOriginal\": \"\",\n \"updatedAt\": \"\",\n \"videoId\": \"\",\n \"viewerRating\": \"\"\n }\n}"
headers = { 'content-type': "application/json" }
conn.request("PUT", "/baseUrl/youtube/v3/comments?part=", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/youtube/v3/comments"
querystring = {"part":""}
payload = {
"etag": "",
"id": "",
"kind": "",
"snippet": {
"authorChannelId": { "value": "" },
"authorChannelUrl": "",
"authorDisplayName": "",
"authorProfileImageUrl": "",
"canRate": False,
"channelId": "",
"likeCount": 0,
"moderationStatus": "",
"parentId": "",
"publishedAt": "",
"textDisplay": "",
"textOriginal": "",
"updatedAt": "",
"videoId": "",
"viewerRating": ""
}
}
headers = {"content-type": "application/json"}
response = requests.put(url, json=payload, headers=headers, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/youtube/v3/comments"
queryString <- list(part = "")
payload <- "{\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"authorChannelId\": {\n \"value\": \"\"\n },\n \"authorChannelUrl\": \"\",\n \"authorDisplayName\": \"\",\n \"authorProfileImageUrl\": \"\",\n \"canRate\": false,\n \"channelId\": \"\",\n \"likeCount\": 0,\n \"moderationStatus\": \"\",\n \"parentId\": \"\",\n \"publishedAt\": \"\",\n \"textDisplay\": \"\",\n \"textOriginal\": \"\",\n \"updatedAt\": \"\",\n \"videoId\": \"\",\n \"viewerRating\": \"\"\n }\n}"
encode <- "json"
response <- VERB("PUT", url, body = payload, query = queryString, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/youtube/v3/comments?part=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"authorChannelId\": {\n \"value\": \"\"\n },\n \"authorChannelUrl\": \"\",\n \"authorDisplayName\": \"\",\n \"authorProfileImageUrl\": \"\",\n \"canRate\": false,\n \"channelId\": \"\",\n \"likeCount\": 0,\n \"moderationStatus\": \"\",\n \"parentId\": \"\",\n \"publishedAt\": \"\",\n \"textDisplay\": \"\",\n \"textOriginal\": \"\",\n \"updatedAt\": \"\",\n \"videoId\": \"\",\n \"viewerRating\": \"\"\n }\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.put('/baseUrl/youtube/v3/comments') do |req|
req.params['part'] = ''
req.body = "{\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"authorChannelId\": {\n \"value\": \"\"\n },\n \"authorChannelUrl\": \"\",\n \"authorDisplayName\": \"\",\n \"authorProfileImageUrl\": \"\",\n \"canRate\": false,\n \"channelId\": \"\",\n \"likeCount\": 0,\n \"moderationStatus\": \"\",\n \"parentId\": \"\",\n \"publishedAt\": \"\",\n \"textDisplay\": \"\",\n \"textOriginal\": \"\",\n \"updatedAt\": \"\",\n \"videoId\": \"\",\n \"viewerRating\": \"\"\n }\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}}/youtube/v3/comments";
let querystring = [
("part", ""),
];
let payload = json!({
"etag": "",
"id": "",
"kind": "",
"snippet": json!({
"authorChannelId": json!({"value": ""}),
"authorChannelUrl": "",
"authorDisplayName": "",
"authorProfileImageUrl": "",
"canRate": false,
"channelId": "",
"likeCount": 0,
"moderationStatus": "",
"parentId": "",
"publishedAt": "",
"textDisplay": "",
"textOriginal": "",
"updatedAt": "",
"videoId": "",
"viewerRating": ""
})
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PUT").unwrap(), url)
.query(&querystring)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PUT \
--url '{{baseUrl}}/youtube/v3/comments?part=' \
--header 'content-type: application/json' \
--data '{
"etag": "",
"id": "",
"kind": "",
"snippet": {
"authorChannelId": {
"value": ""
},
"authorChannelUrl": "",
"authorDisplayName": "",
"authorProfileImageUrl": "",
"canRate": false,
"channelId": "",
"likeCount": 0,
"moderationStatus": "",
"parentId": "",
"publishedAt": "",
"textDisplay": "",
"textOriginal": "",
"updatedAt": "",
"videoId": "",
"viewerRating": ""
}
}'
echo '{
"etag": "",
"id": "",
"kind": "",
"snippet": {
"authorChannelId": {
"value": ""
},
"authorChannelUrl": "",
"authorDisplayName": "",
"authorProfileImageUrl": "",
"canRate": false,
"channelId": "",
"likeCount": 0,
"moderationStatus": "",
"parentId": "",
"publishedAt": "",
"textDisplay": "",
"textOriginal": "",
"updatedAt": "",
"videoId": "",
"viewerRating": ""
}
}' | \
http PUT '{{baseUrl}}/youtube/v3/comments?part=' \
content-type:application/json
wget --quiet \
--method PUT \
--header 'content-type: application/json' \
--body-data '{\n "etag": "",\n "id": "",\n "kind": "",\n "snippet": {\n "authorChannelId": {\n "value": ""\n },\n "authorChannelUrl": "",\n "authorDisplayName": "",\n "authorProfileImageUrl": "",\n "canRate": false,\n "channelId": "",\n "likeCount": 0,\n "moderationStatus": "",\n "parentId": "",\n "publishedAt": "",\n "textDisplay": "",\n "textOriginal": "",\n "updatedAt": "",\n "videoId": "",\n "viewerRating": ""\n }\n}' \
--output-document \
- '{{baseUrl}}/youtube/v3/comments?part='
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"etag": "",
"id": "",
"kind": "",
"snippet": [
"authorChannelId": ["value": ""],
"authorChannelUrl": "",
"authorDisplayName": "",
"authorProfileImageUrl": "",
"canRate": false,
"channelId": "",
"likeCount": 0,
"moderationStatus": "",
"parentId": "",
"publishedAt": "",
"textDisplay": "",
"textOriginal": "",
"updatedAt": "",
"videoId": "",
"viewerRating": ""
]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/youtube/v3/comments?part=")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
youtube.commentThreads.insert
{{baseUrl}}/youtube/v3/commentThreads
QUERY PARAMS
part
BODY json
{
"etag": "",
"id": "",
"kind": "",
"replies": {
"comments": [
{
"etag": "",
"id": "",
"kind": "",
"snippet": {
"authorChannelId": {
"value": ""
},
"authorChannelUrl": "",
"authorDisplayName": "",
"authorProfileImageUrl": "",
"canRate": false,
"channelId": "",
"likeCount": 0,
"moderationStatus": "",
"parentId": "",
"publishedAt": "",
"textDisplay": "",
"textOriginal": "",
"updatedAt": "",
"videoId": "",
"viewerRating": ""
}
}
]
},
"snippet": {
"canReply": false,
"channelId": "",
"isPublic": false,
"topLevelComment": {},
"totalReplyCount": 0,
"videoId": ""
}
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/youtube/v3/commentThreads?part=");
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 \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"replies\": {\n \"comments\": [\n {\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"authorChannelId\": {\n \"value\": \"\"\n },\n \"authorChannelUrl\": \"\",\n \"authorDisplayName\": \"\",\n \"authorProfileImageUrl\": \"\",\n \"canRate\": false,\n \"channelId\": \"\",\n \"likeCount\": 0,\n \"moderationStatus\": \"\",\n \"parentId\": \"\",\n \"publishedAt\": \"\",\n \"textDisplay\": \"\",\n \"textOriginal\": \"\",\n \"updatedAt\": \"\",\n \"videoId\": \"\",\n \"viewerRating\": \"\"\n }\n }\n ]\n },\n \"snippet\": {\n \"canReply\": false,\n \"channelId\": \"\",\n \"isPublic\": false,\n \"topLevelComment\": {},\n \"totalReplyCount\": 0,\n \"videoId\": \"\"\n }\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/youtube/v3/commentThreads" {:query-params {:part ""}
:content-type :json
:form-params {:etag ""
:id ""
:kind ""
:replies {:comments [{:etag ""
:id ""
:kind ""
:snippet {:authorChannelId {:value ""}
:authorChannelUrl ""
:authorDisplayName ""
:authorProfileImageUrl ""
:canRate false
:channelId ""
:likeCount 0
:moderationStatus ""
:parentId ""
:publishedAt ""
:textDisplay ""
:textOriginal ""
:updatedAt ""
:videoId ""
:viewerRating ""}}]}
:snippet {:canReply false
:channelId ""
:isPublic false
:topLevelComment {}
:totalReplyCount 0
:videoId ""}}})
require "http/client"
url = "{{baseUrl}}/youtube/v3/commentThreads?part="
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"replies\": {\n \"comments\": [\n {\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"authorChannelId\": {\n \"value\": \"\"\n },\n \"authorChannelUrl\": \"\",\n \"authorDisplayName\": \"\",\n \"authorProfileImageUrl\": \"\",\n \"canRate\": false,\n \"channelId\": \"\",\n \"likeCount\": 0,\n \"moderationStatus\": \"\",\n \"parentId\": \"\",\n \"publishedAt\": \"\",\n \"textDisplay\": \"\",\n \"textOriginal\": \"\",\n \"updatedAt\": \"\",\n \"videoId\": \"\",\n \"viewerRating\": \"\"\n }\n }\n ]\n },\n \"snippet\": {\n \"canReply\": false,\n \"channelId\": \"\",\n \"isPublic\": false,\n \"topLevelComment\": {},\n \"totalReplyCount\": 0,\n \"videoId\": \"\"\n }\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/youtube/v3/commentThreads?part="),
Content = new StringContent("{\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"replies\": {\n \"comments\": [\n {\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"authorChannelId\": {\n \"value\": \"\"\n },\n \"authorChannelUrl\": \"\",\n \"authorDisplayName\": \"\",\n \"authorProfileImageUrl\": \"\",\n \"canRate\": false,\n \"channelId\": \"\",\n \"likeCount\": 0,\n \"moderationStatus\": \"\",\n \"parentId\": \"\",\n \"publishedAt\": \"\",\n \"textDisplay\": \"\",\n \"textOriginal\": \"\",\n \"updatedAt\": \"\",\n \"videoId\": \"\",\n \"viewerRating\": \"\"\n }\n }\n ]\n },\n \"snippet\": {\n \"canReply\": false,\n \"channelId\": \"\",\n \"isPublic\": false,\n \"topLevelComment\": {},\n \"totalReplyCount\": 0,\n \"videoId\": \"\"\n }\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/youtube/v3/commentThreads?part=");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"replies\": {\n \"comments\": [\n {\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"authorChannelId\": {\n \"value\": \"\"\n },\n \"authorChannelUrl\": \"\",\n \"authorDisplayName\": \"\",\n \"authorProfileImageUrl\": \"\",\n \"canRate\": false,\n \"channelId\": \"\",\n \"likeCount\": 0,\n \"moderationStatus\": \"\",\n \"parentId\": \"\",\n \"publishedAt\": \"\",\n \"textDisplay\": \"\",\n \"textOriginal\": \"\",\n \"updatedAt\": \"\",\n \"videoId\": \"\",\n \"viewerRating\": \"\"\n }\n }\n ]\n },\n \"snippet\": {\n \"canReply\": false,\n \"channelId\": \"\",\n \"isPublic\": false,\n \"topLevelComment\": {},\n \"totalReplyCount\": 0,\n \"videoId\": \"\"\n }\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/youtube/v3/commentThreads?part="
payload := strings.NewReader("{\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"replies\": {\n \"comments\": [\n {\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"authorChannelId\": {\n \"value\": \"\"\n },\n \"authorChannelUrl\": \"\",\n \"authorDisplayName\": \"\",\n \"authorProfileImageUrl\": \"\",\n \"canRate\": false,\n \"channelId\": \"\",\n \"likeCount\": 0,\n \"moderationStatus\": \"\",\n \"parentId\": \"\",\n \"publishedAt\": \"\",\n \"textDisplay\": \"\",\n \"textOriginal\": \"\",\n \"updatedAt\": \"\",\n \"videoId\": \"\",\n \"viewerRating\": \"\"\n }\n }\n ]\n },\n \"snippet\": {\n \"canReply\": false,\n \"channelId\": \"\",\n \"isPublic\": false,\n \"topLevelComment\": {},\n \"totalReplyCount\": 0,\n \"videoId\": \"\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/youtube/v3/commentThreads?part= HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 835
{
"etag": "",
"id": "",
"kind": "",
"replies": {
"comments": [
{
"etag": "",
"id": "",
"kind": "",
"snippet": {
"authorChannelId": {
"value": ""
},
"authorChannelUrl": "",
"authorDisplayName": "",
"authorProfileImageUrl": "",
"canRate": false,
"channelId": "",
"likeCount": 0,
"moderationStatus": "",
"parentId": "",
"publishedAt": "",
"textDisplay": "",
"textOriginal": "",
"updatedAt": "",
"videoId": "",
"viewerRating": ""
}
}
]
},
"snippet": {
"canReply": false,
"channelId": "",
"isPublic": false,
"topLevelComment": {},
"totalReplyCount": 0,
"videoId": ""
}
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/youtube/v3/commentThreads?part=")
.setHeader("content-type", "application/json")
.setBody("{\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"replies\": {\n \"comments\": [\n {\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"authorChannelId\": {\n \"value\": \"\"\n },\n \"authorChannelUrl\": \"\",\n \"authorDisplayName\": \"\",\n \"authorProfileImageUrl\": \"\",\n \"canRate\": false,\n \"channelId\": \"\",\n \"likeCount\": 0,\n \"moderationStatus\": \"\",\n \"parentId\": \"\",\n \"publishedAt\": \"\",\n \"textDisplay\": \"\",\n \"textOriginal\": \"\",\n \"updatedAt\": \"\",\n \"videoId\": \"\",\n \"viewerRating\": \"\"\n }\n }\n ]\n },\n \"snippet\": {\n \"canReply\": false,\n \"channelId\": \"\",\n \"isPublic\": false,\n \"topLevelComment\": {},\n \"totalReplyCount\": 0,\n \"videoId\": \"\"\n }\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/youtube/v3/commentThreads?part="))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"replies\": {\n \"comments\": [\n {\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"authorChannelId\": {\n \"value\": \"\"\n },\n \"authorChannelUrl\": \"\",\n \"authorDisplayName\": \"\",\n \"authorProfileImageUrl\": \"\",\n \"canRate\": false,\n \"channelId\": \"\",\n \"likeCount\": 0,\n \"moderationStatus\": \"\",\n \"parentId\": \"\",\n \"publishedAt\": \"\",\n \"textDisplay\": \"\",\n \"textOriginal\": \"\",\n \"updatedAt\": \"\",\n \"videoId\": \"\",\n \"viewerRating\": \"\"\n }\n }\n ]\n },\n \"snippet\": {\n \"canReply\": false,\n \"channelId\": \"\",\n \"isPublic\": false,\n \"topLevelComment\": {},\n \"totalReplyCount\": 0,\n \"videoId\": \"\"\n }\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"replies\": {\n \"comments\": [\n {\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"authorChannelId\": {\n \"value\": \"\"\n },\n \"authorChannelUrl\": \"\",\n \"authorDisplayName\": \"\",\n \"authorProfileImageUrl\": \"\",\n \"canRate\": false,\n \"channelId\": \"\",\n \"likeCount\": 0,\n \"moderationStatus\": \"\",\n \"parentId\": \"\",\n \"publishedAt\": \"\",\n \"textDisplay\": \"\",\n \"textOriginal\": \"\",\n \"updatedAt\": \"\",\n \"videoId\": \"\",\n \"viewerRating\": \"\"\n }\n }\n ]\n },\n \"snippet\": {\n \"canReply\": false,\n \"channelId\": \"\",\n \"isPublic\": false,\n \"topLevelComment\": {},\n \"totalReplyCount\": 0,\n \"videoId\": \"\"\n }\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/youtube/v3/commentThreads?part=")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/youtube/v3/commentThreads?part=")
.header("content-type", "application/json")
.body("{\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"replies\": {\n \"comments\": [\n {\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"authorChannelId\": {\n \"value\": \"\"\n },\n \"authorChannelUrl\": \"\",\n \"authorDisplayName\": \"\",\n \"authorProfileImageUrl\": \"\",\n \"canRate\": false,\n \"channelId\": \"\",\n \"likeCount\": 0,\n \"moderationStatus\": \"\",\n \"parentId\": \"\",\n \"publishedAt\": \"\",\n \"textDisplay\": \"\",\n \"textOriginal\": \"\",\n \"updatedAt\": \"\",\n \"videoId\": \"\",\n \"viewerRating\": \"\"\n }\n }\n ]\n },\n \"snippet\": {\n \"canReply\": false,\n \"channelId\": \"\",\n \"isPublic\": false,\n \"topLevelComment\": {},\n \"totalReplyCount\": 0,\n \"videoId\": \"\"\n }\n}")
.asString();
const data = JSON.stringify({
etag: '',
id: '',
kind: '',
replies: {
comments: [
{
etag: '',
id: '',
kind: '',
snippet: {
authorChannelId: {
value: ''
},
authorChannelUrl: '',
authorDisplayName: '',
authorProfileImageUrl: '',
canRate: false,
channelId: '',
likeCount: 0,
moderationStatus: '',
parentId: '',
publishedAt: '',
textDisplay: '',
textOriginal: '',
updatedAt: '',
videoId: '',
viewerRating: ''
}
}
]
},
snippet: {
canReply: false,
channelId: '',
isPublic: false,
topLevelComment: {},
totalReplyCount: 0,
videoId: ''
}
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/youtube/v3/commentThreads?part=');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/youtube/v3/commentThreads',
params: {part: ''},
headers: {'content-type': 'application/json'},
data: {
etag: '',
id: '',
kind: '',
replies: {
comments: [
{
etag: '',
id: '',
kind: '',
snippet: {
authorChannelId: {value: ''},
authorChannelUrl: '',
authorDisplayName: '',
authorProfileImageUrl: '',
canRate: false,
channelId: '',
likeCount: 0,
moderationStatus: '',
parentId: '',
publishedAt: '',
textDisplay: '',
textOriginal: '',
updatedAt: '',
videoId: '',
viewerRating: ''
}
}
]
},
snippet: {
canReply: false,
channelId: '',
isPublic: false,
topLevelComment: {},
totalReplyCount: 0,
videoId: ''
}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/youtube/v3/commentThreads?part=';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"etag":"","id":"","kind":"","replies":{"comments":[{"etag":"","id":"","kind":"","snippet":{"authorChannelId":{"value":""},"authorChannelUrl":"","authorDisplayName":"","authorProfileImageUrl":"","canRate":false,"channelId":"","likeCount":0,"moderationStatus":"","parentId":"","publishedAt":"","textDisplay":"","textOriginal":"","updatedAt":"","videoId":"","viewerRating":""}}]},"snippet":{"canReply":false,"channelId":"","isPublic":false,"topLevelComment":{},"totalReplyCount":0,"videoId":""}}'
};
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}}/youtube/v3/commentThreads?part=',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "etag": "",\n "id": "",\n "kind": "",\n "replies": {\n "comments": [\n {\n "etag": "",\n "id": "",\n "kind": "",\n "snippet": {\n "authorChannelId": {\n "value": ""\n },\n "authorChannelUrl": "",\n "authorDisplayName": "",\n "authorProfileImageUrl": "",\n "canRate": false,\n "channelId": "",\n "likeCount": 0,\n "moderationStatus": "",\n "parentId": "",\n "publishedAt": "",\n "textDisplay": "",\n "textOriginal": "",\n "updatedAt": "",\n "videoId": "",\n "viewerRating": ""\n }\n }\n ]\n },\n "snippet": {\n "canReply": false,\n "channelId": "",\n "isPublic": false,\n "topLevelComment": {},\n "totalReplyCount": 0,\n "videoId": ""\n }\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"replies\": {\n \"comments\": [\n {\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"authorChannelId\": {\n \"value\": \"\"\n },\n \"authorChannelUrl\": \"\",\n \"authorDisplayName\": \"\",\n \"authorProfileImageUrl\": \"\",\n \"canRate\": false,\n \"channelId\": \"\",\n \"likeCount\": 0,\n \"moderationStatus\": \"\",\n \"parentId\": \"\",\n \"publishedAt\": \"\",\n \"textDisplay\": \"\",\n \"textOriginal\": \"\",\n \"updatedAt\": \"\",\n \"videoId\": \"\",\n \"viewerRating\": \"\"\n }\n }\n ]\n },\n \"snippet\": {\n \"canReply\": false,\n \"channelId\": \"\",\n \"isPublic\": false,\n \"topLevelComment\": {},\n \"totalReplyCount\": 0,\n \"videoId\": \"\"\n }\n}")
val request = Request.Builder()
.url("{{baseUrl}}/youtube/v3/commentThreads?part=")
.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/youtube/v3/commentThreads?part=',
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({
etag: '',
id: '',
kind: '',
replies: {
comments: [
{
etag: '',
id: '',
kind: '',
snippet: {
authorChannelId: {value: ''},
authorChannelUrl: '',
authorDisplayName: '',
authorProfileImageUrl: '',
canRate: false,
channelId: '',
likeCount: 0,
moderationStatus: '',
parentId: '',
publishedAt: '',
textDisplay: '',
textOriginal: '',
updatedAt: '',
videoId: '',
viewerRating: ''
}
}
]
},
snippet: {
canReply: false,
channelId: '',
isPublic: false,
topLevelComment: {},
totalReplyCount: 0,
videoId: ''
}
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/youtube/v3/commentThreads',
qs: {part: ''},
headers: {'content-type': 'application/json'},
body: {
etag: '',
id: '',
kind: '',
replies: {
comments: [
{
etag: '',
id: '',
kind: '',
snippet: {
authorChannelId: {value: ''},
authorChannelUrl: '',
authorDisplayName: '',
authorProfileImageUrl: '',
canRate: false,
channelId: '',
likeCount: 0,
moderationStatus: '',
parentId: '',
publishedAt: '',
textDisplay: '',
textOriginal: '',
updatedAt: '',
videoId: '',
viewerRating: ''
}
}
]
},
snippet: {
canReply: false,
channelId: '',
isPublic: false,
topLevelComment: {},
totalReplyCount: 0,
videoId: ''
}
},
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}}/youtube/v3/commentThreads');
req.query({
part: ''
});
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
etag: '',
id: '',
kind: '',
replies: {
comments: [
{
etag: '',
id: '',
kind: '',
snippet: {
authorChannelId: {
value: ''
},
authorChannelUrl: '',
authorDisplayName: '',
authorProfileImageUrl: '',
canRate: false,
channelId: '',
likeCount: 0,
moderationStatus: '',
parentId: '',
publishedAt: '',
textDisplay: '',
textOriginal: '',
updatedAt: '',
videoId: '',
viewerRating: ''
}
}
]
},
snippet: {
canReply: false,
channelId: '',
isPublic: false,
topLevelComment: {},
totalReplyCount: 0,
videoId: ''
}
});
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}}/youtube/v3/commentThreads',
params: {part: ''},
headers: {'content-type': 'application/json'},
data: {
etag: '',
id: '',
kind: '',
replies: {
comments: [
{
etag: '',
id: '',
kind: '',
snippet: {
authorChannelId: {value: ''},
authorChannelUrl: '',
authorDisplayName: '',
authorProfileImageUrl: '',
canRate: false,
channelId: '',
likeCount: 0,
moderationStatus: '',
parentId: '',
publishedAt: '',
textDisplay: '',
textOriginal: '',
updatedAt: '',
videoId: '',
viewerRating: ''
}
}
]
},
snippet: {
canReply: false,
channelId: '',
isPublic: false,
topLevelComment: {},
totalReplyCount: 0,
videoId: ''
}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/youtube/v3/commentThreads?part=';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"etag":"","id":"","kind":"","replies":{"comments":[{"etag":"","id":"","kind":"","snippet":{"authorChannelId":{"value":""},"authorChannelUrl":"","authorDisplayName":"","authorProfileImageUrl":"","canRate":false,"channelId":"","likeCount":0,"moderationStatus":"","parentId":"","publishedAt":"","textDisplay":"","textOriginal":"","updatedAt":"","videoId":"","viewerRating":""}}]},"snippet":{"canReply":false,"channelId":"","isPublic":false,"topLevelComment":{},"totalReplyCount":0,"videoId":""}}'
};
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 = @{ @"etag": @"",
@"id": @"",
@"kind": @"",
@"replies": @{ @"comments": @[ @{ @"etag": @"", @"id": @"", @"kind": @"", @"snippet": @{ @"authorChannelId": @{ @"value": @"" }, @"authorChannelUrl": @"", @"authorDisplayName": @"", @"authorProfileImageUrl": @"", @"canRate": @NO, @"channelId": @"", @"likeCount": @0, @"moderationStatus": @"", @"parentId": @"", @"publishedAt": @"", @"textDisplay": @"", @"textOriginal": @"", @"updatedAt": @"", @"videoId": @"", @"viewerRating": @"" } } ] },
@"snippet": @{ @"canReply": @NO, @"channelId": @"", @"isPublic": @NO, @"topLevelComment": @{ }, @"totalReplyCount": @0, @"videoId": @"" } };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/youtube/v3/commentThreads?part="]
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}}/youtube/v3/commentThreads?part=" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"replies\": {\n \"comments\": [\n {\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"authorChannelId\": {\n \"value\": \"\"\n },\n \"authorChannelUrl\": \"\",\n \"authorDisplayName\": \"\",\n \"authorProfileImageUrl\": \"\",\n \"canRate\": false,\n \"channelId\": \"\",\n \"likeCount\": 0,\n \"moderationStatus\": \"\",\n \"parentId\": \"\",\n \"publishedAt\": \"\",\n \"textDisplay\": \"\",\n \"textOriginal\": \"\",\n \"updatedAt\": \"\",\n \"videoId\": \"\",\n \"viewerRating\": \"\"\n }\n }\n ]\n },\n \"snippet\": {\n \"canReply\": false,\n \"channelId\": \"\",\n \"isPublic\": false,\n \"topLevelComment\": {},\n \"totalReplyCount\": 0,\n \"videoId\": \"\"\n }\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/youtube/v3/commentThreads?part=",
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([
'etag' => '',
'id' => '',
'kind' => '',
'replies' => [
'comments' => [
[
'etag' => '',
'id' => '',
'kind' => '',
'snippet' => [
'authorChannelId' => [
'value' => ''
],
'authorChannelUrl' => '',
'authorDisplayName' => '',
'authorProfileImageUrl' => '',
'canRate' => null,
'channelId' => '',
'likeCount' => 0,
'moderationStatus' => '',
'parentId' => '',
'publishedAt' => '',
'textDisplay' => '',
'textOriginal' => '',
'updatedAt' => '',
'videoId' => '',
'viewerRating' => ''
]
]
]
],
'snippet' => [
'canReply' => null,
'channelId' => '',
'isPublic' => null,
'topLevelComment' => [
],
'totalReplyCount' => 0,
'videoId' => ''
]
]),
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}}/youtube/v3/commentThreads?part=', [
'body' => '{
"etag": "",
"id": "",
"kind": "",
"replies": {
"comments": [
{
"etag": "",
"id": "",
"kind": "",
"snippet": {
"authorChannelId": {
"value": ""
},
"authorChannelUrl": "",
"authorDisplayName": "",
"authorProfileImageUrl": "",
"canRate": false,
"channelId": "",
"likeCount": 0,
"moderationStatus": "",
"parentId": "",
"publishedAt": "",
"textDisplay": "",
"textOriginal": "",
"updatedAt": "",
"videoId": "",
"viewerRating": ""
}
}
]
},
"snippet": {
"canReply": false,
"channelId": "",
"isPublic": false,
"topLevelComment": {},
"totalReplyCount": 0,
"videoId": ""
}
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/youtube/v3/commentThreads');
$request->setMethod(HTTP_METH_POST);
$request->setQueryData([
'part' => ''
]);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'etag' => '',
'id' => '',
'kind' => '',
'replies' => [
'comments' => [
[
'etag' => '',
'id' => '',
'kind' => '',
'snippet' => [
'authorChannelId' => [
'value' => ''
],
'authorChannelUrl' => '',
'authorDisplayName' => '',
'authorProfileImageUrl' => '',
'canRate' => null,
'channelId' => '',
'likeCount' => 0,
'moderationStatus' => '',
'parentId' => '',
'publishedAt' => '',
'textDisplay' => '',
'textOriginal' => '',
'updatedAt' => '',
'videoId' => '',
'viewerRating' => ''
]
]
]
],
'snippet' => [
'canReply' => null,
'channelId' => '',
'isPublic' => null,
'topLevelComment' => [
],
'totalReplyCount' => 0,
'videoId' => ''
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'etag' => '',
'id' => '',
'kind' => '',
'replies' => [
'comments' => [
[
'etag' => '',
'id' => '',
'kind' => '',
'snippet' => [
'authorChannelId' => [
'value' => ''
],
'authorChannelUrl' => '',
'authorDisplayName' => '',
'authorProfileImageUrl' => '',
'canRate' => null,
'channelId' => '',
'likeCount' => 0,
'moderationStatus' => '',
'parentId' => '',
'publishedAt' => '',
'textDisplay' => '',
'textOriginal' => '',
'updatedAt' => '',
'videoId' => '',
'viewerRating' => ''
]
]
]
],
'snippet' => [
'canReply' => null,
'channelId' => '',
'isPublic' => null,
'topLevelComment' => [
],
'totalReplyCount' => 0,
'videoId' => ''
]
]));
$request->setRequestUrl('{{baseUrl}}/youtube/v3/commentThreads');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setQuery(new http\QueryString([
'part' => ''
]));
$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}}/youtube/v3/commentThreads?part=' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"etag": "",
"id": "",
"kind": "",
"replies": {
"comments": [
{
"etag": "",
"id": "",
"kind": "",
"snippet": {
"authorChannelId": {
"value": ""
},
"authorChannelUrl": "",
"authorDisplayName": "",
"authorProfileImageUrl": "",
"canRate": false,
"channelId": "",
"likeCount": 0,
"moderationStatus": "",
"parentId": "",
"publishedAt": "",
"textDisplay": "",
"textOriginal": "",
"updatedAt": "",
"videoId": "",
"viewerRating": ""
}
}
]
},
"snippet": {
"canReply": false,
"channelId": "",
"isPublic": false,
"topLevelComment": {},
"totalReplyCount": 0,
"videoId": ""
}
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/youtube/v3/commentThreads?part=' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"etag": "",
"id": "",
"kind": "",
"replies": {
"comments": [
{
"etag": "",
"id": "",
"kind": "",
"snippet": {
"authorChannelId": {
"value": ""
},
"authorChannelUrl": "",
"authorDisplayName": "",
"authorProfileImageUrl": "",
"canRate": false,
"channelId": "",
"likeCount": 0,
"moderationStatus": "",
"parentId": "",
"publishedAt": "",
"textDisplay": "",
"textOriginal": "",
"updatedAt": "",
"videoId": "",
"viewerRating": ""
}
}
]
},
"snippet": {
"canReply": false,
"channelId": "",
"isPublic": false,
"topLevelComment": {},
"totalReplyCount": 0,
"videoId": ""
}
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"replies\": {\n \"comments\": [\n {\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"authorChannelId\": {\n \"value\": \"\"\n },\n \"authorChannelUrl\": \"\",\n \"authorDisplayName\": \"\",\n \"authorProfileImageUrl\": \"\",\n \"canRate\": false,\n \"channelId\": \"\",\n \"likeCount\": 0,\n \"moderationStatus\": \"\",\n \"parentId\": \"\",\n \"publishedAt\": \"\",\n \"textDisplay\": \"\",\n \"textOriginal\": \"\",\n \"updatedAt\": \"\",\n \"videoId\": \"\",\n \"viewerRating\": \"\"\n }\n }\n ]\n },\n \"snippet\": {\n \"canReply\": false,\n \"channelId\": \"\",\n \"isPublic\": false,\n \"topLevelComment\": {},\n \"totalReplyCount\": 0,\n \"videoId\": \"\"\n }\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/youtube/v3/commentThreads?part=", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/youtube/v3/commentThreads"
querystring = {"part":""}
payload = {
"etag": "",
"id": "",
"kind": "",
"replies": { "comments": [
{
"etag": "",
"id": "",
"kind": "",
"snippet": {
"authorChannelId": { "value": "" },
"authorChannelUrl": "",
"authorDisplayName": "",
"authorProfileImageUrl": "",
"canRate": False,
"channelId": "",
"likeCount": 0,
"moderationStatus": "",
"parentId": "",
"publishedAt": "",
"textDisplay": "",
"textOriginal": "",
"updatedAt": "",
"videoId": "",
"viewerRating": ""
}
}
] },
"snippet": {
"canReply": False,
"channelId": "",
"isPublic": False,
"topLevelComment": {},
"totalReplyCount": 0,
"videoId": ""
}
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/youtube/v3/commentThreads"
queryString <- list(part = "")
payload <- "{\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"replies\": {\n \"comments\": [\n {\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"authorChannelId\": {\n \"value\": \"\"\n },\n \"authorChannelUrl\": \"\",\n \"authorDisplayName\": \"\",\n \"authorProfileImageUrl\": \"\",\n \"canRate\": false,\n \"channelId\": \"\",\n \"likeCount\": 0,\n \"moderationStatus\": \"\",\n \"parentId\": \"\",\n \"publishedAt\": \"\",\n \"textDisplay\": \"\",\n \"textOriginal\": \"\",\n \"updatedAt\": \"\",\n \"videoId\": \"\",\n \"viewerRating\": \"\"\n }\n }\n ]\n },\n \"snippet\": {\n \"canReply\": false,\n \"channelId\": \"\",\n \"isPublic\": false,\n \"topLevelComment\": {},\n \"totalReplyCount\": 0,\n \"videoId\": \"\"\n }\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, query = queryString, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/youtube/v3/commentThreads?part=")
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 \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"replies\": {\n \"comments\": [\n {\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"authorChannelId\": {\n \"value\": \"\"\n },\n \"authorChannelUrl\": \"\",\n \"authorDisplayName\": \"\",\n \"authorProfileImageUrl\": \"\",\n \"canRate\": false,\n \"channelId\": \"\",\n \"likeCount\": 0,\n \"moderationStatus\": \"\",\n \"parentId\": \"\",\n \"publishedAt\": \"\",\n \"textDisplay\": \"\",\n \"textOriginal\": \"\",\n \"updatedAt\": \"\",\n \"videoId\": \"\",\n \"viewerRating\": \"\"\n }\n }\n ]\n },\n \"snippet\": {\n \"canReply\": false,\n \"channelId\": \"\",\n \"isPublic\": false,\n \"topLevelComment\": {},\n \"totalReplyCount\": 0,\n \"videoId\": \"\"\n }\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/youtube/v3/commentThreads') do |req|
req.params['part'] = ''
req.body = "{\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"replies\": {\n \"comments\": [\n {\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"authorChannelId\": {\n \"value\": \"\"\n },\n \"authorChannelUrl\": \"\",\n \"authorDisplayName\": \"\",\n \"authorProfileImageUrl\": \"\",\n \"canRate\": false,\n \"channelId\": \"\",\n \"likeCount\": 0,\n \"moderationStatus\": \"\",\n \"parentId\": \"\",\n \"publishedAt\": \"\",\n \"textDisplay\": \"\",\n \"textOriginal\": \"\",\n \"updatedAt\": \"\",\n \"videoId\": \"\",\n \"viewerRating\": \"\"\n }\n }\n ]\n },\n \"snippet\": {\n \"canReply\": false,\n \"channelId\": \"\",\n \"isPublic\": false,\n \"topLevelComment\": {},\n \"totalReplyCount\": 0,\n \"videoId\": \"\"\n }\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/youtube/v3/commentThreads";
let querystring = [
("part", ""),
];
let payload = json!({
"etag": "",
"id": "",
"kind": "",
"replies": json!({"comments": (
json!({
"etag": "",
"id": "",
"kind": "",
"snippet": json!({
"authorChannelId": json!({"value": ""}),
"authorChannelUrl": "",
"authorDisplayName": "",
"authorProfileImageUrl": "",
"canRate": false,
"channelId": "",
"likeCount": 0,
"moderationStatus": "",
"parentId": "",
"publishedAt": "",
"textDisplay": "",
"textOriginal": "",
"updatedAt": "",
"videoId": "",
"viewerRating": ""
})
})
)}),
"snippet": json!({
"canReply": false,
"channelId": "",
"isPublic": false,
"topLevelComment": json!({}),
"totalReplyCount": 0,
"videoId": ""
})
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.query(&querystring)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/youtube/v3/commentThreads?part=' \
--header 'content-type: application/json' \
--data '{
"etag": "",
"id": "",
"kind": "",
"replies": {
"comments": [
{
"etag": "",
"id": "",
"kind": "",
"snippet": {
"authorChannelId": {
"value": ""
},
"authorChannelUrl": "",
"authorDisplayName": "",
"authorProfileImageUrl": "",
"canRate": false,
"channelId": "",
"likeCount": 0,
"moderationStatus": "",
"parentId": "",
"publishedAt": "",
"textDisplay": "",
"textOriginal": "",
"updatedAt": "",
"videoId": "",
"viewerRating": ""
}
}
]
},
"snippet": {
"canReply": false,
"channelId": "",
"isPublic": false,
"topLevelComment": {},
"totalReplyCount": 0,
"videoId": ""
}
}'
echo '{
"etag": "",
"id": "",
"kind": "",
"replies": {
"comments": [
{
"etag": "",
"id": "",
"kind": "",
"snippet": {
"authorChannelId": {
"value": ""
},
"authorChannelUrl": "",
"authorDisplayName": "",
"authorProfileImageUrl": "",
"canRate": false,
"channelId": "",
"likeCount": 0,
"moderationStatus": "",
"parentId": "",
"publishedAt": "",
"textDisplay": "",
"textOriginal": "",
"updatedAt": "",
"videoId": "",
"viewerRating": ""
}
}
]
},
"snippet": {
"canReply": false,
"channelId": "",
"isPublic": false,
"topLevelComment": {},
"totalReplyCount": 0,
"videoId": ""
}
}' | \
http POST '{{baseUrl}}/youtube/v3/commentThreads?part=' \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "etag": "",\n "id": "",\n "kind": "",\n "replies": {\n "comments": [\n {\n "etag": "",\n "id": "",\n "kind": "",\n "snippet": {\n "authorChannelId": {\n "value": ""\n },\n "authorChannelUrl": "",\n "authorDisplayName": "",\n "authorProfileImageUrl": "",\n "canRate": false,\n "channelId": "",\n "likeCount": 0,\n "moderationStatus": "",\n "parentId": "",\n "publishedAt": "",\n "textDisplay": "",\n "textOriginal": "",\n "updatedAt": "",\n "videoId": "",\n "viewerRating": ""\n }\n }\n ]\n },\n "snippet": {\n "canReply": false,\n "channelId": "",\n "isPublic": false,\n "topLevelComment": {},\n "totalReplyCount": 0,\n "videoId": ""\n }\n}' \
--output-document \
- '{{baseUrl}}/youtube/v3/commentThreads?part='
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"etag": "",
"id": "",
"kind": "",
"replies": ["comments": [
[
"etag": "",
"id": "",
"kind": "",
"snippet": [
"authorChannelId": ["value": ""],
"authorChannelUrl": "",
"authorDisplayName": "",
"authorProfileImageUrl": "",
"canRate": false,
"channelId": "",
"likeCount": 0,
"moderationStatus": "",
"parentId": "",
"publishedAt": "",
"textDisplay": "",
"textOriginal": "",
"updatedAt": "",
"videoId": "",
"viewerRating": ""
]
]
]],
"snippet": [
"canReply": false,
"channelId": "",
"isPublic": false,
"topLevelComment": [],
"totalReplyCount": 0,
"videoId": ""
]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/youtube/v3/commentThreads?part=")! 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()
GET
youtube.commentThreads.list
{{baseUrl}}/youtube/v3/commentThreads
QUERY PARAMS
part
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/youtube/v3/commentThreads?part=");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/youtube/v3/commentThreads" {:query-params {:part ""}})
require "http/client"
url = "{{baseUrl}}/youtube/v3/commentThreads?part="
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}}/youtube/v3/commentThreads?part="),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/youtube/v3/commentThreads?part=");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/youtube/v3/commentThreads?part="
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/youtube/v3/commentThreads?part= HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/youtube/v3/commentThreads?part=")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/youtube/v3/commentThreads?part="))
.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}}/youtube/v3/commentThreads?part=")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/youtube/v3/commentThreads?part=")
.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}}/youtube/v3/commentThreads?part=');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/youtube/v3/commentThreads',
params: {part: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/youtube/v3/commentThreads?part=';
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}}/youtube/v3/commentThreads?part=',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/youtube/v3/commentThreads?part=")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/youtube/v3/commentThreads?part=',
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}}/youtube/v3/commentThreads',
qs: {part: ''}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/youtube/v3/commentThreads');
req.query({
part: ''
});
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}}/youtube/v3/commentThreads',
params: {part: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/youtube/v3/commentThreads?part=';
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}}/youtube/v3/commentThreads?part="]
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}}/youtube/v3/commentThreads?part=" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/youtube/v3/commentThreads?part=",
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}}/youtube/v3/commentThreads?part=');
echo $response->getBody();
setUrl('{{baseUrl}}/youtube/v3/commentThreads');
$request->setMethod(HTTP_METH_GET);
$request->setQueryData([
'part' => ''
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/youtube/v3/commentThreads');
$request->setRequestMethod('GET');
$request->setQuery(new http\QueryString([
'part' => ''
]));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/youtube/v3/commentThreads?part=' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/youtube/v3/commentThreads?part=' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/youtube/v3/commentThreads?part=")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/youtube/v3/commentThreads"
querystring = {"part":""}
response = requests.get(url, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/youtube/v3/commentThreads"
queryString <- list(part = "")
response <- VERB("GET", url, query = queryString, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/youtube/v3/commentThreads?part=")
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/youtube/v3/commentThreads') do |req|
req.params['part'] = ''
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/youtube/v3/commentThreads";
let querystring = [
("part", ""),
];
let client = reqwest::Client::new();
let response = client.get(url)
.query(&querystring)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url '{{baseUrl}}/youtube/v3/commentThreads?part='
http GET '{{baseUrl}}/youtube/v3/commentThreads?part='
wget --quiet \
--method GET \
--output-document \
- '{{baseUrl}}/youtube/v3/commentThreads?part='
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/youtube/v3/commentThreads?part=")! 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
youtube.i18nLanguages.list
{{baseUrl}}/youtube/v3/i18nLanguages
QUERY PARAMS
part
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/youtube/v3/i18nLanguages?part=");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/youtube/v3/i18nLanguages" {:query-params {:part ""}})
require "http/client"
url = "{{baseUrl}}/youtube/v3/i18nLanguages?part="
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}}/youtube/v3/i18nLanguages?part="),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/youtube/v3/i18nLanguages?part=");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/youtube/v3/i18nLanguages?part="
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/youtube/v3/i18nLanguages?part= HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/youtube/v3/i18nLanguages?part=")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/youtube/v3/i18nLanguages?part="))
.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}}/youtube/v3/i18nLanguages?part=")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/youtube/v3/i18nLanguages?part=")
.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}}/youtube/v3/i18nLanguages?part=');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/youtube/v3/i18nLanguages',
params: {part: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/youtube/v3/i18nLanguages?part=';
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}}/youtube/v3/i18nLanguages?part=',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/youtube/v3/i18nLanguages?part=")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/youtube/v3/i18nLanguages?part=',
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}}/youtube/v3/i18nLanguages',
qs: {part: ''}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/youtube/v3/i18nLanguages');
req.query({
part: ''
});
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}}/youtube/v3/i18nLanguages',
params: {part: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/youtube/v3/i18nLanguages?part=';
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}}/youtube/v3/i18nLanguages?part="]
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}}/youtube/v3/i18nLanguages?part=" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/youtube/v3/i18nLanguages?part=",
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}}/youtube/v3/i18nLanguages?part=');
echo $response->getBody();
setUrl('{{baseUrl}}/youtube/v3/i18nLanguages');
$request->setMethod(HTTP_METH_GET);
$request->setQueryData([
'part' => ''
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/youtube/v3/i18nLanguages');
$request->setRequestMethod('GET');
$request->setQuery(new http\QueryString([
'part' => ''
]));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/youtube/v3/i18nLanguages?part=' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/youtube/v3/i18nLanguages?part=' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/youtube/v3/i18nLanguages?part=")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/youtube/v3/i18nLanguages"
querystring = {"part":""}
response = requests.get(url, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/youtube/v3/i18nLanguages"
queryString <- list(part = "")
response <- VERB("GET", url, query = queryString, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/youtube/v3/i18nLanguages?part=")
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/youtube/v3/i18nLanguages') do |req|
req.params['part'] = ''
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/youtube/v3/i18nLanguages";
let querystring = [
("part", ""),
];
let client = reqwest::Client::new();
let response = client.get(url)
.query(&querystring)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url '{{baseUrl}}/youtube/v3/i18nLanguages?part='
http GET '{{baseUrl}}/youtube/v3/i18nLanguages?part='
wget --quiet \
--method GET \
--output-document \
- '{{baseUrl}}/youtube/v3/i18nLanguages?part='
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/youtube/v3/i18nLanguages?part=")! 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
youtube.i18nRegions.list
{{baseUrl}}/youtube/v3/i18nRegions
QUERY PARAMS
part
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/youtube/v3/i18nRegions?part=");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/youtube/v3/i18nRegions" {:query-params {:part ""}})
require "http/client"
url = "{{baseUrl}}/youtube/v3/i18nRegions?part="
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}}/youtube/v3/i18nRegions?part="),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/youtube/v3/i18nRegions?part=");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/youtube/v3/i18nRegions?part="
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/youtube/v3/i18nRegions?part= HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/youtube/v3/i18nRegions?part=")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/youtube/v3/i18nRegions?part="))
.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}}/youtube/v3/i18nRegions?part=")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/youtube/v3/i18nRegions?part=")
.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}}/youtube/v3/i18nRegions?part=');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/youtube/v3/i18nRegions',
params: {part: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/youtube/v3/i18nRegions?part=';
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}}/youtube/v3/i18nRegions?part=',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/youtube/v3/i18nRegions?part=")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/youtube/v3/i18nRegions?part=',
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}}/youtube/v3/i18nRegions',
qs: {part: ''}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/youtube/v3/i18nRegions');
req.query({
part: ''
});
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}}/youtube/v3/i18nRegions',
params: {part: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/youtube/v3/i18nRegions?part=';
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}}/youtube/v3/i18nRegions?part="]
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}}/youtube/v3/i18nRegions?part=" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/youtube/v3/i18nRegions?part=",
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}}/youtube/v3/i18nRegions?part=');
echo $response->getBody();
setUrl('{{baseUrl}}/youtube/v3/i18nRegions');
$request->setMethod(HTTP_METH_GET);
$request->setQueryData([
'part' => ''
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/youtube/v3/i18nRegions');
$request->setRequestMethod('GET');
$request->setQuery(new http\QueryString([
'part' => ''
]));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/youtube/v3/i18nRegions?part=' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/youtube/v3/i18nRegions?part=' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/youtube/v3/i18nRegions?part=")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/youtube/v3/i18nRegions"
querystring = {"part":""}
response = requests.get(url, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/youtube/v3/i18nRegions"
queryString <- list(part = "")
response <- VERB("GET", url, query = queryString, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/youtube/v3/i18nRegions?part=")
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/youtube/v3/i18nRegions') do |req|
req.params['part'] = ''
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/youtube/v3/i18nRegions";
let querystring = [
("part", ""),
];
let client = reqwest::Client::new();
let response = client.get(url)
.query(&querystring)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url '{{baseUrl}}/youtube/v3/i18nRegions?part='
http GET '{{baseUrl}}/youtube/v3/i18nRegions?part='
wget --quiet \
--method GET \
--output-document \
- '{{baseUrl}}/youtube/v3/i18nRegions?part='
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/youtube/v3/i18nRegions?part=")! 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()
POST
youtube.liveBroadcasts.bind
{{baseUrl}}/youtube/v3/liveBroadcasts/bind
QUERY PARAMS
id
part
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/youtube/v3/liveBroadcasts/bind?id=&part=");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/youtube/v3/liveBroadcasts/bind" {:query-params {:id ""
:part ""}})
require "http/client"
url = "{{baseUrl}}/youtube/v3/liveBroadcasts/bind?id=&part="
response = HTTP::Client.post url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/youtube/v3/liveBroadcasts/bind?id=&part="),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/youtube/v3/liveBroadcasts/bind?id=&part=");
var request = new RestRequest("", Method.Post);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/youtube/v3/liveBroadcasts/bind?id=&part="
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/youtube/v3/liveBroadcasts/bind?id=&part= HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/youtube/v3/liveBroadcasts/bind?id=&part=")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/youtube/v3/liveBroadcasts/bind?id=&part="))
.method("POST", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/youtube/v3/liveBroadcasts/bind?id=&part=")
.post(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/youtube/v3/liveBroadcasts/bind?id=&part=")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/youtube/v3/liveBroadcasts/bind?id=&part=');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/youtube/v3/liveBroadcasts/bind',
params: {id: '', part: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/youtube/v3/liveBroadcasts/bind?id=&part=';
const options = {method: 'POST'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/youtube/v3/liveBroadcasts/bind?id=&part=',
method: 'POST',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/youtube/v3/liveBroadcasts/bind?id=&part=")
.post(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/youtube/v3/liveBroadcasts/bind?id=&part=',
headers: {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/youtube/v3/liveBroadcasts/bind',
qs: {id: '', part: ''}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/youtube/v3/liveBroadcasts/bind');
req.query({
id: '',
part: ''
});
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}}/youtube/v3/liveBroadcasts/bind',
params: {id: '', part: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/youtube/v3/liveBroadcasts/bind?id=&part=';
const options = {method: 'POST'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/youtube/v3/liveBroadcasts/bind?id=&part="]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/youtube/v3/liveBroadcasts/bind?id=&part=" in
Client.call `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/youtube/v3/liveBroadcasts/bind?id=&part=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/youtube/v3/liveBroadcasts/bind?id=&part=');
echo $response->getBody();
setUrl('{{baseUrl}}/youtube/v3/liveBroadcasts/bind');
$request->setMethod(HTTP_METH_POST);
$request->setQueryData([
'id' => '',
'part' => ''
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/youtube/v3/liveBroadcasts/bind');
$request->setRequestMethod('POST');
$request->setQuery(new http\QueryString([
'id' => '',
'part' => ''
]));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/youtube/v3/liveBroadcasts/bind?id=&part=' -Method POST
$response = Invoke-RestMethod -Uri '{{baseUrl}}/youtube/v3/liveBroadcasts/bind?id=&part=' -Method POST
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("POST", "/baseUrl/youtube/v3/liveBroadcasts/bind?id=&part=")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/youtube/v3/liveBroadcasts/bind"
querystring = {"id":"","part":""}
response = requests.post(url, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/youtube/v3/liveBroadcasts/bind"
queryString <- list(
id = "",
part = ""
)
response <- VERB("POST", url, query = queryString, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/youtube/v3/liveBroadcasts/bind?id=&part=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.post('/baseUrl/youtube/v3/liveBroadcasts/bind') do |req|
req.params['id'] = ''
req.params['part'] = ''
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/youtube/v3/liveBroadcasts/bind";
let querystring = [
("id", ""),
("part", ""),
];
let client = reqwest::Client::new();
let response = client.post(url)
.query(&querystring)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/youtube/v3/liveBroadcasts/bind?id=&part='
http POST '{{baseUrl}}/youtube/v3/liveBroadcasts/bind?id=&part='
wget --quiet \
--method POST \
--output-document \
- '{{baseUrl}}/youtube/v3/liveBroadcasts/bind?id=&part='
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/youtube/v3/liveBroadcasts/bind?id=&part=")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
DELETE
youtube.liveBroadcasts.delete
{{baseUrl}}/youtube/v3/liveBroadcasts
QUERY PARAMS
id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/youtube/v3/liveBroadcasts?id=");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/delete "{{baseUrl}}/youtube/v3/liveBroadcasts" {:query-params {:id ""}})
require "http/client"
url = "{{baseUrl}}/youtube/v3/liveBroadcasts?id="
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}}/youtube/v3/liveBroadcasts?id="),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/youtube/v3/liveBroadcasts?id=");
var request = new RestRequest("", Method.Delete);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/youtube/v3/liveBroadcasts?id="
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/youtube/v3/liveBroadcasts?id= HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/youtube/v3/liveBroadcasts?id=")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/youtube/v3/liveBroadcasts?id="))
.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}}/youtube/v3/liveBroadcasts?id=")
.delete(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/youtube/v3/liveBroadcasts?id=")
.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}}/youtube/v3/liveBroadcasts?id=');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'DELETE',
url: '{{baseUrl}}/youtube/v3/liveBroadcasts',
params: {id: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/youtube/v3/liveBroadcasts?id=';
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}}/youtube/v3/liveBroadcasts?id=',
method: 'DELETE',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/youtube/v3/liveBroadcasts?id=")
.delete(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'DELETE',
hostname: 'example.com',
port: null,
path: '/baseUrl/youtube/v3/liveBroadcasts?id=',
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}}/youtube/v3/liveBroadcasts',
qs: {id: ''}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('DELETE', '{{baseUrl}}/youtube/v3/liveBroadcasts');
req.query({
id: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'DELETE',
url: '{{baseUrl}}/youtube/v3/liveBroadcasts',
params: {id: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/youtube/v3/liveBroadcasts?id=';
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}}/youtube/v3/liveBroadcasts?id="]
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}}/youtube/v3/liveBroadcasts?id=" in
Client.call `DELETE uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/youtube/v3/liveBroadcasts?id=",
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}}/youtube/v3/liveBroadcasts?id=');
echo $response->getBody();
setUrl('{{baseUrl}}/youtube/v3/liveBroadcasts');
$request->setMethod(HTTP_METH_DELETE);
$request->setQueryData([
'id' => ''
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/youtube/v3/liveBroadcasts');
$request->setRequestMethod('DELETE');
$request->setQuery(new http\QueryString([
'id' => ''
]));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/youtube/v3/liveBroadcasts?id=' -Method DELETE
$response = Invoke-RestMethod -Uri '{{baseUrl}}/youtube/v3/liveBroadcasts?id=' -Method DELETE
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("DELETE", "/baseUrl/youtube/v3/liveBroadcasts?id=")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/youtube/v3/liveBroadcasts"
querystring = {"id":""}
response = requests.delete(url, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/youtube/v3/liveBroadcasts"
queryString <- list(id = "")
response <- VERB("DELETE", url, query = queryString, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/youtube/v3/liveBroadcasts?id=")
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/youtube/v3/liveBroadcasts') do |req|
req.params['id'] = ''
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/youtube/v3/liveBroadcasts";
let querystring = [
("id", ""),
];
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("DELETE").unwrap(), url)
.query(&querystring)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request DELETE \
--url '{{baseUrl}}/youtube/v3/liveBroadcasts?id='
http DELETE '{{baseUrl}}/youtube/v3/liveBroadcasts?id='
wget --quiet \
--method DELETE \
--output-document \
- '{{baseUrl}}/youtube/v3/liveBroadcasts?id='
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/youtube/v3/liveBroadcasts?id=")! 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()
POST
youtube.liveBroadcasts.insert
{{baseUrl}}/youtube/v3/liveBroadcasts
QUERY PARAMS
part
BODY json
{
"contentDetails": {
"boundStreamId": "",
"boundStreamLastUpdateTimeMs": "",
"closedCaptionsType": "",
"enableAutoStart": false,
"enableAutoStop": false,
"enableClosedCaptions": false,
"enableContentEncryption": false,
"enableDvr": false,
"enableEmbed": false,
"enableLowLatency": false,
"latencyPreference": "",
"mesh": "",
"monitorStream": {
"broadcastStreamDelayMs": 0,
"embedHtml": "",
"enableMonitorStream": false
},
"projection": "",
"recordFromStart": false,
"startWithSlate": false,
"stereoLayout": ""
},
"etag": "",
"id": "",
"kind": "",
"snippet": {
"actualEndTime": "",
"actualStartTime": "",
"channelId": "",
"description": "",
"isDefaultBroadcast": false,
"liveChatId": "",
"publishedAt": "",
"scheduledEndTime": "",
"scheduledStartTime": "",
"thumbnails": {
"high": {
"height": 0,
"url": "",
"width": 0
},
"maxres": {},
"medium": {},
"standard": {}
},
"title": ""
},
"statistics": {
"concurrentViewers": ""
},
"status": {
"lifeCycleStatus": "",
"liveBroadcastPriority": "",
"madeForKids": false,
"privacyStatus": "",
"recordingStatus": "",
"selfDeclaredMadeForKids": false
}
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/youtube/v3/liveBroadcasts?part=");
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 \"contentDetails\": {\n \"boundStreamId\": \"\",\n \"boundStreamLastUpdateTimeMs\": \"\",\n \"closedCaptionsType\": \"\",\n \"enableAutoStart\": false,\n \"enableAutoStop\": false,\n \"enableClosedCaptions\": false,\n \"enableContentEncryption\": false,\n \"enableDvr\": false,\n \"enableEmbed\": false,\n \"enableLowLatency\": false,\n \"latencyPreference\": \"\",\n \"mesh\": \"\",\n \"monitorStream\": {\n \"broadcastStreamDelayMs\": 0,\n \"embedHtml\": \"\",\n \"enableMonitorStream\": false\n },\n \"projection\": \"\",\n \"recordFromStart\": false,\n \"startWithSlate\": false,\n \"stereoLayout\": \"\"\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"actualEndTime\": \"\",\n \"actualStartTime\": \"\",\n \"channelId\": \"\",\n \"description\": \"\",\n \"isDefaultBroadcast\": false,\n \"liveChatId\": \"\",\n \"publishedAt\": \"\",\n \"scheduledEndTime\": \"\",\n \"scheduledStartTime\": \"\",\n \"thumbnails\": {\n \"high\": {\n \"height\": 0,\n \"url\": \"\",\n \"width\": 0\n },\n \"maxres\": {},\n \"medium\": {},\n \"standard\": {}\n },\n \"title\": \"\"\n },\n \"statistics\": {\n \"concurrentViewers\": \"\"\n },\n \"status\": {\n \"lifeCycleStatus\": \"\",\n \"liveBroadcastPriority\": \"\",\n \"madeForKids\": false,\n \"privacyStatus\": \"\",\n \"recordingStatus\": \"\",\n \"selfDeclaredMadeForKids\": false\n }\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/youtube/v3/liveBroadcasts" {:query-params {:part ""}
:content-type :json
:form-params {:contentDetails {:boundStreamId ""
:boundStreamLastUpdateTimeMs ""
:closedCaptionsType ""
:enableAutoStart false
:enableAutoStop false
:enableClosedCaptions false
:enableContentEncryption false
:enableDvr false
:enableEmbed false
:enableLowLatency false
:latencyPreference ""
:mesh ""
:monitorStream {:broadcastStreamDelayMs 0
:embedHtml ""
:enableMonitorStream false}
:projection ""
:recordFromStart false
:startWithSlate false
:stereoLayout ""}
:etag ""
:id ""
:kind ""
:snippet {:actualEndTime ""
:actualStartTime ""
:channelId ""
:description ""
:isDefaultBroadcast false
:liveChatId ""
:publishedAt ""
:scheduledEndTime ""
:scheduledStartTime ""
:thumbnails {:high {:height 0
:url ""
:width 0}
:maxres {}
:medium {}
:standard {}}
:title ""}
:statistics {:concurrentViewers ""}
:status {:lifeCycleStatus ""
:liveBroadcastPriority ""
:madeForKids false
:privacyStatus ""
:recordingStatus ""
:selfDeclaredMadeForKids false}}})
require "http/client"
url = "{{baseUrl}}/youtube/v3/liveBroadcasts?part="
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"contentDetails\": {\n \"boundStreamId\": \"\",\n \"boundStreamLastUpdateTimeMs\": \"\",\n \"closedCaptionsType\": \"\",\n \"enableAutoStart\": false,\n \"enableAutoStop\": false,\n \"enableClosedCaptions\": false,\n \"enableContentEncryption\": false,\n \"enableDvr\": false,\n \"enableEmbed\": false,\n \"enableLowLatency\": false,\n \"latencyPreference\": \"\",\n \"mesh\": \"\",\n \"monitorStream\": {\n \"broadcastStreamDelayMs\": 0,\n \"embedHtml\": \"\",\n \"enableMonitorStream\": false\n },\n \"projection\": \"\",\n \"recordFromStart\": false,\n \"startWithSlate\": false,\n \"stereoLayout\": \"\"\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"actualEndTime\": \"\",\n \"actualStartTime\": \"\",\n \"channelId\": \"\",\n \"description\": \"\",\n \"isDefaultBroadcast\": false,\n \"liveChatId\": \"\",\n \"publishedAt\": \"\",\n \"scheduledEndTime\": \"\",\n \"scheduledStartTime\": \"\",\n \"thumbnails\": {\n \"high\": {\n \"height\": 0,\n \"url\": \"\",\n \"width\": 0\n },\n \"maxres\": {},\n \"medium\": {},\n \"standard\": {}\n },\n \"title\": \"\"\n },\n \"statistics\": {\n \"concurrentViewers\": \"\"\n },\n \"status\": {\n \"lifeCycleStatus\": \"\",\n \"liveBroadcastPriority\": \"\",\n \"madeForKids\": false,\n \"privacyStatus\": \"\",\n \"recordingStatus\": \"\",\n \"selfDeclaredMadeForKids\": false\n }\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/youtube/v3/liveBroadcasts?part="),
Content = new StringContent("{\n \"contentDetails\": {\n \"boundStreamId\": \"\",\n \"boundStreamLastUpdateTimeMs\": \"\",\n \"closedCaptionsType\": \"\",\n \"enableAutoStart\": false,\n \"enableAutoStop\": false,\n \"enableClosedCaptions\": false,\n \"enableContentEncryption\": false,\n \"enableDvr\": false,\n \"enableEmbed\": false,\n \"enableLowLatency\": false,\n \"latencyPreference\": \"\",\n \"mesh\": \"\",\n \"monitorStream\": {\n \"broadcastStreamDelayMs\": 0,\n \"embedHtml\": \"\",\n \"enableMonitorStream\": false\n },\n \"projection\": \"\",\n \"recordFromStart\": false,\n \"startWithSlate\": false,\n \"stereoLayout\": \"\"\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"actualEndTime\": \"\",\n \"actualStartTime\": \"\",\n \"channelId\": \"\",\n \"description\": \"\",\n \"isDefaultBroadcast\": false,\n \"liveChatId\": \"\",\n \"publishedAt\": \"\",\n \"scheduledEndTime\": \"\",\n \"scheduledStartTime\": \"\",\n \"thumbnails\": {\n \"high\": {\n \"height\": 0,\n \"url\": \"\",\n \"width\": 0\n },\n \"maxres\": {},\n \"medium\": {},\n \"standard\": {}\n },\n \"title\": \"\"\n },\n \"statistics\": {\n \"concurrentViewers\": \"\"\n },\n \"status\": {\n \"lifeCycleStatus\": \"\",\n \"liveBroadcastPriority\": \"\",\n \"madeForKids\": false,\n \"privacyStatus\": \"\",\n \"recordingStatus\": \"\",\n \"selfDeclaredMadeForKids\": false\n }\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/youtube/v3/liveBroadcasts?part=");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"contentDetails\": {\n \"boundStreamId\": \"\",\n \"boundStreamLastUpdateTimeMs\": \"\",\n \"closedCaptionsType\": \"\",\n \"enableAutoStart\": false,\n \"enableAutoStop\": false,\n \"enableClosedCaptions\": false,\n \"enableContentEncryption\": false,\n \"enableDvr\": false,\n \"enableEmbed\": false,\n \"enableLowLatency\": false,\n \"latencyPreference\": \"\",\n \"mesh\": \"\",\n \"monitorStream\": {\n \"broadcastStreamDelayMs\": 0,\n \"embedHtml\": \"\",\n \"enableMonitorStream\": false\n },\n \"projection\": \"\",\n \"recordFromStart\": false,\n \"startWithSlate\": false,\n \"stereoLayout\": \"\"\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"actualEndTime\": \"\",\n \"actualStartTime\": \"\",\n \"channelId\": \"\",\n \"description\": \"\",\n \"isDefaultBroadcast\": false,\n \"liveChatId\": \"\",\n \"publishedAt\": \"\",\n \"scheduledEndTime\": \"\",\n \"scheduledStartTime\": \"\",\n \"thumbnails\": {\n \"high\": {\n \"height\": 0,\n \"url\": \"\",\n \"width\": 0\n },\n \"maxres\": {},\n \"medium\": {},\n \"standard\": {}\n },\n \"title\": \"\"\n },\n \"statistics\": {\n \"concurrentViewers\": \"\"\n },\n \"status\": {\n \"lifeCycleStatus\": \"\",\n \"liveBroadcastPriority\": \"\",\n \"madeForKids\": false,\n \"privacyStatus\": \"\",\n \"recordingStatus\": \"\",\n \"selfDeclaredMadeForKids\": false\n }\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/youtube/v3/liveBroadcasts?part="
payload := strings.NewReader("{\n \"contentDetails\": {\n \"boundStreamId\": \"\",\n \"boundStreamLastUpdateTimeMs\": \"\",\n \"closedCaptionsType\": \"\",\n \"enableAutoStart\": false,\n \"enableAutoStop\": false,\n \"enableClosedCaptions\": false,\n \"enableContentEncryption\": false,\n \"enableDvr\": false,\n \"enableEmbed\": false,\n \"enableLowLatency\": false,\n \"latencyPreference\": \"\",\n \"mesh\": \"\",\n \"monitorStream\": {\n \"broadcastStreamDelayMs\": 0,\n \"embedHtml\": \"\",\n \"enableMonitorStream\": false\n },\n \"projection\": \"\",\n \"recordFromStart\": false,\n \"startWithSlate\": false,\n \"stereoLayout\": \"\"\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"actualEndTime\": \"\",\n \"actualStartTime\": \"\",\n \"channelId\": \"\",\n \"description\": \"\",\n \"isDefaultBroadcast\": false,\n \"liveChatId\": \"\",\n \"publishedAt\": \"\",\n \"scheduledEndTime\": \"\",\n \"scheduledStartTime\": \"\",\n \"thumbnails\": {\n \"high\": {\n \"height\": 0,\n \"url\": \"\",\n \"width\": 0\n },\n \"maxres\": {},\n \"medium\": {},\n \"standard\": {}\n },\n \"title\": \"\"\n },\n \"statistics\": {\n \"concurrentViewers\": \"\"\n },\n \"status\": {\n \"lifeCycleStatus\": \"\",\n \"liveBroadcastPriority\": \"\",\n \"madeForKids\": false,\n \"privacyStatus\": \"\",\n \"recordingStatus\": \"\",\n \"selfDeclaredMadeForKids\": false\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/youtube/v3/liveBroadcasts?part= HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 1333
{
"contentDetails": {
"boundStreamId": "",
"boundStreamLastUpdateTimeMs": "",
"closedCaptionsType": "",
"enableAutoStart": false,
"enableAutoStop": false,
"enableClosedCaptions": false,
"enableContentEncryption": false,
"enableDvr": false,
"enableEmbed": false,
"enableLowLatency": false,
"latencyPreference": "",
"mesh": "",
"monitorStream": {
"broadcastStreamDelayMs": 0,
"embedHtml": "",
"enableMonitorStream": false
},
"projection": "",
"recordFromStart": false,
"startWithSlate": false,
"stereoLayout": ""
},
"etag": "",
"id": "",
"kind": "",
"snippet": {
"actualEndTime": "",
"actualStartTime": "",
"channelId": "",
"description": "",
"isDefaultBroadcast": false,
"liveChatId": "",
"publishedAt": "",
"scheduledEndTime": "",
"scheduledStartTime": "",
"thumbnails": {
"high": {
"height": 0,
"url": "",
"width": 0
},
"maxres": {},
"medium": {},
"standard": {}
},
"title": ""
},
"statistics": {
"concurrentViewers": ""
},
"status": {
"lifeCycleStatus": "",
"liveBroadcastPriority": "",
"madeForKids": false,
"privacyStatus": "",
"recordingStatus": "",
"selfDeclaredMadeForKids": false
}
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/youtube/v3/liveBroadcasts?part=")
.setHeader("content-type", "application/json")
.setBody("{\n \"contentDetails\": {\n \"boundStreamId\": \"\",\n \"boundStreamLastUpdateTimeMs\": \"\",\n \"closedCaptionsType\": \"\",\n \"enableAutoStart\": false,\n \"enableAutoStop\": false,\n \"enableClosedCaptions\": false,\n \"enableContentEncryption\": false,\n \"enableDvr\": false,\n \"enableEmbed\": false,\n \"enableLowLatency\": false,\n \"latencyPreference\": \"\",\n \"mesh\": \"\",\n \"monitorStream\": {\n \"broadcastStreamDelayMs\": 0,\n \"embedHtml\": \"\",\n \"enableMonitorStream\": false\n },\n \"projection\": \"\",\n \"recordFromStart\": false,\n \"startWithSlate\": false,\n \"stereoLayout\": \"\"\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"actualEndTime\": \"\",\n \"actualStartTime\": \"\",\n \"channelId\": \"\",\n \"description\": \"\",\n \"isDefaultBroadcast\": false,\n \"liveChatId\": \"\",\n \"publishedAt\": \"\",\n \"scheduledEndTime\": \"\",\n \"scheduledStartTime\": \"\",\n \"thumbnails\": {\n \"high\": {\n \"height\": 0,\n \"url\": \"\",\n \"width\": 0\n },\n \"maxres\": {},\n \"medium\": {},\n \"standard\": {}\n },\n \"title\": \"\"\n },\n \"statistics\": {\n \"concurrentViewers\": \"\"\n },\n \"status\": {\n \"lifeCycleStatus\": \"\",\n \"liveBroadcastPriority\": \"\",\n \"madeForKids\": false,\n \"privacyStatus\": \"\",\n \"recordingStatus\": \"\",\n \"selfDeclaredMadeForKids\": false\n }\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/youtube/v3/liveBroadcasts?part="))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"contentDetails\": {\n \"boundStreamId\": \"\",\n \"boundStreamLastUpdateTimeMs\": \"\",\n \"closedCaptionsType\": \"\",\n \"enableAutoStart\": false,\n \"enableAutoStop\": false,\n \"enableClosedCaptions\": false,\n \"enableContentEncryption\": false,\n \"enableDvr\": false,\n \"enableEmbed\": false,\n \"enableLowLatency\": false,\n \"latencyPreference\": \"\",\n \"mesh\": \"\",\n \"monitorStream\": {\n \"broadcastStreamDelayMs\": 0,\n \"embedHtml\": \"\",\n \"enableMonitorStream\": false\n },\n \"projection\": \"\",\n \"recordFromStart\": false,\n \"startWithSlate\": false,\n \"stereoLayout\": \"\"\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"actualEndTime\": \"\",\n \"actualStartTime\": \"\",\n \"channelId\": \"\",\n \"description\": \"\",\n \"isDefaultBroadcast\": false,\n \"liveChatId\": \"\",\n \"publishedAt\": \"\",\n \"scheduledEndTime\": \"\",\n \"scheduledStartTime\": \"\",\n \"thumbnails\": {\n \"high\": {\n \"height\": 0,\n \"url\": \"\",\n \"width\": 0\n },\n \"maxres\": {},\n \"medium\": {},\n \"standard\": {}\n },\n \"title\": \"\"\n },\n \"statistics\": {\n \"concurrentViewers\": \"\"\n },\n \"status\": {\n \"lifeCycleStatus\": \"\",\n \"liveBroadcastPriority\": \"\",\n \"madeForKids\": false,\n \"privacyStatus\": \"\",\n \"recordingStatus\": \"\",\n \"selfDeclaredMadeForKids\": false\n }\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"contentDetails\": {\n \"boundStreamId\": \"\",\n \"boundStreamLastUpdateTimeMs\": \"\",\n \"closedCaptionsType\": \"\",\n \"enableAutoStart\": false,\n \"enableAutoStop\": false,\n \"enableClosedCaptions\": false,\n \"enableContentEncryption\": false,\n \"enableDvr\": false,\n \"enableEmbed\": false,\n \"enableLowLatency\": false,\n \"latencyPreference\": \"\",\n \"mesh\": \"\",\n \"monitorStream\": {\n \"broadcastStreamDelayMs\": 0,\n \"embedHtml\": \"\",\n \"enableMonitorStream\": false\n },\n \"projection\": \"\",\n \"recordFromStart\": false,\n \"startWithSlate\": false,\n \"stereoLayout\": \"\"\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"actualEndTime\": \"\",\n \"actualStartTime\": \"\",\n \"channelId\": \"\",\n \"description\": \"\",\n \"isDefaultBroadcast\": false,\n \"liveChatId\": \"\",\n \"publishedAt\": \"\",\n \"scheduledEndTime\": \"\",\n \"scheduledStartTime\": \"\",\n \"thumbnails\": {\n \"high\": {\n \"height\": 0,\n \"url\": \"\",\n \"width\": 0\n },\n \"maxres\": {},\n \"medium\": {},\n \"standard\": {}\n },\n \"title\": \"\"\n },\n \"statistics\": {\n \"concurrentViewers\": \"\"\n },\n \"status\": {\n \"lifeCycleStatus\": \"\",\n \"liveBroadcastPriority\": \"\",\n \"madeForKids\": false,\n \"privacyStatus\": \"\",\n \"recordingStatus\": \"\",\n \"selfDeclaredMadeForKids\": false\n }\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/youtube/v3/liveBroadcasts?part=")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/youtube/v3/liveBroadcasts?part=")
.header("content-type", "application/json")
.body("{\n \"contentDetails\": {\n \"boundStreamId\": \"\",\n \"boundStreamLastUpdateTimeMs\": \"\",\n \"closedCaptionsType\": \"\",\n \"enableAutoStart\": false,\n \"enableAutoStop\": false,\n \"enableClosedCaptions\": false,\n \"enableContentEncryption\": false,\n \"enableDvr\": false,\n \"enableEmbed\": false,\n \"enableLowLatency\": false,\n \"latencyPreference\": \"\",\n \"mesh\": \"\",\n \"monitorStream\": {\n \"broadcastStreamDelayMs\": 0,\n \"embedHtml\": \"\",\n \"enableMonitorStream\": false\n },\n \"projection\": \"\",\n \"recordFromStart\": false,\n \"startWithSlate\": false,\n \"stereoLayout\": \"\"\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"actualEndTime\": \"\",\n \"actualStartTime\": \"\",\n \"channelId\": \"\",\n \"description\": \"\",\n \"isDefaultBroadcast\": false,\n \"liveChatId\": \"\",\n \"publishedAt\": \"\",\n \"scheduledEndTime\": \"\",\n \"scheduledStartTime\": \"\",\n \"thumbnails\": {\n \"high\": {\n \"height\": 0,\n \"url\": \"\",\n \"width\": 0\n },\n \"maxres\": {},\n \"medium\": {},\n \"standard\": {}\n },\n \"title\": \"\"\n },\n \"statistics\": {\n \"concurrentViewers\": \"\"\n },\n \"status\": {\n \"lifeCycleStatus\": \"\",\n \"liveBroadcastPriority\": \"\",\n \"madeForKids\": false,\n \"privacyStatus\": \"\",\n \"recordingStatus\": \"\",\n \"selfDeclaredMadeForKids\": false\n }\n}")
.asString();
const data = JSON.stringify({
contentDetails: {
boundStreamId: '',
boundStreamLastUpdateTimeMs: '',
closedCaptionsType: '',
enableAutoStart: false,
enableAutoStop: false,
enableClosedCaptions: false,
enableContentEncryption: false,
enableDvr: false,
enableEmbed: false,
enableLowLatency: false,
latencyPreference: '',
mesh: '',
monitorStream: {
broadcastStreamDelayMs: 0,
embedHtml: '',
enableMonitorStream: false
},
projection: '',
recordFromStart: false,
startWithSlate: false,
stereoLayout: ''
},
etag: '',
id: '',
kind: '',
snippet: {
actualEndTime: '',
actualStartTime: '',
channelId: '',
description: '',
isDefaultBroadcast: false,
liveChatId: '',
publishedAt: '',
scheduledEndTime: '',
scheduledStartTime: '',
thumbnails: {
high: {
height: 0,
url: '',
width: 0
},
maxres: {},
medium: {},
standard: {}
},
title: ''
},
statistics: {
concurrentViewers: ''
},
status: {
lifeCycleStatus: '',
liveBroadcastPriority: '',
madeForKids: false,
privacyStatus: '',
recordingStatus: '',
selfDeclaredMadeForKids: false
}
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/youtube/v3/liveBroadcasts?part=');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/youtube/v3/liveBroadcasts',
params: {part: ''},
headers: {'content-type': 'application/json'},
data: {
contentDetails: {
boundStreamId: '',
boundStreamLastUpdateTimeMs: '',
closedCaptionsType: '',
enableAutoStart: false,
enableAutoStop: false,
enableClosedCaptions: false,
enableContentEncryption: false,
enableDvr: false,
enableEmbed: false,
enableLowLatency: false,
latencyPreference: '',
mesh: '',
monitorStream: {broadcastStreamDelayMs: 0, embedHtml: '', enableMonitorStream: false},
projection: '',
recordFromStart: false,
startWithSlate: false,
stereoLayout: ''
},
etag: '',
id: '',
kind: '',
snippet: {
actualEndTime: '',
actualStartTime: '',
channelId: '',
description: '',
isDefaultBroadcast: false,
liveChatId: '',
publishedAt: '',
scheduledEndTime: '',
scheduledStartTime: '',
thumbnails: {high: {height: 0, url: '', width: 0}, maxres: {}, medium: {}, standard: {}},
title: ''
},
statistics: {concurrentViewers: ''},
status: {
lifeCycleStatus: '',
liveBroadcastPriority: '',
madeForKids: false,
privacyStatus: '',
recordingStatus: '',
selfDeclaredMadeForKids: false
}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/youtube/v3/liveBroadcasts?part=';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"contentDetails":{"boundStreamId":"","boundStreamLastUpdateTimeMs":"","closedCaptionsType":"","enableAutoStart":false,"enableAutoStop":false,"enableClosedCaptions":false,"enableContentEncryption":false,"enableDvr":false,"enableEmbed":false,"enableLowLatency":false,"latencyPreference":"","mesh":"","monitorStream":{"broadcastStreamDelayMs":0,"embedHtml":"","enableMonitorStream":false},"projection":"","recordFromStart":false,"startWithSlate":false,"stereoLayout":""},"etag":"","id":"","kind":"","snippet":{"actualEndTime":"","actualStartTime":"","channelId":"","description":"","isDefaultBroadcast":false,"liveChatId":"","publishedAt":"","scheduledEndTime":"","scheduledStartTime":"","thumbnails":{"high":{"height":0,"url":"","width":0},"maxres":{},"medium":{},"standard":{}},"title":""},"statistics":{"concurrentViewers":""},"status":{"lifeCycleStatus":"","liveBroadcastPriority":"","madeForKids":false,"privacyStatus":"","recordingStatus":"","selfDeclaredMadeForKids":false}}'
};
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}}/youtube/v3/liveBroadcasts?part=',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "contentDetails": {\n "boundStreamId": "",\n "boundStreamLastUpdateTimeMs": "",\n "closedCaptionsType": "",\n "enableAutoStart": false,\n "enableAutoStop": false,\n "enableClosedCaptions": false,\n "enableContentEncryption": false,\n "enableDvr": false,\n "enableEmbed": false,\n "enableLowLatency": false,\n "latencyPreference": "",\n "mesh": "",\n "monitorStream": {\n "broadcastStreamDelayMs": 0,\n "embedHtml": "",\n "enableMonitorStream": false\n },\n "projection": "",\n "recordFromStart": false,\n "startWithSlate": false,\n "stereoLayout": ""\n },\n "etag": "",\n "id": "",\n "kind": "",\n "snippet": {\n "actualEndTime": "",\n "actualStartTime": "",\n "channelId": "",\n "description": "",\n "isDefaultBroadcast": false,\n "liveChatId": "",\n "publishedAt": "",\n "scheduledEndTime": "",\n "scheduledStartTime": "",\n "thumbnails": {\n "high": {\n "height": 0,\n "url": "",\n "width": 0\n },\n "maxres": {},\n "medium": {},\n "standard": {}\n },\n "title": ""\n },\n "statistics": {\n "concurrentViewers": ""\n },\n "status": {\n "lifeCycleStatus": "",\n "liveBroadcastPriority": "",\n "madeForKids": false,\n "privacyStatus": "",\n "recordingStatus": "",\n "selfDeclaredMadeForKids": false\n }\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"contentDetails\": {\n \"boundStreamId\": \"\",\n \"boundStreamLastUpdateTimeMs\": \"\",\n \"closedCaptionsType\": \"\",\n \"enableAutoStart\": false,\n \"enableAutoStop\": false,\n \"enableClosedCaptions\": false,\n \"enableContentEncryption\": false,\n \"enableDvr\": false,\n \"enableEmbed\": false,\n \"enableLowLatency\": false,\n \"latencyPreference\": \"\",\n \"mesh\": \"\",\n \"monitorStream\": {\n \"broadcastStreamDelayMs\": 0,\n \"embedHtml\": \"\",\n \"enableMonitorStream\": false\n },\n \"projection\": \"\",\n \"recordFromStart\": false,\n \"startWithSlate\": false,\n \"stereoLayout\": \"\"\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"actualEndTime\": \"\",\n \"actualStartTime\": \"\",\n \"channelId\": \"\",\n \"description\": \"\",\n \"isDefaultBroadcast\": false,\n \"liveChatId\": \"\",\n \"publishedAt\": \"\",\n \"scheduledEndTime\": \"\",\n \"scheduledStartTime\": \"\",\n \"thumbnails\": {\n \"high\": {\n \"height\": 0,\n \"url\": \"\",\n \"width\": 0\n },\n \"maxres\": {},\n \"medium\": {},\n \"standard\": {}\n },\n \"title\": \"\"\n },\n \"statistics\": {\n \"concurrentViewers\": \"\"\n },\n \"status\": {\n \"lifeCycleStatus\": \"\",\n \"liveBroadcastPriority\": \"\",\n \"madeForKids\": false,\n \"privacyStatus\": \"\",\n \"recordingStatus\": \"\",\n \"selfDeclaredMadeForKids\": false\n }\n}")
val request = Request.Builder()
.url("{{baseUrl}}/youtube/v3/liveBroadcasts?part=")
.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/youtube/v3/liveBroadcasts?part=',
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({
contentDetails: {
boundStreamId: '',
boundStreamLastUpdateTimeMs: '',
closedCaptionsType: '',
enableAutoStart: false,
enableAutoStop: false,
enableClosedCaptions: false,
enableContentEncryption: false,
enableDvr: false,
enableEmbed: false,
enableLowLatency: false,
latencyPreference: '',
mesh: '',
monitorStream: {broadcastStreamDelayMs: 0, embedHtml: '', enableMonitorStream: false},
projection: '',
recordFromStart: false,
startWithSlate: false,
stereoLayout: ''
},
etag: '',
id: '',
kind: '',
snippet: {
actualEndTime: '',
actualStartTime: '',
channelId: '',
description: '',
isDefaultBroadcast: false,
liveChatId: '',
publishedAt: '',
scheduledEndTime: '',
scheduledStartTime: '',
thumbnails: {high: {height: 0, url: '', width: 0}, maxres: {}, medium: {}, standard: {}},
title: ''
},
statistics: {concurrentViewers: ''},
status: {
lifeCycleStatus: '',
liveBroadcastPriority: '',
madeForKids: false,
privacyStatus: '',
recordingStatus: '',
selfDeclaredMadeForKids: false
}
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/youtube/v3/liveBroadcasts',
qs: {part: ''},
headers: {'content-type': 'application/json'},
body: {
contentDetails: {
boundStreamId: '',
boundStreamLastUpdateTimeMs: '',
closedCaptionsType: '',
enableAutoStart: false,
enableAutoStop: false,
enableClosedCaptions: false,
enableContentEncryption: false,
enableDvr: false,
enableEmbed: false,
enableLowLatency: false,
latencyPreference: '',
mesh: '',
monitorStream: {broadcastStreamDelayMs: 0, embedHtml: '', enableMonitorStream: false},
projection: '',
recordFromStart: false,
startWithSlate: false,
stereoLayout: ''
},
etag: '',
id: '',
kind: '',
snippet: {
actualEndTime: '',
actualStartTime: '',
channelId: '',
description: '',
isDefaultBroadcast: false,
liveChatId: '',
publishedAt: '',
scheduledEndTime: '',
scheduledStartTime: '',
thumbnails: {high: {height: 0, url: '', width: 0}, maxres: {}, medium: {}, standard: {}},
title: ''
},
statistics: {concurrentViewers: ''},
status: {
lifeCycleStatus: '',
liveBroadcastPriority: '',
madeForKids: false,
privacyStatus: '',
recordingStatus: '',
selfDeclaredMadeForKids: false
}
},
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}}/youtube/v3/liveBroadcasts');
req.query({
part: ''
});
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
contentDetails: {
boundStreamId: '',
boundStreamLastUpdateTimeMs: '',
closedCaptionsType: '',
enableAutoStart: false,
enableAutoStop: false,
enableClosedCaptions: false,
enableContentEncryption: false,
enableDvr: false,
enableEmbed: false,
enableLowLatency: false,
latencyPreference: '',
mesh: '',
monitorStream: {
broadcastStreamDelayMs: 0,
embedHtml: '',
enableMonitorStream: false
},
projection: '',
recordFromStart: false,
startWithSlate: false,
stereoLayout: ''
},
etag: '',
id: '',
kind: '',
snippet: {
actualEndTime: '',
actualStartTime: '',
channelId: '',
description: '',
isDefaultBroadcast: false,
liveChatId: '',
publishedAt: '',
scheduledEndTime: '',
scheduledStartTime: '',
thumbnails: {
high: {
height: 0,
url: '',
width: 0
},
maxres: {},
medium: {},
standard: {}
},
title: ''
},
statistics: {
concurrentViewers: ''
},
status: {
lifeCycleStatus: '',
liveBroadcastPriority: '',
madeForKids: false,
privacyStatus: '',
recordingStatus: '',
selfDeclaredMadeForKids: false
}
});
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}}/youtube/v3/liveBroadcasts',
params: {part: ''},
headers: {'content-type': 'application/json'},
data: {
contentDetails: {
boundStreamId: '',
boundStreamLastUpdateTimeMs: '',
closedCaptionsType: '',
enableAutoStart: false,
enableAutoStop: false,
enableClosedCaptions: false,
enableContentEncryption: false,
enableDvr: false,
enableEmbed: false,
enableLowLatency: false,
latencyPreference: '',
mesh: '',
monitorStream: {broadcastStreamDelayMs: 0, embedHtml: '', enableMonitorStream: false},
projection: '',
recordFromStart: false,
startWithSlate: false,
stereoLayout: ''
},
etag: '',
id: '',
kind: '',
snippet: {
actualEndTime: '',
actualStartTime: '',
channelId: '',
description: '',
isDefaultBroadcast: false,
liveChatId: '',
publishedAt: '',
scheduledEndTime: '',
scheduledStartTime: '',
thumbnails: {high: {height: 0, url: '', width: 0}, maxres: {}, medium: {}, standard: {}},
title: ''
},
statistics: {concurrentViewers: ''},
status: {
lifeCycleStatus: '',
liveBroadcastPriority: '',
madeForKids: false,
privacyStatus: '',
recordingStatus: '',
selfDeclaredMadeForKids: false
}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/youtube/v3/liveBroadcasts?part=';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"contentDetails":{"boundStreamId":"","boundStreamLastUpdateTimeMs":"","closedCaptionsType":"","enableAutoStart":false,"enableAutoStop":false,"enableClosedCaptions":false,"enableContentEncryption":false,"enableDvr":false,"enableEmbed":false,"enableLowLatency":false,"latencyPreference":"","mesh":"","monitorStream":{"broadcastStreamDelayMs":0,"embedHtml":"","enableMonitorStream":false},"projection":"","recordFromStart":false,"startWithSlate":false,"stereoLayout":""},"etag":"","id":"","kind":"","snippet":{"actualEndTime":"","actualStartTime":"","channelId":"","description":"","isDefaultBroadcast":false,"liveChatId":"","publishedAt":"","scheduledEndTime":"","scheduledStartTime":"","thumbnails":{"high":{"height":0,"url":"","width":0},"maxres":{},"medium":{},"standard":{}},"title":""},"statistics":{"concurrentViewers":""},"status":{"lifeCycleStatus":"","liveBroadcastPriority":"","madeForKids":false,"privacyStatus":"","recordingStatus":"","selfDeclaredMadeForKids":false}}'
};
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 = @{ @"contentDetails": @{ @"boundStreamId": @"", @"boundStreamLastUpdateTimeMs": @"", @"closedCaptionsType": @"", @"enableAutoStart": @NO, @"enableAutoStop": @NO, @"enableClosedCaptions": @NO, @"enableContentEncryption": @NO, @"enableDvr": @NO, @"enableEmbed": @NO, @"enableLowLatency": @NO, @"latencyPreference": @"", @"mesh": @"", @"monitorStream": @{ @"broadcastStreamDelayMs": @0, @"embedHtml": @"", @"enableMonitorStream": @NO }, @"projection": @"", @"recordFromStart": @NO, @"startWithSlate": @NO, @"stereoLayout": @"" },
@"etag": @"",
@"id": @"",
@"kind": @"",
@"snippet": @{ @"actualEndTime": @"", @"actualStartTime": @"", @"channelId": @"", @"description": @"", @"isDefaultBroadcast": @NO, @"liveChatId": @"", @"publishedAt": @"", @"scheduledEndTime": @"", @"scheduledStartTime": @"", @"thumbnails": @{ @"high": @{ @"height": @0, @"url": @"", @"width": @0 }, @"maxres": @{ }, @"medium": @{ }, @"standard": @{ } }, @"title": @"" },
@"statistics": @{ @"concurrentViewers": @"" },
@"status": @{ @"lifeCycleStatus": @"", @"liveBroadcastPriority": @"", @"madeForKids": @NO, @"privacyStatus": @"", @"recordingStatus": @"", @"selfDeclaredMadeForKids": @NO } };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/youtube/v3/liveBroadcasts?part="]
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}}/youtube/v3/liveBroadcasts?part=" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"contentDetails\": {\n \"boundStreamId\": \"\",\n \"boundStreamLastUpdateTimeMs\": \"\",\n \"closedCaptionsType\": \"\",\n \"enableAutoStart\": false,\n \"enableAutoStop\": false,\n \"enableClosedCaptions\": false,\n \"enableContentEncryption\": false,\n \"enableDvr\": false,\n \"enableEmbed\": false,\n \"enableLowLatency\": false,\n \"latencyPreference\": \"\",\n \"mesh\": \"\",\n \"monitorStream\": {\n \"broadcastStreamDelayMs\": 0,\n \"embedHtml\": \"\",\n \"enableMonitorStream\": false\n },\n \"projection\": \"\",\n \"recordFromStart\": false,\n \"startWithSlate\": false,\n \"stereoLayout\": \"\"\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"actualEndTime\": \"\",\n \"actualStartTime\": \"\",\n \"channelId\": \"\",\n \"description\": \"\",\n \"isDefaultBroadcast\": false,\n \"liveChatId\": \"\",\n \"publishedAt\": \"\",\n \"scheduledEndTime\": \"\",\n \"scheduledStartTime\": \"\",\n \"thumbnails\": {\n \"high\": {\n \"height\": 0,\n \"url\": \"\",\n \"width\": 0\n },\n \"maxres\": {},\n \"medium\": {},\n \"standard\": {}\n },\n \"title\": \"\"\n },\n \"statistics\": {\n \"concurrentViewers\": \"\"\n },\n \"status\": {\n \"lifeCycleStatus\": \"\",\n \"liveBroadcastPriority\": \"\",\n \"madeForKids\": false,\n \"privacyStatus\": \"\",\n \"recordingStatus\": \"\",\n \"selfDeclaredMadeForKids\": false\n }\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/youtube/v3/liveBroadcasts?part=",
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([
'contentDetails' => [
'boundStreamId' => '',
'boundStreamLastUpdateTimeMs' => '',
'closedCaptionsType' => '',
'enableAutoStart' => null,
'enableAutoStop' => null,
'enableClosedCaptions' => null,
'enableContentEncryption' => null,
'enableDvr' => null,
'enableEmbed' => null,
'enableLowLatency' => null,
'latencyPreference' => '',
'mesh' => '',
'monitorStream' => [
'broadcastStreamDelayMs' => 0,
'embedHtml' => '',
'enableMonitorStream' => null
],
'projection' => '',
'recordFromStart' => null,
'startWithSlate' => null,
'stereoLayout' => ''
],
'etag' => '',
'id' => '',
'kind' => '',
'snippet' => [
'actualEndTime' => '',
'actualStartTime' => '',
'channelId' => '',
'description' => '',
'isDefaultBroadcast' => null,
'liveChatId' => '',
'publishedAt' => '',
'scheduledEndTime' => '',
'scheduledStartTime' => '',
'thumbnails' => [
'high' => [
'height' => 0,
'url' => '',
'width' => 0
],
'maxres' => [
],
'medium' => [
],
'standard' => [
]
],
'title' => ''
],
'statistics' => [
'concurrentViewers' => ''
],
'status' => [
'lifeCycleStatus' => '',
'liveBroadcastPriority' => '',
'madeForKids' => null,
'privacyStatus' => '',
'recordingStatus' => '',
'selfDeclaredMadeForKids' => null
]
]),
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}}/youtube/v3/liveBroadcasts?part=', [
'body' => '{
"contentDetails": {
"boundStreamId": "",
"boundStreamLastUpdateTimeMs": "",
"closedCaptionsType": "",
"enableAutoStart": false,
"enableAutoStop": false,
"enableClosedCaptions": false,
"enableContentEncryption": false,
"enableDvr": false,
"enableEmbed": false,
"enableLowLatency": false,
"latencyPreference": "",
"mesh": "",
"monitorStream": {
"broadcastStreamDelayMs": 0,
"embedHtml": "",
"enableMonitorStream": false
},
"projection": "",
"recordFromStart": false,
"startWithSlate": false,
"stereoLayout": ""
},
"etag": "",
"id": "",
"kind": "",
"snippet": {
"actualEndTime": "",
"actualStartTime": "",
"channelId": "",
"description": "",
"isDefaultBroadcast": false,
"liveChatId": "",
"publishedAt": "",
"scheduledEndTime": "",
"scheduledStartTime": "",
"thumbnails": {
"high": {
"height": 0,
"url": "",
"width": 0
},
"maxres": {},
"medium": {},
"standard": {}
},
"title": ""
},
"statistics": {
"concurrentViewers": ""
},
"status": {
"lifeCycleStatus": "",
"liveBroadcastPriority": "",
"madeForKids": false,
"privacyStatus": "",
"recordingStatus": "",
"selfDeclaredMadeForKids": false
}
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/youtube/v3/liveBroadcasts');
$request->setMethod(HTTP_METH_POST);
$request->setQueryData([
'part' => ''
]);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'contentDetails' => [
'boundStreamId' => '',
'boundStreamLastUpdateTimeMs' => '',
'closedCaptionsType' => '',
'enableAutoStart' => null,
'enableAutoStop' => null,
'enableClosedCaptions' => null,
'enableContentEncryption' => null,
'enableDvr' => null,
'enableEmbed' => null,
'enableLowLatency' => null,
'latencyPreference' => '',
'mesh' => '',
'monitorStream' => [
'broadcastStreamDelayMs' => 0,
'embedHtml' => '',
'enableMonitorStream' => null
],
'projection' => '',
'recordFromStart' => null,
'startWithSlate' => null,
'stereoLayout' => ''
],
'etag' => '',
'id' => '',
'kind' => '',
'snippet' => [
'actualEndTime' => '',
'actualStartTime' => '',
'channelId' => '',
'description' => '',
'isDefaultBroadcast' => null,
'liveChatId' => '',
'publishedAt' => '',
'scheduledEndTime' => '',
'scheduledStartTime' => '',
'thumbnails' => [
'high' => [
'height' => 0,
'url' => '',
'width' => 0
],
'maxres' => [
],
'medium' => [
],
'standard' => [
]
],
'title' => ''
],
'statistics' => [
'concurrentViewers' => ''
],
'status' => [
'lifeCycleStatus' => '',
'liveBroadcastPriority' => '',
'madeForKids' => null,
'privacyStatus' => '',
'recordingStatus' => '',
'selfDeclaredMadeForKids' => null
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'contentDetails' => [
'boundStreamId' => '',
'boundStreamLastUpdateTimeMs' => '',
'closedCaptionsType' => '',
'enableAutoStart' => null,
'enableAutoStop' => null,
'enableClosedCaptions' => null,
'enableContentEncryption' => null,
'enableDvr' => null,
'enableEmbed' => null,
'enableLowLatency' => null,
'latencyPreference' => '',
'mesh' => '',
'monitorStream' => [
'broadcastStreamDelayMs' => 0,
'embedHtml' => '',
'enableMonitorStream' => null
],
'projection' => '',
'recordFromStart' => null,
'startWithSlate' => null,
'stereoLayout' => ''
],
'etag' => '',
'id' => '',
'kind' => '',
'snippet' => [
'actualEndTime' => '',
'actualStartTime' => '',
'channelId' => '',
'description' => '',
'isDefaultBroadcast' => null,
'liveChatId' => '',
'publishedAt' => '',
'scheduledEndTime' => '',
'scheduledStartTime' => '',
'thumbnails' => [
'high' => [
'height' => 0,
'url' => '',
'width' => 0
],
'maxres' => [
],
'medium' => [
],
'standard' => [
]
],
'title' => ''
],
'statistics' => [
'concurrentViewers' => ''
],
'status' => [
'lifeCycleStatus' => '',
'liveBroadcastPriority' => '',
'madeForKids' => null,
'privacyStatus' => '',
'recordingStatus' => '',
'selfDeclaredMadeForKids' => null
]
]));
$request->setRequestUrl('{{baseUrl}}/youtube/v3/liveBroadcasts');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setQuery(new http\QueryString([
'part' => ''
]));
$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}}/youtube/v3/liveBroadcasts?part=' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"contentDetails": {
"boundStreamId": "",
"boundStreamLastUpdateTimeMs": "",
"closedCaptionsType": "",
"enableAutoStart": false,
"enableAutoStop": false,
"enableClosedCaptions": false,
"enableContentEncryption": false,
"enableDvr": false,
"enableEmbed": false,
"enableLowLatency": false,
"latencyPreference": "",
"mesh": "",
"monitorStream": {
"broadcastStreamDelayMs": 0,
"embedHtml": "",
"enableMonitorStream": false
},
"projection": "",
"recordFromStart": false,
"startWithSlate": false,
"stereoLayout": ""
},
"etag": "",
"id": "",
"kind": "",
"snippet": {
"actualEndTime": "",
"actualStartTime": "",
"channelId": "",
"description": "",
"isDefaultBroadcast": false,
"liveChatId": "",
"publishedAt": "",
"scheduledEndTime": "",
"scheduledStartTime": "",
"thumbnails": {
"high": {
"height": 0,
"url": "",
"width": 0
},
"maxres": {},
"medium": {},
"standard": {}
},
"title": ""
},
"statistics": {
"concurrentViewers": ""
},
"status": {
"lifeCycleStatus": "",
"liveBroadcastPriority": "",
"madeForKids": false,
"privacyStatus": "",
"recordingStatus": "",
"selfDeclaredMadeForKids": false
}
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/youtube/v3/liveBroadcasts?part=' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"contentDetails": {
"boundStreamId": "",
"boundStreamLastUpdateTimeMs": "",
"closedCaptionsType": "",
"enableAutoStart": false,
"enableAutoStop": false,
"enableClosedCaptions": false,
"enableContentEncryption": false,
"enableDvr": false,
"enableEmbed": false,
"enableLowLatency": false,
"latencyPreference": "",
"mesh": "",
"monitorStream": {
"broadcastStreamDelayMs": 0,
"embedHtml": "",
"enableMonitorStream": false
},
"projection": "",
"recordFromStart": false,
"startWithSlate": false,
"stereoLayout": ""
},
"etag": "",
"id": "",
"kind": "",
"snippet": {
"actualEndTime": "",
"actualStartTime": "",
"channelId": "",
"description": "",
"isDefaultBroadcast": false,
"liveChatId": "",
"publishedAt": "",
"scheduledEndTime": "",
"scheduledStartTime": "",
"thumbnails": {
"high": {
"height": 0,
"url": "",
"width": 0
},
"maxres": {},
"medium": {},
"standard": {}
},
"title": ""
},
"statistics": {
"concurrentViewers": ""
},
"status": {
"lifeCycleStatus": "",
"liveBroadcastPriority": "",
"madeForKids": false,
"privacyStatus": "",
"recordingStatus": "",
"selfDeclaredMadeForKids": false
}
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"contentDetails\": {\n \"boundStreamId\": \"\",\n \"boundStreamLastUpdateTimeMs\": \"\",\n \"closedCaptionsType\": \"\",\n \"enableAutoStart\": false,\n \"enableAutoStop\": false,\n \"enableClosedCaptions\": false,\n \"enableContentEncryption\": false,\n \"enableDvr\": false,\n \"enableEmbed\": false,\n \"enableLowLatency\": false,\n \"latencyPreference\": \"\",\n \"mesh\": \"\",\n \"monitorStream\": {\n \"broadcastStreamDelayMs\": 0,\n \"embedHtml\": \"\",\n \"enableMonitorStream\": false\n },\n \"projection\": \"\",\n \"recordFromStart\": false,\n \"startWithSlate\": false,\n \"stereoLayout\": \"\"\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"actualEndTime\": \"\",\n \"actualStartTime\": \"\",\n \"channelId\": \"\",\n \"description\": \"\",\n \"isDefaultBroadcast\": false,\n \"liveChatId\": \"\",\n \"publishedAt\": \"\",\n \"scheduledEndTime\": \"\",\n \"scheduledStartTime\": \"\",\n \"thumbnails\": {\n \"high\": {\n \"height\": 0,\n \"url\": \"\",\n \"width\": 0\n },\n \"maxres\": {},\n \"medium\": {},\n \"standard\": {}\n },\n \"title\": \"\"\n },\n \"statistics\": {\n \"concurrentViewers\": \"\"\n },\n \"status\": {\n \"lifeCycleStatus\": \"\",\n \"liveBroadcastPriority\": \"\",\n \"madeForKids\": false,\n \"privacyStatus\": \"\",\n \"recordingStatus\": \"\",\n \"selfDeclaredMadeForKids\": false\n }\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/youtube/v3/liveBroadcasts?part=", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/youtube/v3/liveBroadcasts"
querystring = {"part":""}
payload = {
"contentDetails": {
"boundStreamId": "",
"boundStreamLastUpdateTimeMs": "",
"closedCaptionsType": "",
"enableAutoStart": False,
"enableAutoStop": False,
"enableClosedCaptions": False,
"enableContentEncryption": False,
"enableDvr": False,
"enableEmbed": False,
"enableLowLatency": False,
"latencyPreference": "",
"mesh": "",
"monitorStream": {
"broadcastStreamDelayMs": 0,
"embedHtml": "",
"enableMonitorStream": False
},
"projection": "",
"recordFromStart": False,
"startWithSlate": False,
"stereoLayout": ""
},
"etag": "",
"id": "",
"kind": "",
"snippet": {
"actualEndTime": "",
"actualStartTime": "",
"channelId": "",
"description": "",
"isDefaultBroadcast": False,
"liveChatId": "",
"publishedAt": "",
"scheduledEndTime": "",
"scheduledStartTime": "",
"thumbnails": {
"high": {
"height": 0,
"url": "",
"width": 0
},
"maxres": {},
"medium": {},
"standard": {}
},
"title": ""
},
"statistics": { "concurrentViewers": "" },
"status": {
"lifeCycleStatus": "",
"liveBroadcastPriority": "",
"madeForKids": False,
"privacyStatus": "",
"recordingStatus": "",
"selfDeclaredMadeForKids": False
}
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/youtube/v3/liveBroadcasts"
queryString <- list(part = "")
payload <- "{\n \"contentDetails\": {\n \"boundStreamId\": \"\",\n \"boundStreamLastUpdateTimeMs\": \"\",\n \"closedCaptionsType\": \"\",\n \"enableAutoStart\": false,\n \"enableAutoStop\": false,\n \"enableClosedCaptions\": false,\n \"enableContentEncryption\": false,\n \"enableDvr\": false,\n \"enableEmbed\": false,\n \"enableLowLatency\": false,\n \"latencyPreference\": \"\",\n \"mesh\": \"\",\n \"monitorStream\": {\n \"broadcastStreamDelayMs\": 0,\n \"embedHtml\": \"\",\n \"enableMonitorStream\": false\n },\n \"projection\": \"\",\n \"recordFromStart\": false,\n \"startWithSlate\": false,\n \"stereoLayout\": \"\"\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"actualEndTime\": \"\",\n \"actualStartTime\": \"\",\n \"channelId\": \"\",\n \"description\": \"\",\n \"isDefaultBroadcast\": false,\n \"liveChatId\": \"\",\n \"publishedAt\": \"\",\n \"scheduledEndTime\": \"\",\n \"scheduledStartTime\": \"\",\n \"thumbnails\": {\n \"high\": {\n \"height\": 0,\n \"url\": \"\",\n \"width\": 0\n },\n \"maxres\": {},\n \"medium\": {},\n \"standard\": {}\n },\n \"title\": \"\"\n },\n \"statistics\": {\n \"concurrentViewers\": \"\"\n },\n \"status\": {\n \"lifeCycleStatus\": \"\",\n \"liveBroadcastPriority\": \"\",\n \"madeForKids\": false,\n \"privacyStatus\": \"\",\n \"recordingStatus\": \"\",\n \"selfDeclaredMadeForKids\": false\n }\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, query = queryString, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/youtube/v3/liveBroadcasts?part=")
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 \"contentDetails\": {\n \"boundStreamId\": \"\",\n \"boundStreamLastUpdateTimeMs\": \"\",\n \"closedCaptionsType\": \"\",\n \"enableAutoStart\": false,\n \"enableAutoStop\": false,\n \"enableClosedCaptions\": false,\n \"enableContentEncryption\": false,\n \"enableDvr\": false,\n \"enableEmbed\": false,\n \"enableLowLatency\": false,\n \"latencyPreference\": \"\",\n \"mesh\": \"\",\n \"monitorStream\": {\n \"broadcastStreamDelayMs\": 0,\n \"embedHtml\": \"\",\n \"enableMonitorStream\": false\n },\n \"projection\": \"\",\n \"recordFromStart\": false,\n \"startWithSlate\": false,\n \"stereoLayout\": \"\"\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"actualEndTime\": \"\",\n \"actualStartTime\": \"\",\n \"channelId\": \"\",\n \"description\": \"\",\n \"isDefaultBroadcast\": false,\n \"liveChatId\": \"\",\n \"publishedAt\": \"\",\n \"scheduledEndTime\": \"\",\n \"scheduledStartTime\": \"\",\n \"thumbnails\": {\n \"high\": {\n \"height\": 0,\n \"url\": \"\",\n \"width\": 0\n },\n \"maxres\": {},\n \"medium\": {},\n \"standard\": {}\n },\n \"title\": \"\"\n },\n \"statistics\": {\n \"concurrentViewers\": \"\"\n },\n \"status\": {\n \"lifeCycleStatus\": \"\",\n \"liveBroadcastPriority\": \"\",\n \"madeForKids\": false,\n \"privacyStatus\": \"\",\n \"recordingStatus\": \"\",\n \"selfDeclaredMadeForKids\": false\n }\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/youtube/v3/liveBroadcasts') do |req|
req.params['part'] = ''
req.body = "{\n \"contentDetails\": {\n \"boundStreamId\": \"\",\n \"boundStreamLastUpdateTimeMs\": \"\",\n \"closedCaptionsType\": \"\",\n \"enableAutoStart\": false,\n \"enableAutoStop\": false,\n \"enableClosedCaptions\": false,\n \"enableContentEncryption\": false,\n \"enableDvr\": false,\n \"enableEmbed\": false,\n \"enableLowLatency\": false,\n \"latencyPreference\": \"\",\n \"mesh\": \"\",\n \"monitorStream\": {\n \"broadcastStreamDelayMs\": 0,\n \"embedHtml\": \"\",\n \"enableMonitorStream\": false\n },\n \"projection\": \"\",\n \"recordFromStart\": false,\n \"startWithSlate\": false,\n \"stereoLayout\": \"\"\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"actualEndTime\": \"\",\n \"actualStartTime\": \"\",\n \"channelId\": \"\",\n \"description\": \"\",\n \"isDefaultBroadcast\": false,\n \"liveChatId\": \"\",\n \"publishedAt\": \"\",\n \"scheduledEndTime\": \"\",\n \"scheduledStartTime\": \"\",\n \"thumbnails\": {\n \"high\": {\n \"height\": 0,\n \"url\": \"\",\n \"width\": 0\n },\n \"maxres\": {},\n \"medium\": {},\n \"standard\": {}\n },\n \"title\": \"\"\n },\n \"statistics\": {\n \"concurrentViewers\": \"\"\n },\n \"status\": {\n \"lifeCycleStatus\": \"\",\n \"liveBroadcastPriority\": \"\",\n \"madeForKids\": false,\n \"privacyStatus\": \"\",\n \"recordingStatus\": \"\",\n \"selfDeclaredMadeForKids\": false\n }\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/youtube/v3/liveBroadcasts";
let querystring = [
("part", ""),
];
let payload = json!({
"contentDetails": json!({
"boundStreamId": "",
"boundStreamLastUpdateTimeMs": "",
"closedCaptionsType": "",
"enableAutoStart": false,
"enableAutoStop": false,
"enableClosedCaptions": false,
"enableContentEncryption": false,
"enableDvr": false,
"enableEmbed": false,
"enableLowLatency": false,
"latencyPreference": "",
"mesh": "",
"monitorStream": json!({
"broadcastStreamDelayMs": 0,
"embedHtml": "",
"enableMonitorStream": false
}),
"projection": "",
"recordFromStart": false,
"startWithSlate": false,
"stereoLayout": ""
}),
"etag": "",
"id": "",
"kind": "",
"snippet": json!({
"actualEndTime": "",
"actualStartTime": "",
"channelId": "",
"description": "",
"isDefaultBroadcast": false,
"liveChatId": "",
"publishedAt": "",
"scheduledEndTime": "",
"scheduledStartTime": "",
"thumbnails": json!({
"high": json!({
"height": 0,
"url": "",
"width": 0
}),
"maxres": json!({}),
"medium": json!({}),
"standard": json!({})
}),
"title": ""
}),
"statistics": json!({"concurrentViewers": ""}),
"status": json!({
"lifeCycleStatus": "",
"liveBroadcastPriority": "",
"madeForKids": false,
"privacyStatus": "",
"recordingStatus": "",
"selfDeclaredMadeForKids": false
})
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.query(&querystring)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/youtube/v3/liveBroadcasts?part=' \
--header 'content-type: application/json' \
--data '{
"contentDetails": {
"boundStreamId": "",
"boundStreamLastUpdateTimeMs": "",
"closedCaptionsType": "",
"enableAutoStart": false,
"enableAutoStop": false,
"enableClosedCaptions": false,
"enableContentEncryption": false,
"enableDvr": false,
"enableEmbed": false,
"enableLowLatency": false,
"latencyPreference": "",
"mesh": "",
"monitorStream": {
"broadcastStreamDelayMs": 0,
"embedHtml": "",
"enableMonitorStream": false
},
"projection": "",
"recordFromStart": false,
"startWithSlate": false,
"stereoLayout": ""
},
"etag": "",
"id": "",
"kind": "",
"snippet": {
"actualEndTime": "",
"actualStartTime": "",
"channelId": "",
"description": "",
"isDefaultBroadcast": false,
"liveChatId": "",
"publishedAt": "",
"scheduledEndTime": "",
"scheduledStartTime": "",
"thumbnails": {
"high": {
"height": 0,
"url": "",
"width": 0
},
"maxres": {},
"medium": {},
"standard": {}
},
"title": ""
},
"statistics": {
"concurrentViewers": ""
},
"status": {
"lifeCycleStatus": "",
"liveBroadcastPriority": "",
"madeForKids": false,
"privacyStatus": "",
"recordingStatus": "",
"selfDeclaredMadeForKids": false
}
}'
echo '{
"contentDetails": {
"boundStreamId": "",
"boundStreamLastUpdateTimeMs": "",
"closedCaptionsType": "",
"enableAutoStart": false,
"enableAutoStop": false,
"enableClosedCaptions": false,
"enableContentEncryption": false,
"enableDvr": false,
"enableEmbed": false,
"enableLowLatency": false,
"latencyPreference": "",
"mesh": "",
"monitorStream": {
"broadcastStreamDelayMs": 0,
"embedHtml": "",
"enableMonitorStream": false
},
"projection": "",
"recordFromStart": false,
"startWithSlate": false,
"stereoLayout": ""
},
"etag": "",
"id": "",
"kind": "",
"snippet": {
"actualEndTime": "",
"actualStartTime": "",
"channelId": "",
"description": "",
"isDefaultBroadcast": false,
"liveChatId": "",
"publishedAt": "",
"scheduledEndTime": "",
"scheduledStartTime": "",
"thumbnails": {
"high": {
"height": 0,
"url": "",
"width": 0
},
"maxres": {},
"medium": {},
"standard": {}
},
"title": ""
},
"statistics": {
"concurrentViewers": ""
},
"status": {
"lifeCycleStatus": "",
"liveBroadcastPriority": "",
"madeForKids": false,
"privacyStatus": "",
"recordingStatus": "",
"selfDeclaredMadeForKids": false
}
}' | \
http POST '{{baseUrl}}/youtube/v3/liveBroadcasts?part=' \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "contentDetails": {\n "boundStreamId": "",\n "boundStreamLastUpdateTimeMs": "",\n "closedCaptionsType": "",\n "enableAutoStart": false,\n "enableAutoStop": false,\n "enableClosedCaptions": false,\n "enableContentEncryption": false,\n "enableDvr": false,\n "enableEmbed": false,\n "enableLowLatency": false,\n "latencyPreference": "",\n "mesh": "",\n "monitorStream": {\n "broadcastStreamDelayMs": 0,\n "embedHtml": "",\n "enableMonitorStream": false\n },\n "projection": "",\n "recordFromStart": false,\n "startWithSlate": false,\n "stereoLayout": ""\n },\n "etag": "",\n "id": "",\n "kind": "",\n "snippet": {\n "actualEndTime": "",\n "actualStartTime": "",\n "channelId": "",\n "description": "",\n "isDefaultBroadcast": false,\n "liveChatId": "",\n "publishedAt": "",\n "scheduledEndTime": "",\n "scheduledStartTime": "",\n "thumbnails": {\n "high": {\n "height": 0,\n "url": "",\n "width": 0\n },\n "maxres": {},\n "medium": {},\n "standard": {}\n },\n "title": ""\n },\n "statistics": {\n "concurrentViewers": ""\n },\n "status": {\n "lifeCycleStatus": "",\n "liveBroadcastPriority": "",\n "madeForKids": false,\n "privacyStatus": "",\n "recordingStatus": "",\n "selfDeclaredMadeForKids": false\n }\n}' \
--output-document \
- '{{baseUrl}}/youtube/v3/liveBroadcasts?part='
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"contentDetails": [
"boundStreamId": "",
"boundStreamLastUpdateTimeMs": "",
"closedCaptionsType": "",
"enableAutoStart": false,
"enableAutoStop": false,
"enableClosedCaptions": false,
"enableContentEncryption": false,
"enableDvr": false,
"enableEmbed": false,
"enableLowLatency": false,
"latencyPreference": "",
"mesh": "",
"monitorStream": [
"broadcastStreamDelayMs": 0,
"embedHtml": "",
"enableMonitorStream": false
],
"projection": "",
"recordFromStart": false,
"startWithSlate": false,
"stereoLayout": ""
],
"etag": "",
"id": "",
"kind": "",
"snippet": [
"actualEndTime": "",
"actualStartTime": "",
"channelId": "",
"description": "",
"isDefaultBroadcast": false,
"liveChatId": "",
"publishedAt": "",
"scheduledEndTime": "",
"scheduledStartTime": "",
"thumbnails": [
"high": [
"height": 0,
"url": "",
"width": 0
],
"maxres": [],
"medium": [],
"standard": []
],
"title": ""
],
"statistics": ["concurrentViewers": ""],
"status": [
"lifeCycleStatus": "",
"liveBroadcastPriority": "",
"madeForKids": false,
"privacyStatus": "",
"recordingStatus": "",
"selfDeclaredMadeForKids": false
]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/youtube/v3/liveBroadcasts?part=")! 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()
POST
youtube.liveBroadcasts.insertCuepoint
{{baseUrl}}/youtube/v3/liveBroadcasts/cuepoint
BODY json
{
"cueType": "",
"durationSecs": 0,
"etag": "",
"id": "",
"insertionOffsetTimeMs": "",
"walltimeMs": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/youtube/v3/liveBroadcasts/cuepoint");
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 \"cueType\": \"\",\n \"durationSecs\": 0,\n \"etag\": \"\",\n \"id\": \"\",\n \"insertionOffsetTimeMs\": \"\",\n \"walltimeMs\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/youtube/v3/liveBroadcasts/cuepoint" {:content-type :json
:form-params {:cueType ""
:durationSecs 0
:etag ""
:id ""
:insertionOffsetTimeMs ""
:walltimeMs ""}})
require "http/client"
url = "{{baseUrl}}/youtube/v3/liveBroadcasts/cuepoint"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"cueType\": \"\",\n \"durationSecs\": 0,\n \"etag\": \"\",\n \"id\": \"\",\n \"insertionOffsetTimeMs\": \"\",\n \"walltimeMs\": \"\"\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}}/youtube/v3/liveBroadcasts/cuepoint"),
Content = new StringContent("{\n \"cueType\": \"\",\n \"durationSecs\": 0,\n \"etag\": \"\",\n \"id\": \"\",\n \"insertionOffsetTimeMs\": \"\",\n \"walltimeMs\": \"\"\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}}/youtube/v3/liveBroadcasts/cuepoint");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"cueType\": \"\",\n \"durationSecs\": 0,\n \"etag\": \"\",\n \"id\": \"\",\n \"insertionOffsetTimeMs\": \"\",\n \"walltimeMs\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/youtube/v3/liveBroadcasts/cuepoint"
payload := strings.NewReader("{\n \"cueType\": \"\",\n \"durationSecs\": 0,\n \"etag\": \"\",\n \"id\": \"\",\n \"insertionOffsetTimeMs\": \"\",\n \"walltimeMs\": \"\"\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/youtube/v3/liveBroadcasts/cuepoint HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 117
{
"cueType": "",
"durationSecs": 0,
"etag": "",
"id": "",
"insertionOffsetTimeMs": "",
"walltimeMs": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/youtube/v3/liveBroadcasts/cuepoint")
.setHeader("content-type", "application/json")
.setBody("{\n \"cueType\": \"\",\n \"durationSecs\": 0,\n \"etag\": \"\",\n \"id\": \"\",\n \"insertionOffsetTimeMs\": \"\",\n \"walltimeMs\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/youtube/v3/liveBroadcasts/cuepoint"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"cueType\": \"\",\n \"durationSecs\": 0,\n \"etag\": \"\",\n \"id\": \"\",\n \"insertionOffsetTimeMs\": \"\",\n \"walltimeMs\": \"\"\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 \"cueType\": \"\",\n \"durationSecs\": 0,\n \"etag\": \"\",\n \"id\": \"\",\n \"insertionOffsetTimeMs\": \"\",\n \"walltimeMs\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/youtube/v3/liveBroadcasts/cuepoint")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/youtube/v3/liveBroadcasts/cuepoint")
.header("content-type", "application/json")
.body("{\n \"cueType\": \"\",\n \"durationSecs\": 0,\n \"etag\": \"\",\n \"id\": \"\",\n \"insertionOffsetTimeMs\": \"\",\n \"walltimeMs\": \"\"\n}")
.asString();
const data = JSON.stringify({
cueType: '',
durationSecs: 0,
etag: '',
id: '',
insertionOffsetTimeMs: '',
walltimeMs: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/youtube/v3/liveBroadcasts/cuepoint');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/youtube/v3/liveBroadcasts/cuepoint',
headers: {'content-type': 'application/json'},
data: {
cueType: '',
durationSecs: 0,
etag: '',
id: '',
insertionOffsetTimeMs: '',
walltimeMs: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/youtube/v3/liveBroadcasts/cuepoint';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"cueType":"","durationSecs":0,"etag":"","id":"","insertionOffsetTimeMs":"","walltimeMs":""}'
};
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}}/youtube/v3/liveBroadcasts/cuepoint',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "cueType": "",\n "durationSecs": 0,\n "etag": "",\n "id": "",\n "insertionOffsetTimeMs": "",\n "walltimeMs": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"cueType\": \"\",\n \"durationSecs\": 0,\n \"etag\": \"\",\n \"id\": \"\",\n \"insertionOffsetTimeMs\": \"\",\n \"walltimeMs\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/youtube/v3/liveBroadcasts/cuepoint")
.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/youtube/v3/liveBroadcasts/cuepoint',
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({
cueType: '',
durationSecs: 0,
etag: '',
id: '',
insertionOffsetTimeMs: '',
walltimeMs: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/youtube/v3/liveBroadcasts/cuepoint',
headers: {'content-type': 'application/json'},
body: {
cueType: '',
durationSecs: 0,
etag: '',
id: '',
insertionOffsetTimeMs: '',
walltimeMs: ''
},
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}}/youtube/v3/liveBroadcasts/cuepoint');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
cueType: '',
durationSecs: 0,
etag: '',
id: '',
insertionOffsetTimeMs: '',
walltimeMs: ''
});
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}}/youtube/v3/liveBroadcasts/cuepoint',
headers: {'content-type': 'application/json'},
data: {
cueType: '',
durationSecs: 0,
etag: '',
id: '',
insertionOffsetTimeMs: '',
walltimeMs: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/youtube/v3/liveBroadcasts/cuepoint';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"cueType":"","durationSecs":0,"etag":"","id":"","insertionOffsetTimeMs":"","walltimeMs":""}'
};
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 = @{ @"cueType": @"",
@"durationSecs": @0,
@"etag": @"",
@"id": @"",
@"insertionOffsetTimeMs": @"",
@"walltimeMs": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/youtube/v3/liveBroadcasts/cuepoint"]
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}}/youtube/v3/liveBroadcasts/cuepoint" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"cueType\": \"\",\n \"durationSecs\": 0,\n \"etag\": \"\",\n \"id\": \"\",\n \"insertionOffsetTimeMs\": \"\",\n \"walltimeMs\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/youtube/v3/liveBroadcasts/cuepoint",
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([
'cueType' => '',
'durationSecs' => 0,
'etag' => '',
'id' => '',
'insertionOffsetTimeMs' => '',
'walltimeMs' => ''
]),
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}}/youtube/v3/liveBroadcasts/cuepoint', [
'body' => '{
"cueType": "",
"durationSecs": 0,
"etag": "",
"id": "",
"insertionOffsetTimeMs": "",
"walltimeMs": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/youtube/v3/liveBroadcasts/cuepoint');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'cueType' => '',
'durationSecs' => 0,
'etag' => '',
'id' => '',
'insertionOffsetTimeMs' => '',
'walltimeMs' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'cueType' => '',
'durationSecs' => 0,
'etag' => '',
'id' => '',
'insertionOffsetTimeMs' => '',
'walltimeMs' => ''
]));
$request->setRequestUrl('{{baseUrl}}/youtube/v3/liveBroadcasts/cuepoint');
$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}}/youtube/v3/liveBroadcasts/cuepoint' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"cueType": "",
"durationSecs": 0,
"etag": "",
"id": "",
"insertionOffsetTimeMs": "",
"walltimeMs": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/youtube/v3/liveBroadcasts/cuepoint' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"cueType": "",
"durationSecs": 0,
"etag": "",
"id": "",
"insertionOffsetTimeMs": "",
"walltimeMs": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"cueType\": \"\",\n \"durationSecs\": 0,\n \"etag\": \"\",\n \"id\": \"\",\n \"insertionOffsetTimeMs\": \"\",\n \"walltimeMs\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/youtube/v3/liveBroadcasts/cuepoint", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/youtube/v3/liveBroadcasts/cuepoint"
payload = {
"cueType": "",
"durationSecs": 0,
"etag": "",
"id": "",
"insertionOffsetTimeMs": "",
"walltimeMs": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/youtube/v3/liveBroadcasts/cuepoint"
payload <- "{\n \"cueType\": \"\",\n \"durationSecs\": 0,\n \"etag\": \"\",\n \"id\": \"\",\n \"insertionOffsetTimeMs\": \"\",\n \"walltimeMs\": \"\"\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}}/youtube/v3/liveBroadcasts/cuepoint")
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 \"cueType\": \"\",\n \"durationSecs\": 0,\n \"etag\": \"\",\n \"id\": \"\",\n \"insertionOffsetTimeMs\": \"\",\n \"walltimeMs\": \"\"\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/youtube/v3/liveBroadcasts/cuepoint') do |req|
req.body = "{\n \"cueType\": \"\",\n \"durationSecs\": 0,\n \"etag\": \"\",\n \"id\": \"\",\n \"insertionOffsetTimeMs\": \"\",\n \"walltimeMs\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/youtube/v3/liveBroadcasts/cuepoint";
let payload = json!({
"cueType": "",
"durationSecs": 0,
"etag": "",
"id": "",
"insertionOffsetTimeMs": "",
"walltimeMs": ""
});
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}}/youtube/v3/liveBroadcasts/cuepoint \
--header 'content-type: application/json' \
--data '{
"cueType": "",
"durationSecs": 0,
"etag": "",
"id": "",
"insertionOffsetTimeMs": "",
"walltimeMs": ""
}'
echo '{
"cueType": "",
"durationSecs": 0,
"etag": "",
"id": "",
"insertionOffsetTimeMs": "",
"walltimeMs": ""
}' | \
http POST {{baseUrl}}/youtube/v3/liveBroadcasts/cuepoint \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "cueType": "",\n "durationSecs": 0,\n "etag": "",\n "id": "",\n "insertionOffsetTimeMs": "",\n "walltimeMs": ""\n}' \
--output-document \
- {{baseUrl}}/youtube/v3/liveBroadcasts/cuepoint
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"cueType": "",
"durationSecs": 0,
"etag": "",
"id": "",
"insertionOffsetTimeMs": "",
"walltimeMs": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/youtube/v3/liveBroadcasts/cuepoint")! 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()
GET
youtube.liveBroadcasts.list
{{baseUrl}}/youtube/v3/liveBroadcasts
QUERY PARAMS
part
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/youtube/v3/liveBroadcasts?part=");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/youtube/v3/liveBroadcasts" {:query-params {:part ""}})
require "http/client"
url = "{{baseUrl}}/youtube/v3/liveBroadcasts?part="
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}}/youtube/v3/liveBroadcasts?part="),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/youtube/v3/liveBroadcasts?part=");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/youtube/v3/liveBroadcasts?part="
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/youtube/v3/liveBroadcasts?part= HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/youtube/v3/liveBroadcasts?part=")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/youtube/v3/liveBroadcasts?part="))
.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}}/youtube/v3/liveBroadcasts?part=")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/youtube/v3/liveBroadcasts?part=")
.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}}/youtube/v3/liveBroadcasts?part=');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/youtube/v3/liveBroadcasts',
params: {part: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/youtube/v3/liveBroadcasts?part=';
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}}/youtube/v3/liveBroadcasts?part=',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/youtube/v3/liveBroadcasts?part=")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/youtube/v3/liveBroadcasts?part=',
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}}/youtube/v3/liveBroadcasts',
qs: {part: ''}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/youtube/v3/liveBroadcasts');
req.query({
part: ''
});
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}}/youtube/v3/liveBroadcasts',
params: {part: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/youtube/v3/liveBroadcasts?part=';
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}}/youtube/v3/liveBroadcasts?part="]
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}}/youtube/v3/liveBroadcasts?part=" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/youtube/v3/liveBroadcasts?part=",
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}}/youtube/v3/liveBroadcasts?part=');
echo $response->getBody();
setUrl('{{baseUrl}}/youtube/v3/liveBroadcasts');
$request->setMethod(HTTP_METH_GET);
$request->setQueryData([
'part' => ''
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/youtube/v3/liveBroadcasts');
$request->setRequestMethod('GET');
$request->setQuery(new http\QueryString([
'part' => ''
]));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/youtube/v3/liveBroadcasts?part=' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/youtube/v3/liveBroadcasts?part=' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/youtube/v3/liveBroadcasts?part=")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/youtube/v3/liveBroadcasts"
querystring = {"part":""}
response = requests.get(url, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/youtube/v3/liveBroadcasts"
queryString <- list(part = "")
response <- VERB("GET", url, query = queryString, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/youtube/v3/liveBroadcasts?part=")
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/youtube/v3/liveBroadcasts') do |req|
req.params['part'] = ''
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/youtube/v3/liveBroadcasts";
let querystring = [
("part", ""),
];
let client = reqwest::Client::new();
let response = client.get(url)
.query(&querystring)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url '{{baseUrl}}/youtube/v3/liveBroadcasts?part='
http GET '{{baseUrl}}/youtube/v3/liveBroadcasts?part='
wget --quiet \
--method GET \
--output-document \
- '{{baseUrl}}/youtube/v3/liveBroadcasts?part='
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/youtube/v3/liveBroadcasts?part=")! 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()
POST
youtube.liveBroadcasts.transition
{{baseUrl}}/youtube/v3/liveBroadcasts/transition
QUERY PARAMS
broadcastStatus
id
part
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/youtube/v3/liveBroadcasts/transition?broadcastStatus=&id=&part=");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/youtube/v3/liveBroadcasts/transition" {:query-params {:broadcastStatus ""
:id ""
:part ""}})
require "http/client"
url = "{{baseUrl}}/youtube/v3/liveBroadcasts/transition?broadcastStatus=&id=&part="
response = HTTP::Client.post url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/youtube/v3/liveBroadcasts/transition?broadcastStatus=&id=&part="),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/youtube/v3/liveBroadcasts/transition?broadcastStatus=&id=&part=");
var request = new RestRequest("", Method.Post);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/youtube/v3/liveBroadcasts/transition?broadcastStatus=&id=&part="
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/youtube/v3/liveBroadcasts/transition?broadcastStatus=&id=&part= HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/youtube/v3/liveBroadcasts/transition?broadcastStatus=&id=&part=")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/youtube/v3/liveBroadcasts/transition?broadcastStatus=&id=&part="))
.method("POST", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/youtube/v3/liveBroadcasts/transition?broadcastStatus=&id=&part=")
.post(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/youtube/v3/liveBroadcasts/transition?broadcastStatus=&id=&part=")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/youtube/v3/liveBroadcasts/transition?broadcastStatus=&id=&part=');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/youtube/v3/liveBroadcasts/transition',
params: {broadcastStatus: '', id: '', part: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/youtube/v3/liveBroadcasts/transition?broadcastStatus=&id=&part=';
const options = {method: 'POST'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/youtube/v3/liveBroadcasts/transition?broadcastStatus=&id=&part=',
method: 'POST',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/youtube/v3/liveBroadcasts/transition?broadcastStatus=&id=&part=")
.post(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/youtube/v3/liveBroadcasts/transition?broadcastStatus=&id=&part=',
headers: {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/youtube/v3/liveBroadcasts/transition',
qs: {broadcastStatus: '', id: '', part: ''}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/youtube/v3/liveBroadcasts/transition');
req.query({
broadcastStatus: '',
id: '',
part: ''
});
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}}/youtube/v3/liveBroadcasts/transition',
params: {broadcastStatus: '', id: '', part: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/youtube/v3/liveBroadcasts/transition?broadcastStatus=&id=&part=';
const options = {method: 'POST'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/youtube/v3/liveBroadcasts/transition?broadcastStatus=&id=&part="]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/youtube/v3/liveBroadcasts/transition?broadcastStatus=&id=&part=" in
Client.call `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/youtube/v3/liveBroadcasts/transition?broadcastStatus=&id=&part=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/youtube/v3/liveBroadcasts/transition?broadcastStatus=&id=&part=');
echo $response->getBody();
setUrl('{{baseUrl}}/youtube/v3/liveBroadcasts/transition');
$request->setMethod(HTTP_METH_POST);
$request->setQueryData([
'broadcastStatus' => '',
'id' => '',
'part' => ''
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/youtube/v3/liveBroadcasts/transition');
$request->setRequestMethod('POST');
$request->setQuery(new http\QueryString([
'broadcastStatus' => '',
'id' => '',
'part' => ''
]));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/youtube/v3/liveBroadcasts/transition?broadcastStatus=&id=&part=' -Method POST
$response = Invoke-RestMethod -Uri '{{baseUrl}}/youtube/v3/liveBroadcasts/transition?broadcastStatus=&id=&part=' -Method POST
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("POST", "/baseUrl/youtube/v3/liveBroadcasts/transition?broadcastStatus=&id=&part=")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/youtube/v3/liveBroadcasts/transition"
querystring = {"broadcastStatus":"","id":"","part":""}
response = requests.post(url, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/youtube/v3/liveBroadcasts/transition"
queryString <- list(
broadcastStatus = "",
id = "",
part = ""
)
response <- VERB("POST", url, query = queryString, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/youtube/v3/liveBroadcasts/transition?broadcastStatus=&id=&part=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.post('/baseUrl/youtube/v3/liveBroadcasts/transition') do |req|
req.params['broadcastStatus'] = ''
req.params['id'] = ''
req.params['part'] = ''
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/youtube/v3/liveBroadcasts/transition";
let querystring = [
("broadcastStatus", ""),
("id", ""),
("part", ""),
];
let client = reqwest::Client::new();
let response = client.post(url)
.query(&querystring)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/youtube/v3/liveBroadcasts/transition?broadcastStatus=&id=&part='
http POST '{{baseUrl}}/youtube/v3/liveBroadcasts/transition?broadcastStatus=&id=&part='
wget --quiet \
--method POST \
--output-document \
- '{{baseUrl}}/youtube/v3/liveBroadcasts/transition?broadcastStatus=&id=&part='
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/youtube/v3/liveBroadcasts/transition?broadcastStatus=&id=&part=")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
PUT
youtube.liveBroadcasts.update
{{baseUrl}}/youtube/v3/liveBroadcasts
QUERY PARAMS
part
BODY json
{
"contentDetails": {
"boundStreamId": "",
"boundStreamLastUpdateTimeMs": "",
"closedCaptionsType": "",
"enableAutoStart": false,
"enableAutoStop": false,
"enableClosedCaptions": false,
"enableContentEncryption": false,
"enableDvr": false,
"enableEmbed": false,
"enableLowLatency": false,
"latencyPreference": "",
"mesh": "",
"monitorStream": {
"broadcastStreamDelayMs": 0,
"embedHtml": "",
"enableMonitorStream": false
},
"projection": "",
"recordFromStart": false,
"startWithSlate": false,
"stereoLayout": ""
},
"etag": "",
"id": "",
"kind": "",
"snippet": {
"actualEndTime": "",
"actualStartTime": "",
"channelId": "",
"description": "",
"isDefaultBroadcast": false,
"liveChatId": "",
"publishedAt": "",
"scheduledEndTime": "",
"scheduledStartTime": "",
"thumbnails": {
"high": {
"height": 0,
"url": "",
"width": 0
},
"maxres": {},
"medium": {},
"standard": {}
},
"title": ""
},
"statistics": {
"concurrentViewers": ""
},
"status": {
"lifeCycleStatus": "",
"liveBroadcastPriority": "",
"madeForKids": false,
"privacyStatus": "",
"recordingStatus": "",
"selfDeclaredMadeForKids": false
}
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/youtube/v3/liveBroadcasts?part=");
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 \"contentDetails\": {\n \"boundStreamId\": \"\",\n \"boundStreamLastUpdateTimeMs\": \"\",\n \"closedCaptionsType\": \"\",\n \"enableAutoStart\": false,\n \"enableAutoStop\": false,\n \"enableClosedCaptions\": false,\n \"enableContentEncryption\": false,\n \"enableDvr\": false,\n \"enableEmbed\": false,\n \"enableLowLatency\": false,\n \"latencyPreference\": \"\",\n \"mesh\": \"\",\n \"monitorStream\": {\n \"broadcastStreamDelayMs\": 0,\n \"embedHtml\": \"\",\n \"enableMonitorStream\": false\n },\n \"projection\": \"\",\n \"recordFromStart\": false,\n \"startWithSlate\": false,\n \"stereoLayout\": \"\"\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"actualEndTime\": \"\",\n \"actualStartTime\": \"\",\n \"channelId\": \"\",\n \"description\": \"\",\n \"isDefaultBroadcast\": false,\n \"liveChatId\": \"\",\n \"publishedAt\": \"\",\n \"scheduledEndTime\": \"\",\n \"scheduledStartTime\": \"\",\n \"thumbnails\": {\n \"high\": {\n \"height\": 0,\n \"url\": \"\",\n \"width\": 0\n },\n \"maxres\": {},\n \"medium\": {},\n \"standard\": {}\n },\n \"title\": \"\"\n },\n \"statistics\": {\n \"concurrentViewers\": \"\"\n },\n \"status\": {\n \"lifeCycleStatus\": \"\",\n \"liveBroadcastPriority\": \"\",\n \"madeForKids\": false,\n \"privacyStatus\": \"\",\n \"recordingStatus\": \"\",\n \"selfDeclaredMadeForKids\": false\n }\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/youtube/v3/liveBroadcasts" {:query-params {:part ""}
:content-type :json
:form-params {:contentDetails {:boundStreamId ""
:boundStreamLastUpdateTimeMs ""
:closedCaptionsType ""
:enableAutoStart false
:enableAutoStop false
:enableClosedCaptions false
:enableContentEncryption false
:enableDvr false
:enableEmbed false
:enableLowLatency false
:latencyPreference ""
:mesh ""
:monitorStream {:broadcastStreamDelayMs 0
:embedHtml ""
:enableMonitorStream false}
:projection ""
:recordFromStart false
:startWithSlate false
:stereoLayout ""}
:etag ""
:id ""
:kind ""
:snippet {:actualEndTime ""
:actualStartTime ""
:channelId ""
:description ""
:isDefaultBroadcast false
:liveChatId ""
:publishedAt ""
:scheduledEndTime ""
:scheduledStartTime ""
:thumbnails {:high {:height 0
:url ""
:width 0}
:maxres {}
:medium {}
:standard {}}
:title ""}
:statistics {:concurrentViewers ""}
:status {:lifeCycleStatus ""
:liveBroadcastPriority ""
:madeForKids false
:privacyStatus ""
:recordingStatus ""
:selfDeclaredMadeForKids false}}})
require "http/client"
url = "{{baseUrl}}/youtube/v3/liveBroadcasts?part="
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"contentDetails\": {\n \"boundStreamId\": \"\",\n \"boundStreamLastUpdateTimeMs\": \"\",\n \"closedCaptionsType\": \"\",\n \"enableAutoStart\": false,\n \"enableAutoStop\": false,\n \"enableClosedCaptions\": false,\n \"enableContentEncryption\": false,\n \"enableDvr\": false,\n \"enableEmbed\": false,\n \"enableLowLatency\": false,\n \"latencyPreference\": \"\",\n \"mesh\": \"\",\n \"monitorStream\": {\n \"broadcastStreamDelayMs\": 0,\n \"embedHtml\": \"\",\n \"enableMonitorStream\": false\n },\n \"projection\": \"\",\n \"recordFromStart\": false,\n \"startWithSlate\": false,\n \"stereoLayout\": \"\"\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"actualEndTime\": \"\",\n \"actualStartTime\": \"\",\n \"channelId\": \"\",\n \"description\": \"\",\n \"isDefaultBroadcast\": false,\n \"liveChatId\": \"\",\n \"publishedAt\": \"\",\n \"scheduledEndTime\": \"\",\n \"scheduledStartTime\": \"\",\n \"thumbnails\": {\n \"high\": {\n \"height\": 0,\n \"url\": \"\",\n \"width\": 0\n },\n \"maxres\": {},\n \"medium\": {},\n \"standard\": {}\n },\n \"title\": \"\"\n },\n \"statistics\": {\n \"concurrentViewers\": \"\"\n },\n \"status\": {\n \"lifeCycleStatus\": \"\",\n \"liveBroadcastPriority\": \"\",\n \"madeForKids\": false,\n \"privacyStatus\": \"\",\n \"recordingStatus\": \"\",\n \"selfDeclaredMadeForKids\": false\n }\n}"
response = HTTP::Client.put url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Put,
RequestUri = new Uri("{{baseUrl}}/youtube/v3/liveBroadcasts?part="),
Content = new StringContent("{\n \"contentDetails\": {\n \"boundStreamId\": \"\",\n \"boundStreamLastUpdateTimeMs\": \"\",\n \"closedCaptionsType\": \"\",\n \"enableAutoStart\": false,\n \"enableAutoStop\": false,\n \"enableClosedCaptions\": false,\n \"enableContentEncryption\": false,\n \"enableDvr\": false,\n \"enableEmbed\": false,\n \"enableLowLatency\": false,\n \"latencyPreference\": \"\",\n \"mesh\": \"\",\n \"monitorStream\": {\n \"broadcastStreamDelayMs\": 0,\n \"embedHtml\": \"\",\n \"enableMonitorStream\": false\n },\n \"projection\": \"\",\n \"recordFromStart\": false,\n \"startWithSlate\": false,\n \"stereoLayout\": \"\"\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"actualEndTime\": \"\",\n \"actualStartTime\": \"\",\n \"channelId\": \"\",\n \"description\": \"\",\n \"isDefaultBroadcast\": false,\n \"liveChatId\": \"\",\n \"publishedAt\": \"\",\n \"scheduledEndTime\": \"\",\n \"scheduledStartTime\": \"\",\n \"thumbnails\": {\n \"high\": {\n \"height\": 0,\n \"url\": \"\",\n \"width\": 0\n },\n \"maxres\": {},\n \"medium\": {},\n \"standard\": {}\n },\n \"title\": \"\"\n },\n \"statistics\": {\n \"concurrentViewers\": \"\"\n },\n \"status\": {\n \"lifeCycleStatus\": \"\",\n \"liveBroadcastPriority\": \"\",\n \"madeForKids\": false,\n \"privacyStatus\": \"\",\n \"recordingStatus\": \"\",\n \"selfDeclaredMadeForKids\": false\n }\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/youtube/v3/liveBroadcasts?part=");
var request = new RestRequest("", Method.Put);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"contentDetails\": {\n \"boundStreamId\": \"\",\n \"boundStreamLastUpdateTimeMs\": \"\",\n \"closedCaptionsType\": \"\",\n \"enableAutoStart\": false,\n \"enableAutoStop\": false,\n \"enableClosedCaptions\": false,\n \"enableContentEncryption\": false,\n \"enableDvr\": false,\n \"enableEmbed\": false,\n \"enableLowLatency\": false,\n \"latencyPreference\": \"\",\n \"mesh\": \"\",\n \"monitorStream\": {\n \"broadcastStreamDelayMs\": 0,\n \"embedHtml\": \"\",\n \"enableMonitorStream\": false\n },\n \"projection\": \"\",\n \"recordFromStart\": false,\n \"startWithSlate\": false,\n \"stereoLayout\": \"\"\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"actualEndTime\": \"\",\n \"actualStartTime\": \"\",\n \"channelId\": \"\",\n \"description\": \"\",\n \"isDefaultBroadcast\": false,\n \"liveChatId\": \"\",\n \"publishedAt\": \"\",\n \"scheduledEndTime\": \"\",\n \"scheduledStartTime\": \"\",\n \"thumbnails\": {\n \"high\": {\n \"height\": 0,\n \"url\": \"\",\n \"width\": 0\n },\n \"maxres\": {},\n \"medium\": {},\n \"standard\": {}\n },\n \"title\": \"\"\n },\n \"statistics\": {\n \"concurrentViewers\": \"\"\n },\n \"status\": {\n \"lifeCycleStatus\": \"\",\n \"liveBroadcastPriority\": \"\",\n \"madeForKids\": false,\n \"privacyStatus\": \"\",\n \"recordingStatus\": \"\",\n \"selfDeclaredMadeForKids\": false\n }\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/youtube/v3/liveBroadcasts?part="
payload := strings.NewReader("{\n \"contentDetails\": {\n \"boundStreamId\": \"\",\n \"boundStreamLastUpdateTimeMs\": \"\",\n \"closedCaptionsType\": \"\",\n \"enableAutoStart\": false,\n \"enableAutoStop\": false,\n \"enableClosedCaptions\": false,\n \"enableContentEncryption\": false,\n \"enableDvr\": false,\n \"enableEmbed\": false,\n \"enableLowLatency\": false,\n \"latencyPreference\": \"\",\n \"mesh\": \"\",\n \"monitorStream\": {\n \"broadcastStreamDelayMs\": 0,\n \"embedHtml\": \"\",\n \"enableMonitorStream\": false\n },\n \"projection\": \"\",\n \"recordFromStart\": false,\n \"startWithSlate\": false,\n \"stereoLayout\": \"\"\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"actualEndTime\": \"\",\n \"actualStartTime\": \"\",\n \"channelId\": \"\",\n \"description\": \"\",\n \"isDefaultBroadcast\": false,\n \"liveChatId\": \"\",\n \"publishedAt\": \"\",\n \"scheduledEndTime\": \"\",\n \"scheduledStartTime\": \"\",\n \"thumbnails\": {\n \"high\": {\n \"height\": 0,\n \"url\": \"\",\n \"width\": 0\n },\n \"maxres\": {},\n \"medium\": {},\n \"standard\": {}\n },\n \"title\": \"\"\n },\n \"statistics\": {\n \"concurrentViewers\": \"\"\n },\n \"status\": {\n \"lifeCycleStatus\": \"\",\n \"liveBroadcastPriority\": \"\",\n \"madeForKids\": false,\n \"privacyStatus\": \"\",\n \"recordingStatus\": \"\",\n \"selfDeclaredMadeForKids\": false\n }\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PUT /baseUrl/youtube/v3/liveBroadcasts?part= HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 1333
{
"contentDetails": {
"boundStreamId": "",
"boundStreamLastUpdateTimeMs": "",
"closedCaptionsType": "",
"enableAutoStart": false,
"enableAutoStop": false,
"enableClosedCaptions": false,
"enableContentEncryption": false,
"enableDvr": false,
"enableEmbed": false,
"enableLowLatency": false,
"latencyPreference": "",
"mesh": "",
"monitorStream": {
"broadcastStreamDelayMs": 0,
"embedHtml": "",
"enableMonitorStream": false
},
"projection": "",
"recordFromStart": false,
"startWithSlate": false,
"stereoLayout": ""
},
"etag": "",
"id": "",
"kind": "",
"snippet": {
"actualEndTime": "",
"actualStartTime": "",
"channelId": "",
"description": "",
"isDefaultBroadcast": false,
"liveChatId": "",
"publishedAt": "",
"scheduledEndTime": "",
"scheduledStartTime": "",
"thumbnails": {
"high": {
"height": 0,
"url": "",
"width": 0
},
"maxres": {},
"medium": {},
"standard": {}
},
"title": ""
},
"statistics": {
"concurrentViewers": ""
},
"status": {
"lifeCycleStatus": "",
"liveBroadcastPriority": "",
"madeForKids": false,
"privacyStatus": "",
"recordingStatus": "",
"selfDeclaredMadeForKids": false
}
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/youtube/v3/liveBroadcasts?part=")
.setHeader("content-type", "application/json")
.setBody("{\n \"contentDetails\": {\n \"boundStreamId\": \"\",\n \"boundStreamLastUpdateTimeMs\": \"\",\n \"closedCaptionsType\": \"\",\n \"enableAutoStart\": false,\n \"enableAutoStop\": false,\n \"enableClosedCaptions\": false,\n \"enableContentEncryption\": false,\n \"enableDvr\": false,\n \"enableEmbed\": false,\n \"enableLowLatency\": false,\n \"latencyPreference\": \"\",\n \"mesh\": \"\",\n \"monitorStream\": {\n \"broadcastStreamDelayMs\": 0,\n \"embedHtml\": \"\",\n \"enableMonitorStream\": false\n },\n \"projection\": \"\",\n \"recordFromStart\": false,\n \"startWithSlate\": false,\n \"stereoLayout\": \"\"\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"actualEndTime\": \"\",\n \"actualStartTime\": \"\",\n \"channelId\": \"\",\n \"description\": \"\",\n \"isDefaultBroadcast\": false,\n \"liveChatId\": \"\",\n \"publishedAt\": \"\",\n \"scheduledEndTime\": \"\",\n \"scheduledStartTime\": \"\",\n \"thumbnails\": {\n \"high\": {\n \"height\": 0,\n \"url\": \"\",\n \"width\": 0\n },\n \"maxres\": {},\n \"medium\": {},\n \"standard\": {}\n },\n \"title\": \"\"\n },\n \"statistics\": {\n \"concurrentViewers\": \"\"\n },\n \"status\": {\n \"lifeCycleStatus\": \"\",\n \"liveBroadcastPriority\": \"\",\n \"madeForKids\": false,\n \"privacyStatus\": \"\",\n \"recordingStatus\": \"\",\n \"selfDeclaredMadeForKids\": false\n }\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/youtube/v3/liveBroadcasts?part="))
.header("content-type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString("{\n \"contentDetails\": {\n \"boundStreamId\": \"\",\n \"boundStreamLastUpdateTimeMs\": \"\",\n \"closedCaptionsType\": \"\",\n \"enableAutoStart\": false,\n \"enableAutoStop\": false,\n \"enableClosedCaptions\": false,\n \"enableContentEncryption\": false,\n \"enableDvr\": false,\n \"enableEmbed\": false,\n \"enableLowLatency\": false,\n \"latencyPreference\": \"\",\n \"mesh\": \"\",\n \"monitorStream\": {\n \"broadcastStreamDelayMs\": 0,\n \"embedHtml\": \"\",\n \"enableMonitorStream\": false\n },\n \"projection\": \"\",\n \"recordFromStart\": false,\n \"startWithSlate\": false,\n \"stereoLayout\": \"\"\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"actualEndTime\": \"\",\n \"actualStartTime\": \"\",\n \"channelId\": \"\",\n \"description\": \"\",\n \"isDefaultBroadcast\": false,\n \"liveChatId\": \"\",\n \"publishedAt\": \"\",\n \"scheduledEndTime\": \"\",\n \"scheduledStartTime\": \"\",\n \"thumbnails\": {\n \"high\": {\n \"height\": 0,\n \"url\": \"\",\n \"width\": 0\n },\n \"maxres\": {},\n \"medium\": {},\n \"standard\": {}\n },\n \"title\": \"\"\n },\n \"statistics\": {\n \"concurrentViewers\": \"\"\n },\n \"status\": {\n \"lifeCycleStatus\": \"\",\n \"liveBroadcastPriority\": \"\",\n \"madeForKids\": false,\n \"privacyStatus\": \"\",\n \"recordingStatus\": \"\",\n \"selfDeclaredMadeForKids\": false\n }\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"contentDetails\": {\n \"boundStreamId\": \"\",\n \"boundStreamLastUpdateTimeMs\": \"\",\n \"closedCaptionsType\": \"\",\n \"enableAutoStart\": false,\n \"enableAutoStop\": false,\n \"enableClosedCaptions\": false,\n \"enableContentEncryption\": false,\n \"enableDvr\": false,\n \"enableEmbed\": false,\n \"enableLowLatency\": false,\n \"latencyPreference\": \"\",\n \"mesh\": \"\",\n \"monitorStream\": {\n \"broadcastStreamDelayMs\": 0,\n \"embedHtml\": \"\",\n \"enableMonitorStream\": false\n },\n \"projection\": \"\",\n \"recordFromStart\": false,\n \"startWithSlate\": false,\n \"stereoLayout\": \"\"\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"actualEndTime\": \"\",\n \"actualStartTime\": \"\",\n \"channelId\": \"\",\n \"description\": \"\",\n \"isDefaultBroadcast\": false,\n \"liveChatId\": \"\",\n \"publishedAt\": \"\",\n \"scheduledEndTime\": \"\",\n \"scheduledStartTime\": \"\",\n \"thumbnails\": {\n \"high\": {\n \"height\": 0,\n \"url\": \"\",\n \"width\": 0\n },\n \"maxres\": {},\n \"medium\": {},\n \"standard\": {}\n },\n \"title\": \"\"\n },\n \"statistics\": {\n \"concurrentViewers\": \"\"\n },\n \"status\": {\n \"lifeCycleStatus\": \"\",\n \"liveBroadcastPriority\": \"\",\n \"madeForKids\": false,\n \"privacyStatus\": \"\",\n \"recordingStatus\": \"\",\n \"selfDeclaredMadeForKids\": false\n }\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/youtube/v3/liveBroadcasts?part=")
.put(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/youtube/v3/liveBroadcasts?part=")
.header("content-type", "application/json")
.body("{\n \"contentDetails\": {\n \"boundStreamId\": \"\",\n \"boundStreamLastUpdateTimeMs\": \"\",\n \"closedCaptionsType\": \"\",\n \"enableAutoStart\": false,\n \"enableAutoStop\": false,\n \"enableClosedCaptions\": false,\n \"enableContentEncryption\": false,\n \"enableDvr\": false,\n \"enableEmbed\": false,\n \"enableLowLatency\": false,\n \"latencyPreference\": \"\",\n \"mesh\": \"\",\n \"monitorStream\": {\n \"broadcastStreamDelayMs\": 0,\n \"embedHtml\": \"\",\n \"enableMonitorStream\": false\n },\n \"projection\": \"\",\n \"recordFromStart\": false,\n \"startWithSlate\": false,\n \"stereoLayout\": \"\"\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"actualEndTime\": \"\",\n \"actualStartTime\": \"\",\n \"channelId\": \"\",\n \"description\": \"\",\n \"isDefaultBroadcast\": false,\n \"liveChatId\": \"\",\n \"publishedAt\": \"\",\n \"scheduledEndTime\": \"\",\n \"scheduledStartTime\": \"\",\n \"thumbnails\": {\n \"high\": {\n \"height\": 0,\n \"url\": \"\",\n \"width\": 0\n },\n \"maxres\": {},\n \"medium\": {},\n \"standard\": {}\n },\n \"title\": \"\"\n },\n \"statistics\": {\n \"concurrentViewers\": \"\"\n },\n \"status\": {\n \"lifeCycleStatus\": \"\",\n \"liveBroadcastPriority\": \"\",\n \"madeForKids\": false,\n \"privacyStatus\": \"\",\n \"recordingStatus\": \"\",\n \"selfDeclaredMadeForKids\": false\n }\n}")
.asString();
const data = JSON.stringify({
contentDetails: {
boundStreamId: '',
boundStreamLastUpdateTimeMs: '',
closedCaptionsType: '',
enableAutoStart: false,
enableAutoStop: false,
enableClosedCaptions: false,
enableContentEncryption: false,
enableDvr: false,
enableEmbed: false,
enableLowLatency: false,
latencyPreference: '',
mesh: '',
monitorStream: {
broadcastStreamDelayMs: 0,
embedHtml: '',
enableMonitorStream: false
},
projection: '',
recordFromStart: false,
startWithSlate: false,
stereoLayout: ''
},
etag: '',
id: '',
kind: '',
snippet: {
actualEndTime: '',
actualStartTime: '',
channelId: '',
description: '',
isDefaultBroadcast: false,
liveChatId: '',
publishedAt: '',
scheduledEndTime: '',
scheduledStartTime: '',
thumbnails: {
high: {
height: 0,
url: '',
width: 0
},
maxres: {},
medium: {},
standard: {}
},
title: ''
},
statistics: {
concurrentViewers: ''
},
status: {
lifeCycleStatus: '',
liveBroadcastPriority: '',
madeForKids: false,
privacyStatus: '',
recordingStatus: '',
selfDeclaredMadeForKids: false
}
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/youtube/v3/liveBroadcasts?part=');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/youtube/v3/liveBroadcasts',
params: {part: ''},
headers: {'content-type': 'application/json'},
data: {
contentDetails: {
boundStreamId: '',
boundStreamLastUpdateTimeMs: '',
closedCaptionsType: '',
enableAutoStart: false,
enableAutoStop: false,
enableClosedCaptions: false,
enableContentEncryption: false,
enableDvr: false,
enableEmbed: false,
enableLowLatency: false,
latencyPreference: '',
mesh: '',
monitorStream: {broadcastStreamDelayMs: 0, embedHtml: '', enableMonitorStream: false},
projection: '',
recordFromStart: false,
startWithSlate: false,
stereoLayout: ''
},
etag: '',
id: '',
kind: '',
snippet: {
actualEndTime: '',
actualStartTime: '',
channelId: '',
description: '',
isDefaultBroadcast: false,
liveChatId: '',
publishedAt: '',
scheduledEndTime: '',
scheduledStartTime: '',
thumbnails: {high: {height: 0, url: '', width: 0}, maxres: {}, medium: {}, standard: {}},
title: ''
},
statistics: {concurrentViewers: ''},
status: {
lifeCycleStatus: '',
liveBroadcastPriority: '',
madeForKids: false,
privacyStatus: '',
recordingStatus: '',
selfDeclaredMadeForKids: false
}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/youtube/v3/liveBroadcasts?part=';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"contentDetails":{"boundStreamId":"","boundStreamLastUpdateTimeMs":"","closedCaptionsType":"","enableAutoStart":false,"enableAutoStop":false,"enableClosedCaptions":false,"enableContentEncryption":false,"enableDvr":false,"enableEmbed":false,"enableLowLatency":false,"latencyPreference":"","mesh":"","monitorStream":{"broadcastStreamDelayMs":0,"embedHtml":"","enableMonitorStream":false},"projection":"","recordFromStart":false,"startWithSlate":false,"stereoLayout":""},"etag":"","id":"","kind":"","snippet":{"actualEndTime":"","actualStartTime":"","channelId":"","description":"","isDefaultBroadcast":false,"liveChatId":"","publishedAt":"","scheduledEndTime":"","scheduledStartTime":"","thumbnails":{"high":{"height":0,"url":"","width":0},"maxres":{},"medium":{},"standard":{}},"title":""},"statistics":{"concurrentViewers":""},"status":{"lifeCycleStatus":"","liveBroadcastPriority":"","madeForKids":false,"privacyStatus":"","recordingStatus":"","selfDeclaredMadeForKids":false}}'
};
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}}/youtube/v3/liveBroadcasts?part=',
method: 'PUT',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "contentDetails": {\n "boundStreamId": "",\n "boundStreamLastUpdateTimeMs": "",\n "closedCaptionsType": "",\n "enableAutoStart": false,\n "enableAutoStop": false,\n "enableClosedCaptions": false,\n "enableContentEncryption": false,\n "enableDvr": false,\n "enableEmbed": false,\n "enableLowLatency": false,\n "latencyPreference": "",\n "mesh": "",\n "monitorStream": {\n "broadcastStreamDelayMs": 0,\n "embedHtml": "",\n "enableMonitorStream": false\n },\n "projection": "",\n "recordFromStart": false,\n "startWithSlate": false,\n "stereoLayout": ""\n },\n "etag": "",\n "id": "",\n "kind": "",\n "snippet": {\n "actualEndTime": "",\n "actualStartTime": "",\n "channelId": "",\n "description": "",\n "isDefaultBroadcast": false,\n "liveChatId": "",\n "publishedAt": "",\n "scheduledEndTime": "",\n "scheduledStartTime": "",\n "thumbnails": {\n "high": {\n "height": 0,\n "url": "",\n "width": 0\n },\n "maxres": {},\n "medium": {},\n "standard": {}\n },\n "title": ""\n },\n "statistics": {\n "concurrentViewers": ""\n },\n "status": {\n "lifeCycleStatus": "",\n "liveBroadcastPriority": "",\n "madeForKids": false,\n "privacyStatus": "",\n "recordingStatus": "",\n "selfDeclaredMadeForKids": false\n }\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"contentDetails\": {\n \"boundStreamId\": \"\",\n \"boundStreamLastUpdateTimeMs\": \"\",\n \"closedCaptionsType\": \"\",\n \"enableAutoStart\": false,\n \"enableAutoStop\": false,\n \"enableClosedCaptions\": false,\n \"enableContentEncryption\": false,\n \"enableDvr\": false,\n \"enableEmbed\": false,\n \"enableLowLatency\": false,\n \"latencyPreference\": \"\",\n \"mesh\": \"\",\n \"monitorStream\": {\n \"broadcastStreamDelayMs\": 0,\n \"embedHtml\": \"\",\n \"enableMonitorStream\": false\n },\n \"projection\": \"\",\n \"recordFromStart\": false,\n \"startWithSlate\": false,\n \"stereoLayout\": \"\"\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"actualEndTime\": \"\",\n \"actualStartTime\": \"\",\n \"channelId\": \"\",\n \"description\": \"\",\n \"isDefaultBroadcast\": false,\n \"liveChatId\": \"\",\n \"publishedAt\": \"\",\n \"scheduledEndTime\": \"\",\n \"scheduledStartTime\": \"\",\n \"thumbnails\": {\n \"high\": {\n \"height\": 0,\n \"url\": \"\",\n \"width\": 0\n },\n \"maxres\": {},\n \"medium\": {},\n \"standard\": {}\n },\n \"title\": \"\"\n },\n \"statistics\": {\n \"concurrentViewers\": \"\"\n },\n \"status\": {\n \"lifeCycleStatus\": \"\",\n \"liveBroadcastPriority\": \"\",\n \"madeForKids\": false,\n \"privacyStatus\": \"\",\n \"recordingStatus\": \"\",\n \"selfDeclaredMadeForKids\": false\n }\n}")
val request = Request.Builder()
.url("{{baseUrl}}/youtube/v3/liveBroadcasts?part=")
.put(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PUT',
hostname: 'example.com',
port: null,
path: '/baseUrl/youtube/v3/liveBroadcasts?part=',
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({
contentDetails: {
boundStreamId: '',
boundStreamLastUpdateTimeMs: '',
closedCaptionsType: '',
enableAutoStart: false,
enableAutoStop: false,
enableClosedCaptions: false,
enableContentEncryption: false,
enableDvr: false,
enableEmbed: false,
enableLowLatency: false,
latencyPreference: '',
mesh: '',
monitorStream: {broadcastStreamDelayMs: 0, embedHtml: '', enableMonitorStream: false},
projection: '',
recordFromStart: false,
startWithSlate: false,
stereoLayout: ''
},
etag: '',
id: '',
kind: '',
snippet: {
actualEndTime: '',
actualStartTime: '',
channelId: '',
description: '',
isDefaultBroadcast: false,
liveChatId: '',
publishedAt: '',
scheduledEndTime: '',
scheduledStartTime: '',
thumbnails: {high: {height: 0, url: '', width: 0}, maxres: {}, medium: {}, standard: {}},
title: ''
},
statistics: {concurrentViewers: ''},
status: {
lifeCycleStatus: '',
liveBroadcastPriority: '',
madeForKids: false,
privacyStatus: '',
recordingStatus: '',
selfDeclaredMadeForKids: false
}
}));
req.end();
const request = require('request');
const options = {
method: 'PUT',
url: '{{baseUrl}}/youtube/v3/liveBroadcasts',
qs: {part: ''},
headers: {'content-type': 'application/json'},
body: {
contentDetails: {
boundStreamId: '',
boundStreamLastUpdateTimeMs: '',
closedCaptionsType: '',
enableAutoStart: false,
enableAutoStop: false,
enableClosedCaptions: false,
enableContentEncryption: false,
enableDvr: false,
enableEmbed: false,
enableLowLatency: false,
latencyPreference: '',
mesh: '',
monitorStream: {broadcastStreamDelayMs: 0, embedHtml: '', enableMonitorStream: false},
projection: '',
recordFromStart: false,
startWithSlate: false,
stereoLayout: ''
},
etag: '',
id: '',
kind: '',
snippet: {
actualEndTime: '',
actualStartTime: '',
channelId: '',
description: '',
isDefaultBroadcast: false,
liveChatId: '',
publishedAt: '',
scheduledEndTime: '',
scheduledStartTime: '',
thumbnails: {high: {height: 0, url: '', width: 0}, maxres: {}, medium: {}, standard: {}},
title: ''
},
statistics: {concurrentViewers: ''},
status: {
lifeCycleStatus: '',
liveBroadcastPriority: '',
madeForKids: false,
privacyStatus: '',
recordingStatus: '',
selfDeclaredMadeForKids: false
}
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PUT', '{{baseUrl}}/youtube/v3/liveBroadcasts');
req.query({
part: ''
});
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
contentDetails: {
boundStreamId: '',
boundStreamLastUpdateTimeMs: '',
closedCaptionsType: '',
enableAutoStart: false,
enableAutoStop: false,
enableClosedCaptions: false,
enableContentEncryption: false,
enableDvr: false,
enableEmbed: false,
enableLowLatency: false,
latencyPreference: '',
mesh: '',
monitorStream: {
broadcastStreamDelayMs: 0,
embedHtml: '',
enableMonitorStream: false
},
projection: '',
recordFromStart: false,
startWithSlate: false,
stereoLayout: ''
},
etag: '',
id: '',
kind: '',
snippet: {
actualEndTime: '',
actualStartTime: '',
channelId: '',
description: '',
isDefaultBroadcast: false,
liveChatId: '',
publishedAt: '',
scheduledEndTime: '',
scheduledStartTime: '',
thumbnails: {
high: {
height: 0,
url: '',
width: 0
},
maxres: {},
medium: {},
standard: {}
},
title: ''
},
statistics: {
concurrentViewers: ''
},
status: {
lifeCycleStatus: '',
liveBroadcastPriority: '',
madeForKids: false,
privacyStatus: '',
recordingStatus: '',
selfDeclaredMadeForKids: false
}
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'PUT',
url: '{{baseUrl}}/youtube/v3/liveBroadcasts',
params: {part: ''},
headers: {'content-type': 'application/json'},
data: {
contentDetails: {
boundStreamId: '',
boundStreamLastUpdateTimeMs: '',
closedCaptionsType: '',
enableAutoStart: false,
enableAutoStop: false,
enableClosedCaptions: false,
enableContentEncryption: false,
enableDvr: false,
enableEmbed: false,
enableLowLatency: false,
latencyPreference: '',
mesh: '',
monitorStream: {broadcastStreamDelayMs: 0, embedHtml: '', enableMonitorStream: false},
projection: '',
recordFromStart: false,
startWithSlate: false,
stereoLayout: ''
},
etag: '',
id: '',
kind: '',
snippet: {
actualEndTime: '',
actualStartTime: '',
channelId: '',
description: '',
isDefaultBroadcast: false,
liveChatId: '',
publishedAt: '',
scheduledEndTime: '',
scheduledStartTime: '',
thumbnails: {high: {height: 0, url: '', width: 0}, maxres: {}, medium: {}, standard: {}},
title: ''
},
statistics: {concurrentViewers: ''},
status: {
lifeCycleStatus: '',
liveBroadcastPriority: '',
madeForKids: false,
privacyStatus: '',
recordingStatus: '',
selfDeclaredMadeForKids: false
}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/youtube/v3/liveBroadcasts?part=';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"contentDetails":{"boundStreamId":"","boundStreamLastUpdateTimeMs":"","closedCaptionsType":"","enableAutoStart":false,"enableAutoStop":false,"enableClosedCaptions":false,"enableContentEncryption":false,"enableDvr":false,"enableEmbed":false,"enableLowLatency":false,"latencyPreference":"","mesh":"","monitorStream":{"broadcastStreamDelayMs":0,"embedHtml":"","enableMonitorStream":false},"projection":"","recordFromStart":false,"startWithSlate":false,"stereoLayout":""},"etag":"","id":"","kind":"","snippet":{"actualEndTime":"","actualStartTime":"","channelId":"","description":"","isDefaultBroadcast":false,"liveChatId":"","publishedAt":"","scheduledEndTime":"","scheduledStartTime":"","thumbnails":{"high":{"height":0,"url":"","width":0},"maxres":{},"medium":{},"standard":{}},"title":""},"statistics":{"concurrentViewers":""},"status":{"lifeCycleStatus":"","liveBroadcastPriority":"","madeForKids":false,"privacyStatus":"","recordingStatus":"","selfDeclaredMadeForKids":false}}'
};
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 = @{ @"contentDetails": @{ @"boundStreamId": @"", @"boundStreamLastUpdateTimeMs": @"", @"closedCaptionsType": @"", @"enableAutoStart": @NO, @"enableAutoStop": @NO, @"enableClosedCaptions": @NO, @"enableContentEncryption": @NO, @"enableDvr": @NO, @"enableEmbed": @NO, @"enableLowLatency": @NO, @"latencyPreference": @"", @"mesh": @"", @"monitorStream": @{ @"broadcastStreamDelayMs": @0, @"embedHtml": @"", @"enableMonitorStream": @NO }, @"projection": @"", @"recordFromStart": @NO, @"startWithSlate": @NO, @"stereoLayout": @"" },
@"etag": @"",
@"id": @"",
@"kind": @"",
@"snippet": @{ @"actualEndTime": @"", @"actualStartTime": @"", @"channelId": @"", @"description": @"", @"isDefaultBroadcast": @NO, @"liveChatId": @"", @"publishedAt": @"", @"scheduledEndTime": @"", @"scheduledStartTime": @"", @"thumbnails": @{ @"high": @{ @"height": @0, @"url": @"", @"width": @0 }, @"maxres": @{ }, @"medium": @{ }, @"standard": @{ } }, @"title": @"" },
@"statistics": @{ @"concurrentViewers": @"" },
@"status": @{ @"lifeCycleStatus": @"", @"liveBroadcastPriority": @"", @"madeForKids": @NO, @"privacyStatus": @"", @"recordingStatus": @"", @"selfDeclaredMadeForKids": @NO } };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/youtube/v3/liveBroadcasts?part="]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PUT"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/youtube/v3/liveBroadcasts?part=" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"contentDetails\": {\n \"boundStreamId\": \"\",\n \"boundStreamLastUpdateTimeMs\": \"\",\n \"closedCaptionsType\": \"\",\n \"enableAutoStart\": false,\n \"enableAutoStop\": false,\n \"enableClosedCaptions\": false,\n \"enableContentEncryption\": false,\n \"enableDvr\": false,\n \"enableEmbed\": false,\n \"enableLowLatency\": false,\n \"latencyPreference\": \"\",\n \"mesh\": \"\",\n \"monitorStream\": {\n \"broadcastStreamDelayMs\": 0,\n \"embedHtml\": \"\",\n \"enableMonitorStream\": false\n },\n \"projection\": \"\",\n \"recordFromStart\": false,\n \"startWithSlate\": false,\n \"stereoLayout\": \"\"\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"actualEndTime\": \"\",\n \"actualStartTime\": \"\",\n \"channelId\": \"\",\n \"description\": \"\",\n \"isDefaultBroadcast\": false,\n \"liveChatId\": \"\",\n \"publishedAt\": \"\",\n \"scheduledEndTime\": \"\",\n \"scheduledStartTime\": \"\",\n \"thumbnails\": {\n \"high\": {\n \"height\": 0,\n \"url\": \"\",\n \"width\": 0\n },\n \"maxres\": {},\n \"medium\": {},\n \"standard\": {}\n },\n \"title\": \"\"\n },\n \"statistics\": {\n \"concurrentViewers\": \"\"\n },\n \"status\": {\n \"lifeCycleStatus\": \"\",\n \"liveBroadcastPriority\": \"\",\n \"madeForKids\": false,\n \"privacyStatus\": \"\",\n \"recordingStatus\": \"\",\n \"selfDeclaredMadeForKids\": false\n }\n}" in
Client.call ~headers ~body `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/youtube/v3/liveBroadcasts?part=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'contentDetails' => [
'boundStreamId' => '',
'boundStreamLastUpdateTimeMs' => '',
'closedCaptionsType' => '',
'enableAutoStart' => null,
'enableAutoStop' => null,
'enableClosedCaptions' => null,
'enableContentEncryption' => null,
'enableDvr' => null,
'enableEmbed' => null,
'enableLowLatency' => null,
'latencyPreference' => '',
'mesh' => '',
'monitorStream' => [
'broadcastStreamDelayMs' => 0,
'embedHtml' => '',
'enableMonitorStream' => null
],
'projection' => '',
'recordFromStart' => null,
'startWithSlate' => null,
'stereoLayout' => ''
],
'etag' => '',
'id' => '',
'kind' => '',
'snippet' => [
'actualEndTime' => '',
'actualStartTime' => '',
'channelId' => '',
'description' => '',
'isDefaultBroadcast' => null,
'liveChatId' => '',
'publishedAt' => '',
'scheduledEndTime' => '',
'scheduledStartTime' => '',
'thumbnails' => [
'high' => [
'height' => 0,
'url' => '',
'width' => 0
],
'maxres' => [
],
'medium' => [
],
'standard' => [
]
],
'title' => ''
],
'statistics' => [
'concurrentViewers' => ''
],
'status' => [
'lifeCycleStatus' => '',
'liveBroadcastPriority' => '',
'madeForKids' => null,
'privacyStatus' => '',
'recordingStatus' => '',
'selfDeclaredMadeForKids' => null
]
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('PUT', '{{baseUrl}}/youtube/v3/liveBroadcasts?part=', [
'body' => '{
"contentDetails": {
"boundStreamId": "",
"boundStreamLastUpdateTimeMs": "",
"closedCaptionsType": "",
"enableAutoStart": false,
"enableAutoStop": false,
"enableClosedCaptions": false,
"enableContentEncryption": false,
"enableDvr": false,
"enableEmbed": false,
"enableLowLatency": false,
"latencyPreference": "",
"mesh": "",
"monitorStream": {
"broadcastStreamDelayMs": 0,
"embedHtml": "",
"enableMonitorStream": false
},
"projection": "",
"recordFromStart": false,
"startWithSlate": false,
"stereoLayout": ""
},
"etag": "",
"id": "",
"kind": "",
"snippet": {
"actualEndTime": "",
"actualStartTime": "",
"channelId": "",
"description": "",
"isDefaultBroadcast": false,
"liveChatId": "",
"publishedAt": "",
"scheduledEndTime": "",
"scheduledStartTime": "",
"thumbnails": {
"high": {
"height": 0,
"url": "",
"width": 0
},
"maxres": {},
"medium": {},
"standard": {}
},
"title": ""
},
"statistics": {
"concurrentViewers": ""
},
"status": {
"lifeCycleStatus": "",
"liveBroadcastPriority": "",
"madeForKids": false,
"privacyStatus": "",
"recordingStatus": "",
"selfDeclaredMadeForKids": false
}
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/youtube/v3/liveBroadcasts');
$request->setMethod(HTTP_METH_PUT);
$request->setQueryData([
'part' => ''
]);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'contentDetails' => [
'boundStreamId' => '',
'boundStreamLastUpdateTimeMs' => '',
'closedCaptionsType' => '',
'enableAutoStart' => null,
'enableAutoStop' => null,
'enableClosedCaptions' => null,
'enableContentEncryption' => null,
'enableDvr' => null,
'enableEmbed' => null,
'enableLowLatency' => null,
'latencyPreference' => '',
'mesh' => '',
'monitorStream' => [
'broadcastStreamDelayMs' => 0,
'embedHtml' => '',
'enableMonitorStream' => null
],
'projection' => '',
'recordFromStart' => null,
'startWithSlate' => null,
'stereoLayout' => ''
],
'etag' => '',
'id' => '',
'kind' => '',
'snippet' => [
'actualEndTime' => '',
'actualStartTime' => '',
'channelId' => '',
'description' => '',
'isDefaultBroadcast' => null,
'liveChatId' => '',
'publishedAt' => '',
'scheduledEndTime' => '',
'scheduledStartTime' => '',
'thumbnails' => [
'high' => [
'height' => 0,
'url' => '',
'width' => 0
],
'maxres' => [
],
'medium' => [
],
'standard' => [
]
],
'title' => ''
],
'statistics' => [
'concurrentViewers' => ''
],
'status' => [
'lifeCycleStatus' => '',
'liveBroadcastPriority' => '',
'madeForKids' => null,
'privacyStatus' => '',
'recordingStatus' => '',
'selfDeclaredMadeForKids' => null
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'contentDetails' => [
'boundStreamId' => '',
'boundStreamLastUpdateTimeMs' => '',
'closedCaptionsType' => '',
'enableAutoStart' => null,
'enableAutoStop' => null,
'enableClosedCaptions' => null,
'enableContentEncryption' => null,
'enableDvr' => null,
'enableEmbed' => null,
'enableLowLatency' => null,
'latencyPreference' => '',
'mesh' => '',
'monitorStream' => [
'broadcastStreamDelayMs' => 0,
'embedHtml' => '',
'enableMonitorStream' => null
],
'projection' => '',
'recordFromStart' => null,
'startWithSlate' => null,
'stereoLayout' => ''
],
'etag' => '',
'id' => '',
'kind' => '',
'snippet' => [
'actualEndTime' => '',
'actualStartTime' => '',
'channelId' => '',
'description' => '',
'isDefaultBroadcast' => null,
'liveChatId' => '',
'publishedAt' => '',
'scheduledEndTime' => '',
'scheduledStartTime' => '',
'thumbnails' => [
'high' => [
'height' => 0,
'url' => '',
'width' => 0
],
'maxres' => [
],
'medium' => [
],
'standard' => [
]
],
'title' => ''
],
'statistics' => [
'concurrentViewers' => ''
],
'status' => [
'lifeCycleStatus' => '',
'liveBroadcastPriority' => '',
'madeForKids' => null,
'privacyStatus' => '',
'recordingStatus' => '',
'selfDeclaredMadeForKids' => null
]
]));
$request->setRequestUrl('{{baseUrl}}/youtube/v3/liveBroadcasts');
$request->setRequestMethod('PUT');
$request->setBody($body);
$request->setQuery(new http\QueryString([
'part' => ''
]));
$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}}/youtube/v3/liveBroadcasts?part=' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"contentDetails": {
"boundStreamId": "",
"boundStreamLastUpdateTimeMs": "",
"closedCaptionsType": "",
"enableAutoStart": false,
"enableAutoStop": false,
"enableClosedCaptions": false,
"enableContentEncryption": false,
"enableDvr": false,
"enableEmbed": false,
"enableLowLatency": false,
"latencyPreference": "",
"mesh": "",
"monitorStream": {
"broadcastStreamDelayMs": 0,
"embedHtml": "",
"enableMonitorStream": false
},
"projection": "",
"recordFromStart": false,
"startWithSlate": false,
"stereoLayout": ""
},
"etag": "",
"id": "",
"kind": "",
"snippet": {
"actualEndTime": "",
"actualStartTime": "",
"channelId": "",
"description": "",
"isDefaultBroadcast": false,
"liveChatId": "",
"publishedAt": "",
"scheduledEndTime": "",
"scheduledStartTime": "",
"thumbnails": {
"high": {
"height": 0,
"url": "",
"width": 0
},
"maxres": {},
"medium": {},
"standard": {}
},
"title": ""
},
"statistics": {
"concurrentViewers": ""
},
"status": {
"lifeCycleStatus": "",
"liveBroadcastPriority": "",
"madeForKids": false,
"privacyStatus": "",
"recordingStatus": "",
"selfDeclaredMadeForKids": false
}
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/youtube/v3/liveBroadcasts?part=' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"contentDetails": {
"boundStreamId": "",
"boundStreamLastUpdateTimeMs": "",
"closedCaptionsType": "",
"enableAutoStart": false,
"enableAutoStop": false,
"enableClosedCaptions": false,
"enableContentEncryption": false,
"enableDvr": false,
"enableEmbed": false,
"enableLowLatency": false,
"latencyPreference": "",
"mesh": "",
"monitorStream": {
"broadcastStreamDelayMs": 0,
"embedHtml": "",
"enableMonitorStream": false
},
"projection": "",
"recordFromStart": false,
"startWithSlate": false,
"stereoLayout": ""
},
"etag": "",
"id": "",
"kind": "",
"snippet": {
"actualEndTime": "",
"actualStartTime": "",
"channelId": "",
"description": "",
"isDefaultBroadcast": false,
"liveChatId": "",
"publishedAt": "",
"scheduledEndTime": "",
"scheduledStartTime": "",
"thumbnails": {
"high": {
"height": 0,
"url": "",
"width": 0
},
"maxres": {},
"medium": {},
"standard": {}
},
"title": ""
},
"statistics": {
"concurrentViewers": ""
},
"status": {
"lifeCycleStatus": "",
"liveBroadcastPriority": "",
"madeForKids": false,
"privacyStatus": "",
"recordingStatus": "",
"selfDeclaredMadeForKids": false
}
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"contentDetails\": {\n \"boundStreamId\": \"\",\n \"boundStreamLastUpdateTimeMs\": \"\",\n \"closedCaptionsType\": \"\",\n \"enableAutoStart\": false,\n \"enableAutoStop\": false,\n \"enableClosedCaptions\": false,\n \"enableContentEncryption\": false,\n \"enableDvr\": false,\n \"enableEmbed\": false,\n \"enableLowLatency\": false,\n \"latencyPreference\": \"\",\n \"mesh\": \"\",\n \"monitorStream\": {\n \"broadcastStreamDelayMs\": 0,\n \"embedHtml\": \"\",\n \"enableMonitorStream\": false\n },\n \"projection\": \"\",\n \"recordFromStart\": false,\n \"startWithSlate\": false,\n \"stereoLayout\": \"\"\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"actualEndTime\": \"\",\n \"actualStartTime\": \"\",\n \"channelId\": \"\",\n \"description\": \"\",\n \"isDefaultBroadcast\": false,\n \"liveChatId\": \"\",\n \"publishedAt\": \"\",\n \"scheduledEndTime\": \"\",\n \"scheduledStartTime\": \"\",\n \"thumbnails\": {\n \"high\": {\n \"height\": 0,\n \"url\": \"\",\n \"width\": 0\n },\n \"maxres\": {},\n \"medium\": {},\n \"standard\": {}\n },\n \"title\": \"\"\n },\n \"statistics\": {\n \"concurrentViewers\": \"\"\n },\n \"status\": {\n \"lifeCycleStatus\": \"\",\n \"liveBroadcastPriority\": \"\",\n \"madeForKids\": false,\n \"privacyStatus\": \"\",\n \"recordingStatus\": \"\",\n \"selfDeclaredMadeForKids\": false\n }\n}"
headers = { 'content-type': "application/json" }
conn.request("PUT", "/baseUrl/youtube/v3/liveBroadcasts?part=", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/youtube/v3/liveBroadcasts"
querystring = {"part":""}
payload = {
"contentDetails": {
"boundStreamId": "",
"boundStreamLastUpdateTimeMs": "",
"closedCaptionsType": "",
"enableAutoStart": False,
"enableAutoStop": False,
"enableClosedCaptions": False,
"enableContentEncryption": False,
"enableDvr": False,
"enableEmbed": False,
"enableLowLatency": False,
"latencyPreference": "",
"mesh": "",
"monitorStream": {
"broadcastStreamDelayMs": 0,
"embedHtml": "",
"enableMonitorStream": False
},
"projection": "",
"recordFromStart": False,
"startWithSlate": False,
"stereoLayout": ""
},
"etag": "",
"id": "",
"kind": "",
"snippet": {
"actualEndTime": "",
"actualStartTime": "",
"channelId": "",
"description": "",
"isDefaultBroadcast": False,
"liveChatId": "",
"publishedAt": "",
"scheduledEndTime": "",
"scheduledStartTime": "",
"thumbnails": {
"high": {
"height": 0,
"url": "",
"width": 0
},
"maxres": {},
"medium": {},
"standard": {}
},
"title": ""
},
"statistics": { "concurrentViewers": "" },
"status": {
"lifeCycleStatus": "",
"liveBroadcastPriority": "",
"madeForKids": False,
"privacyStatus": "",
"recordingStatus": "",
"selfDeclaredMadeForKids": False
}
}
headers = {"content-type": "application/json"}
response = requests.put(url, json=payload, headers=headers, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/youtube/v3/liveBroadcasts"
queryString <- list(part = "")
payload <- "{\n \"contentDetails\": {\n \"boundStreamId\": \"\",\n \"boundStreamLastUpdateTimeMs\": \"\",\n \"closedCaptionsType\": \"\",\n \"enableAutoStart\": false,\n \"enableAutoStop\": false,\n \"enableClosedCaptions\": false,\n \"enableContentEncryption\": false,\n \"enableDvr\": false,\n \"enableEmbed\": false,\n \"enableLowLatency\": false,\n \"latencyPreference\": \"\",\n \"mesh\": \"\",\n \"monitorStream\": {\n \"broadcastStreamDelayMs\": 0,\n \"embedHtml\": \"\",\n \"enableMonitorStream\": false\n },\n \"projection\": \"\",\n \"recordFromStart\": false,\n \"startWithSlate\": false,\n \"stereoLayout\": \"\"\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"actualEndTime\": \"\",\n \"actualStartTime\": \"\",\n \"channelId\": \"\",\n \"description\": \"\",\n \"isDefaultBroadcast\": false,\n \"liveChatId\": \"\",\n \"publishedAt\": \"\",\n \"scheduledEndTime\": \"\",\n \"scheduledStartTime\": \"\",\n \"thumbnails\": {\n \"high\": {\n \"height\": 0,\n \"url\": \"\",\n \"width\": 0\n },\n \"maxres\": {},\n \"medium\": {},\n \"standard\": {}\n },\n \"title\": \"\"\n },\n \"statistics\": {\n \"concurrentViewers\": \"\"\n },\n \"status\": {\n \"lifeCycleStatus\": \"\",\n \"liveBroadcastPriority\": \"\",\n \"madeForKids\": false,\n \"privacyStatus\": \"\",\n \"recordingStatus\": \"\",\n \"selfDeclaredMadeForKids\": false\n }\n}"
encode <- "json"
response <- VERB("PUT", url, body = payload, query = queryString, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/youtube/v3/liveBroadcasts?part=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"contentDetails\": {\n \"boundStreamId\": \"\",\n \"boundStreamLastUpdateTimeMs\": \"\",\n \"closedCaptionsType\": \"\",\n \"enableAutoStart\": false,\n \"enableAutoStop\": false,\n \"enableClosedCaptions\": false,\n \"enableContentEncryption\": false,\n \"enableDvr\": false,\n \"enableEmbed\": false,\n \"enableLowLatency\": false,\n \"latencyPreference\": \"\",\n \"mesh\": \"\",\n \"monitorStream\": {\n \"broadcastStreamDelayMs\": 0,\n \"embedHtml\": \"\",\n \"enableMonitorStream\": false\n },\n \"projection\": \"\",\n \"recordFromStart\": false,\n \"startWithSlate\": false,\n \"stereoLayout\": \"\"\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"actualEndTime\": \"\",\n \"actualStartTime\": \"\",\n \"channelId\": \"\",\n \"description\": \"\",\n \"isDefaultBroadcast\": false,\n \"liveChatId\": \"\",\n \"publishedAt\": \"\",\n \"scheduledEndTime\": \"\",\n \"scheduledStartTime\": \"\",\n \"thumbnails\": {\n \"high\": {\n \"height\": 0,\n \"url\": \"\",\n \"width\": 0\n },\n \"maxres\": {},\n \"medium\": {},\n \"standard\": {}\n },\n \"title\": \"\"\n },\n \"statistics\": {\n \"concurrentViewers\": \"\"\n },\n \"status\": {\n \"lifeCycleStatus\": \"\",\n \"liveBroadcastPriority\": \"\",\n \"madeForKids\": false,\n \"privacyStatus\": \"\",\n \"recordingStatus\": \"\",\n \"selfDeclaredMadeForKids\": false\n }\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.put('/baseUrl/youtube/v3/liveBroadcasts') do |req|
req.params['part'] = ''
req.body = "{\n \"contentDetails\": {\n \"boundStreamId\": \"\",\n \"boundStreamLastUpdateTimeMs\": \"\",\n \"closedCaptionsType\": \"\",\n \"enableAutoStart\": false,\n \"enableAutoStop\": false,\n \"enableClosedCaptions\": false,\n \"enableContentEncryption\": false,\n \"enableDvr\": false,\n \"enableEmbed\": false,\n \"enableLowLatency\": false,\n \"latencyPreference\": \"\",\n \"mesh\": \"\",\n \"monitorStream\": {\n \"broadcastStreamDelayMs\": 0,\n \"embedHtml\": \"\",\n \"enableMonitorStream\": false\n },\n \"projection\": \"\",\n \"recordFromStart\": false,\n \"startWithSlate\": false,\n \"stereoLayout\": \"\"\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"actualEndTime\": \"\",\n \"actualStartTime\": \"\",\n \"channelId\": \"\",\n \"description\": \"\",\n \"isDefaultBroadcast\": false,\n \"liveChatId\": \"\",\n \"publishedAt\": \"\",\n \"scheduledEndTime\": \"\",\n \"scheduledStartTime\": \"\",\n \"thumbnails\": {\n \"high\": {\n \"height\": 0,\n \"url\": \"\",\n \"width\": 0\n },\n \"maxres\": {},\n \"medium\": {},\n \"standard\": {}\n },\n \"title\": \"\"\n },\n \"statistics\": {\n \"concurrentViewers\": \"\"\n },\n \"status\": {\n \"lifeCycleStatus\": \"\",\n \"liveBroadcastPriority\": \"\",\n \"madeForKids\": false,\n \"privacyStatus\": \"\",\n \"recordingStatus\": \"\",\n \"selfDeclaredMadeForKids\": false\n }\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}}/youtube/v3/liveBroadcasts";
let querystring = [
("part", ""),
];
let payload = json!({
"contentDetails": json!({
"boundStreamId": "",
"boundStreamLastUpdateTimeMs": "",
"closedCaptionsType": "",
"enableAutoStart": false,
"enableAutoStop": false,
"enableClosedCaptions": false,
"enableContentEncryption": false,
"enableDvr": false,
"enableEmbed": false,
"enableLowLatency": false,
"latencyPreference": "",
"mesh": "",
"monitorStream": json!({
"broadcastStreamDelayMs": 0,
"embedHtml": "",
"enableMonitorStream": false
}),
"projection": "",
"recordFromStart": false,
"startWithSlate": false,
"stereoLayout": ""
}),
"etag": "",
"id": "",
"kind": "",
"snippet": json!({
"actualEndTime": "",
"actualStartTime": "",
"channelId": "",
"description": "",
"isDefaultBroadcast": false,
"liveChatId": "",
"publishedAt": "",
"scheduledEndTime": "",
"scheduledStartTime": "",
"thumbnails": json!({
"high": json!({
"height": 0,
"url": "",
"width": 0
}),
"maxres": json!({}),
"medium": json!({}),
"standard": json!({})
}),
"title": ""
}),
"statistics": json!({"concurrentViewers": ""}),
"status": json!({
"lifeCycleStatus": "",
"liveBroadcastPriority": "",
"madeForKids": false,
"privacyStatus": "",
"recordingStatus": "",
"selfDeclaredMadeForKids": false
})
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PUT").unwrap(), url)
.query(&querystring)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PUT \
--url '{{baseUrl}}/youtube/v3/liveBroadcasts?part=' \
--header 'content-type: application/json' \
--data '{
"contentDetails": {
"boundStreamId": "",
"boundStreamLastUpdateTimeMs": "",
"closedCaptionsType": "",
"enableAutoStart": false,
"enableAutoStop": false,
"enableClosedCaptions": false,
"enableContentEncryption": false,
"enableDvr": false,
"enableEmbed": false,
"enableLowLatency": false,
"latencyPreference": "",
"mesh": "",
"monitorStream": {
"broadcastStreamDelayMs": 0,
"embedHtml": "",
"enableMonitorStream": false
},
"projection": "",
"recordFromStart": false,
"startWithSlate": false,
"stereoLayout": ""
},
"etag": "",
"id": "",
"kind": "",
"snippet": {
"actualEndTime": "",
"actualStartTime": "",
"channelId": "",
"description": "",
"isDefaultBroadcast": false,
"liveChatId": "",
"publishedAt": "",
"scheduledEndTime": "",
"scheduledStartTime": "",
"thumbnails": {
"high": {
"height": 0,
"url": "",
"width": 0
},
"maxres": {},
"medium": {},
"standard": {}
},
"title": ""
},
"statistics": {
"concurrentViewers": ""
},
"status": {
"lifeCycleStatus": "",
"liveBroadcastPriority": "",
"madeForKids": false,
"privacyStatus": "",
"recordingStatus": "",
"selfDeclaredMadeForKids": false
}
}'
echo '{
"contentDetails": {
"boundStreamId": "",
"boundStreamLastUpdateTimeMs": "",
"closedCaptionsType": "",
"enableAutoStart": false,
"enableAutoStop": false,
"enableClosedCaptions": false,
"enableContentEncryption": false,
"enableDvr": false,
"enableEmbed": false,
"enableLowLatency": false,
"latencyPreference": "",
"mesh": "",
"monitorStream": {
"broadcastStreamDelayMs": 0,
"embedHtml": "",
"enableMonitorStream": false
},
"projection": "",
"recordFromStart": false,
"startWithSlate": false,
"stereoLayout": ""
},
"etag": "",
"id": "",
"kind": "",
"snippet": {
"actualEndTime": "",
"actualStartTime": "",
"channelId": "",
"description": "",
"isDefaultBroadcast": false,
"liveChatId": "",
"publishedAt": "",
"scheduledEndTime": "",
"scheduledStartTime": "",
"thumbnails": {
"high": {
"height": 0,
"url": "",
"width": 0
},
"maxres": {},
"medium": {},
"standard": {}
},
"title": ""
},
"statistics": {
"concurrentViewers": ""
},
"status": {
"lifeCycleStatus": "",
"liveBroadcastPriority": "",
"madeForKids": false,
"privacyStatus": "",
"recordingStatus": "",
"selfDeclaredMadeForKids": false
}
}' | \
http PUT '{{baseUrl}}/youtube/v3/liveBroadcasts?part=' \
content-type:application/json
wget --quiet \
--method PUT \
--header 'content-type: application/json' \
--body-data '{\n "contentDetails": {\n "boundStreamId": "",\n "boundStreamLastUpdateTimeMs": "",\n "closedCaptionsType": "",\n "enableAutoStart": false,\n "enableAutoStop": false,\n "enableClosedCaptions": false,\n "enableContentEncryption": false,\n "enableDvr": false,\n "enableEmbed": false,\n "enableLowLatency": false,\n "latencyPreference": "",\n "mesh": "",\n "monitorStream": {\n "broadcastStreamDelayMs": 0,\n "embedHtml": "",\n "enableMonitorStream": false\n },\n "projection": "",\n "recordFromStart": false,\n "startWithSlate": false,\n "stereoLayout": ""\n },\n "etag": "",\n "id": "",\n "kind": "",\n "snippet": {\n "actualEndTime": "",\n "actualStartTime": "",\n "channelId": "",\n "description": "",\n "isDefaultBroadcast": false,\n "liveChatId": "",\n "publishedAt": "",\n "scheduledEndTime": "",\n "scheduledStartTime": "",\n "thumbnails": {\n "high": {\n "height": 0,\n "url": "",\n "width": 0\n },\n "maxres": {},\n "medium": {},\n "standard": {}\n },\n "title": ""\n },\n "statistics": {\n "concurrentViewers": ""\n },\n "status": {\n "lifeCycleStatus": "",\n "liveBroadcastPriority": "",\n "madeForKids": false,\n "privacyStatus": "",\n "recordingStatus": "",\n "selfDeclaredMadeForKids": false\n }\n}' \
--output-document \
- '{{baseUrl}}/youtube/v3/liveBroadcasts?part='
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"contentDetails": [
"boundStreamId": "",
"boundStreamLastUpdateTimeMs": "",
"closedCaptionsType": "",
"enableAutoStart": false,
"enableAutoStop": false,
"enableClosedCaptions": false,
"enableContentEncryption": false,
"enableDvr": false,
"enableEmbed": false,
"enableLowLatency": false,
"latencyPreference": "",
"mesh": "",
"monitorStream": [
"broadcastStreamDelayMs": 0,
"embedHtml": "",
"enableMonitorStream": false
],
"projection": "",
"recordFromStart": false,
"startWithSlate": false,
"stereoLayout": ""
],
"etag": "",
"id": "",
"kind": "",
"snippet": [
"actualEndTime": "",
"actualStartTime": "",
"channelId": "",
"description": "",
"isDefaultBroadcast": false,
"liveChatId": "",
"publishedAt": "",
"scheduledEndTime": "",
"scheduledStartTime": "",
"thumbnails": [
"high": [
"height": 0,
"url": "",
"width": 0
],
"maxres": [],
"medium": [],
"standard": []
],
"title": ""
],
"statistics": ["concurrentViewers": ""],
"status": [
"lifeCycleStatus": "",
"liveBroadcastPriority": "",
"madeForKids": false,
"privacyStatus": "",
"recordingStatus": "",
"selfDeclaredMadeForKids": false
]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/youtube/v3/liveBroadcasts?part=")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
DELETE
youtube.liveChatBans.delete
{{baseUrl}}/youtube/v3/liveChat/bans
QUERY PARAMS
id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/youtube/v3/liveChat/bans?id=");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/delete "{{baseUrl}}/youtube/v3/liveChat/bans" {:query-params {:id ""}})
require "http/client"
url = "{{baseUrl}}/youtube/v3/liveChat/bans?id="
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}}/youtube/v3/liveChat/bans?id="),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/youtube/v3/liveChat/bans?id=");
var request = new RestRequest("", Method.Delete);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/youtube/v3/liveChat/bans?id="
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/youtube/v3/liveChat/bans?id= HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/youtube/v3/liveChat/bans?id=")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/youtube/v3/liveChat/bans?id="))
.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}}/youtube/v3/liveChat/bans?id=")
.delete(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/youtube/v3/liveChat/bans?id=")
.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}}/youtube/v3/liveChat/bans?id=');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'DELETE',
url: '{{baseUrl}}/youtube/v3/liveChat/bans',
params: {id: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/youtube/v3/liveChat/bans?id=';
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}}/youtube/v3/liveChat/bans?id=',
method: 'DELETE',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/youtube/v3/liveChat/bans?id=")
.delete(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'DELETE',
hostname: 'example.com',
port: null,
path: '/baseUrl/youtube/v3/liveChat/bans?id=',
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}}/youtube/v3/liveChat/bans',
qs: {id: ''}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('DELETE', '{{baseUrl}}/youtube/v3/liveChat/bans');
req.query({
id: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'DELETE',
url: '{{baseUrl}}/youtube/v3/liveChat/bans',
params: {id: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/youtube/v3/liveChat/bans?id=';
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}}/youtube/v3/liveChat/bans?id="]
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}}/youtube/v3/liveChat/bans?id=" in
Client.call `DELETE uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/youtube/v3/liveChat/bans?id=",
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}}/youtube/v3/liveChat/bans?id=');
echo $response->getBody();
setUrl('{{baseUrl}}/youtube/v3/liveChat/bans');
$request->setMethod(HTTP_METH_DELETE);
$request->setQueryData([
'id' => ''
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/youtube/v3/liveChat/bans');
$request->setRequestMethod('DELETE');
$request->setQuery(new http\QueryString([
'id' => ''
]));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/youtube/v3/liveChat/bans?id=' -Method DELETE
$response = Invoke-RestMethod -Uri '{{baseUrl}}/youtube/v3/liveChat/bans?id=' -Method DELETE
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("DELETE", "/baseUrl/youtube/v3/liveChat/bans?id=")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/youtube/v3/liveChat/bans"
querystring = {"id":""}
response = requests.delete(url, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/youtube/v3/liveChat/bans"
queryString <- list(id = "")
response <- VERB("DELETE", url, query = queryString, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/youtube/v3/liveChat/bans?id=")
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/youtube/v3/liveChat/bans') do |req|
req.params['id'] = ''
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/youtube/v3/liveChat/bans";
let querystring = [
("id", ""),
];
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("DELETE").unwrap(), url)
.query(&querystring)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request DELETE \
--url '{{baseUrl}}/youtube/v3/liveChat/bans?id='
http DELETE '{{baseUrl}}/youtube/v3/liveChat/bans?id='
wget --quiet \
--method DELETE \
--output-document \
- '{{baseUrl}}/youtube/v3/liveChat/bans?id='
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/youtube/v3/liveChat/bans?id=")! 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()
POST
youtube.liveChatBans.insert
{{baseUrl}}/youtube/v3/liveChat/bans
QUERY PARAMS
part
BODY json
{
"etag": "",
"id": "",
"kind": "",
"snippet": {
"banDurationSeconds": "",
"bannedUserDetails": {
"channelId": "",
"channelUrl": "",
"displayName": "",
"profileImageUrl": ""
},
"liveChatId": "",
"type": ""
}
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/youtube/v3/liveChat/bans?part=");
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 \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"banDurationSeconds\": \"\",\n \"bannedUserDetails\": {\n \"channelId\": \"\",\n \"channelUrl\": \"\",\n \"displayName\": \"\",\n \"profileImageUrl\": \"\"\n },\n \"liveChatId\": \"\",\n \"type\": \"\"\n }\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/youtube/v3/liveChat/bans" {:query-params {:part ""}
:content-type :json
:form-params {:etag ""
:id ""
:kind ""
:snippet {:banDurationSeconds ""
:bannedUserDetails {:channelId ""
:channelUrl ""
:displayName ""
:profileImageUrl ""}
:liveChatId ""
:type ""}}})
require "http/client"
url = "{{baseUrl}}/youtube/v3/liveChat/bans?part="
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"banDurationSeconds\": \"\",\n \"bannedUserDetails\": {\n \"channelId\": \"\",\n \"channelUrl\": \"\",\n \"displayName\": \"\",\n \"profileImageUrl\": \"\"\n },\n \"liveChatId\": \"\",\n \"type\": \"\"\n }\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/youtube/v3/liveChat/bans?part="),
Content = new StringContent("{\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"banDurationSeconds\": \"\",\n \"bannedUserDetails\": {\n \"channelId\": \"\",\n \"channelUrl\": \"\",\n \"displayName\": \"\",\n \"profileImageUrl\": \"\"\n },\n \"liveChatId\": \"\",\n \"type\": \"\"\n }\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/youtube/v3/liveChat/bans?part=");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"banDurationSeconds\": \"\",\n \"bannedUserDetails\": {\n \"channelId\": \"\",\n \"channelUrl\": \"\",\n \"displayName\": \"\",\n \"profileImageUrl\": \"\"\n },\n \"liveChatId\": \"\",\n \"type\": \"\"\n }\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/youtube/v3/liveChat/bans?part="
payload := strings.NewReader("{\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"banDurationSeconds\": \"\",\n \"bannedUserDetails\": {\n \"channelId\": \"\",\n \"channelUrl\": \"\",\n \"displayName\": \"\",\n \"profileImageUrl\": \"\"\n },\n \"liveChatId\": \"\",\n \"type\": \"\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/youtube/v3/liveChat/bans?part= HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 263
{
"etag": "",
"id": "",
"kind": "",
"snippet": {
"banDurationSeconds": "",
"bannedUserDetails": {
"channelId": "",
"channelUrl": "",
"displayName": "",
"profileImageUrl": ""
},
"liveChatId": "",
"type": ""
}
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/youtube/v3/liveChat/bans?part=")
.setHeader("content-type", "application/json")
.setBody("{\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"banDurationSeconds\": \"\",\n \"bannedUserDetails\": {\n \"channelId\": \"\",\n \"channelUrl\": \"\",\n \"displayName\": \"\",\n \"profileImageUrl\": \"\"\n },\n \"liveChatId\": \"\",\n \"type\": \"\"\n }\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/youtube/v3/liveChat/bans?part="))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"banDurationSeconds\": \"\",\n \"bannedUserDetails\": {\n \"channelId\": \"\",\n \"channelUrl\": \"\",\n \"displayName\": \"\",\n \"profileImageUrl\": \"\"\n },\n \"liveChatId\": \"\",\n \"type\": \"\"\n }\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"banDurationSeconds\": \"\",\n \"bannedUserDetails\": {\n \"channelId\": \"\",\n \"channelUrl\": \"\",\n \"displayName\": \"\",\n \"profileImageUrl\": \"\"\n },\n \"liveChatId\": \"\",\n \"type\": \"\"\n }\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/youtube/v3/liveChat/bans?part=")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/youtube/v3/liveChat/bans?part=")
.header("content-type", "application/json")
.body("{\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"banDurationSeconds\": \"\",\n \"bannedUserDetails\": {\n \"channelId\": \"\",\n \"channelUrl\": \"\",\n \"displayName\": \"\",\n \"profileImageUrl\": \"\"\n },\n \"liveChatId\": \"\",\n \"type\": \"\"\n }\n}")
.asString();
const data = JSON.stringify({
etag: '',
id: '',
kind: '',
snippet: {
banDurationSeconds: '',
bannedUserDetails: {
channelId: '',
channelUrl: '',
displayName: '',
profileImageUrl: ''
},
liveChatId: '',
type: ''
}
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/youtube/v3/liveChat/bans?part=');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/youtube/v3/liveChat/bans',
params: {part: ''},
headers: {'content-type': 'application/json'},
data: {
etag: '',
id: '',
kind: '',
snippet: {
banDurationSeconds: '',
bannedUserDetails: {channelId: '', channelUrl: '', displayName: '', profileImageUrl: ''},
liveChatId: '',
type: ''
}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/youtube/v3/liveChat/bans?part=';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"etag":"","id":"","kind":"","snippet":{"banDurationSeconds":"","bannedUserDetails":{"channelId":"","channelUrl":"","displayName":"","profileImageUrl":""},"liveChatId":"","type":""}}'
};
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}}/youtube/v3/liveChat/bans?part=',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "etag": "",\n "id": "",\n "kind": "",\n "snippet": {\n "banDurationSeconds": "",\n "bannedUserDetails": {\n "channelId": "",\n "channelUrl": "",\n "displayName": "",\n "profileImageUrl": ""\n },\n "liveChatId": "",\n "type": ""\n }\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"banDurationSeconds\": \"\",\n \"bannedUserDetails\": {\n \"channelId\": \"\",\n \"channelUrl\": \"\",\n \"displayName\": \"\",\n \"profileImageUrl\": \"\"\n },\n \"liveChatId\": \"\",\n \"type\": \"\"\n }\n}")
val request = Request.Builder()
.url("{{baseUrl}}/youtube/v3/liveChat/bans?part=")
.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/youtube/v3/liveChat/bans?part=',
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({
etag: '',
id: '',
kind: '',
snippet: {
banDurationSeconds: '',
bannedUserDetails: {channelId: '', channelUrl: '', displayName: '', profileImageUrl: ''},
liveChatId: '',
type: ''
}
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/youtube/v3/liveChat/bans',
qs: {part: ''},
headers: {'content-type': 'application/json'},
body: {
etag: '',
id: '',
kind: '',
snippet: {
banDurationSeconds: '',
bannedUserDetails: {channelId: '', channelUrl: '', displayName: '', profileImageUrl: ''},
liveChatId: '',
type: ''
}
},
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}}/youtube/v3/liveChat/bans');
req.query({
part: ''
});
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
etag: '',
id: '',
kind: '',
snippet: {
banDurationSeconds: '',
bannedUserDetails: {
channelId: '',
channelUrl: '',
displayName: '',
profileImageUrl: ''
},
liveChatId: '',
type: ''
}
});
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}}/youtube/v3/liveChat/bans',
params: {part: ''},
headers: {'content-type': 'application/json'},
data: {
etag: '',
id: '',
kind: '',
snippet: {
banDurationSeconds: '',
bannedUserDetails: {channelId: '', channelUrl: '', displayName: '', profileImageUrl: ''},
liveChatId: '',
type: ''
}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/youtube/v3/liveChat/bans?part=';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"etag":"","id":"","kind":"","snippet":{"banDurationSeconds":"","bannedUserDetails":{"channelId":"","channelUrl":"","displayName":"","profileImageUrl":""},"liveChatId":"","type":""}}'
};
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 = @{ @"etag": @"",
@"id": @"",
@"kind": @"",
@"snippet": @{ @"banDurationSeconds": @"", @"bannedUserDetails": @{ @"channelId": @"", @"channelUrl": @"", @"displayName": @"", @"profileImageUrl": @"" }, @"liveChatId": @"", @"type": @"" } };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/youtube/v3/liveChat/bans?part="]
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}}/youtube/v3/liveChat/bans?part=" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"banDurationSeconds\": \"\",\n \"bannedUserDetails\": {\n \"channelId\": \"\",\n \"channelUrl\": \"\",\n \"displayName\": \"\",\n \"profileImageUrl\": \"\"\n },\n \"liveChatId\": \"\",\n \"type\": \"\"\n }\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/youtube/v3/liveChat/bans?part=",
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([
'etag' => '',
'id' => '',
'kind' => '',
'snippet' => [
'banDurationSeconds' => '',
'bannedUserDetails' => [
'channelId' => '',
'channelUrl' => '',
'displayName' => '',
'profileImageUrl' => ''
],
'liveChatId' => '',
'type' => ''
]
]),
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}}/youtube/v3/liveChat/bans?part=', [
'body' => '{
"etag": "",
"id": "",
"kind": "",
"snippet": {
"banDurationSeconds": "",
"bannedUserDetails": {
"channelId": "",
"channelUrl": "",
"displayName": "",
"profileImageUrl": ""
},
"liveChatId": "",
"type": ""
}
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/youtube/v3/liveChat/bans');
$request->setMethod(HTTP_METH_POST);
$request->setQueryData([
'part' => ''
]);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'etag' => '',
'id' => '',
'kind' => '',
'snippet' => [
'banDurationSeconds' => '',
'bannedUserDetails' => [
'channelId' => '',
'channelUrl' => '',
'displayName' => '',
'profileImageUrl' => ''
],
'liveChatId' => '',
'type' => ''
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'etag' => '',
'id' => '',
'kind' => '',
'snippet' => [
'banDurationSeconds' => '',
'bannedUserDetails' => [
'channelId' => '',
'channelUrl' => '',
'displayName' => '',
'profileImageUrl' => ''
],
'liveChatId' => '',
'type' => ''
]
]));
$request->setRequestUrl('{{baseUrl}}/youtube/v3/liveChat/bans');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setQuery(new http\QueryString([
'part' => ''
]));
$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}}/youtube/v3/liveChat/bans?part=' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"etag": "",
"id": "",
"kind": "",
"snippet": {
"banDurationSeconds": "",
"bannedUserDetails": {
"channelId": "",
"channelUrl": "",
"displayName": "",
"profileImageUrl": ""
},
"liveChatId": "",
"type": ""
}
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/youtube/v3/liveChat/bans?part=' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"etag": "",
"id": "",
"kind": "",
"snippet": {
"banDurationSeconds": "",
"bannedUserDetails": {
"channelId": "",
"channelUrl": "",
"displayName": "",
"profileImageUrl": ""
},
"liveChatId": "",
"type": ""
}
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"banDurationSeconds\": \"\",\n \"bannedUserDetails\": {\n \"channelId\": \"\",\n \"channelUrl\": \"\",\n \"displayName\": \"\",\n \"profileImageUrl\": \"\"\n },\n \"liveChatId\": \"\",\n \"type\": \"\"\n }\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/youtube/v3/liveChat/bans?part=", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/youtube/v3/liveChat/bans"
querystring = {"part":""}
payload = {
"etag": "",
"id": "",
"kind": "",
"snippet": {
"banDurationSeconds": "",
"bannedUserDetails": {
"channelId": "",
"channelUrl": "",
"displayName": "",
"profileImageUrl": ""
},
"liveChatId": "",
"type": ""
}
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/youtube/v3/liveChat/bans"
queryString <- list(part = "")
payload <- "{\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"banDurationSeconds\": \"\",\n \"bannedUserDetails\": {\n \"channelId\": \"\",\n \"channelUrl\": \"\",\n \"displayName\": \"\",\n \"profileImageUrl\": \"\"\n },\n \"liveChatId\": \"\",\n \"type\": \"\"\n }\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, query = queryString, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/youtube/v3/liveChat/bans?part=")
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 \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"banDurationSeconds\": \"\",\n \"bannedUserDetails\": {\n \"channelId\": \"\",\n \"channelUrl\": \"\",\n \"displayName\": \"\",\n \"profileImageUrl\": \"\"\n },\n \"liveChatId\": \"\",\n \"type\": \"\"\n }\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/youtube/v3/liveChat/bans') do |req|
req.params['part'] = ''
req.body = "{\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"banDurationSeconds\": \"\",\n \"bannedUserDetails\": {\n \"channelId\": \"\",\n \"channelUrl\": \"\",\n \"displayName\": \"\",\n \"profileImageUrl\": \"\"\n },\n \"liveChatId\": \"\",\n \"type\": \"\"\n }\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/youtube/v3/liveChat/bans";
let querystring = [
("part", ""),
];
let payload = json!({
"etag": "",
"id": "",
"kind": "",
"snippet": json!({
"banDurationSeconds": "",
"bannedUserDetails": json!({
"channelId": "",
"channelUrl": "",
"displayName": "",
"profileImageUrl": ""
}),
"liveChatId": "",
"type": ""
})
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.query(&querystring)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/youtube/v3/liveChat/bans?part=' \
--header 'content-type: application/json' \
--data '{
"etag": "",
"id": "",
"kind": "",
"snippet": {
"banDurationSeconds": "",
"bannedUserDetails": {
"channelId": "",
"channelUrl": "",
"displayName": "",
"profileImageUrl": ""
},
"liveChatId": "",
"type": ""
}
}'
echo '{
"etag": "",
"id": "",
"kind": "",
"snippet": {
"banDurationSeconds": "",
"bannedUserDetails": {
"channelId": "",
"channelUrl": "",
"displayName": "",
"profileImageUrl": ""
},
"liveChatId": "",
"type": ""
}
}' | \
http POST '{{baseUrl}}/youtube/v3/liveChat/bans?part=' \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "etag": "",\n "id": "",\n "kind": "",\n "snippet": {\n "banDurationSeconds": "",\n "bannedUserDetails": {\n "channelId": "",\n "channelUrl": "",\n "displayName": "",\n "profileImageUrl": ""\n },\n "liveChatId": "",\n "type": ""\n }\n}' \
--output-document \
- '{{baseUrl}}/youtube/v3/liveChat/bans?part='
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"etag": "",
"id": "",
"kind": "",
"snippet": [
"banDurationSeconds": "",
"bannedUserDetails": [
"channelId": "",
"channelUrl": "",
"displayName": "",
"profileImageUrl": ""
],
"liveChatId": "",
"type": ""
]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/youtube/v3/liveChat/bans?part=")! 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()
DELETE
youtube.liveChatMessages.delete
{{baseUrl}}/youtube/v3/liveChat/messages
QUERY PARAMS
id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/youtube/v3/liveChat/messages?id=");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/delete "{{baseUrl}}/youtube/v3/liveChat/messages" {:query-params {:id ""}})
require "http/client"
url = "{{baseUrl}}/youtube/v3/liveChat/messages?id="
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}}/youtube/v3/liveChat/messages?id="),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/youtube/v3/liveChat/messages?id=");
var request = new RestRequest("", Method.Delete);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/youtube/v3/liveChat/messages?id="
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/youtube/v3/liveChat/messages?id= HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/youtube/v3/liveChat/messages?id=")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/youtube/v3/liveChat/messages?id="))
.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}}/youtube/v3/liveChat/messages?id=")
.delete(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/youtube/v3/liveChat/messages?id=")
.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}}/youtube/v3/liveChat/messages?id=');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'DELETE',
url: '{{baseUrl}}/youtube/v3/liveChat/messages',
params: {id: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/youtube/v3/liveChat/messages?id=';
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}}/youtube/v3/liveChat/messages?id=',
method: 'DELETE',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/youtube/v3/liveChat/messages?id=")
.delete(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'DELETE',
hostname: 'example.com',
port: null,
path: '/baseUrl/youtube/v3/liveChat/messages?id=',
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}}/youtube/v3/liveChat/messages',
qs: {id: ''}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('DELETE', '{{baseUrl}}/youtube/v3/liveChat/messages');
req.query({
id: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'DELETE',
url: '{{baseUrl}}/youtube/v3/liveChat/messages',
params: {id: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/youtube/v3/liveChat/messages?id=';
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}}/youtube/v3/liveChat/messages?id="]
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}}/youtube/v3/liveChat/messages?id=" in
Client.call `DELETE uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/youtube/v3/liveChat/messages?id=",
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}}/youtube/v3/liveChat/messages?id=');
echo $response->getBody();
setUrl('{{baseUrl}}/youtube/v3/liveChat/messages');
$request->setMethod(HTTP_METH_DELETE);
$request->setQueryData([
'id' => ''
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/youtube/v3/liveChat/messages');
$request->setRequestMethod('DELETE');
$request->setQuery(new http\QueryString([
'id' => ''
]));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/youtube/v3/liveChat/messages?id=' -Method DELETE
$response = Invoke-RestMethod -Uri '{{baseUrl}}/youtube/v3/liveChat/messages?id=' -Method DELETE
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("DELETE", "/baseUrl/youtube/v3/liveChat/messages?id=")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/youtube/v3/liveChat/messages"
querystring = {"id":""}
response = requests.delete(url, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/youtube/v3/liveChat/messages"
queryString <- list(id = "")
response <- VERB("DELETE", url, query = queryString, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/youtube/v3/liveChat/messages?id=")
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/youtube/v3/liveChat/messages') do |req|
req.params['id'] = ''
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/youtube/v3/liveChat/messages";
let querystring = [
("id", ""),
];
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("DELETE").unwrap(), url)
.query(&querystring)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request DELETE \
--url '{{baseUrl}}/youtube/v3/liveChat/messages?id='
http DELETE '{{baseUrl}}/youtube/v3/liveChat/messages?id='
wget --quiet \
--method DELETE \
--output-document \
- '{{baseUrl}}/youtube/v3/liveChat/messages?id='
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/youtube/v3/liveChat/messages?id=")! 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()
POST
youtube.liveChatMessages.insert
{{baseUrl}}/youtube/v3/liveChat/messages
QUERY PARAMS
part
BODY json
{
"authorDetails": {
"channelId": "",
"channelUrl": "",
"displayName": "",
"isChatModerator": false,
"isChatOwner": false,
"isChatSponsor": false,
"isVerified": false,
"profileImageUrl": ""
},
"etag": "",
"id": "",
"kind": "",
"snippet": {
"authorChannelId": "",
"displayMessage": "",
"fanFundingEventDetails": {
"amountDisplayString": "",
"amountMicros": "",
"currency": "",
"userComment": ""
},
"giftMembershipReceivedDetails": {
"associatedMembershipGiftingMessageId": "",
"gifterChannelId": "",
"memberLevelName": ""
},
"hasDisplayContent": false,
"liveChatId": "",
"memberMilestoneChatDetails": {
"memberLevelName": "",
"memberMonth": 0,
"userComment": ""
},
"membershipGiftingDetails": {
"giftMembershipsCount": 0,
"giftMembershipsLevelName": ""
},
"messageDeletedDetails": {
"deletedMessageId": ""
},
"messageRetractedDetails": {
"retractedMessageId": ""
},
"newSponsorDetails": {
"isUpgrade": false,
"memberLevelName": ""
},
"publishedAt": "",
"superChatDetails": {
"amountDisplayString": "",
"amountMicros": "",
"currency": "",
"tier": 0,
"userComment": ""
},
"superStickerDetails": {
"amountDisplayString": "",
"amountMicros": "",
"currency": "",
"superStickerMetadata": {
"altText": "",
"altTextLanguage": "",
"stickerId": ""
},
"tier": 0
},
"textMessageDetails": {
"messageText": ""
},
"type": "",
"userBannedDetails": {
"banDurationSeconds": "",
"banType": "",
"bannedUserDetails": {
"channelId": "",
"channelUrl": "",
"displayName": "",
"profileImageUrl": ""
}
}
}
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/youtube/v3/liveChat/messages?part=");
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 \"authorDetails\": {\n \"channelId\": \"\",\n \"channelUrl\": \"\",\n \"displayName\": \"\",\n \"isChatModerator\": false,\n \"isChatOwner\": false,\n \"isChatSponsor\": false,\n \"isVerified\": false,\n \"profileImageUrl\": \"\"\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"authorChannelId\": \"\",\n \"displayMessage\": \"\",\n \"fanFundingEventDetails\": {\n \"amountDisplayString\": \"\",\n \"amountMicros\": \"\",\n \"currency\": \"\",\n \"userComment\": \"\"\n },\n \"giftMembershipReceivedDetails\": {\n \"associatedMembershipGiftingMessageId\": \"\",\n \"gifterChannelId\": \"\",\n \"memberLevelName\": \"\"\n },\n \"hasDisplayContent\": false,\n \"liveChatId\": \"\",\n \"memberMilestoneChatDetails\": {\n \"memberLevelName\": \"\",\n \"memberMonth\": 0,\n \"userComment\": \"\"\n },\n \"membershipGiftingDetails\": {\n \"giftMembershipsCount\": 0,\n \"giftMembershipsLevelName\": \"\"\n },\n \"messageDeletedDetails\": {\n \"deletedMessageId\": \"\"\n },\n \"messageRetractedDetails\": {\n \"retractedMessageId\": \"\"\n },\n \"newSponsorDetails\": {\n \"isUpgrade\": false,\n \"memberLevelName\": \"\"\n },\n \"publishedAt\": \"\",\n \"superChatDetails\": {\n \"amountDisplayString\": \"\",\n \"amountMicros\": \"\",\n \"currency\": \"\",\n \"tier\": 0,\n \"userComment\": \"\"\n },\n \"superStickerDetails\": {\n \"amountDisplayString\": \"\",\n \"amountMicros\": \"\",\n \"currency\": \"\",\n \"superStickerMetadata\": {\n \"altText\": \"\",\n \"altTextLanguage\": \"\",\n \"stickerId\": \"\"\n },\n \"tier\": 0\n },\n \"textMessageDetails\": {\n \"messageText\": \"\"\n },\n \"type\": \"\",\n \"userBannedDetails\": {\n \"banDurationSeconds\": \"\",\n \"banType\": \"\",\n \"bannedUserDetails\": {\n \"channelId\": \"\",\n \"channelUrl\": \"\",\n \"displayName\": \"\",\n \"profileImageUrl\": \"\"\n }\n }\n }\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/youtube/v3/liveChat/messages" {:query-params {:part ""}
:content-type :json
:form-params {:authorDetails {:channelId ""
:channelUrl ""
:displayName ""
:isChatModerator false
:isChatOwner false
:isChatSponsor false
:isVerified false
:profileImageUrl ""}
:etag ""
:id ""
:kind ""
:snippet {:authorChannelId ""
:displayMessage ""
:fanFundingEventDetails {:amountDisplayString ""
:amountMicros ""
:currency ""
:userComment ""}
:giftMembershipReceivedDetails {:associatedMembershipGiftingMessageId ""
:gifterChannelId ""
:memberLevelName ""}
:hasDisplayContent false
:liveChatId ""
:memberMilestoneChatDetails {:memberLevelName ""
:memberMonth 0
:userComment ""}
:membershipGiftingDetails {:giftMembershipsCount 0
:giftMembershipsLevelName ""}
:messageDeletedDetails {:deletedMessageId ""}
:messageRetractedDetails {:retractedMessageId ""}
:newSponsorDetails {:isUpgrade false
:memberLevelName ""}
:publishedAt ""
:superChatDetails {:amountDisplayString ""
:amountMicros ""
:currency ""
:tier 0
:userComment ""}
:superStickerDetails {:amountDisplayString ""
:amountMicros ""
:currency ""
:superStickerMetadata {:altText ""
:altTextLanguage ""
:stickerId ""}
:tier 0}
:textMessageDetails {:messageText ""}
:type ""
:userBannedDetails {:banDurationSeconds ""
:banType ""
:bannedUserDetails {:channelId ""
:channelUrl ""
:displayName ""
:profileImageUrl ""}}}}})
require "http/client"
url = "{{baseUrl}}/youtube/v3/liveChat/messages?part="
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"authorDetails\": {\n \"channelId\": \"\",\n \"channelUrl\": \"\",\n \"displayName\": \"\",\n \"isChatModerator\": false,\n \"isChatOwner\": false,\n \"isChatSponsor\": false,\n \"isVerified\": false,\n \"profileImageUrl\": \"\"\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"authorChannelId\": \"\",\n \"displayMessage\": \"\",\n \"fanFundingEventDetails\": {\n \"amountDisplayString\": \"\",\n \"amountMicros\": \"\",\n \"currency\": \"\",\n \"userComment\": \"\"\n },\n \"giftMembershipReceivedDetails\": {\n \"associatedMembershipGiftingMessageId\": \"\",\n \"gifterChannelId\": \"\",\n \"memberLevelName\": \"\"\n },\n \"hasDisplayContent\": false,\n \"liveChatId\": \"\",\n \"memberMilestoneChatDetails\": {\n \"memberLevelName\": \"\",\n \"memberMonth\": 0,\n \"userComment\": \"\"\n },\n \"membershipGiftingDetails\": {\n \"giftMembershipsCount\": 0,\n \"giftMembershipsLevelName\": \"\"\n },\n \"messageDeletedDetails\": {\n \"deletedMessageId\": \"\"\n },\n \"messageRetractedDetails\": {\n \"retractedMessageId\": \"\"\n },\n \"newSponsorDetails\": {\n \"isUpgrade\": false,\n \"memberLevelName\": \"\"\n },\n \"publishedAt\": \"\",\n \"superChatDetails\": {\n \"amountDisplayString\": \"\",\n \"amountMicros\": \"\",\n \"currency\": \"\",\n \"tier\": 0,\n \"userComment\": \"\"\n },\n \"superStickerDetails\": {\n \"amountDisplayString\": \"\",\n \"amountMicros\": \"\",\n \"currency\": \"\",\n \"superStickerMetadata\": {\n \"altText\": \"\",\n \"altTextLanguage\": \"\",\n \"stickerId\": \"\"\n },\n \"tier\": 0\n },\n \"textMessageDetails\": {\n \"messageText\": \"\"\n },\n \"type\": \"\",\n \"userBannedDetails\": {\n \"banDurationSeconds\": \"\",\n \"banType\": \"\",\n \"bannedUserDetails\": {\n \"channelId\": \"\",\n \"channelUrl\": \"\",\n \"displayName\": \"\",\n \"profileImageUrl\": \"\"\n }\n }\n }\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/youtube/v3/liveChat/messages?part="),
Content = new StringContent("{\n \"authorDetails\": {\n \"channelId\": \"\",\n \"channelUrl\": \"\",\n \"displayName\": \"\",\n \"isChatModerator\": false,\n \"isChatOwner\": false,\n \"isChatSponsor\": false,\n \"isVerified\": false,\n \"profileImageUrl\": \"\"\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"authorChannelId\": \"\",\n \"displayMessage\": \"\",\n \"fanFundingEventDetails\": {\n \"amountDisplayString\": \"\",\n \"amountMicros\": \"\",\n \"currency\": \"\",\n \"userComment\": \"\"\n },\n \"giftMembershipReceivedDetails\": {\n \"associatedMembershipGiftingMessageId\": \"\",\n \"gifterChannelId\": \"\",\n \"memberLevelName\": \"\"\n },\n \"hasDisplayContent\": false,\n \"liveChatId\": \"\",\n \"memberMilestoneChatDetails\": {\n \"memberLevelName\": \"\",\n \"memberMonth\": 0,\n \"userComment\": \"\"\n },\n \"membershipGiftingDetails\": {\n \"giftMembershipsCount\": 0,\n \"giftMembershipsLevelName\": \"\"\n },\n \"messageDeletedDetails\": {\n \"deletedMessageId\": \"\"\n },\n \"messageRetractedDetails\": {\n \"retractedMessageId\": \"\"\n },\n \"newSponsorDetails\": {\n \"isUpgrade\": false,\n \"memberLevelName\": \"\"\n },\n \"publishedAt\": \"\",\n \"superChatDetails\": {\n \"amountDisplayString\": \"\",\n \"amountMicros\": \"\",\n \"currency\": \"\",\n \"tier\": 0,\n \"userComment\": \"\"\n },\n \"superStickerDetails\": {\n \"amountDisplayString\": \"\",\n \"amountMicros\": \"\",\n \"currency\": \"\",\n \"superStickerMetadata\": {\n \"altText\": \"\",\n \"altTextLanguage\": \"\",\n \"stickerId\": \"\"\n },\n \"tier\": 0\n },\n \"textMessageDetails\": {\n \"messageText\": \"\"\n },\n \"type\": \"\",\n \"userBannedDetails\": {\n \"banDurationSeconds\": \"\",\n \"banType\": \"\",\n \"bannedUserDetails\": {\n \"channelId\": \"\",\n \"channelUrl\": \"\",\n \"displayName\": \"\",\n \"profileImageUrl\": \"\"\n }\n }\n }\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/youtube/v3/liveChat/messages?part=");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"authorDetails\": {\n \"channelId\": \"\",\n \"channelUrl\": \"\",\n \"displayName\": \"\",\n \"isChatModerator\": false,\n \"isChatOwner\": false,\n \"isChatSponsor\": false,\n \"isVerified\": false,\n \"profileImageUrl\": \"\"\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"authorChannelId\": \"\",\n \"displayMessage\": \"\",\n \"fanFundingEventDetails\": {\n \"amountDisplayString\": \"\",\n \"amountMicros\": \"\",\n \"currency\": \"\",\n \"userComment\": \"\"\n },\n \"giftMembershipReceivedDetails\": {\n \"associatedMembershipGiftingMessageId\": \"\",\n \"gifterChannelId\": \"\",\n \"memberLevelName\": \"\"\n },\n \"hasDisplayContent\": false,\n \"liveChatId\": \"\",\n \"memberMilestoneChatDetails\": {\n \"memberLevelName\": \"\",\n \"memberMonth\": 0,\n \"userComment\": \"\"\n },\n \"membershipGiftingDetails\": {\n \"giftMembershipsCount\": 0,\n \"giftMembershipsLevelName\": \"\"\n },\n \"messageDeletedDetails\": {\n \"deletedMessageId\": \"\"\n },\n \"messageRetractedDetails\": {\n \"retractedMessageId\": \"\"\n },\n \"newSponsorDetails\": {\n \"isUpgrade\": false,\n \"memberLevelName\": \"\"\n },\n \"publishedAt\": \"\",\n \"superChatDetails\": {\n \"amountDisplayString\": \"\",\n \"amountMicros\": \"\",\n \"currency\": \"\",\n \"tier\": 0,\n \"userComment\": \"\"\n },\n \"superStickerDetails\": {\n \"amountDisplayString\": \"\",\n \"amountMicros\": \"\",\n \"currency\": \"\",\n \"superStickerMetadata\": {\n \"altText\": \"\",\n \"altTextLanguage\": \"\",\n \"stickerId\": \"\"\n },\n \"tier\": 0\n },\n \"textMessageDetails\": {\n \"messageText\": \"\"\n },\n \"type\": \"\",\n \"userBannedDetails\": {\n \"banDurationSeconds\": \"\",\n \"banType\": \"\",\n \"bannedUserDetails\": {\n \"channelId\": \"\",\n \"channelUrl\": \"\",\n \"displayName\": \"\",\n \"profileImageUrl\": \"\"\n }\n }\n }\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/youtube/v3/liveChat/messages?part="
payload := strings.NewReader("{\n \"authorDetails\": {\n \"channelId\": \"\",\n \"channelUrl\": \"\",\n \"displayName\": \"\",\n \"isChatModerator\": false,\n \"isChatOwner\": false,\n \"isChatSponsor\": false,\n \"isVerified\": false,\n \"profileImageUrl\": \"\"\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"authorChannelId\": \"\",\n \"displayMessage\": \"\",\n \"fanFundingEventDetails\": {\n \"amountDisplayString\": \"\",\n \"amountMicros\": \"\",\n \"currency\": \"\",\n \"userComment\": \"\"\n },\n \"giftMembershipReceivedDetails\": {\n \"associatedMembershipGiftingMessageId\": \"\",\n \"gifterChannelId\": \"\",\n \"memberLevelName\": \"\"\n },\n \"hasDisplayContent\": false,\n \"liveChatId\": \"\",\n \"memberMilestoneChatDetails\": {\n \"memberLevelName\": \"\",\n \"memberMonth\": 0,\n \"userComment\": \"\"\n },\n \"membershipGiftingDetails\": {\n \"giftMembershipsCount\": 0,\n \"giftMembershipsLevelName\": \"\"\n },\n \"messageDeletedDetails\": {\n \"deletedMessageId\": \"\"\n },\n \"messageRetractedDetails\": {\n \"retractedMessageId\": \"\"\n },\n \"newSponsorDetails\": {\n \"isUpgrade\": false,\n \"memberLevelName\": \"\"\n },\n \"publishedAt\": \"\",\n \"superChatDetails\": {\n \"amountDisplayString\": \"\",\n \"amountMicros\": \"\",\n \"currency\": \"\",\n \"tier\": 0,\n \"userComment\": \"\"\n },\n \"superStickerDetails\": {\n \"amountDisplayString\": \"\",\n \"amountMicros\": \"\",\n \"currency\": \"\",\n \"superStickerMetadata\": {\n \"altText\": \"\",\n \"altTextLanguage\": \"\",\n \"stickerId\": \"\"\n },\n \"tier\": 0\n },\n \"textMessageDetails\": {\n \"messageText\": \"\"\n },\n \"type\": \"\",\n \"userBannedDetails\": {\n \"banDurationSeconds\": \"\",\n \"banType\": \"\",\n \"bannedUserDetails\": {\n \"channelId\": \"\",\n \"channelUrl\": \"\",\n \"displayName\": \"\",\n \"profileImageUrl\": \"\"\n }\n }\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/youtube/v3/liveChat/messages?part= HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 1886
{
"authorDetails": {
"channelId": "",
"channelUrl": "",
"displayName": "",
"isChatModerator": false,
"isChatOwner": false,
"isChatSponsor": false,
"isVerified": false,
"profileImageUrl": ""
},
"etag": "",
"id": "",
"kind": "",
"snippet": {
"authorChannelId": "",
"displayMessage": "",
"fanFundingEventDetails": {
"amountDisplayString": "",
"amountMicros": "",
"currency": "",
"userComment": ""
},
"giftMembershipReceivedDetails": {
"associatedMembershipGiftingMessageId": "",
"gifterChannelId": "",
"memberLevelName": ""
},
"hasDisplayContent": false,
"liveChatId": "",
"memberMilestoneChatDetails": {
"memberLevelName": "",
"memberMonth": 0,
"userComment": ""
},
"membershipGiftingDetails": {
"giftMembershipsCount": 0,
"giftMembershipsLevelName": ""
},
"messageDeletedDetails": {
"deletedMessageId": ""
},
"messageRetractedDetails": {
"retractedMessageId": ""
},
"newSponsorDetails": {
"isUpgrade": false,
"memberLevelName": ""
},
"publishedAt": "",
"superChatDetails": {
"amountDisplayString": "",
"amountMicros": "",
"currency": "",
"tier": 0,
"userComment": ""
},
"superStickerDetails": {
"amountDisplayString": "",
"amountMicros": "",
"currency": "",
"superStickerMetadata": {
"altText": "",
"altTextLanguage": "",
"stickerId": ""
},
"tier": 0
},
"textMessageDetails": {
"messageText": ""
},
"type": "",
"userBannedDetails": {
"banDurationSeconds": "",
"banType": "",
"bannedUserDetails": {
"channelId": "",
"channelUrl": "",
"displayName": "",
"profileImageUrl": ""
}
}
}
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/youtube/v3/liveChat/messages?part=")
.setHeader("content-type", "application/json")
.setBody("{\n \"authorDetails\": {\n \"channelId\": \"\",\n \"channelUrl\": \"\",\n \"displayName\": \"\",\n \"isChatModerator\": false,\n \"isChatOwner\": false,\n \"isChatSponsor\": false,\n \"isVerified\": false,\n \"profileImageUrl\": \"\"\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"authorChannelId\": \"\",\n \"displayMessage\": \"\",\n \"fanFundingEventDetails\": {\n \"amountDisplayString\": \"\",\n \"amountMicros\": \"\",\n \"currency\": \"\",\n \"userComment\": \"\"\n },\n \"giftMembershipReceivedDetails\": {\n \"associatedMembershipGiftingMessageId\": \"\",\n \"gifterChannelId\": \"\",\n \"memberLevelName\": \"\"\n },\n \"hasDisplayContent\": false,\n \"liveChatId\": \"\",\n \"memberMilestoneChatDetails\": {\n \"memberLevelName\": \"\",\n \"memberMonth\": 0,\n \"userComment\": \"\"\n },\n \"membershipGiftingDetails\": {\n \"giftMembershipsCount\": 0,\n \"giftMembershipsLevelName\": \"\"\n },\n \"messageDeletedDetails\": {\n \"deletedMessageId\": \"\"\n },\n \"messageRetractedDetails\": {\n \"retractedMessageId\": \"\"\n },\n \"newSponsorDetails\": {\n \"isUpgrade\": false,\n \"memberLevelName\": \"\"\n },\n \"publishedAt\": \"\",\n \"superChatDetails\": {\n \"amountDisplayString\": \"\",\n \"amountMicros\": \"\",\n \"currency\": \"\",\n \"tier\": 0,\n \"userComment\": \"\"\n },\n \"superStickerDetails\": {\n \"amountDisplayString\": \"\",\n \"amountMicros\": \"\",\n \"currency\": \"\",\n \"superStickerMetadata\": {\n \"altText\": \"\",\n \"altTextLanguage\": \"\",\n \"stickerId\": \"\"\n },\n \"tier\": 0\n },\n \"textMessageDetails\": {\n \"messageText\": \"\"\n },\n \"type\": \"\",\n \"userBannedDetails\": {\n \"banDurationSeconds\": \"\",\n \"banType\": \"\",\n \"bannedUserDetails\": {\n \"channelId\": \"\",\n \"channelUrl\": \"\",\n \"displayName\": \"\",\n \"profileImageUrl\": \"\"\n }\n }\n }\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/youtube/v3/liveChat/messages?part="))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"authorDetails\": {\n \"channelId\": \"\",\n \"channelUrl\": \"\",\n \"displayName\": \"\",\n \"isChatModerator\": false,\n \"isChatOwner\": false,\n \"isChatSponsor\": false,\n \"isVerified\": false,\n \"profileImageUrl\": \"\"\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"authorChannelId\": \"\",\n \"displayMessage\": \"\",\n \"fanFundingEventDetails\": {\n \"amountDisplayString\": \"\",\n \"amountMicros\": \"\",\n \"currency\": \"\",\n \"userComment\": \"\"\n },\n \"giftMembershipReceivedDetails\": {\n \"associatedMembershipGiftingMessageId\": \"\",\n \"gifterChannelId\": \"\",\n \"memberLevelName\": \"\"\n },\n \"hasDisplayContent\": false,\n \"liveChatId\": \"\",\n \"memberMilestoneChatDetails\": {\n \"memberLevelName\": \"\",\n \"memberMonth\": 0,\n \"userComment\": \"\"\n },\n \"membershipGiftingDetails\": {\n \"giftMembershipsCount\": 0,\n \"giftMembershipsLevelName\": \"\"\n },\n \"messageDeletedDetails\": {\n \"deletedMessageId\": \"\"\n },\n \"messageRetractedDetails\": {\n \"retractedMessageId\": \"\"\n },\n \"newSponsorDetails\": {\n \"isUpgrade\": false,\n \"memberLevelName\": \"\"\n },\n \"publishedAt\": \"\",\n \"superChatDetails\": {\n \"amountDisplayString\": \"\",\n \"amountMicros\": \"\",\n \"currency\": \"\",\n \"tier\": 0,\n \"userComment\": \"\"\n },\n \"superStickerDetails\": {\n \"amountDisplayString\": \"\",\n \"amountMicros\": \"\",\n \"currency\": \"\",\n \"superStickerMetadata\": {\n \"altText\": \"\",\n \"altTextLanguage\": \"\",\n \"stickerId\": \"\"\n },\n \"tier\": 0\n },\n \"textMessageDetails\": {\n \"messageText\": \"\"\n },\n \"type\": \"\",\n \"userBannedDetails\": {\n \"banDurationSeconds\": \"\",\n \"banType\": \"\",\n \"bannedUserDetails\": {\n \"channelId\": \"\",\n \"channelUrl\": \"\",\n \"displayName\": \"\",\n \"profileImageUrl\": \"\"\n }\n }\n }\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"authorDetails\": {\n \"channelId\": \"\",\n \"channelUrl\": \"\",\n \"displayName\": \"\",\n \"isChatModerator\": false,\n \"isChatOwner\": false,\n \"isChatSponsor\": false,\n \"isVerified\": false,\n \"profileImageUrl\": \"\"\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"authorChannelId\": \"\",\n \"displayMessage\": \"\",\n \"fanFundingEventDetails\": {\n \"amountDisplayString\": \"\",\n \"amountMicros\": \"\",\n \"currency\": \"\",\n \"userComment\": \"\"\n },\n \"giftMembershipReceivedDetails\": {\n \"associatedMembershipGiftingMessageId\": \"\",\n \"gifterChannelId\": \"\",\n \"memberLevelName\": \"\"\n },\n \"hasDisplayContent\": false,\n \"liveChatId\": \"\",\n \"memberMilestoneChatDetails\": {\n \"memberLevelName\": \"\",\n \"memberMonth\": 0,\n \"userComment\": \"\"\n },\n \"membershipGiftingDetails\": {\n \"giftMembershipsCount\": 0,\n \"giftMembershipsLevelName\": \"\"\n },\n \"messageDeletedDetails\": {\n \"deletedMessageId\": \"\"\n },\n \"messageRetractedDetails\": {\n \"retractedMessageId\": \"\"\n },\n \"newSponsorDetails\": {\n \"isUpgrade\": false,\n \"memberLevelName\": \"\"\n },\n \"publishedAt\": \"\",\n \"superChatDetails\": {\n \"amountDisplayString\": \"\",\n \"amountMicros\": \"\",\n \"currency\": \"\",\n \"tier\": 0,\n \"userComment\": \"\"\n },\n \"superStickerDetails\": {\n \"amountDisplayString\": \"\",\n \"amountMicros\": \"\",\n \"currency\": \"\",\n \"superStickerMetadata\": {\n \"altText\": \"\",\n \"altTextLanguage\": \"\",\n \"stickerId\": \"\"\n },\n \"tier\": 0\n },\n \"textMessageDetails\": {\n \"messageText\": \"\"\n },\n \"type\": \"\",\n \"userBannedDetails\": {\n \"banDurationSeconds\": \"\",\n \"banType\": \"\",\n \"bannedUserDetails\": {\n \"channelId\": \"\",\n \"channelUrl\": \"\",\n \"displayName\": \"\",\n \"profileImageUrl\": \"\"\n }\n }\n }\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/youtube/v3/liveChat/messages?part=")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/youtube/v3/liveChat/messages?part=")
.header("content-type", "application/json")
.body("{\n \"authorDetails\": {\n \"channelId\": \"\",\n \"channelUrl\": \"\",\n \"displayName\": \"\",\n \"isChatModerator\": false,\n \"isChatOwner\": false,\n \"isChatSponsor\": false,\n \"isVerified\": false,\n \"profileImageUrl\": \"\"\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"authorChannelId\": \"\",\n \"displayMessage\": \"\",\n \"fanFundingEventDetails\": {\n \"amountDisplayString\": \"\",\n \"amountMicros\": \"\",\n \"currency\": \"\",\n \"userComment\": \"\"\n },\n \"giftMembershipReceivedDetails\": {\n \"associatedMembershipGiftingMessageId\": \"\",\n \"gifterChannelId\": \"\",\n \"memberLevelName\": \"\"\n },\n \"hasDisplayContent\": false,\n \"liveChatId\": \"\",\n \"memberMilestoneChatDetails\": {\n \"memberLevelName\": \"\",\n \"memberMonth\": 0,\n \"userComment\": \"\"\n },\n \"membershipGiftingDetails\": {\n \"giftMembershipsCount\": 0,\n \"giftMembershipsLevelName\": \"\"\n },\n \"messageDeletedDetails\": {\n \"deletedMessageId\": \"\"\n },\n \"messageRetractedDetails\": {\n \"retractedMessageId\": \"\"\n },\n \"newSponsorDetails\": {\n \"isUpgrade\": false,\n \"memberLevelName\": \"\"\n },\n \"publishedAt\": \"\",\n \"superChatDetails\": {\n \"amountDisplayString\": \"\",\n \"amountMicros\": \"\",\n \"currency\": \"\",\n \"tier\": 0,\n \"userComment\": \"\"\n },\n \"superStickerDetails\": {\n \"amountDisplayString\": \"\",\n \"amountMicros\": \"\",\n \"currency\": \"\",\n \"superStickerMetadata\": {\n \"altText\": \"\",\n \"altTextLanguage\": \"\",\n \"stickerId\": \"\"\n },\n \"tier\": 0\n },\n \"textMessageDetails\": {\n \"messageText\": \"\"\n },\n \"type\": \"\",\n \"userBannedDetails\": {\n \"banDurationSeconds\": \"\",\n \"banType\": \"\",\n \"bannedUserDetails\": {\n \"channelId\": \"\",\n \"channelUrl\": \"\",\n \"displayName\": \"\",\n \"profileImageUrl\": \"\"\n }\n }\n }\n}")
.asString();
const data = JSON.stringify({
authorDetails: {
channelId: '',
channelUrl: '',
displayName: '',
isChatModerator: false,
isChatOwner: false,
isChatSponsor: false,
isVerified: false,
profileImageUrl: ''
},
etag: '',
id: '',
kind: '',
snippet: {
authorChannelId: '',
displayMessage: '',
fanFundingEventDetails: {
amountDisplayString: '',
amountMicros: '',
currency: '',
userComment: ''
},
giftMembershipReceivedDetails: {
associatedMembershipGiftingMessageId: '',
gifterChannelId: '',
memberLevelName: ''
},
hasDisplayContent: false,
liveChatId: '',
memberMilestoneChatDetails: {
memberLevelName: '',
memberMonth: 0,
userComment: ''
},
membershipGiftingDetails: {
giftMembershipsCount: 0,
giftMembershipsLevelName: ''
},
messageDeletedDetails: {
deletedMessageId: ''
},
messageRetractedDetails: {
retractedMessageId: ''
},
newSponsorDetails: {
isUpgrade: false,
memberLevelName: ''
},
publishedAt: '',
superChatDetails: {
amountDisplayString: '',
amountMicros: '',
currency: '',
tier: 0,
userComment: ''
},
superStickerDetails: {
amountDisplayString: '',
amountMicros: '',
currency: '',
superStickerMetadata: {
altText: '',
altTextLanguage: '',
stickerId: ''
},
tier: 0
},
textMessageDetails: {
messageText: ''
},
type: '',
userBannedDetails: {
banDurationSeconds: '',
banType: '',
bannedUserDetails: {
channelId: '',
channelUrl: '',
displayName: '',
profileImageUrl: ''
}
}
}
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/youtube/v3/liveChat/messages?part=');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/youtube/v3/liveChat/messages',
params: {part: ''},
headers: {'content-type': 'application/json'},
data: {
authorDetails: {
channelId: '',
channelUrl: '',
displayName: '',
isChatModerator: false,
isChatOwner: false,
isChatSponsor: false,
isVerified: false,
profileImageUrl: ''
},
etag: '',
id: '',
kind: '',
snippet: {
authorChannelId: '',
displayMessage: '',
fanFundingEventDetails: {amountDisplayString: '', amountMicros: '', currency: '', userComment: ''},
giftMembershipReceivedDetails: {
associatedMembershipGiftingMessageId: '',
gifterChannelId: '',
memberLevelName: ''
},
hasDisplayContent: false,
liveChatId: '',
memberMilestoneChatDetails: {memberLevelName: '', memberMonth: 0, userComment: ''},
membershipGiftingDetails: {giftMembershipsCount: 0, giftMembershipsLevelName: ''},
messageDeletedDetails: {deletedMessageId: ''},
messageRetractedDetails: {retractedMessageId: ''},
newSponsorDetails: {isUpgrade: false, memberLevelName: ''},
publishedAt: '',
superChatDetails: {
amountDisplayString: '',
amountMicros: '',
currency: '',
tier: 0,
userComment: ''
},
superStickerDetails: {
amountDisplayString: '',
amountMicros: '',
currency: '',
superStickerMetadata: {altText: '', altTextLanguage: '', stickerId: ''},
tier: 0
},
textMessageDetails: {messageText: ''},
type: '',
userBannedDetails: {
banDurationSeconds: '',
banType: '',
bannedUserDetails: {channelId: '', channelUrl: '', displayName: '', profileImageUrl: ''}
}
}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/youtube/v3/liveChat/messages?part=';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"authorDetails":{"channelId":"","channelUrl":"","displayName":"","isChatModerator":false,"isChatOwner":false,"isChatSponsor":false,"isVerified":false,"profileImageUrl":""},"etag":"","id":"","kind":"","snippet":{"authorChannelId":"","displayMessage":"","fanFundingEventDetails":{"amountDisplayString":"","amountMicros":"","currency":"","userComment":""},"giftMembershipReceivedDetails":{"associatedMembershipGiftingMessageId":"","gifterChannelId":"","memberLevelName":""},"hasDisplayContent":false,"liveChatId":"","memberMilestoneChatDetails":{"memberLevelName":"","memberMonth":0,"userComment":""},"membershipGiftingDetails":{"giftMembershipsCount":0,"giftMembershipsLevelName":""},"messageDeletedDetails":{"deletedMessageId":""},"messageRetractedDetails":{"retractedMessageId":""},"newSponsorDetails":{"isUpgrade":false,"memberLevelName":""},"publishedAt":"","superChatDetails":{"amountDisplayString":"","amountMicros":"","currency":"","tier":0,"userComment":""},"superStickerDetails":{"amountDisplayString":"","amountMicros":"","currency":"","superStickerMetadata":{"altText":"","altTextLanguage":"","stickerId":""},"tier":0},"textMessageDetails":{"messageText":""},"type":"","userBannedDetails":{"banDurationSeconds":"","banType":"","bannedUserDetails":{"channelId":"","channelUrl":"","displayName":"","profileImageUrl":""}}}}'
};
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}}/youtube/v3/liveChat/messages?part=',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "authorDetails": {\n "channelId": "",\n "channelUrl": "",\n "displayName": "",\n "isChatModerator": false,\n "isChatOwner": false,\n "isChatSponsor": false,\n "isVerified": false,\n "profileImageUrl": ""\n },\n "etag": "",\n "id": "",\n "kind": "",\n "snippet": {\n "authorChannelId": "",\n "displayMessage": "",\n "fanFundingEventDetails": {\n "amountDisplayString": "",\n "amountMicros": "",\n "currency": "",\n "userComment": ""\n },\n "giftMembershipReceivedDetails": {\n "associatedMembershipGiftingMessageId": "",\n "gifterChannelId": "",\n "memberLevelName": ""\n },\n "hasDisplayContent": false,\n "liveChatId": "",\n "memberMilestoneChatDetails": {\n "memberLevelName": "",\n "memberMonth": 0,\n "userComment": ""\n },\n "membershipGiftingDetails": {\n "giftMembershipsCount": 0,\n "giftMembershipsLevelName": ""\n },\n "messageDeletedDetails": {\n "deletedMessageId": ""\n },\n "messageRetractedDetails": {\n "retractedMessageId": ""\n },\n "newSponsorDetails": {\n "isUpgrade": false,\n "memberLevelName": ""\n },\n "publishedAt": "",\n "superChatDetails": {\n "amountDisplayString": "",\n "amountMicros": "",\n "currency": "",\n "tier": 0,\n "userComment": ""\n },\n "superStickerDetails": {\n "amountDisplayString": "",\n "amountMicros": "",\n "currency": "",\n "superStickerMetadata": {\n "altText": "",\n "altTextLanguage": "",\n "stickerId": ""\n },\n "tier": 0\n },\n "textMessageDetails": {\n "messageText": ""\n },\n "type": "",\n "userBannedDetails": {\n "banDurationSeconds": "",\n "banType": "",\n "bannedUserDetails": {\n "channelId": "",\n "channelUrl": "",\n "displayName": "",\n "profileImageUrl": ""\n }\n }\n }\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"authorDetails\": {\n \"channelId\": \"\",\n \"channelUrl\": \"\",\n \"displayName\": \"\",\n \"isChatModerator\": false,\n \"isChatOwner\": false,\n \"isChatSponsor\": false,\n \"isVerified\": false,\n \"profileImageUrl\": \"\"\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"authorChannelId\": \"\",\n \"displayMessage\": \"\",\n \"fanFundingEventDetails\": {\n \"amountDisplayString\": \"\",\n \"amountMicros\": \"\",\n \"currency\": \"\",\n \"userComment\": \"\"\n },\n \"giftMembershipReceivedDetails\": {\n \"associatedMembershipGiftingMessageId\": \"\",\n \"gifterChannelId\": \"\",\n \"memberLevelName\": \"\"\n },\n \"hasDisplayContent\": false,\n \"liveChatId\": \"\",\n \"memberMilestoneChatDetails\": {\n \"memberLevelName\": \"\",\n \"memberMonth\": 0,\n \"userComment\": \"\"\n },\n \"membershipGiftingDetails\": {\n \"giftMembershipsCount\": 0,\n \"giftMembershipsLevelName\": \"\"\n },\n \"messageDeletedDetails\": {\n \"deletedMessageId\": \"\"\n },\n \"messageRetractedDetails\": {\n \"retractedMessageId\": \"\"\n },\n \"newSponsorDetails\": {\n \"isUpgrade\": false,\n \"memberLevelName\": \"\"\n },\n \"publishedAt\": \"\",\n \"superChatDetails\": {\n \"amountDisplayString\": \"\",\n \"amountMicros\": \"\",\n \"currency\": \"\",\n \"tier\": 0,\n \"userComment\": \"\"\n },\n \"superStickerDetails\": {\n \"amountDisplayString\": \"\",\n \"amountMicros\": \"\",\n \"currency\": \"\",\n \"superStickerMetadata\": {\n \"altText\": \"\",\n \"altTextLanguage\": \"\",\n \"stickerId\": \"\"\n },\n \"tier\": 0\n },\n \"textMessageDetails\": {\n \"messageText\": \"\"\n },\n \"type\": \"\",\n \"userBannedDetails\": {\n \"banDurationSeconds\": \"\",\n \"banType\": \"\",\n \"bannedUserDetails\": {\n \"channelId\": \"\",\n \"channelUrl\": \"\",\n \"displayName\": \"\",\n \"profileImageUrl\": \"\"\n }\n }\n }\n}")
val request = Request.Builder()
.url("{{baseUrl}}/youtube/v3/liveChat/messages?part=")
.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/youtube/v3/liveChat/messages?part=',
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({
authorDetails: {
channelId: '',
channelUrl: '',
displayName: '',
isChatModerator: false,
isChatOwner: false,
isChatSponsor: false,
isVerified: false,
profileImageUrl: ''
},
etag: '',
id: '',
kind: '',
snippet: {
authorChannelId: '',
displayMessage: '',
fanFundingEventDetails: {amountDisplayString: '', amountMicros: '', currency: '', userComment: ''},
giftMembershipReceivedDetails: {
associatedMembershipGiftingMessageId: '',
gifterChannelId: '',
memberLevelName: ''
},
hasDisplayContent: false,
liveChatId: '',
memberMilestoneChatDetails: {memberLevelName: '', memberMonth: 0, userComment: ''},
membershipGiftingDetails: {giftMembershipsCount: 0, giftMembershipsLevelName: ''},
messageDeletedDetails: {deletedMessageId: ''},
messageRetractedDetails: {retractedMessageId: ''},
newSponsorDetails: {isUpgrade: false, memberLevelName: ''},
publishedAt: '',
superChatDetails: {
amountDisplayString: '',
amountMicros: '',
currency: '',
tier: 0,
userComment: ''
},
superStickerDetails: {
amountDisplayString: '',
amountMicros: '',
currency: '',
superStickerMetadata: {altText: '', altTextLanguage: '', stickerId: ''},
tier: 0
},
textMessageDetails: {messageText: ''},
type: '',
userBannedDetails: {
banDurationSeconds: '',
banType: '',
bannedUserDetails: {channelId: '', channelUrl: '', displayName: '', profileImageUrl: ''}
}
}
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/youtube/v3/liveChat/messages',
qs: {part: ''},
headers: {'content-type': 'application/json'},
body: {
authorDetails: {
channelId: '',
channelUrl: '',
displayName: '',
isChatModerator: false,
isChatOwner: false,
isChatSponsor: false,
isVerified: false,
profileImageUrl: ''
},
etag: '',
id: '',
kind: '',
snippet: {
authorChannelId: '',
displayMessage: '',
fanFundingEventDetails: {amountDisplayString: '', amountMicros: '', currency: '', userComment: ''},
giftMembershipReceivedDetails: {
associatedMembershipGiftingMessageId: '',
gifterChannelId: '',
memberLevelName: ''
},
hasDisplayContent: false,
liveChatId: '',
memberMilestoneChatDetails: {memberLevelName: '', memberMonth: 0, userComment: ''},
membershipGiftingDetails: {giftMembershipsCount: 0, giftMembershipsLevelName: ''},
messageDeletedDetails: {deletedMessageId: ''},
messageRetractedDetails: {retractedMessageId: ''},
newSponsorDetails: {isUpgrade: false, memberLevelName: ''},
publishedAt: '',
superChatDetails: {
amountDisplayString: '',
amountMicros: '',
currency: '',
tier: 0,
userComment: ''
},
superStickerDetails: {
amountDisplayString: '',
amountMicros: '',
currency: '',
superStickerMetadata: {altText: '', altTextLanguage: '', stickerId: ''},
tier: 0
},
textMessageDetails: {messageText: ''},
type: '',
userBannedDetails: {
banDurationSeconds: '',
banType: '',
bannedUserDetails: {channelId: '', channelUrl: '', displayName: '', profileImageUrl: ''}
}
}
},
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}}/youtube/v3/liveChat/messages');
req.query({
part: ''
});
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
authorDetails: {
channelId: '',
channelUrl: '',
displayName: '',
isChatModerator: false,
isChatOwner: false,
isChatSponsor: false,
isVerified: false,
profileImageUrl: ''
},
etag: '',
id: '',
kind: '',
snippet: {
authorChannelId: '',
displayMessage: '',
fanFundingEventDetails: {
amountDisplayString: '',
amountMicros: '',
currency: '',
userComment: ''
},
giftMembershipReceivedDetails: {
associatedMembershipGiftingMessageId: '',
gifterChannelId: '',
memberLevelName: ''
},
hasDisplayContent: false,
liveChatId: '',
memberMilestoneChatDetails: {
memberLevelName: '',
memberMonth: 0,
userComment: ''
},
membershipGiftingDetails: {
giftMembershipsCount: 0,
giftMembershipsLevelName: ''
},
messageDeletedDetails: {
deletedMessageId: ''
},
messageRetractedDetails: {
retractedMessageId: ''
},
newSponsorDetails: {
isUpgrade: false,
memberLevelName: ''
},
publishedAt: '',
superChatDetails: {
amountDisplayString: '',
amountMicros: '',
currency: '',
tier: 0,
userComment: ''
},
superStickerDetails: {
amountDisplayString: '',
amountMicros: '',
currency: '',
superStickerMetadata: {
altText: '',
altTextLanguage: '',
stickerId: ''
},
tier: 0
},
textMessageDetails: {
messageText: ''
},
type: '',
userBannedDetails: {
banDurationSeconds: '',
banType: '',
bannedUserDetails: {
channelId: '',
channelUrl: '',
displayName: '',
profileImageUrl: ''
}
}
}
});
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}}/youtube/v3/liveChat/messages',
params: {part: ''},
headers: {'content-type': 'application/json'},
data: {
authorDetails: {
channelId: '',
channelUrl: '',
displayName: '',
isChatModerator: false,
isChatOwner: false,
isChatSponsor: false,
isVerified: false,
profileImageUrl: ''
},
etag: '',
id: '',
kind: '',
snippet: {
authorChannelId: '',
displayMessage: '',
fanFundingEventDetails: {amountDisplayString: '', amountMicros: '', currency: '', userComment: ''},
giftMembershipReceivedDetails: {
associatedMembershipGiftingMessageId: '',
gifterChannelId: '',
memberLevelName: ''
},
hasDisplayContent: false,
liveChatId: '',
memberMilestoneChatDetails: {memberLevelName: '', memberMonth: 0, userComment: ''},
membershipGiftingDetails: {giftMembershipsCount: 0, giftMembershipsLevelName: ''},
messageDeletedDetails: {deletedMessageId: ''},
messageRetractedDetails: {retractedMessageId: ''},
newSponsorDetails: {isUpgrade: false, memberLevelName: ''},
publishedAt: '',
superChatDetails: {
amountDisplayString: '',
amountMicros: '',
currency: '',
tier: 0,
userComment: ''
},
superStickerDetails: {
amountDisplayString: '',
amountMicros: '',
currency: '',
superStickerMetadata: {altText: '', altTextLanguage: '', stickerId: ''},
tier: 0
},
textMessageDetails: {messageText: ''},
type: '',
userBannedDetails: {
banDurationSeconds: '',
banType: '',
bannedUserDetails: {channelId: '', channelUrl: '', displayName: '', profileImageUrl: ''}
}
}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/youtube/v3/liveChat/messages?part=';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"authorDetails":{"channelId":"","channelUrl":"","displayName":"","isChatModerator":false,"isChatOwner":false,"isChatSponsor":false,"isVerified":false,"profileImageUrl":""},"etag":"","id":"","kind":"","snippet":{"authorChannelId":"","displayMessage":"","fanFundingEventDetails":{"amountDisplayString":"","amountMicros":"","currency":"","userComment":""},"giftMembershipReceivedDetails":{"associatedMembershipGiftingMessageId":"","gifterChannelId":"","memberLevelName":""},"hasDisplayContent":false,"liveChatId":"","memberMilestoneChatDetails":{"memberLevelName":"","memberMonth":0,"userComment":""},"membershipGiftingDetails":{"giftMembershipsCount":0,"giftMembershipsLevelName":""},"messageDeletedDetails":{"deletedMessageId":""},"messageRetractedDetails":{"retractedMessageId":""},"newSponsorDetails":{"isUpgrade":false,"memberLevelName":""},"publishedAt":"","superChatDetails":{"amountDisplayString":"","amountMicros":"","currency":"","tier":0,"userComment":""},"superStickerDetails":{"amountDisplayString":"","amountMicros":"","currency":"","superStickerMetadata":{"altText":"","altTextLanguage":"","stickerId":""},"tier":0},"textMessageDetails":{"messageText":""},"type":"","userBannedDetails":{"banDurationSeconds":"","banType":"","bannedUserDetails":{"channelId":"","channelUrl":"","displayName":"","profileImageUrl":""}}}}'
};
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 = @{ @"authorDetails": @{ @"channelId": @"", @"channelUrl": @"", @"displayName": @"", @"isChatModerator": @NO, @"isChatOwner": @NO, @"isChatSponsor": @NO, @"isVerified": @NO, @"profileImageUrl": @"" },
@"etag": @"",
@"id": @"",
@"kind": @"",
@"snippet": @{ @"authorChannelId": @"", @"displayMessage": @"", @"fanFundingEventDetails": @{ @"amountDisplayString": @"", @"amountMicros": @"", @"currency": @"", @"userComment": @"" }, @"giftMembershipReceivedDetails": @{ @"associatedMembershipGiftingMessageId": @"", @"gifterChannelId": @"", @"memberLevelName": @"" }, @"hasDisplayContent": @NO, @"liveChatId": @"", @"memberMilestoneChatDetails": @{ @"memberLevelName": @"", @"memberMonth": @0, @"userComment": @"" }, @"membershipGiftingDetails": @{ @"giftMembershipsCount": @0, @"giftMembershipsLevelName": @"" }, @"messageDeletedDetails": @{ @"deletedMessageId": @"" }, @"messageRetractedDetails": @{ @"retractedMessageId": @"" }, @"newSponsorDetails": @{ @"isUpgrade": @NO, @"memberLevelName": @"" }, @"publishedAt": @"", @"superChatDetails": @{ @"amountDisplayString": @"", @"amountMicros": @"", @"currency": @"", @"tier": @0, @"userComment": @"" }, @"superStickerDetails": @{ @"amountDisplayString": @"", @"amountMicros": @"", @"currency": @"", @"superStickerMetadata": @{ @"altText": @"", @"altTextLanguage": @"", @"stickerId": @"" }, @"tier": @0 }, @"textMessageDetails": @{ @"messageText": @"" }, @"type": @"", @"userBannedDetails": @{ @"banDurationSeconds": @"", @"banType": @"", @"bannedUserDetails": @{ @"channelId": @"", @"channelUrl": @"", @"displayName": @"", @"profileImageUrl": @"" } } } };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/youtube/v3/liveChat/messages?part="]
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}}/youtube/v3/liveChat/messages?part=" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"authorDetails\": {\n \"channelId\": \"\",\n \"channelUrl\": \"\",\n \"displayName\": \"\",\n \"isChatModerator\": false,\n \"isChatOwner\": false,\n \"isChatSponsor\": false,\n \"isVerified\": false,\n \"profileImageUrl\": \"\"\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"authorChannelId\": \"\",\n \"displayMessage\": \"\",\n \"fanFundingEventDetails\": {\n \"amountDisplayString\": \"\",\n \"amountMicros\": \"\",\n \"currency\": \"\",\n \"userComment\": \"\"\n },\n \"giftMembershipReceivedDetails\": {\n \"associatedMembershipGiftingMessageId\": \"\",\n \"gifterChannelId\": \"\",\n \"memberLevelName\": \"\"\n },\n \"hasDisplayContent\": false,\n \"liveChatId\": \"\",\n \"memberMilestoneChatDetails\": {\n \"memberLevelName\": \"\",\n \"memberMonth\": 0,\n \"userComment\": \"\"\n },\n \"membershipGiftingDetails\": {\n \"giftMembershipsCount\": 0,\n \"giftMembershipsLevelName\": \"\"\n },\n \"messageDeletedDetails\": {\n \"deletedMessageId\": \"\"\n },\n \"messageRetractedDetails\": {\n \"retractedMessageId\": \"\"\n },\n \"newSponsorDetails\": {\n \"isUpgrade\": false,\n \"memberLevelName\": \"\"\n },\n \"publishedAt\": \"\",\n \"superChatDetails\": {\n \"amountDisplayString\": \"\",\n \"amountMicros\": \"\",\n \"currency\": \"\",\n \"tier\": 0,\n \"userComment\": \"\"\n },\n \"superStickerDetails\": {\n \"amountDisplayString\": \"\",\n \"amountMicros\": \"\",\n \"currency\": \"\",\n \"superStickerMetadata\": {\n \"altText\": \"\",\n \"altTextLanguage\": \"\",\n \"stickerId\": \"\"\n },\n \"tier\": 0\n },\n \"textMessageDetails\": {\n \"messageText\": \"\"\n },\n \"type\": \"\",\n \"userBannedDetails\": {\n \"banDurationSeconds\": \"\",\n \"banType\": \"\",\n \"bannedUserDetails\": {\n \"channelId\": \"\",\n \"channelUrl\": \"\",\n \"displayName\": \"\",\n \"profileImageUrl\": \"\"\n }\n }\n }\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/youtube/v3/liveChat/messages?part=",
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([
'authorDetails' => [
'channelId' => '',
'channelUrl' => '',
'displayName' => '',
'isChatModerator' => null,
'isChatOwner' => null,
'isChatSponsor' => null,
'isVerified' => null,
'profileImageUrl' => ''
],
'etag' => '',
'id' => '',
'kind' => '',
'snippet' => [
'authorChannelId' => '',
'displayMessage' => '',
'fanFundingEventDetails' => [
'amountDisplayString' => '',
'amountMicros' => '',
'currency' => '',
'userComment' => ''
],
'giftMembershipReceivedDetails' => [
'associatedMembershipGiftingMessageId' => '',
'gifterChannelId' => '',
'memberLevelName' => ''
],
'hasDisplayContent' => null,
'liveChatId' => '',
'memberMilestoneChatDetails' => [
'memberLevelName' => '',
'memberMonth' => 0,
'userComment' => ''
],
'membershipGiftingDetails' => [
'giftMembershipsCount' => 0,
'giftMembershipsLevelName' => ''
],
'messageDeletedDetails' => [
'deletedMessageId' => ''
],
'messageRetractedDetails' => [
'retractedMessageId' => ''
],
'newSponsorDetails' => [
'isUpgrade' => null,
'memberLevelName' => ''
],
'publishedAt' => '',
'superChatDetails' => [
'amountDisplayString' => '',
'amountMicros' => '',
'currency' => '',
'tier' => 0,
'userComment' => ''
],
'superStickerDetails' => [
'amountDisplayString' => '',
'amountMicros' => '',
'currency' => '',
'superStickerMetadata' => [
'altText' => '',
'altTextLanguage' => '',
'stickerId' => ''
],
'tier' => 0
],
'textMessageDetails' => [
'messageText' => ''
],
'type' => '',
'userBannedDetails' => [
'banDurationSeconds' => '',
'banType' => '',
'bannedUserDetails' => [
'channelId' => '',
'channelUrl' => '',
'displayName' => '',
'profileImageUrl' => ''
]
]
]
]),
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}}/youtube/v3/liveChat/messages?part=', [
'body' => '{
"authorDetails": {
"channelId": "",
"channelUrl": "",
"displayName": "",
"isChatModerator": false,
"isChatOwner": false,
"isChatSponsor": false,
"isVerified": false,
"profileImageUrl": ""
},
"etag": "",
"id": "",
"kind": "",
"snippet": {
"authorChannelId": "",
"displayMessage": "",
"fanFundingEventDetails": {
"amountDisplayString": "",
"amountMicros": "",
"currency": "",
"userComment": ""
},
"giftMembershipReceivedDetails": {
"associatedMembershipGiftingMessageId": "",
"gifterChannelId": "",
"memberLevelName": ""
},
"hasDisplayContent": false,
"liveChatId": "",
"memberMilestoneChatDetails": {
"memberLevelName": "",
"memberMonth": 0,
"userComment": ""
},
"membershipGiftingDetails": {
"giftMembershipsCount": 0,
"giftMembershipsLevelName": ""
},
"messageDeletedDetails": {
"deletedMessageId": ""
},
"messageRetractedDetails": {
"retractedMessageId": ""
},
"newSponsorDetails": {
"isUpgrade": false,
"memberLevelName": ""
},
"publishedAt": "",
"superChatDetails": {
"amountDisplayString": "",
"amountMicros": "",
"currency": "",
"tier": 0,
"userComment": ""
},
"superStickerDetails": {
"amountDisplayString": "",
"amountMicros": "",
"currency": "",
"superStickerMetadata": {
"altText": "",
"altTextLanguage": "",
"stickerId": ""
},
"tier": 0
},
"textMessageDetails": {
"messageText": ""
},
"type": "",
"userBannedDetails": {
"banDurationSeconds": "",
"banType": "",
"bannedUserDetails": {
"channelId": "",
"channelUrl": "",
"displayName": "",
"profileImageUrl": ""
}
}
}
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/youtube/v3/liveChat/messages');
$request->setMethod(HTTP_METH_POST);
$request->setQueryData([
'part' => ''
]);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'authorDetails' => [
'channelId' => '',
'channelUrl' => '',
'displayName' => '',
'isChatModerator' => null,
'isChatOwner' => null,
'isChatSponsor' => null,
'isVerified' => null,
'profileImageUrl' => ''
],
'etag' => '',
'id' => '',
'kind' => '',
'snippet' => [
'authorChannelId' => '',
'displayMessage' => '',
'fanFundingEventDetails' => [
'amountDisplayString' => '',
'amountMicros' => '',
'currency' => '',
'userComment' => ''
],
'giftMembershipReceivedDetails' => [
'associatedMembershipGiftingMessageId' => '',
'gifterChannelId' => '',
'memberLevelName' => ''
],
'hasDisplayContent' => null,
'liveChatId' => '',
'memberMilestoneChatDetails' => [
'memberLevelName' => '',
'memberMonth' => 0,
'userComment' => ''
],
'membershipGiftingDetails' => [
'giftMembershipsCount' => 0,
'giftMembershipsLevelName' => ''
],
'messageDeletedDetails' => [
'deletedMessageId' => ''
],
'messageRetractedDetails' => [
'retractedMessageId' => ''
],
'newSponsorDetails' => [
'isUpgrade' => null,
'memberLevelName' => ''
],
'publishedAt' => '',
'superChatDetails' => [
'amountDisplayString' => '',
'amountMicros' => '',
'currency' => '',
'tier' => 0,
'userComment' => ''
],
'superStickerDetails' => [
'amountDisplayString' => '',
'amountMicros' => '',
'currency' => '',
'superStickerMetadata' => [
'altText' => '',
'altTextLanguage' => '',
'stickerId' => ''
],
'tier' => 0
],
'textMessageDetails' => [
'messageText' => ''
],
'type' => '',
'userBannedDetails' => [
'banDurationSeconds' => '',
'banType' => '',
'bannedUserDetails' => [
'channelId' => '',
'channelUrl' => '',
'displayName' => '',
'profileImageUrl' => ''
]
]
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'authorDetails' => [
'channelId' => '',
'channelUrl' => '',
'displayName' => '',
'isChatModerator' => null,
'isChatOwner' => null,
'isChatSponsor' => null,
'isVerified' => null,
'profileImageUrl' => ''
],
'etag' => '',
'id' => '',
'kind' => '',
'snippet' => [
'authorChannelId' => '',
'displayMessage' => '',
'fanFundingEventDetails' => [
'amountDisplayString' => '',
'amountMicros' => '',
'currency' => '',
'userComment' => ''
],
'giftMembershipReceivedDetails' => [
'associatedMembershipGiftingMessageId' => '',
'gifterChannelId' => '',
'memberLevelName' => ''
],
'hasDisplayContent' => null,
'liveChatId' => '',
'memberMilestoneChatDetails' => [
'memberLevelName' => '',
'memberMonth' => 0,
'userComment' => ''
],
'membershipGiftingDetails' => [
'giftMembershipsCount' => 0,
'giftMembershipsLevelName' => ''
],
'messageDeletedDetails' => [
'deletedMessageId' => ''
],
'messageRetractedDetails' => [
'retractedMessageId' => ''
],
'newSponsorDetails' => [
'isUpgrade' => null,
'memberLevelName' => ''
],
'publishedAt' => '',
'superChatDetails' => [
'amountDisplayString' => '',
'amountMicros' => '',
'currency' => '',
'tier' => 0,
'userComment' => ''
],
'superStickerDetails' => [
'amountDisplayString' => '',
'amountMicros' => '',
'currency' => '',
'superStickerMetadata' => [
'altText' => '',
'altTextLanguage' => '',
'stickerId' => ''
],
'tier' => 0
],
'textMessageDetails' => [
'messageText' => ''
],
'type' => '',
'userBannedDetails' => [
'banDurationSeconds' => '',
'banType' => '',
'bannedUserDetails' => [
'channelId' => '',
'channelUrl' => '',
'displayName' => '',
'profileImageUrl' => ''
]
]
]
]));
$request->setRequestUrl('{{baseUrl}}/youtube/v3/liveChat/messages');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setQuery(new http\QueryString([
'part' => ''
]));
$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}}/youtube/v3/liveChat/messages?part=' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"authorDetails": {
"channelId": "",
"channelUrl": "",
"displayName": "",
"isChatModerator": false,
"isChatOwner": false,
"isChatSponsor": false,
"isVerified": false,
"profileImageUrl": ""
},
"etag": "",
"id": "",
"kind": "",
"snippet": {
"authorChannelId": "",
"displayMessage": "",
"fanFundingEventDetails": {
"amountDisplayString": "",
"amountMicros": "",
"currency": "",
"userComment": ""
},
"giftMembershipReceivedDetails": {
"associatedMembershipGiftingMessageId": "",
"gifterChannelId": "",
"memberLevelName": ""
},
"hasDisplayContent": false,
"liveChatId": "",
"memberMilestoneChatDetails": {
"memberLevelName": "",
"memberMonth": 0,
"userComment": ""
},
"membershipGiftingDetails": {
"giftMembershipsCount": 0,
"giftMembershipsLevelName": ""
},
"messageDeletedDetails": {
"deletedMessageId": ""
},
"messageRetractedDetails": {
"retractedMessageId": ""
},
"newSponsorDetails": {
"isUpgrade": false,
"memberLevelName": ""
},
"publishedAt": "",
"superChatDetails": {
"amountDisplayString": "",
"amountMicros": "",
"currency": "",
"tier": 0,
"userComment": ""
},
"superStickerDetails": {
"amountDisplayString": "",
"amountMicros": "",
"currency": "",
"superStickerMetadata": {
"altText": "",
"altTextLanguage": "",
"stickerId": ""
},
"tier": 0
},
"textMessageDetails": {
"messageText": ""
},
"type": "",
"userBannedDetails": {
"banDurationSeconds": "",
"banType": "",
"bannedUserDetails": {
"channelId": "",
"channelUrl": "",
"displayName": "",
"profileImageUrl": ""
}
}
}
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/youtube/v3/liveChat/messages?part=' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"authorDetails": {
"channelId": "",
"channelUrl": "",
"displayName": "",
"isChatModerator": false,
"isChatOwner": false,
"isChatSponsor": false,
"isVerified": false,
"profileImageUrl": ""
},
"etag": "",
"id": "",
"kind": "",
"snippet": {
"authorChannelId": "",
"displayMessage": "",
"fanFundingEventDetails": {
"amountDisplayString": "",
"amountMicros": "",
"currency": "",
"userComment": ""
},
"giftMembershipReceivedDetails": {
"associatedMembershipGiftingMessageId": "",
"gifterChannelId": "",
"memberLevelName": ""
},
"hasDisplayContent": false,
"liveChatId": "",
"memberMilestoneChatDetails": {
"memberLevelName": "",
"memberMonth": 0,
"userComment": ""
},
"membershipGiftingDetails": {
"giftMembershipsCount": 0,
"giftMembershipsLevelName": ""
},
"messageDeletedDetails": {
"deletedMessageId": ""
},
"messageRetractedDetails": {
"retractedMessageId": ""
},
"newSponsorDetails": {
"isUpgrade": false,
"memberLevelName": ""
},
"publishedAt": "",
"superChatDetails": {
"amountDisplayString": "",
"amountMicros": "",
"currency": "",
"tier": 0,
"userComment": ""
},
"superStickerDetails": {
"amountDisplayString": "",
"amountMicros": "",
"currency": "",
"superStickerMetadata": {
"altText": "",
"altTextLanguage": "",
"stickerId": ""
},
"tier": 0
},
"textMessageDetails": {
"messageText": ""
},
"type": "",
"userBannedDetails": {
"banDurationSeconds": "",
"banType": "",
"bannedUserDetails": {
"channelId": "",
"channelUrl": "",
"displayName": "",
"profileImageUrl": ""
}
}
}
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"authorDetails\": {\n \"channelId\": \"\",\n \"channelUrl\": \"\",\n \"displayName\": \"\",\n \"isChatModerator\": false,\n \"isChatOwner\": false,\n \"isChatSponsor\": false,\n \"isVerified\": false,\n \"profileImageUrl\": \"\"\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"authorChannelId\": \"\",\n \"displayMessage\": \"\",\n \"fanFundingEventDetails\": {\n \"amountDisplayString\": \"\",\n \"amountMicros\": \"\",\n \"currency\": \"\",\n \"userComment\": \"\"\n },\n \"giftMembershipReceivedDetails\": {\n \"associatedMembershipGiftingMessageId\": \"\",\n \"gifterChannelId\": \"\",\n \"memberLevelName\": \"\"\n },\n \"hasDisplayContent\": false,\n \"liveChatId\": \"\",\n \"memberMilestoneChatDetails\": {\n \"memberLevelName\": \"\",\n \"memberMonth\": 0,\n \"userComment\": \"\"\n },\n \"membershipGiftingDetails\": {\n \"giftMembershipsCount\": 0,\n \"giftMembershipsLevelName\": \"\"\n },\n \"messageDeletedDetails\": {\n \"deletedMessageId\": \"\"\n },\n \"messageRetractedDetails\": {\n \"retractedMessageId\": \"\"\n },\n \"newSponsorDetails\": {\n \"isUpgrade\": false,\n \"memberLevelName\": \"\"\n },\n \"publishedAt\": \"\",\n \"superChatDetails\": {\n \"amountDisplayString\": \"\",\n \"amountMicros\": \"\",\n \"currency\": \"\",\n \"tier\": 0,\n \"userComment\": \"\"\n },\n \"superStickerDetails\": {\n \"amountDisplayString\": \"\",\n \"amountMicros\": \"\",\n \"currency\": \"\",\n \"superStickerMetadata\": {\n \"altText\": \"\",\n \"altTextLanguage\": \"\",\n \"stickerId\": \"\"\n },\n \"tier\": 0\n },\n \"textMessageDetails\": {\n \"messageText\": \"\"\n },\n \"type\": \"\",\n \"userBannedDetails\": {\n \"banDurationSeconds\": \"\",\n \"banType\": \"\",\n \"bannedUserDetails\": {\n \"channelId\": \"\",\n \"channelUrl\": \"\",\n \"displayName\": \"\",\n \"profileImageUrl\": \"\"\n }\n }\n }\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/youtube/v3/liveChat/messages?part=", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/youtube/v3/liveChat/messages"
querystring = {"part":""}
payload = {
"authorDetails": {
"channelId": "",
"channelUrl": "",
"displayName": "",
"isChatModerator": False,
"isChatOwner": False,
"isChatSponsor": False,
"isVerified": False,
"profileImageUrl": ""
},
"etag": "",
"id": "",
"kind": "",
"snippet": {
"authorChannelId": "",
"displayMessage": "",
"fanFundingEventDetails": {
"amountDisplayString": "",
"amountMicros": "",
"currency": "",
"userComment": ""
},
"giftMembershipReceivedDetails": {
"associatedMembershipGiftingMessageId": "",
"gifterChannelId": "",
"memberLevelName": ""
},
"hasDisplayContent": False,
"liveChatId": "",
"memberMilestoneChatDetails": {
"memberLevelName": "",
"memberMonth": 0,
"userComment": ""
},
"membershipGiftingDetails": {
"giftMembershipsCount": 0,
"giftMembershipsLevelName": ""
},
"messageDeletedDetails": { "deletedMessageId": "" },
"messageRetractedDetails": { "retractedMessageId": "" },
"newSponsorDetails": {
"isUpgrade": False,
"memberLevelName": ""
},
"publishedAt": "",
"superChatDetails": {
"amountDisplayString": "",
"amountMicros": "",
"currency": "",
"tier": 0,
"userComment": ""
},
"superStickerDetails": {
"amountDisplayString": "",
"amountMicros": "",
"currency": "",
"superStickerMetadata": {
"altText": "",
"altTextLanguage": "",
"stickerId": ""
},
"tier": 0
},
"textMessageDetails": { "messageText": "" },
"type": "",
"userBannedDetails": {
"banDurationSeconds": "",
"banType": "",
"bannedUserDetails": {
"channelId": "",
"channelUrl": "",
"displayName": "",
"profileImageUrl": ""
}
}
}
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/youtube/v3/liveChat/messages"
queryString <- list(part = "")
payload <- "{\n \"authorDetails\": {\n \"channelId\": \"\",\n \"channelUrl\": \"\",\n \"displayName\": \"\",\n \"isChatModerator\": false,\n \"isChatOwner\": false,\n \"isChatSponsor\": false,\n \"isVerified\": false,\n \"profileImageUrl\": \"\"\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"authorChannelId\": \"\",\n \"displayMessage\": \"\",\n \"fanFundingEventDetails\": {\n \"amountDisplayString\": \"\",\n \"amountMicros\": \"\",\n \"currency\": \"\",\n \"userComment\": \"\"\n },\n \"giftMembershipReceivedDetails\": {\n \"associatedMembershipGiftingMessageId\": \"\",\n \"gifterChannelId\": \"\",\n \"memberLevelName\": \"\"\n },\n \"hasDisplayContent\": false,\n \"liveChatId\": \"\",\n \"memberMilestoneChatDetails\": {\n \"memberLevelName\": \"\",\n \"memberMonth\": 0,\n \"userComment\": \"\"\n },\n \"membershipGiftingDetails\": {\n \"giftMembershipsCount\": 0,\n \"giftMembershipsLevelName\": \"\"\n },\n \"messageDeletedDetails\": {\n \"deletedMessageId\": \"\"\n },\n \"messageRetractedDetails\": {\n \"retractedMessageId\": \"\"\n },\n \"newSponsorDetails\": {\n \"isUpgrade\": false,\n \"memberLevelName\": \"\"\n },\n \"publishedAt\": \"\",\n \"superChatDetails\": {\n \"amountDisplayString\": \"\",\n \"amountMicros\": \"\",\n \"currency\": \"\",\n \"tier\": 0,\n \"userComment\": \"\"\n },\n \"superStickerDetails\": {\n \"amountDisplayString\": \"\",\n \"amountMicros\": \"\",\n \"currency\": \"\",\n \"superStickerMetadata\": {\n \"altText\": \"\",\n \"altTextLanguage\": \"\",\n \"stickerId\": \"\"\n },\n \"tier\": 0\n },\n \"textMessageDetails\": {\n \"messageText\": \"\"\n },\n \"type\": \"\",\n \"userBannedDetails\": {\n \"banDurationSeconds\": \"\",\n \"banType\": \"\",\n \"bannedUserDetails\": {\n \"channelId\": \"\",\n \"channelUrl\": \"\",\n \"displayName\": \"\",\n \"profileImageUrl\": \"\"\n }\n }\n }\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, query = queryString, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/youtube/v3/liveChat/messages?part=")
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 \"authorDetails\": {\n \"channelId\": \"\",\n \"channelUrl\": \"\",\n \"displayName\": \"\",\n \"isChatModerator\": false,\n \"isChatOwner\": false,\n \"isChatSponsor\": false,\n \"isVerified\": false,\n \"profileImageUrl\": \"\"\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"authorChannelId\": \"\",\n \"displayMessage\": \"\",\n \"fanFundingEventDetails\": {\n \"amountDisplayString\": \"\",\n \"amountMicros\": \"\",\n \"currency\": \"\",\n \"userComment\": \"\"\n },\n \"giftMembershipReceivedDetails\": {\n \"associatedMembershipGiftingMessageId\": \"\",\n \"gifterChannelId\": \"\",\n \"memberLevelName\": \"\"\n },\n \"hasDisplayContent\": false,\n \"liveChatId\": \"\",\n \"memberMilestoneChatDetails\": {\n \"memberLevelName\": \"\",\n \"memberMonth\": 0,\n \"userComment\": \"\"\n },\n \"membershipGiftingDetails\": {\n \"giftMembershipsCount\": 0,\n \"giftMembershipsLevelName\": \"\"\n },\n \"messageDeletedDetails\": {\n \"deletedMessageId\": \"\"\n },\n \"messageRetractedDetails\": {\n \"retractedMessageId\": \"\"\n },\n \"newSponsorDetails\": {\n \"isUpgrade\": false,\n \"memberLevelName\": \"\"\n },\n \"publishedAt\": \"\",\n \"superChatDetails\": {\n \"amountDisplayString\": \"\",\n \"amountMicros\": \"\",\n \"currency\": \"\",\n \"tier\": 0,\n \"userComment\": \"\"\n },\n \"superStickerDetails\": {\n \"amountDisplayString\": \"\",\n \"amountMicros\": \"\",\n \"currency\": \"\",\n \"superStickerMetadata\": {\n \"altText\": \"\",\n \"altTextLanguage\": \"\",\n \"stickerId\": \"\"\n },\n \"tier\": 0\n },\n \"textMessageDetails\": {\n \"messageText\": \"\"\n },\n \"type\": \"\",\n \"userBannedDetails\": {\n \"banDurationSeconds\": \"\",\n \"banType\": \"\",\n \"bannedUserDetails\": {\n \"channelId\": \"\",\n \"channelUrl\": \"\",\n \"displayName\": \"\",\n \"profileImageUrl\": \"\"\n }\n }\n }\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/youtube/v3/liveChat/messages') do |req|
req.params['part'] = ''
req.body = "{\n \"authorDetails\": {\n \"channelId\": \"\",\n \"channelUrl\": \"\",\n \"displayName\": \"\",\n \"isChatModerator\": false,\n \"isChatOwner\": false,\n \"isChatSponsor\": false,\n \"isVerified\": false,\n \"profileImageUrl\": \"\"\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"authorChannelId\": \"\",\n \"displayMessage\": \"\",\n \"fanFundingEventDetails\": {\n \"amountDisplayString\": \"\",\n \"amountMicros\": \"\",\n \"currency\": \"\",\n \"userComment\": \"\"\n },\n \"giftMembershipReceivedDetails\": {\n \"associatedMembershipGiftingMessageId\": \"\",\n \"gifterChannelId\": \"\",\n \"memberLevelName\": \"\"\n },\n \"hasDisplayContent\": false,\n \"liveChatId\": \"\",\n \"memberMilestoneChatDetails\": {\n \"memberLevelName\": \"\",\n \"memberMonth\": 0,\n \"userComment\": \"\"\n },\n \"membershipGiftingDetails\": {\n \"giftMembershipsCount\": 0,\n \"giftMembershipsLevelName\": \"\"\n },\n \"messageDeletedDetails\": {\n \"deletedMessageId\": \"\"\n },\n \"messageRetractedDetails\": {\n \"retractedMessageId\": \"\"\n },\n \"newSponsorDetails\": {\n \"isUpgrade\": false,\n \"memberLevelName\": \"\"\n },\n \"publishedAt\": \"\",\n \"superChatDetails\": {\n \"amountDisplayString\": \"\",\n \"amountMicros\": \"\",\n \"currency\": \"\",\n \"tier\": 0,\n \"userComment\": \"\"\n },\n \"superStickerDetails\": {\n \"amountDisplayString\": \"\",\n \"amountMicros\": \"\",\n \"currency\": \"\",\n \"superStickerMetadata\": {\n \"altText\": \"\",\n \"altTextLanguage\": \"\",\n \"stickerId\": \"\"\n },\n \"tier\": 0\n },\n \"textMessageDetails\": {\n \"messageText\": \"\"\n },\n \"type\": \"\",\n \"userBannedDetails\": {\n \"banDurationSeconds\": \"\",\n \"banType\": \"\",\n \"bannedUserDetails\": {\n \"channelId\": \"\",\n \"channelUrl\": \"\",\n \"displayName\": \"\",\n \"profileImageUrl\": \"\"\n }\n }\n }\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/youtube/v3/liveChat/messages";
let querystring = [
("part", ""),
];
let payload = json!({
"authorDetails": json!({
"channelId": "",
"channelUrl": "",
"displayName": "",
"isChatModerator": false,
"isChatOwner": false,
"isChatSponsor": false,
"isVerified": false,
"profileImageUrl": ""
}),
"etag": "",
"id": "",
"kind": "",
"snippet": json!({
"authorChannelId": "",
"displayMessage": "",
"fanFundingEventDetails": json!({
"amountDisplayString": "",
"amountMicros": "",
"currency": "",
"userComment": ""
}),
"giftMembershipReceivedDetails": json!({
"associatedMembershipGiftingMessageId": "",
"gifterChannelId": "",
"memberLevelName": ""
}),
"hasDisplayContent": false,
"liveChatId": "",
"memberMilestoneChatDetails": json!({
"memberLevelName": "",
"memberMonth": 0,
"userComment": ""
}),
"membershipGiftingDetails": json!({
"giftMembershipsCount": 0,
"giftMembershipsLevelName": ""
}),
"messageDeletedDetails": json!({"deletedMessageId": ""}),
"messageRetractedDetails": json!({"retractedMessageId": ""}),
"newSponsorDetails": json!({
"isUpgrade": false,
"memberLevelName": ""
}),
"publishedAt": "",
"superChatDetails": json!({
"amountDisplayString": "",
"amountMicros": "",
"currency": "",
"tier": 0,
"userComment": ""
}),
"superStickerDetails": json!({
"amountDisplayString": "",
"amountMicros": "",
"currency": "",
"superStickerMetadata": json!({
"altText": "",
"altTextLanguage": "",
"stickerId": ""
}),
"tier": 0
}),
"textMessageDetails": json!({"messageText": ""}),
"type": "",
"userBannedDetails": json!({
"banDurationSeconds": "",
"banType": "",
"bannedUserDetails": json!({
"channelId": "",
"channelUrl": "",
"displayName": "",
"profileImageUrl": ""
})
})
})
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.query(&querystring)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/youtube/v3/liveChat/messages?part=' \
--header 'content-type: application/json' \
--data '{
"authorDetails": {
"channelId": "",
"channelUrl": "",
"displayName": "",
"isChatModerator": false,
"isChatOwner": false,
"isChatSponsor": false,
"isVerified": false,
"profileImageUrl": ""
},
"etag": "",
"id": "",
"kind": "",
"snippet": {
"authorChannelId": "",
"displayMessage": "",
"fanFundingEventDetails": {
"amountDisplayString": "",
"amountMicros": "",
"currency": "",
"userComment": ""
},
"giftMembershipReceivedDetails": {
"associatedMembershipGiftingMessageId": "",
"gifterChannelId": "",
"memberLevelName": ""
},
"hasDisplayContent": false,
"liveChatId": "",
"memberMilestoneChatDetails": {
"memberLevelName": "",
"memberMonth": 0,
"userComment": ""
},
"membershipGiftingDetails": {
"giftMembershipsCount": 0,
"giftMembershipsLevelName": ""
},
"messageDeletedDetails": {
"deletedMessageId": ""
},
"messageRetractedDetails": {
"retractedMessageId": ""
},
"newSponsorDetails": {
"isUpgrade": false,
"memberLevelName": ""
},
"publishedAt": "",
"superChatDetails": {
"amountDisplayString": "",
"amountMicros": "",
"currency": "",
"tier": 0,
"userComment": ""
},
"superStickerDetails": {
"amountDisplayString": "",
"amountMicros": "",
"currency": "",
"superStickerMetadata": {
"altText": "",
"altTextLanguage": "",
"stickerId": ""
},
"tier": 0
},
"textMessageDetails": {
"messageText": ""
},
"type": "",
"userBannedDetails": {
"banDurationSeconds": "",
"banType": "",
"bannedUserDetails": {
"channelId": "",
"channelUrl": "",
"displayName": "",
"profileImageUrl": ""
}
}
}
}'
echo '{
"authorDetails": {
"channelId": "",
"channelUrl": "",
"displayName": "",
"isChatModerator": false,
"isChatOwner": false,
"isChatSponsor": false,
"isVerified": false,
"profileImageUrl": ""
},
"etag": "",
"id": "",
"kind": "",
"snippet": {
"authorChannelId": "",
"displayMessage": "",
"fanFundingEventDetails": {
"amountDisplayString": "",
"amountMicros": "",
"currency": "",
"userComment": ""
},
"giftMembershipReceivedDetails": {
"associatedMembershipGiftingMessageId": "",
"gifterChannelId": "",
"memberLevelName": ""
},
"hasDisplayContent": false,
"liveChatId": "",
"memberMilestoneChatDetails": {
"memberLevelName": "",
"memberMonth": 0,
"userComment": ""
},
"membershipGiftingDetails": {
"giftMembershipsCount": 0,
"giftMembershipsLevelName": ""
},
"messageDeletedDetails": {
"deletedMessageId": ""
},
"messageRetractedDetails": {
"retractedMessageId": ""
},
"newSponsorDetails": {
"isUpgrade": false,
"memberLevelName": ""
},
"publishedAt": "",
"superChatDetails": {
"amountDisplayString": "",
"amountMicros": "",
"currency": "",
"tier": 0,
"userComment": ""
},
"superStickerDetails": {
"amountDisplayString": "",
"amountMicros": "",
"currency": "",
"superStickerMetadata": {
"altText": "",
"altTextLanguage": "",
"stickerId": ""
},
"tier": 0
},
"textMessageDetails": {
"messageText": ""
},
"type": "",
"userBannedDetails": {
"banDurationSeconds": "",
"banType": "",
"bannedUserDetails": {
"channelId": "",
"channelUrl": "",
"displayName": "",
"profileImageUrl": ""
}
}
}
}' | \
http POST '{{baseUrl}}/youtube/v3/liveChat/messages?part=' \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "authorDetails": {\n "channelId": "",\n "channelUrl": "",\n "displayName": "",\n "isChatModerator": false,\n "isChatOwner": false,\n "isChatSponsor": false,\n "isVerified": false,\n "profileImageUrl": ""\n },\n "etag": "",\n "id": "",\n "kind": "",\n "snippet": {\n "authorChannelId": "",\n "displayMessage": "",\n "fanFundingEventDetails": {\n "amountDisplayString": "",\n "amountMicros": "",\n "currency": "",\n "userComment": ""\n },\n "giftMembershipReceivedDetails": {\n "associatedMembershipGiftingMessageId": "",\n "gifterChannelId": "",\n "memberLevelName": ""\n },\n "hasDisplayContent": false,\n "liveChatId": "",\n "memberMilestoneChatDetails": {\n "memberLevelName": "",\n "memberMonth": 0,\n "userComment": ""\n },\n "membershipGiftingDetails": {\n "giftMembershipsCount": 0,\n "giftMembershipsLevelName": ""\n },\n "messageDeletedDetails": {\n "deletedMessageId": ""\n },\n "messageRetractedDetails": {\n "retractedMessageId": ""\n },\n "newSponsorDetails": {\n "isUpgrade": false,\n "memberLevelName": ""\n },\n "publishedAt": "",\n "superChatDetails": {\n "amountDisplayString": "",\n "amountMicros": "",\n "currency": "",\n "tier": 0,\n "userComment": ""\n },\n "superStickerDetails": {\n "amountDisplayString": "",\n "amountMicros": "",\n "currency": "",\n "superStickerMetadata": {\n "altText": "",\n "altTextLanguage": "",\n "stickerId": ""\n },\n "tier": 0\n },\n "textMessageDetails": {\n "messageText": ""\n },\n "type": "",\n "userBannedDetails": {\n "banDurationSeconds": "",\n "banType": "",\n "bannedUserDetails": {\n "channelId": "",\n "channelUrl": "",\n "displayName": "",\n "profileImageUrl": ""\n }\n }\n }\n}' \
--output-document \
- '{{baseUrl}}/youtube/v3/liveChat/messages?part='
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"authorDetails": [
"channelId": "",
"channelUrl": "",
"displayName": "",
"isChatModerator": false,
"isChatOwner": false,
"isChatSponsor": false,
"isVerified": false,
"profileImageUrl": ""
],
"etag": "",
"id": "",
"kind": "",
"snippet": [
"authorChannelId": "",
"displayMessage": "",
"fanFundingEventDetails": [
"amountDisplayString": "",
"amountMicros": "",
"currency": "",
"userComment": ""
],
"giftMembershipReceivedDetails": [
"associatedMembershipGiftingMessageId": "",
"gifterChannelId": "",
"memberLevelName": ""
],
"hasDisplayContent": false,
"liveChatId": "",
"memberMilestoneChatDetails": [
"memberLevelName": "",
"memberMonth": 0,
"userComment": ""
],
"membershipGiftingDetails": [
"giftMembershipsCount": 0,
"giftMembershipsLevelName": ""
],
"messageDeletedDetails": ["deletedMessageId": ""],
"messageRetractedDetails": ["retractedMessageId": ""],
"newSponsorDetails": [
"isUpgrade": false,
"memberLevelName": ""
],
"publishedAt": "",
"superChatDetails": [
"amountDisplayString": "",
"amountMicros": "",
"currency": "",
"tier": 0,
"userComment": ""
],
"superStickerDetails": [
"amountDisplayString": "",
"amountMicros": "",
"currency": "",
"superStickerMetadata": [
"altText": "",
"altTextLanguage": "",
"stickerId": ""
],
"tier": 0
],
"textMessageDetails": ["messageText": ""],
"type": "",
"userBannedDetails": [
"banDurationSeconds": "",
"banType": "",
"bannedUserDetails": [
"channelId": "",
"channelUrl": "",
"displayName": "",
"profileImageUrl": ""
]
]
]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/youtube/v3/liveChat/messages?part=")! 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()
GET
youtube.liveChatMessages.list
{{baseUrl}}/youtube/v3/liveChat/messages
QUERY PARAMS
liveChatId
part
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/youtube/v3/liveChat/messages?liveChatId=&part=");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/youtube/v3/liveChat/messages" {:query-params {:liveChatId ""
:part ""}})
require "http/client"
url = "{{baseUrl}}/youtube/v3/liveChat/messages?liveChatId=&part="
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}}/youtube/v3/liveChat/messages?liveChatId=&part="),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/youtube/v3/liveChat/messages?liveChatId=&part=");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/youtube/v3/liveChat/messages?liveChatId=&part="
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/youtube/v3/liveChat/messages?liveChatId=&part= HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/youtube/v3/liveChat/messages?liveChatId=&part=")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/youtube/v3/liveChat/messages?liveChatId=&part="))
.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}}/youtube/v3/liveChat/messages?liveChatId=&part=")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/youtube/v3/liveChat/messages?liveChatId=&part=")
.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}}/youtube/v3/liveChat/messages?liveChatId=&part=');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/youtube/v3/liveChat/messages',
params: {liveChatId: '', part: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/youtube/v3/liveChat/messages?liveChatId=&part=';
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}}/youtube/v3/liveChat/messages?liveChatId=&part=',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/youtube/v3/liveChat/messages?liveChatId=&part=")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/youtube/v3/liveChat/messages?liveChatId=&part=',
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}}/youtube/v3/liveChat/messages',
qs: {liveChatId: '', part: ''}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/youtube/v3/liveChat/messages');
req.query({
liveChatId: '',
part: ''
});
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}}/youtube/v3/liveChat/messages',
params: {liveChatId: '', part: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/youtube/v3/liveChat/messages?liveChatId=&part=';
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}}/youtube/v3/liveChat/messages?liveChatId=&part="]
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}}/youtube/v3/liveChat/messages?liveChatId=&part=" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/youtube/v3/liveChat/messages?liveChatId=&part=",
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}}/youtube/v3/liveChat/messages?liveChatId=&part=');
echo $response->getBody();
setUrl('{{baseUrl}}/youtube/v3/liveChat/messages');
$request->setMethod(HTTP_METH_GET);
$request->setQueryData([
'liveChatId' => '',
'part' => ''
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/youtube/v3/liveChat/messages');
$request->setRequestMethod('GET');
$request->setQuery(new http\QueryString([
'liveChatId' => '',
'part' => ''
]));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/youtube/v3/liveChat/messages?liveChatId=&part=' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/youtube/v3/liveChat/messages?liveChatId=&part=' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/youtube/v3/liveChat/messages?liveChatId=&part=")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/youtube/v3/liveChat/messages"
querystring = {"liveChatId":"","part":""}
response = requests.get(url, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/youtube/v3/liveChat/messages"
queryString <- list(
liveChatId = "",
part = ""
)
response <- VERB("GET", url, query = queryString, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/youtube/v3/liveChat/messages?liveChatId=&part=")
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/youtube/v3/liveChat/messages') do |req|
req.params['liveChatId'] = ''
req.params['part'] = ''
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/youtube/v3/liveChat/messages";
let querystring = [
("liveChatId", ""),
("part", ""),
];
let client = reqwest::Client::new();
let response = client.get(url)
.query(&querystring)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url '{{baseUrl}}/youtube/v3/liveChat/messages?liveChatId=&part='
http GET '{{baseUrl}}/youtube/v3/liveChat/messages?liveChatId=&part='
wget --quiet \
--method GET \
--output-document \
- '{{baseUrl}}/youtube/v3/liveChat/messages?liveChatId=&part='
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/youtube/v3/liveChat/messages?liveChatId=&part=")! 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()
DELETE
youtube.liveChatModerators.delete
{{baseUrl}}/youtube/v3/liveChat/moderators
QUERY PARAMS
id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/youtube/v3/liveChat/moderators?id=");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/delete "{{baseUrl}}/youtube/v3/liveChat/moderators" {:query-params {:id ""}})
require "http/client"
url = "{{baseUrl}}/youtube/v3/liveChat/moderators?id="
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}}/youtube/v3/liveChat/moderators?id="),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/youtube/v3/liveChat/moderators?id=");
var request = new RestRequest("", Method.Delete);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/youtube/v3/liveChat/moderators?id="
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/youtube/v3/liveChat/moderators?id= HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/youtube/v3/liveChat/moderators?id=")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/youtube/v3/liveChat/moderators?id="))
.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}}/youtube/v3/liveChat/moderators?id=")
.delete(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/youtube/v3/liveChat/moderators?id=")
.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}}/youtube/v3/liveChat/moderators?id=');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'DELETE',
url: '{{baseUrl}}/youtube/v3/liveChat/moderators',
params: {id: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/youtube/v3/liveChat/moderators?id=';
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}}/youtube/v3/liveChat/moderators?id=',
method: 'DELETE',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/youtube/v3/liveChat/moderators?id=")
.delete(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'DELETE',
hostname: 'example.com',
port: null,
path: '/baseUrl/youtube/v3/liveChat/moderators?id=',
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}}/youtube/v3/liveChat/moderators',
qs: {id: ''}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('DELETE', '{{baseUrl}}/youtube/v3/liveChat/moderators');
req.query({
id: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'DELETE',
url: '{{baseUrl}}/youtube/v3/liveChat/moderators',
params: {id: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/youtube/v3/liveChat/moderators?id=';
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}}/youtube/v3/liveChat/moderators?id="]
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}}/youtube/v3/liveChat/moderators?id=" in
Client.call `DELETE uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/youtube/v3/liveChat/moderators?id=",
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}}/youtube/v3/liveChat/moderators?id=');
echo $response->getBody();
setUrl('{{baseUrl}}/youtube/v3/liveChat/moderators');
$request->setMethod(HTTP_METH_DELETE);
$request->setQueryData([
'id' => ''
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/youtube/v3/liveChat/moderators');
$request->setRequestMethod('DELETE');
$request->setQuery(new http\QueryString([
'id' => ''
]));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/youtube/v3/liveChat/moderators?id=' -Method DELETE
$response = Invoke-RestMethod -Uri '{{baseUrl}}/youtube/v3/liveChat/moderators?id=' -Method DELETE
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("DELETE", "/baseUrl/youtube/v3/liveChat/moderators?id=")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/youtube/v3/liveChat/moderators"
querystring = {"id":""}
response = requests.delete(url, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/youtube/v3/liveChat/moderators"
queryString <- list(id = "")
response <- VERB("DELETE", url, query = queryString, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/youtube/v3/liveChat/moderators?id=")
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/youtube/v3/liveChat/moderators') do |req|
req.params['id'] = ''
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/youtube/v3/liveChat/moderators";
let querystring = [
("id", ""),
];
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("DELETE").unwrap(), url)
.query(&querystring)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request DELETE \
--url '{{baseUrl}}/youtube/v3/liveChat/moderators?id='
http DELETE '{{baseUrl}}/youtube/v3/liveChat/moderators?id='
wget --quiet \
--method DELETE \
--output-document \
- '{{baseUrl}}/youtube/v3/liveChat/moderators?id='
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/youtube/v3/liveChat/moderators?id=")! 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()
POST
youtube.liveChatModerators.insert
{{baseUrl}}/youtube/v3/liveChat/moderators
QUERY PARAMS
part
BODY json
{
"etag": "",
"id": "",
"kind": "",
"snippet": {
"liveChatId": "",
"moderatorDetails": {
"channelId": "",
"channelUrl": "",
"displayName": "",
"profileImageUrl": ""
}
}
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/youtube/v3/liveChat/moderators?part=");
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 \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"liveChatId\": \"\",\n \"moderatorDetails\": {\n \"channelId\": \"\",\n \"channelUrl\": \"\",\n \"displayName\": \"\",\n \"profileImageUrl\": \"\"\n }\n }\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/youtube/v3/liveChat/moderators" {:query-params {:part ""}
:content-type :json
:form-params {:etag ""
:id ""
:kind ""
:snippet {:liveChatId ""
:moderatorDetails {:channelId ""
:channelUrl ""
:displayName ""
:profileImageUrl ""}}}})
require "http/client"
url = "{{baseUrl}}/youtube/v3/liveChat/moderators?part="
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"liveChatId\": \"\",\n \"moderatorDetails\": {\n \"channelId\": \"\",\n \"channelUrl\": \"\",\n \"displayName\": \"\",\n \"profileImageUrl\": \"\"\n }\n }\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/youtube/v3/liveChat/moderators?part="),
Content = new StringContent("{\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"liveChatId\": \"\",\n \"moderatorDetails\": {\n \"channelId\": \"\",\n \"channelUrl\": \"\",\n \"displayName\": \"\",\n \"profileImageUrl\": \"\"\n }\n }\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/youtube/v3/liveChat/moderators?part=");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"liveChatId\": \"\",\n \"moderatorDetails\": {\n \"channelId\": \"\",\n \"channelUrl\": \"\",\n \"displayName\": \"\",\n \"profileImageUrl\": \"\"\n }\n }\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/youtube/v3/liveChat/moderators?part="
payload := strings.NewReader("{\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"liveChatId\": \"\",\n \"moderatorDetails\": {\n \"channelId\": \"\",\n \"channelUrl\": \"\",\n \"displayName\": \"\",\n \"profileImageUrl\": \"\"\n }\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/youtube/v3/liveChat/moderators?part= HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 216
{
"etag": "",
"id": "",
"kind": "",
"snippet": {
"liveChatId": "",
"moderatorDetails": {
"channelId": "",
"channelUrl": "",
"displayName": "",
"profileImageUrl": ""
}
}
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/youtube/v3/liveChat/moderators?part=")
.setHeader("content-type", "application/json")
.setBody("{\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"liveChatId\": \"\",\n \"moderatorDetails\": {\n \"channelId\": \"\",\n \"channelUrl\": \"\",\n \"displayName\": \"\",\n \"profileImageUrl\": \"\"\n }\n }\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/youtube/v3/liveChat/moderators?part="))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"liveChatId\": \"\",\n \"moderatorDetails\": {\n \"channelId\": \"\",\n \"channelUrl\": \"\",\n \"displayName\": \"\",\n \"profileImageUrl\": \"\"\n }\n }\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"liveChatId\": \"\",\n \"moderatorDetails\": {\n \"channelId\": \"\",\n \"channelUrl\": \"\",\n \"displayName\": \"\",\n \"profileImageUrl\": \"\"\n }\n }\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/youtube/v3/liveChat/moderators?part=")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/youtube/v3/liveChat/moderators?part=")
.header("content-type", "application/json")
.body("{\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"liveChatId\": \"\",\n \"moderatorDetails\": {\n \"channelId\": \"\",\n \"channelUrl\": \"\",\n \"displayName\": \"\",\n \"profileImageUrl\": \"\"\n }\n }\n}")
.asString();
const data = JSON.stringify({
etag: '',
id: '',
kind: '',
snippet: {
liveChatId: '',
moderatorDetails: {
channelId: '',
channelUrl: '',
displayName: '',
profileImageUrl: ''
}
}
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/youtube/v3/liveChat/moderators?part=');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/youtube/v3/liveChat/moderators',
params: {part: ''},
headers: {'content-type': 'application/json'},
data: {
etag: '',
id: '',
kind: '',
snippet: {
liveChatId: '',
moderatorDetails: {channelId: '', channelUrl: '', displayName: '', profileImageUrl: ''}
}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/youtube/v3/liveChat/moderators?part=';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"etag":"","id":"","kind":"","snippet":{"liveChatId":"","moderatorDetails":{"channelId":"","channelUrl":"","displayName":"","profileImageUrl":""}}}'
};
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}}/youtube/v3/liveChat/moderators?part=',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "etag": "",\n "id": "",\n "kind": "",\n "snippet": {\n "liveChatId": "",\n "moderatorDetails": {\n "channelId": "",\n "channelUrl": "",\n "displayName": "",\n "profileImageUrl": ""\n }\n }\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"liveChatId\": \"\",\n \"moderatorDetails\": {\n \"channelId\": \"\",\n \"channelUrl\": \"\",\n \"displayName\": \"\",\n \"profileImageUrl\": \"\"\n }\n }\n}")
val request = Request.Builder()
.url("{{baseUrl}}/youtube/v3/liveChat/moderators?part=")
.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/youtube/v3/liveChat/moderators?part=',
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({
etag: '',
id: '',
kind: '',
snippet: {
liveChatId: '',
moderatorDetails: {channelId: '', channelUrl: '', displayName: '', profileImageUrl: ''}
}
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/youtube/v3/liveChat/moderators',
qs: {part: ''},
headers: {'content-type': 'application/json'},
body: {
etag: '',
id: '',
kind: '',
snippet: {
liveChatId: '',
moderatorDetails: {channelId: '', channelUrl: '', displayName: '', profileImageUrl: ''}
}
},
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}}/youtube/v3/liveChat/moderators');
req.query({
part: ''
});
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
etag: '',
id: '',
kind: '',
snippet: {
liveChatId: '',
moderatorDetails: {
channelId: '',
channelUrl: '',
displayName: '',
profileImageUrl: ''
}
}
});
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}}/youtube/v3/liveChat/moderators',
params: {part: ''},
headers: {'content-type': 'application/json'},
data: {
etag: '',
id: '',
kind: '',
snippet: {
liveChatId: '',
moderatorDetails: {channelId: '', channelUrl: '', displayName: '', profileImageUrl: ''}
}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/youtube/v3/liveChat/moderators?part=';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"etag":"","id":"","kind":"","snippet":{"liveChatId":"","moderatorDetails":{"channelId":"","channelUrl":"","displayName":"","profileImageUrl":""}}}'
};
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 = @{ @"etag": @"",
@"id": @"",
@"kind": @"",
@"snippet": @{ @"liveChatId": @"", @"moderatorDetails": @{ @"channelId": @"", @"channelUrl": @"", @"displayName": @"", @"profileImageUrl": @"" } } };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/youtube/v3/liveChat/moderators?part="]
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}}/youtube/v3/liveChat/moderators?part=" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"liveChatId\": \"\",\n \"moderatorDetails\": {\n \"channelId\": \"\",\n \"channelUrl\": \"\",\n \"displayName\": \"\",\n \"profileImageUrl\": \"\"\n }\n }\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/youtube/v3/liveChat/moderators?part=",
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([
'etag' => '',
'id' => '',
'kind' => '',
'snippet' => [
'liveChatId' => '',
'moderatorDetails' => [
'channelId' => '',
'channelUrl' => '',
'displayName' => '',
'profileImageUrl' => ''
]
]
]),
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}}/youtube/v3/liveChat/moderators?part=', [
'body' => '{
"etag": "",
"id": "",
"kind": "",
"snippet": {
"liveChatId": "",
"moderatorDetails": {
"channelId": "",
"channelUrl": "",
"displayName": "",
"profileImageUrl": ""
}
}
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/youtube/v3/liveChat/moderators');
$request->setMethod(HTTP_METH_POST);
$request->setQueryData([
'part' => ''
]);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'etag' => '',
'id' => '',
'kind' => '',
'snippet' => [
'liveChatId' => '',
'moderatorDetails' => [
'channelId' => '',
'channelUrl' => '',
'displayName' => '',
'profileImageUrl' => ''
]
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'etag' => '',
'id' => '',
'kind' => '',
'snippet' => [
'liveChatId' => '',
'moderatorDetails' => [
'channelId' => '',
'channelUrl' => '',
'displayName' => '',
'profileImageUrl' => ''
]
]
]));
$request->setRequestUrl('{{baseUrl}}/youtube/v3/liveChat/moderators');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setQuery(new http\QueryString([
'part' => ''
]));
$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}}/youtube/v3/liveChat/moderators?part=' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"etag": "",
"id": "",
"kind": "",
"snippet": {
"liveChatId": "",
"moderatorDetails": {
"channelId": "",
"channelUrl": "",
"displayName": "",
"profileImageUrl": ""
}
}
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/youtube/v3/liveChat/moderators?part=' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"etag": "",
"id": "",
"kind": "",
"snippet": {
"liveChatId": "",
"moderatorDetails": {
"channelId": "",
"channelUrl": "",
"displayName": "",
"profileImageUrl": ""
}
}
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"liveChatId\": \"\",\n \"moderatorDetails\": {\n \"channelId\": \"\",\n \"channelUrl\": \"\",\n \"displayName\": \"\",\n \"profileImageUrl\": \"\"\n }\n }\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/youtube/v3/liveChat/moderators?part=", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/youtube/v3/liveChat/moderators"
querystring = {"part":""}
payload = {
"etag": "",
"id": "",
"kind": "",
"snippet": {
"liveChatId": "",
"moderatorDetails": {
"channelId": "",
"channelUrl": "",
"displayName": "",
"profileImageUrl": ""
}
}
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/youtube/v3/liveChat/moderators"
queryString <- list(part = "")
payload <- "{\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"liveChatId\": \"\",\n \"moderatorDetails\": {\n \"channelId\": \"\",\n \"channelUrl\": \"\",\n \"displayName\": \"\",\n \"profileImageUrl\": \"\"\n }\n }\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, query = queryString, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/youtube/v3/liveChat/moderators?part=")
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 \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"liveChatId\": \"\",\n \"moderatorDetails\": {\n \"channelId\": \"\",\n \"channelUrl\": \"\",\n \"displayName\": \"\",\n \"profileImageUrl\": \"\"\n }\n }\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/youtube/v3/liveChat/moderators') do |req|
req.params['part'] = ''
req.body = "{\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"liveChatId\": \"\",\n \"moderatorDetails\": {\n \"channelId\": \"\",\n \"channelUrl\": \"\",\n \"displayName\": \"\",\n \"profileImageUrl\": \"\"\n }\n }\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/youtube/v3/liveChat/moderators";
let querystring = [
("part", ""),
];
let payload = json!({
"etag": "",
"id": "",
"kind": "",
"snippet": json!({
"liveChatId": "",
"moderatorDetails": json!({
"channelId": "",
"channelUrl": "",
"displayName": "",
"profileImageUrl": ""
})
})
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.query(&querystring)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/youtube/v3/liveChat/moderators?part=' \
--header 'content-type: application/json' \
--data '{
"etag": "",
"id": "",
"kind": "",
"snippet": {
"liveChatId": "",
"moderatorDetails": {
"channelId": "",
"channelUrl": "",
"displayName": "",
"profileImageUrl": ""
}
}
}'
echo '{
"etag": "",
"id": "",
"kind": "",
"snippet": {
"liveChatId": "",
"moderatorDetails": {
"channelId": "",
"channelUrl": "",
"displayName": "",
"profileImageUrl": ""
}
}
}' | \
http POST '{{baseUrl}}/youtube/v3/liveChat/moderators?part=' \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "etag": "",\n "id": "",\n "kind": "",\n "snippet": {\n "liveChatId": "",\n "moderatorDetails": {\n "channelId": "",\n "channelUrl": "",\n "displayName": "",\n "profileImageUrl": ""\n }\n }\n}' \
--output-document \
- '{{baseUrl}}/youtube/v3/liveChat/moderators?part='
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"etag": "",
"id": "",
"kind": "",
"snippet": [
"liveChatId": "",
"moderatorDetails": [
"channelId": "",
"channelUrl": "",
"displayName": "",
"profileImageUrl": ""
]
]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/youtube/v3/liveChat/moderators?part=")! 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()
GET
youtube.liveChatModerators.list
{{baseUrl}}/youtube/v3/liveChat/moderators
QUERY PARAMS
liveChatId
part
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/youtube/v3/liveChat/moderators?liveChatId=&part=");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/youtube/v3/liveChat/moderators" {:query-params {:liveChatId ""
:part ""}})
require "http/client"
url = "{{baseUrl}}/youtube/v3/liveChat/moderators?liveChatId=&part="
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}}/youtube/v3/liveChat/moderators?liveChatId=&part="),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/youtube/v3/liveChat/moderators?liveChatId=&part=");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/youtube/v3/liveChat/moderators?liveChatId=&part="
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/youtube/v3/liveChat/moderators?liveChatId=&part= HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/youtube/v3/liveChat/moderators?liveChatId=&part=")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/youtube/v3/liveChat/moderators?liveChatId=&part="))
.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}}/youtube/v3/liveChat/moderators?liveChatId=&part=")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/youtube/v3/liveChat/moderators?liveChatId=&part=")
.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}}/youtube/v3/liveChat/moderators?liveChatId=&part=');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/youtube/v3/liveChat/moderators',
params: {liveChatId: '', part: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/youtube/v3/liveChat/moderators?liveChatId=&part=';
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}}/youtube/v3/liveChat/moderators?liveChatId=&part=',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/youtube/v3/liveChat/moderators?liveChatId=&part=")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/youtube/v3/liveChat/moderators?liveChatId=&part=',
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}}/youtube/v3/liveChat/moderators',
qs: {liveChatId: '', part: ''}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/youtube/v3/liveChat/moderators');
req.query({
liveChatId: '',
part: ''
});
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}}/youtube/v3/liveChat/moderators',
params: {liveChatId: '', part: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/youtube/v3/liveChat/moderators?liveChatId=&part=';
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}}/youtube/v3/liveChat/moderators?liveChatId=&part="]
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}}/youtube/v3/liveChat/moderators?liveChatId=&part=" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/youtube/v3/liveChat/moderators?liveChatId=&part=",
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}}/youtube/v3/liveChat/moderators?liveChatId=&part=');
echo $response->getBody();
setUrl('{{baseUrl}}/youtube/v3/liveChat/moderators');
$request->setMethod(HTTP_METH_GET);
$request->setQueryData([
'liveChatId' => '',
'part' => ''
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/youtube/v3/liveChat/moderators');
$request->setRequestMethod('GET');
$request->setQuery(new http\QueryString([
'liveChatId' => '',
'part' => ''
]));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/youtube/v3/liveChat/moderators?liveChatId=&part=' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/youtube/v3/liveChat/moderators?liveChatId=&part=' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/youtube/v3/liveChat/moderators?liveChatId=&part=")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/youtube/v3/liveChat/moderators"
querystring = {"liveChatId":"","part":""}
response = requests.get(url, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/youtube/v3/liveChat/moderators"
queryString <- list(
liveChatId = "",
part = ""
)
response <- VERB("GET", url, query = queryString, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/youtube/v3/liveChat/moderators?liveChatId=&part=")
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/youtube/v3/liveChat/moderators') do |req|
req.params['liveChatId'] = ''
req.params['part'] = ''
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/youtube/v3/liveChat/moderators";
let querystring = [
("liveChatId", ""),
("part", ""),
];
let client = reqwest::Client::new();
let response = client.get(url)
.query(&querystring)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url '{{baseUrl}}/youtube/v3/liveChat/moderators?liveChatId=&part='
http GET '{{baseUrl}}/youtube/v3/liveChat/moderators?liveChatId=&part='
wget --quiet \
--method GET \
--output-document \
- '{{baseUrl}}/youtube/v3/liveChat/moderators?liveChatId=&part='
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/youtube/v3/liveChat/moderators?liveChatId=&part=")! 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()
DELETE
youtube.liveStreams.delete
{{baseUrl}}/youtube/v3/liveStreams
QUERY PARAMS
id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/youtube/v3/liveStreams?id=");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/delete "{{baseUrl}}/youtube/v3/liveStreams" {:query-params {:id ""}})
require "http/client"
url = "{{baseUrl}}/youtube/v3/liveStreams?id="
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}}/youtube/v3/liveStreams?id="),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/youtube/v3/liveStreams?id=");
var request = new RestRequest("", Method.Delete);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/youtube/v3/liveStreams?id="
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/youtube/v3/liveStreams?id= HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/youtube/v3/liveStreams?id=")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/youtube/v3/liveStreams?id="))
.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}}/youtube/v3/liveStreams?id=")
.delete(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/youtube/v3/liveStreams?id=")
.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}}/youtube/v3/liveStreams?id=');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'DELETE',
url: '{{baseUrl}}/youtube/v3/liveStreams',
params: {id: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/youtube/v3/liveStreams?id=';
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}}/youtube/v3/liveStreams?id=',
method: 'DELETE',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/youtube/v3/liveStreams?id=")
.delete(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'DELETE',
hostname: 'example.com',
port: null,
path: '/baseUrl/youtube/v3/liveStreams?id=',
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}}/youtube/v3/liveStreams',
qs: {id: ''}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('DELETE', '{{baseUrl}}/youtube/v3/liveStreams');
req.query({
id: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'DELETE',
url: '{{baseUrl}}/youtube/v3/liveStreams',
params: {id: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/youtube/v3/liveStreams?id=';
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}}/youtube/v3/liveStreams?id="]
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}}/youtube/v3/liveStreams?id=" in
Client.call `DELETE uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/youtube/v3/liveStreams?id=",
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}}/youtube/v3/liveStreams?id=');
echo $response->getBody();
setUrl('{{baseUrl}}/youtube/v3/liveStreams');
$request->setMethod(HTTP_METH_DELETE);
$request->setQueryData([
'id' => ''
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/youtube/v3/liveStreams');
$request->setRequestMethod('DELETE');
$request->setQuery(new http\QueryString([
'id' => ''
]));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/youtube/v3/liveStreams?id=' -Method DELETE
$response = Invoke-RestMethod -Uri '{{baseUrl}}/youtube/v3/liveStreams?id=' -Method DELETE
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("DELETE", "/baseUrl/youtube/v3/liveStreams?id=")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/youtube/v3/liveStreams"
querystring = {"id":""}
response = requests.delete(url, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/youtube/v3/liveStreams"
queryString <- list(id = "")
response <- VERB("DELETE", url, query = queryString, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/youtube/v3/liveStreams?id=")
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/youtube/v3/liveStreams') do |req|
req.params['id'] = ''
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/youtube/v3/liveStreams";
let querystring = [
("id", ""),
];
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("DELETE").unwrap(), url)
.query(&querystring)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request DELETE \
--url '{{baseUrl}}/youtube/v3/liveStreams?id='
http DELETE '{{baseUrl}}/youtube/v3/liveStreams?id='
wget --quiet \
--method DELETE \
--output-document \
- '{{baseUrl}}/youtube/v3/liveStreams?id='
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/youtube/v3/liveStreams?id=")! 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()
POST
youtube.liveStreams.insert
{{baseUrl}}/youtube/v3/liveStreams
QUERY PARAMS
part
BODY json
{
"cdn": {
"format": "",
"frameRate": "",
"ingestionInfo": {
"backupIngestionAddress": "",
"ingestionAddress": "",
"rtmpsBackupIngestionAddress": "",
"rtmpsIngestionAddress": "",
"streamName": ""
},
"ingestionType": "",
"resolution": ""
},
"contentDetails": {
"closedCaptionsIngestionUrl": "",
"isReusable": false
},
"etag": "",
"id": "",
"kind": "",
"snippet": {
"channelId": "",
"description": "",
"isDefaultStream": false,
"publishedAt": "",
"title": ""
},
"status": {
"healthStatus": {
"configurationIssues": [
{
"description": "",
"reason": "",
"severity": "",
"type": ""
}
],
"lastUpdateTimeSeconds": "",
"status": ""
},
"streamStatus": ""
}
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/youtube/v3/liveStreams?part=");
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 \"cdn\": {\n \"format\": \"\",\n \"frameRate\": \"\",\n \"ingestionInfo\": {\n \"backupIngestionAddress\": \"\",\n \"ingestionAddress\": \"\",\n \"rtmpsBackupIngestionAddress\": \"\",\n \"rtmpsIngestionAddress\": \"\",\n \"streamName\": \"\"\n },\n \"ingestionType\": \"\",\n \"resolution\": \"\"\n },\n \"contentDetails\": {\n \"closedCaptionsIngestionUrl\": \"\",\n \"isReusable\": false\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"channelId\": \"\",\n \"description\": \"\",\n \"isDefaultStream\": false,\n \"publishedAt\": \"\",\n \"title\": \"\"\n },\n \"status\": {\n \"healthStatus\": {\n \"configurationIssues\": [\n {\n \"description\": \"\",\n \"reason\": \"\",\n \"severity\": \"\",\n \"type\": \"\"\n }\n ],\n \"lastUpdateTimeSeconds\": \"\",\n \"status\": \"\"\n },\n \"streamStatus\": \"\"\n }\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/youtube/v3/liveStreams" {:query-params {:part ""}
:content-type :json
:form-params {:cdn {:format ""
:frameRate ""
:ingestionInfo {:backupIngestionAddress ""
:ingestionAddress ""
:rtmpsBackupIngestionAddress ""
:rtmpsIngestionAddress ""
:streamName ""}
:ingestionType ""
:resolution ""}
:contentDetails {:closedCaptionsIngestionUrl ""
:isReusable false}
:etag ""
:id ""
:kind ""
:snippet {:channelId ""
:description ""
:isDefaultStream false
:publishedAt ""
:title ""}
:status {:healthStatus {:configurationIssues [{:description ""
:reason ""
:severity ""
:type ""}]
:lastUpdateTimeSeconds ""
:status ""}
:streamStatus ""}}})
require "http/client"
url = "{{baseUrl}}/youtube/v3/liveStreams?part="
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"cdn\": {\n \"format\": \"\",\n \"frameRate\": \"\",\n \"ingestionInfo\": {\n \"backupIngestionAddress\": \"\",\n \"ingestionAddress\": \"\",\n \"rtmpsBackupIngestionAddress\": \"\",\n \"rtmpsIngestionAddress\": \"\",\n \"streamName\": \"\"\n },\n \"ingestionType\": \"\",\n \"resolution\": \"\"\n },\n \"contentDetails\": {\n \"closedCaptionsIngestionUrl\": \"\",\n \"isReusable\": false\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"channelId\": \"\",\n \"description\": \"\",\n \"isDefaultStream\": false,\n \"publishedAt\": \"\",\n \"title\": \"\"\n },\n \"status\": {\n \"healthStatus\": {\n \"configurationIssues\": [\n {\n \"description\": \"\",\n \"reason\": \"\",\n \"severity\": \"\",\n \"type\": \"\"\n }\n ],\n \"lastUpdateTimeSeconds\": \"\",\n \"status\": \"\"\n },\n \"streamStatus\": \"\"\n }\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/youtube/v3/liveStreams?part="),
Content = new StringContent("{\n \"cdn\": {\n \"format\": \"\",\n \"frameRate\": \"\",\n \"ingestionInfo\": {\n \"backupIngestionAddress\": \"\",\n \"ingestionAddress\": \"\",\n \"rtmpsBackupIngestionAddress\": \"\",\n \"rtmpsIngestionAddress\": \"\",\n \"streamName\": \"\"\n },\n \"ingestionType\": \"\",\n \"resolution\": \"\"\n },\n \"contentDetails\": {\n \"closedCaptionsIngestionUrl\": \"\",\n \"isReusable\": false\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"channelId\": \"\",\n \"description\": \"\",\n \"isDefaultStream\": false,\n \"publishedAt\": \"\",\n \"title\": \"\"\n },\n \"status\": {\n \"healthStatus\": {\n \"configurationIssues\": [\n {\n \"description\": \"\",\n \"reason\": \"\",\n \"severity\": \"\",\n \"type\": \"\"\n }\n ],\n \"lastUpdateTimeSeconds\": \"\",\n \"status\": \"\"\n },\n \"streamStatus\": \"\"\n }\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/youtube/v3/liveStreams?part=");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"cdn\": {\n \"format\": \"\",\n \"frameRate\": \"\",\n \"ingestionInfo\": {\n \"backupIngestionAddress\": \"\",\n \"ingestionAddress\": \"\",\n \"rtmpsBackupIngestionAddress\": \"\",\n \"rtmpsIngestionAddress\": \"\",\n \"streamName\": \"\"\n },\n \"ingestionType\": \"\",\n \"resolution\": \"\"\n },\n \"contentDetails\": {\n \"closedCaptionsIngestionUrl\": \"\",\n \"isReusable\": false\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"channelId\": \"\",\n \"description\": \"\",\n \"isDefaultStream\": false,\n \"publishedAt\": \"\",\n \"title\": \"\"\n },\n \"status\": {\n \"healthStatus\": {\n \"configurationIssues\": [\n {\n \"description\": \"\",\n \"reason\": \"\",\n \"severity\": \"\",\n \"type\": \"\"\n }\n ],\n \"lastUpdateTimeSeconds\": \"\",\n \"status\": \"\"\n },\n \"streamStatus\": \"\"\n }\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/youtube/v3/liveStreams?part="
payload := strings.NewReader("{\n \"cdn\": {\n \"format\": \"\",\n \"frameRate\": \"\",\n \"ingestionInfo\": {\n \"backupIngestionAddress\": \"\",\n \"ingestionAddress\": \"\",\n \"rtmpsBackupIngestionAddress\": \"\",\n \"rtmpsIngestionAddress\": \"\",\n \"streamName\": \"\"\n },\n \"ingestionType\": \"\",\n \"resolution\": \"\"\n },\n \"contentDetails\": {\n \"closedCaptionsIngestionUrl\": \"\",\n \"isReusable\": false\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"channelId\": \"\",\n \"description\": \"\",\n \"isDefaultStream\": false,\n \"publishedAt\": \"\",\n \"title\": \"\"\n },\n \"status\": {\n \"healthStatus\": {\n \"configurationIssues\": [\n {\n \"description\": \"\",\n \"reason\": \"\",\n \"severity\": \"\",\n \"type\": \"\"\n }\n ],\n \"lastUpdateTimeSeconds\": \"\",\n \"status\": \"\"\n },\n \"streamStatus\": \"\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/youtube/v3/liveStreams?part= HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 845
{
"cdn": {
"format": "",
"frameRate": "",
"ingestionInfo": {
"backupIngestionAddress": "",
"ingestionAddress": "",
"rtmpsBackupIngestionAddress": "",
"rtmpsIngestionAddress": "",
"streamName": ""
},
"ingestionType": "",
"resolution": ""
},
"contentDetails": {
"closedCaptionsIngestionUrl": "",
"isReusable": false
},
"etag": "",
"id": "",
"kind": "",
"snippet": {
"channelId": "",
"description": "",
"isDefaultStream": false,
"publishedAt": "",
"title": ""
},
"status": {
"healthStatus": {
"configurationIssues": [
{
"description": "",
"reason": "",
"severity": "",
"type": ""
}
],
"lastUpdateTimeSeconds": "",
"status": ""
},
"streamStatus": ""
}
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/youtube/v3/liveStreams?part=")
.setHeader("content-type", "application/json")
.setBody("{\n \"cdn\": {\n \"format\": \"\",\n \"frameRate\": \"\",\n \"ingestionInfo\": {\n \"backupIngestionAddress\": \"\",\n \"ingestionAddress\": \"\",\n \"rtmpsBackupIngestionAddress\": \"\",\n \"rtmpsIngestionAddress\": \"\",\n \"streamName\": \"\"\n },\n \"ingestionType\": \"\",\n \"resolution\": \"\"\n },\n \"contentDetails\": {\n \"closedCaptionsIngestionUrl\": \"\",\n \"isReusable\": false\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"channelId\": \"\",\n \"description\": \"\",\n \"isDefaultStream\": false,\n \"publishedAt\": \"\",\n \"title\": \"\"\n },\n \"status\": {\n \"healthStatus\": {\n \"configurationIssues\": [\n {\n \"description\": \"\",\n \"reason\": \"\",\n \"severity\": \"\",\n \"type\": \"\"\n }\n ],\n \"lastUpdateTimeSeconds\": \"\",\n \"status\": \"\"\n },\n \"streamStatus\": \"\"\n }\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/youtube/v3/liveStreams?part="))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"cdn\": {\n \"format\": \"\",\n \"frameRate\": \"\",\n \"ingestionInfo\": {\n \"backupIngestionAddress\": \"\",\n \"ingestionAddress\": \"\",\n \"rtmpsBackupIngestionAddress\": \"\",\n \"rtmpsIngestionAddress\": \"\",\n \"streamName\": \"\"\n },\n \"ingestionType\": \"\",\n \"resolution\": \"\"\n },\n \"contentDetails\": {\n \"closedCaptionsIngestionUrl\": \"\",\n \"isReusable\": false\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"channelId\": \"\",\n \"description\": \"\",\n \"isDefaultStream\": false,\n \"publishedAt\": \"\",\n \"title\": \"\"\n },\n \"status\": {\n \"healthStatus\": {\n \"configurationIssues\": [\n {\n \"description\": \"\",\n \"reason\": \"\",\n \"severity\": \"\",\n \"type\": \"\"\n }\n ],\n \"lastUpdateTimeSeconds\": \"\",\n \"status\": \"\"\n },\n \"streamStatus\": \"\"\n }\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"cdn\": {\n \"format\": \"\",\n \"frameRate\": \"\",\n \"ingestionInfo\": {\n \"backupIngestionAddress\": \"\",\n \"ingestionAddress\": \"\",\n \"rtmpsBackupIngestionAddress\": \"\",\n \"rtmpsIngestionAddress\": \"\",\n \"streamName\": \"\"\n },\n \"ingestionType\": \"\",\n \"resolution\": \"\"\n },\n \"contentDetails\": {\n \"closedCaptionsIngestionUrl\": \"\",\n \"isReusable\": false\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"channelId\": \"\",\n \"description\": \"\",\n \"isDefaultStream\": false,\n \"publishedAt\": \"\",\n \"title\": \"\"\n },\n \"status\": {\n \"healthStatus\": {\n \"configurationIssues\": [\n {\n \"description\": \"\",\n \"reason\": \"\",\n \"severity\": \"\",\n \"type\": \"\"\n }\n ],\n \"lastUpdateTimeSeconds\": \"\",\n \"status\": \"\"\n },\n \"streamStatus\": \"\"\n }\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/youtube/v3/liveStreams?part=")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/youtube/v3/liveStreams?part=")
.header("content-type", "application/json")
.body("{\n \"cdn\": {\n \"format\": \"\",\n \"frameRate\": \"\",\n \"ingestionInfo\": {\n \"backupIngestionAddress\": \"\",\n \"ingestionAddress\": \"\",\n \"rtmpsBackupIngestionAddress\": \"\",\n \"rtmpsIngestionAddress\": \"\",\n \"streamName\": \"\"\n },\n \"ingestionType\": \"\",\n \"resolution\": \"\"\n },\n \"contentDetails\": {\n \"closedCaptionsIngestionUrl\": \"\",\n \"isReusable\": false\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"channelId\": \"\",\n \"description\": \"\",\n \"isDefaultStream\": false,\n \"publishedAt\": \"\",\n \"title\": \"\"\n },\n \"status\": {\n \"healthStatus\": {\n \"configurationIssues\": [\n {\n \"description\": \"\",\n \"reason\": \"\",\n \"severity\": \"\",\n \"type\": \"\"\n }\n ],\n \"lastUpdateTimeSeconds\": \"\",\n \"status\": \"\"\n },\n \"streamStatus\": \"\"\n }\n}")
.asString();
const data = JSON.stringify({
cdn: {
format: '',
frameRate: '',
ingestionInfo: {
backupIngestionAddress: '',
ingestionAddress: '',
rtmpsBackupIngestionAddress: '',
rtmpsIngestionAddress: '',
streamName: ''
},
ingestionType: '',
resolution: ''
},
contentDetails: {
closedCaptionsIngestionUrl: '',
isReusable: false
},
etag: '',
id: '',
kind: '',
snippet: {
channelId: '',
description: '',
isDefaultStream: false,
publishedAt: '',
title: ''
},
status: {
healthStatus: {
configurationIssues: [
{
description: '',
reason: '',
severity: '',
type: ''
}
],
lastUpdateTimeSeconds: '',
status: ''
},
streamStatus: ''
}
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/youtube/v3/liveStreams?part=');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/youtube/v3/liveStreams',
params: {part: ''},
headers: {'content-type': 'application/json'},
data: {
cdn: {
format: '',
frameRate: '',
ingestionInfo: {
backupIngestionAddress: '',
ingestionAddress: '',
rtmpsBackupIngestionAddress: '',
rtmpsIngestionAddress: '',
streamName: ''
},
ingestionType: '',
resolution: ''
},
contentDetails: {closedCaptionsIngestionUrl: '', isReusable: false},
etag: '',
id: '',
kind: '',
snippet: {
channelId: '',
description: '',
isDefaultStream: false,
publishedAt: '',
title: ''
},
status: {
healthStatus: {
configurationIssues: [{description: '', reason: '', severity: '', type: ''}],
lastUpdateTimeSeconds: '',
status: ''
},
streamStatus: ''
}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/youtube/v3/liveStreams?part=';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"cdn":{"format":"","frameRate":"","ingestionInfo":{"backupIngestionAddress":"","ingestionAddress":"","rtmpsBackupIngestionAddress":"","rtmpsIngestionAddress":"","streamName":""},"ingestionType":"","resolution":""},"contentDetails":{"closedCaptionsIngestionUrl":"","isReusable":false},"etag":"","id":"","kind":"","snippet":{"channelId":"","description":"","isDefaultStream":false,"publishedAt":"","title":""},"status":{"healthStatus":{"configurationIssues":[{"description":"","reason":"","severity":"","type":""}],"lastUpdateTimeSeconds":"","status":""},"streamStatus":""}}'
};
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}}/youtube/v3/liveStreams?part=',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "cdn": {\n "format": "",\n "frameRate": "",\n "ingestionInfo": {\n "backupIngestionAddress": "",\n "ingestionAddress": "",\n "rtmpsBackupIngestionAddress": "",\n "rtmpsIngestionAddress": "",\n "streamName": ""\n },\n "ingestionType": "",\n "resolution": ""\n },\n "contentDetails": {\n "closedCaptionsIngestionUrl": "",\n "isReusable": false\n },\n "etag": "",\n "id": "",\n "kind": "",\n "snippet": {\n "channelId": "",\n "description": "",\n "isDefaultStream": false,\n "publishedAt": "",\n "title": ""\n },\n "status": {\n "healthStatus": {\n "configurationIssues": [\n {\n "description": "",\n "reason": "",\n "severity": "",\n "type": ""\n }\n ],\n "lastUpdateTimeSeconds": "",\n "status": ""\n },\n "streamStatus": ""\n }\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"cdn\": {\n \"format\": \"\",\n \"frameRate\": \"\",\n \"ingestionInfo\": {\n \"backupIngestionAddress\": \"\",\n \"ingestionAddress\": \"\",\n \"rtmpsBackupIngestionAddress\": \"\",\n \"rtmpsIngestionAddress\": \"\",\n \"streamName\": \"\"\n },\n \"ingestionType\": \"\",\n \"resolution\": \"\"\n },\n \"contentDetails\": {\n \"closedCaptionsIngestionUrl\": \"\",\n \"isReusable\": false\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"channelId\": \"\",\n \"description\": \"\",\n \"isDefaultStream\": false,\n \"publishedAt\": \"\",\n \"title\": \"\"\n },\n \"status\": {\n \"healthStatus\": {\n \"configurationIssues\": [\n {\n \"description\": \"\",\n \"reason\": \"\",\n \"severity\": \"\",\n \"type\": \"\"\n }\n ],\n \"lastUpdateTimeSeconds\": \"\",\n \"status\": \"\"\n },\n \"streamStatus\": \"\"\n }\n}")
val request = Request.Builder()
.url("{{baseUrl}}/youtube/v3/liveStreams?part=")
.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/youtube/v3/liveStreams?part=',
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({
cdn: {
format: '',
frameRate: '',
ingestionInfo: {
backupIngestionAddress: '',
ingestionAddress: '',
rtmpsBackupIngestionAddress: '',
rtmpsIngestionAddress: '',
streamName: ''
},
ingestionType: '',
resolution: ''
},
contentDetails: {closedCaptionsIngestionUrl: '', isReusable: false},
etag: '',
id: '',
kind: '',
snippet: {
channelId: '',
description: '',
isDefaultStream: false,
publishedAt: '',
title: ''
},
status: {
healthStatus: {
configurationIssues: [{description: '', reason: '', severity: '', type: ''}],
lastUpdateTimeSeconds: '',
status: ''
},
streamStatus: ''
}
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/youtube/v3/liveStreams',
qs: {part: ''},
headers: {'content-type': 'application/json'},
body: {
cdn: {
format: '',
frameRate: '',
ingestionInfo: {
backupIngestionAddress: '',
ingestionAddress: '',
rtmpsBackupIngestionAddress: '',
rtmpsIngestionAddress: '',
streamName: ''
},
ingestionType: '',
resolution: ''
},
contentDetails: {closedCaptionsIngestionUrl: '', isReusable: false},
etag: '',
id: '',
kind: '',
snippet: {
channelId: '',
description: '',
isDefaultStream: false,
publishedAt: '',
title: ''
},
status: {
healthStatus: {
configurationIssues: [{description: '', reason: '', severity: '', type: ''}],
lastUpdateTimeSeconds: '',
status: ''
},
streamStatus: ''
}
},
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}}/youtube/v3/liveStreams');
req.query({
part: ''
});
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
cdn: {
format: '',
frameRate: '',
ingestionInfo: {
backupIngestionAddress: '',
ingestionAddress: '',
rtmpsBackupIngestionAddress: '',
rtmpsIngestionAddress: '',
streamName: ''
},
ingestionType: '',
resolution: ''
},
contentDetails: {
closedCaptionsIngestionUrl: '',
isReusable: false
},
etag: '',
id: '',
kind: '',
snippet: {
channelId: '',
description: '',
isDefaultStream: false,
publishedAt: '',
title: ''
},
status: {
healthStatus: {
configurationIssues: [
{
description: '',
reason: '',
severity: '',
type: ''
}
],
lastUpdateTimeSeconds: '',
status: ''
},
streamStatus: ''
}
});
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}}/youtube/v3/liveStreams',
params: {part: ''},
headers: {'content-type': 'application/json'},
data: {
cdn: {
format: '',
frameRate: '',
ingestionInfo: {
backupIngestionAddress: '',
ingestionAddress: '',
rtmpsBackupIngestionAddress: '',
rtmpsIngestionAddress: '',
streamName: ''
},
ingestionType: '',
resolution: ''
},
contentDetails: {closedCaptionsIngestionUrl: '', isReusable: false},
etag: '',
id: '',
kind: '',
snippet: {
channelId: '',
description: '',
isDefaultStream: false,
publishedAt: '',
title: ''
},
status: {
healthStatus: {
configurationIssues: [{description: '', reason: '', severity: '', type: ''}],
lastUpdateTimeSeconds: '',
status: ''
},
streamStatus: ''
}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/youtube/v3/liveStreams?part=';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"cdn":{"format":"","frameRate":"","ingestionInfo":{"backupIngestionAddress":"","ingestionAddress":"","rtmpsBackupIngestionAddress":"","rtmpsIngestionAddress":"","streamName":""},"ingestionType":"","resolution":""},"contentDetails":{"closedCaptionsIngestionUrl":"","isReusable":false},"etag":"","id":"","kind":"","snippet":{"channelId":"","description":"","isDefaultStream":false,"publishedAt":"","title":""},"status":{"healthStatus":{"configurationIssues":[{"description":"","reason":"","severity":"","type":""}],"lastUpdateTimeSeconds":"","status":""},"streamStatus":""}}'
};
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 = @{ @"cdn": @{ @"format": @"", @"frameRate": @"", @"ingestionInfo": @{ @"backupIngestionAddress": @"", @"ingestionAddress": @"", @"rtmpsBackupIngestionAddress": @"", @"rtmpsIngestionAddress": @"", @"streamName": @"" }, @"ingestionType": @"", @"resolution": @"" },
@"contentDetails": @{ @"closedCaptionsIngestionUrl": @"", @"isReusable": @NO },
@"etag": @"",
@"id": @"",
@"kind": @"",
@"snippet": @{ @"channelId": @"", @"description": @"", @"isDefaultStream": @NO, @"publishedAt": @"", @"title": @"" },
@"status": @{ @"healthStatus": @{ @"configurationIssues": @[ @{ @"description": @"", @"reason": @"", @"severity": @"", @"type": @"" } ], @"lastUpdateTimeSeconds": @"", @"status": @"" }, @"streamStatus": @"" } };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/youtube/v3/liveStreams?part="]
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}}/youtube/v3/liveStreams?part=" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"cdn\": {\n \"format\": \"\",\n \"frameRate\": \"\",\n \"ingestionInfo\": {\n \"backupIngestionAddress\": \"\",\n \"ingestionAddress\": \"\",\n \"rtmpsBackupIngestionAddress\": \"\",\n \"rtmpsIngestionAddress\": \"\",\n \"streamName\": \"\"\n },\n \"ingestionType\": \"\",\n \"resolution\": \"\"\n },\n \"contentDetails\": {\n \"closedCaptionsIngestionUrl\": \"\",\n \"isReusable\": false\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"channelId\": \"\",\n \"description\": \"\",\n \"isDefaultStream\": false,\n \"publishedAt\": \"\",\n \"title\": \"\"\n },\n \"status\": {\n \"healthStatus\": {\n \"configurationIssues\": [\n {\n \"description\": \"\",\n \"reason\": \"\",\n \"severity\": \"\",\n \"type\": \"\"\n }\n ],\n \"lastUpdateTimeSeconds\": \"\",\n \"status\": \"\"\n },\n \"streamStatus\": \"\"\n }\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/youtube/v3/liveStreams?part=",
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([
'cdn' => [
'format' => '',
'frameRate' => '',
'ingestionInfo' => [
'backupIngestionAddress' => '',
'ingestionAddress' => '',
'rtmpsBackupIngestionAddress' => '',
'rtmpsIngestionAddress' => '',
'streamName' => ''
],
'ingestionType' => '',
'resolution' => ''
],
'contentDetails' => [
'closedCaptionsIngestionUrl' => '',
'isReusable' => null
],
'etag' => '',
'id' => '',
'kind' => '',
'snippet' => [
'channelId' => '',
'description' => '',
'isDefaultStream' => null,
'publishedAt' => '',
'title' => ''
],
'status' => [
'healthStatus' => [
'configurationIssues' => [
[
'description' => '',
'reason' => '',
'severity' => '',
'type' => ''
]
],
'lastUpdateTimeSeconds' => '',
'status' => ''
],
'streamStatus' => ''
]
]),
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}}/youtube/v3/liveStreams?part=', [
'body' => '{
"cdn": {
"format": "",
"frameRate": "",
"ingestionInfo": {
"backupIngestionAddress": "",
"ingestionAddress": "",
"rtmpsBackupIngestionAddress": "",
"rtmpsIngestionAddress": "",
"streamName": ""
},
"ingestionType": "",
"resolution": ""
},
"contentDetails": {
"closedCaptionsIngestionUrl": "",
"isReusable": false
},
"etag": "",
"id": "",
"kind": "",
"snippet": {
"channelId": "",
"description": "",
"isDefaultStream": false,
"publishedAt": "",
"title": ""
},
"status": {
"healthStatus": {
"configurationIssues": [
{
"description": "",
"reason": "",
"severity": "",
"type": ""
}
],
"lastUpdateTimeSeconds": "",
"status": ""
},
"streamStatus": ""
}
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/youtube/v3/liveStreams');
$request->setMethod(HTTP_METH_POST);
$request->setQueryData([
'part' => ''
]);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'cdn' => [
'format' => '',
'frameRate' => '',
'ingestionInfo' => [
'backupIngestionAddress' => '',
'ingestionAddress' => '',
'rtmpsBackupIngestionAddress' => '',
'rtmpsIngestionAddress' => '',
'streamName' => ''
],
'ingestionType' => '',
'resolution' => ''
],
'contentDetails' => [
'closedCaptionsIngestionUrl' => '',
'isReusable' => null
],
'etag' => '',
'id' => '',
'kind' => '',
'snippet' => [
'channelId' => '',
'description' => '',
'isDefaultStream' => null,
'publishedAt' => '',
'title' => ''
],
'status' => [
'healthStatus' => [
'configurationIssues' => [
[
'description' => '',
'reason' => '',
'severity' => '',
'type' => ''
]
],
'lastUpdateTimeSeconds' => '',
'status' => ''
],
'streamStatus' => ''
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'cdn' => [
'format' => '',
'frameRate' => '',
'ingestionInfo' => [
'backupIngestionAddress' => '',
'ingestionAddress' => '',
'rtmpsBackupIngestionAddress' => '',
'rtmpsIngestionAddress' => '',
'streamName' => ''
],
'ingestionType' => '',
'resolution' => ''
],
'contentDetails' => [
'closedCaptionsIngestionUrl' => '',
'isReusable' => null
],
'etag' => '',
'id' => '',
'kind' => '',
'snippet' => [
'channelId' => '',
'description' => '',
'isDefaultStream' => null,
'publishedAt' => '',
'title' => ''
],
'status' => [
'healthStatus' => [
'configurationIssues' => [
[
'description' => '',
'reason' => '',
'severity' => '',
'type' => ''
]
],
'lastUpdateTimeSeconds' => '',
'status' => ''
],
'streamStatus' => ''
]
]));
$request->setRequestUrl('{{baseUrl}}/youtube/v3/liveStreams');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setQuery(new http\QueryString([
'part' => ''
]));
$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}}/youtube/v3/liveStreams?part=' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"cdn": {
"format": "",
"frameRate": "",
"ingestionInfo": {
"backupIngestionAddress": "",
"ingestionAddress": "",
"rtmpsBackupIngestionAddress": "",
"rtmpsIngestionAddress": "",
"streamName": ""
},
"ingestionType": "",
"resolution": ""
},
"contentDetails": {
"closedCaptionsIngestionUrl": "",
"isReusable": false
},
"etag": "",
"id": "",
"kind": "",
"snippet": {
"channelId": "",
"description": "",
"isDefaultStream": false,
"publishedAt": "",
"title": ""
},
"status": {
"healthStatus": {
"configurationIssues": [
{
"description": "",
"reason": "",
"severity": "",
"type": ""
}
],
"lastUpdateTimeSeconds": "",
"status": ""
},
"streamStatus": ""
}
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/youtube/v3/liveStreams?part=' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"cdn": {
"format": "",
"frameRate": "",
"ingestionInfo": {
"backupIngestionAddress": "",
"ingestionAddress": "",
"rtmpsBackupIngestionAddress": "",
"rtmpsIngestionAddress": "",
"streamName": ""
},
"ingestionType": "",
"resolution": ""
},
"contentDetails": {
"closedCaptionsIngestionUrl": "",
"isReusable": false
},
"etag": "",
"id": "",
"kind": "",
"snippet": {
"channelId": "",
"description": "",
"isDefaultStream": false,
"publishedAt": "",
"title": ""
},
"status": {
"healthStatus": {
"configurationIssues": [
{
"description": "",
"reason": "",
"severity": "",
"type": ""
}
],
"lastUpdateTimeSeconds": "",
"status": ""
},
"streamStatus": ""
}
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"cdn\": {\n \"format\": \"\",\n \"frameRate\": \"\",\n \"ingestionInfo\": {\n \"backupIngestionAddress\": \"\",\n \"ingestionAddress\": \"\",\n \"rtmpsBackupIngestionAddress\": \"\",\n \"rtmpsIngestionAddress\": \"\",\n \"streamName\": \"\"\n },\n \"ingestionType\": \"\",\n \"resolution\": \"\"\n },\n \"contentDetails\": {\n \"closedCaptionsIngestionUrl\": \"\",\n \"isReusable\": false\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"channelId\": \"\",\n \"description\": \"\",\n \"isDefaultStream\": false,\n \"publishedAt\": \"\",\n \"title\": \"\"\n },\n \"status\": {\n \"healthStatus\": {\n \"configurationIssues\": [\n {\n \"description\": \"\",\n \"reason\": \"\",\n \"severity\": \"\",\n \"type\": \"\"\n }\n ],\n \"lastUpdateTimeSeconds\": \"\",\n \"status\": \"\"\n },\n \"streamStatus\": \"\"\n }\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/youtube/v3/liveStreams?part=", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/youtube/v3/liveStreams"
querystring = {"part":""}
payload = {
"cdn": {
"format": "",
"frameRate": "",
"ingestionInfo": {
"backupIngestionAddress": "",
"ingestionAddress": "",
"rtmpsBackupIngestionAddress": "",
"rtmpsIngestionAddress": "",
"streamName": ""
},
"ingestionType": "",
"resolution": ""
},
"contentDetails": {
"closedCaptionsIngestionUrl": "",
"isReusable": False
},
"etag": "",
"id": "",
"kind": "",
"snippet": {
"channelId": "",
"description": "",
"isDefaultStream": False,
"publishedAt": "",
"title": ""
},
"status": {
"healthStatus": {
"configurationIssues": [
{
"description": "",
"reason": "",
"severity": "",
"type": ""
}
],
"lastUpdateTimeSeconds": "",
"status": ""
},
"streamStatus": ""
}
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/youtube/v3/liveStreams"
queryString <- list(part = "")
payload <- "{\n \"cdn\": {\n \"format\": \"\",\n \"frameRate\": \"\",\n \"ingestionInfo\": {\n \"backupIngestionAddress\": \"\",\n \"ingestionAddress\": \"\",\n \"rtmpsBackupIngestionAddress\": \"\",\n \"rtmpsIngestionAddress\": \"\",\n \"streamName\": \"\"\n },\n \"ingestionType\": \"\",\n \"resolution\": \"\"\n },\n \"contentDetails\": {\n \"closedCaptionsIngestionUrl\": \"\",\n \"isReusable\": false\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"channelId\": \"\",\n \"description\": \"\",\n \"isDefaultStream\": false,\n \"publishedAt\": \"\",\n \"title\": \"\"\n },\n \"status\": {\n \"healthStatus\": {\n \"configurationIssues\": [\n {\n \"description\": \"\",\n \"reason\": \"\",\n \"severity\": \"\",\n \"type\": \"\"\n }\n ],\n \"lastUpdateTimeSeconds\": \"\",\n \"status\": \"\"\n },\n \"streamStatus\": \"\"\n }\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, query = queryString, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/youtube/v3/liveStreams?part=")
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 \"cdn\": {\n \"format\": \"\",\n \"frameRate\": \"\",\n \"ingestionInfo\": {\n \"backupIngestionAddress\": \"\",\n \"ingestionAddress\": \"\",\n \"rtmpsBackupIngestionAddress\": \"\",\n \"rtmpsIngestionAddress\": \"\",\n \"streamName\": \"\"\n },\n \"ingestionType\": \"\",\n \"resolution\": \"\"\n },\n \"contentDetails\": {\n \"closedCaptionsIngestionUrl\": \"\",\n \"isReusable\": false\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"channelId\": \"\",\n \"description\": \"\",\n \"isDefaultStream\": false,\n \"publishedAt\": \"\",\n \"title\": \"\"\n },\n \"status\": {\n \"healthStatus\": {\n \"configurationIssues\": [\n {\n \"description\": \"\",\n \"reason\": \"\",\n \"severity\": \"\",\n \"type\": \"\"\n }\n ],\n \"lastUpdateTimeSeconds\": \"\",\n \"status\": \"\"\n },\n \"streamStatus\": \"\"\n }\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/youtube/v3/liveStreams') do |req|
req.params['part'] = ''
req.body = "{\n \"cdn\": {\n \"format\": \"\",\n \"frameRate\": \"\",\n \"ingestionInfo\": {\n \"backupIngestionAddress\": \"\",\n \"ingestionAddress\": \"\",\n \"rtmpsBackupIngestionAddress\": \"\",\n \"rtmpsIngestionAddress\": \"\",\n \"streamName\": \"\"\n },\n \"ingestionType\": \"\",\n \"resolution\": \"\"\n },\n \"contentDetails\": {\n \"closedCaptionsIngestionUrl\": \"\",\n \"isReusable\": false\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"channelId\": \"\",\n \"description\": \"\",\n \"isDefaultStream\": false,\n \"publishedAt\": \"\",\n \"title\": \"\"\n },\n \"status\": {\n \"healthStatus\": {\n \"configurationIssues\": [\n {\n \"description\": \"\",\n \"reason\": \"\",\n \"severity\": \"\",\n \"type\": \"\"\n }\n ],\n \"lastUpdateTimeSeconds\": \"\",\n \"status\": \"\"\n },\n \"streamStatus\": \"\"\n }\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/youtube/v3/liveStreams";
let querystring = [
("part", ""),
];
let payload = json!({
"cdn": json!({
"format": "",
"frameRate": "",
"ingestionInfo": json!({
"backupIngestionAddress": "",
"ingestionAddress": "",
"rtmpsBackupIngestionAddress": "",
"rtmpsIngestionAddress": "",
"streamName": ""
}),
"ingestionType": "",
"resolution": ""
}),
"contentDetails": json!({
"closedCaptionsIngestionUrl": "",
"isReusable": false
}),
"etag": "",
"id": "",
"kind": "",
"snippet": json!({
"channelId": "",
"description": "",
"isDefaultStream": false,
"publishedAt": "",
"title": ""
}),
"status": json!({
"healthStatus": json!({
"configurationIssues": (
json!({
"description": "",
"reason": "",
"severity": "",
"type": ""
})
),
"lastUpdateTimeSeconds": "",
"status": ""
}),
"streamStatus": ""
})
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.query(&querystring)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/youtube/v3/liveStreams?part=' \
--header 'content-type: application/json' \
--data '{
"cdn": {
"format": "",
"frameRate": "",
"ingestionInfo": {
"backupIngestionAddress": "",
"ingestionAddress": "",
"rtmpsBackupIngestionAddress": "",
"rtmpsIngestionAddress": "",
"streamName": ""
},
"ingestionType": "",
"resolution": ""
},
"contentDetails": {
"closedCaptionsIngestionUrl": "",
"isReusable": false
},
"etag": "",
"id": "",
"kind": "",
"snippet": {
"channelId": "",
"description": "",
"isDefaultStream": false,
"publishedAt": "",
"title": ""
},
"status": {
"healthStatus": {
"configurationIssues": [
{
"description": "",
"reason": "",
"severity": "",
"type": ""
}
],
"lastUpdateTimeSeconds": "",
"status": ""
},
"streamStatus": ""
}
}'
echo '{
"cdn": {
"format": "",
"frameRate": "",
"ingestionInfo": {
"backupIngestionAddress": "",
"ingestionAddress": "",
"rtmpsBackupIngestionAddress": "",
"rtmpsIngestionAddress": "",
"streamName": ""
},
"ingestionType": "",
"resolution": ""
},
"contentDetails": {
"closedCaptionsIngestionUrl": "",
"isReusable": false
},
"etag": "",
"id": "",
"kind": "",
"snippet": {
"channelId": "",
"description": "",
"isDefaultStream": false,
"publishedAt": "",
"title": ""
},
"status": {
"healthStatus": {
"configurationIssues": [
{
"description": "",
"reason": "",
"severity": "",
"type": ""
}
],
"lastUpdateTimeSeconds": "",
"status": ""
},
"streamStatus": ""
}
}' | \
http POST '{{baseUrl}}/youtube/v3/liveStreams?part=' \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "cdn": {\n "format": "",\n "frameRate": "",\n "ingestionInfo": {\n "backupIngestionAddress": "",\n "ingestionAddress": "",\n "rtmpsBackupIngestionAddress": "",\n "rtmpsIngestionAddress": "",\n "streamName": ""\n },\n "ingestionType": "",\n "resolution": ""\n },\n "contentDetails": {\n "closedCaptionsIngestionUrl": "",\n "isReusable": false\n },\n "etag": "",\n "id": "",\n "kind": "",\n "snippet": {\n "channelId": "",\n "description": "",\n "isDefaultStream": false,\n "publishedAt": "",\n "title": ""\n },\n "status": {\n "healthStatus": {\n "configurationIssues": [\n {\n "description": "",\n "reason": "",\n "severity": "",\n "type": ""\n }\n ],\n "lastUpdateTimeSeconds": "",\n "status": ""\n },\n "streamStatus": ""\n }\n}' \
--output-document \
- '{{baseUrl}}/youtube/v3/liveStreams?part='
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"cdn": [
"format": "",
"frameRate": "",
"ingestionInfo": [
"backupIngestionAddress": "",
"ingestionAddress": "",
"rtmpsBackupIngestionAddress": "",
"rtmpsIngestionAddress": "",
"streamName": ""
],
"ingestionType": "",
"resolution": ""
],
"contentDetails": [
"closedCaptionsIngestionUrl": "",
"isReusable": false
],
"etag": "",
"id": "",
"kind": "",
"snippet": [
"channelId": "",
"description": "",
"isDefaultStream": false,
"publishedAt": "",
"title": ""
],
"status": [
"healthStatus": [
"configurationIssues": [
[
"description": "",
"reason": "",
"severity": "",
"type": ""
]
],
"lastUpdateTimeSeconds": "",
"status": ""
],
"streamStatus": ""
]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/youtube/v3/liveStreams?part=")! 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()
GET
youtube.liveStreams.list
{{baseUrl}}/youtube/v3/liveStreams
QUERY PARAMS
part
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/youtube/v3/liveStreams?part=");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/youtube/v3/liveStreams" {:query-params {:part ""}})
require "http/client"
url = "{{baseUrl}}/youtube/v3/liveStreams?part="
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}}/youtube/v3/liveStreams?part="),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/youtube/v3/liveStreams?part=");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/youtube/v3/liveStreams?part="
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/youtube/v3/liveStreams?part= HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/youtube/v3/liveStreams?part=")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/youtube/v3/liveStreams?part="))
.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}}/youtube/v3/liveStreams?part=")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/youtube/v3/liveStreams?part=")
.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}}/youtube/v3/liveStreams?part=');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/youtube/v3/liveStreams',
params: {part: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/youtube/v3/liveStreams?part=';
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}}/youtube/v3/liveStreams?part=',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/youtube/v3/liveStreams?part=")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/youtube/v3/liveStreams?part=',
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}}/youtube/v3/liveStreams',
qs: {part: ''}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/youtube/v3/liveStreams');
req.query({
part: ''
});
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}}/youtube/v3/liveStreams',
params: {part: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/youtube/v3/liveStreams?part=';
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}}/youtube/v3/liveStreams?part="]
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}}/youtube/v3/liveStreams?part=" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/youtube/v3/liveStreams?part=",
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}}/youtube/v3/liveStreams?part=');
echo $response->getBody();
setUrl('{{baseUrl}}/youtube/v3/liveStreams');
$request->setMethod(HTTP_METH_GET);
$request->setQueryData([
'part' => ''
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/youtube/v3/liveStreams');
$request->setRequestMethod('GET');
$request->setQuery(new http\QueryString([
'part' => ''
]));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/youtube/v3/liveStreams?part=' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/youtube/v3/liveStreams?part=' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/youtube/v3/liveStreams?part=")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/youtube/v3/liveStreams"
querystring = {"part":""}
response = requests.get(url, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/youtube/v3/liveStreams"
queryString <- list(part = "")
response <- VERB("GET", url, query = queryString, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/youtube/v3/liveStreams?part=")
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/youtube/v3/liveStreams') do |req|
req.params['part'] = ''
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/youtube/v3/liveStreams";
let querystring = [
("part", ""),
];
let client = reqwest::Client::new();
let response = client.get(url)
.query(&querystring)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url '{{baseUrl}}/youtube/v3/liveStreams?part='
http GET '{{baseUrl}}/youtube/v3/liveStreams?part='
wget --quiet \
--method GET \
--output-document \
- '{{baseUrl}}/youtube/v3/liveStreams?part='
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/youtube/v3/liveStreams?part=")! 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()
PUT
youtube.liveStreams.update
{{baseUrl}}/youtube/v3/liveStreams
QUERY PARAMS
part
BODY json
{
"cdn": {
"format": "",
"frameRate": "",
"ingestionInfo": {
"backupIngestionAddress": "",
"ingestionAddress": "",
"rtmpsBackupIngestionAddress": "",
"rtmpsIngestionAddress": "",
"streamName": ""
},
"ingestionType": "",
"resolution": ""
},
"contentDetails": {
"closedCaptionsIngestionUrl": "",
"isReusable": false
},
"etag": "",
"id": "",
"kind": "",
"snippet": {
"channelId": "",
"description": "",
"isDefaultStream": false,
"publishedAt": "",
"title": ""
},
"status": {
"healthStatus": {
"configurationIssues": [
{
"description": "",
"reason": "",
"severity": "",
"type": ""
}
],
"lastUpdateTimeSeconds": "",
"status": ""
},
"streamStatus": ""
}
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/youtube/v3/liveStreams?part=");
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 \"cdn\": {\n \"format\": \"\",\n \"frameRate\": \"\",\n \"ingestionInfo\": {\n \"backupIngestionAddress\": \"\",\n \"ingestionAddress\": \"\",\n \"rtmpsBackupIngestionAddress\": \"\",\n \"rtmpsIngestionAddress\": \"\",\n \"streamName\": \"\"\n },\n \"ingestionType\": \"\",\n \"resolution\": \"\"\n },\n \"contentDetails\": {\n \"closedCaptionsIngestionUrl\": \"\",\n \"isReusable\": false\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"channelId\": \"\",\n \"description\": \"\",\n \"isDefaultStream\": false,\n \"publishedAt\": \"\",\n \"title\": \"\"\n },\n \"status\": {\n \"healthStatus\": {\n \"configurationIssues\": [\n {\n \"description\": \"\",\n \"reason\": \"\",\n \"severity\": \"\",\n \"type\": \"\"\n }\n ],\n \"lastUpdateTimeSeconds\": \"\",\n \"status\": \"\"\n },\n \"streamStatus\": \"\"\n }\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/youtube/v3/liveStreams" {:query-params {:part ""}
:content-type :json
:form-params {:cdn {:format ""
:frameRate ""
:ingestionInfo {:backupIngestionAddress ""
:ingestionAddress ""
:rtmpsBackupIngestionAddress ""
:rtmpsIngestionAddress ""
:streamName ""}
:ingestionType ""
:resolution ""}
:contentDetails {:closedCaptionsIngestionUrl ""
:isReusable false}
:etag ""
:id ""
:kind ""
:snippet {:channelId ""
:description ""
:isDefaultStream false
:publishedAt ""
:title ""}
:status {:healthStatus {:configurationIssues [{:description ""
:reason ""
:severity ""
:type ""}]
:lastUpdateTimeSeconds ""
:status ""}
:streamStatus ""}}})
require "http/client"
url = "{{baseUrl}}/youtube/v3/liveStreams?part="
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"cdn\": {\n \"format\": \"\",\n \"frameRate\": \"\",\n \"ingestionInfo\": {\n \"backupIngestionAddress\": \"\",\n \"ingestionAddress\": \"\",\n \"rtmpsBackupIngestionAddress\": \"\",\n \"rtmpsIngestionAddress\": \"\",\n \"streamName\": \"\"\n },\n \"ingestionType\": \"\",\n \"resolution\": \"\"\n },\n \"contentDetails\": {\n \"closedCaptionsIngestionUrl\": \"\",\n \"isReusable\": false\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"channelId\": \"\",\n \"description\": \"\",\n \"isDefaultStream\": false,\n \"publishedAt\": \"\",\n \"title\": \"\"\n },\n \"status\": {\n \"healthStatus\": {\n \"configurationIssues\": [\n {\n \"description\": \"\",\n \"reason\": \"\",\n \"severity\": \"\",\n \"type\": \"\"\n }\n ],\n \"lastUpdateTimeSeconds\": \"\",\n \"status\": \"\"\n },\n \"streamStatus\": \"\"\n }\n}"
response = HTTP::Client.put url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Put,
RequestUri = new Uri("{{baseUrl}}/youtube/v3/liveStreams?part="),
Content = new StringContent("{\n \"cdn\": {\n \"format\": \"\",\n \"frameRate\": \"\",\n \"ingestionInfo\": {\n \"backupIngestionAddress\": \"\",\n \"ingestionAddress\": \"\",\n \"rtmpsBackupIngestionAddress\": \"\",\n \"rtmpsIngestionAddress\": \"\",\n \"streamName\": \"\"\n },\n \"ingestionType\": \"\",\n \"resolution\": \"\"\n },\n \"contentDetails\": {\n \"closedCaptionsIngestionUrl\": \"\",\n \"isReusable\": false\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"channelId\": \"\",\n \"description\": \"\",\n \"isDefaultStream\": false,\n \"publishedAt\": \"\",\n \"title\": \"\"\n },\n \"status\": {\n \"healthStatus\": {\n \"configurationIssues\": [\n {\n \"description\": \"\",\n \"reason\": \"\",\n \"severity\": \"\",\n \"type\": \"\"\n }\n ],\n \"lastUpdateTimeSeconds\": \"\",\n \"status\": \"\"\n },\n \"streamStatus\": \"\"\n }\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/youtube/v3/liveStreams?part=");
var request = new RestRequest("", Method.Put);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"cdn\": {\n \"format\": \"\",\n \"frameRate\": \"\",\n \"ingestionInfo\": {\n \"backupIngestionAddress\": \"\",\n \"ingestionAddress\": \"\",\n \"rtmpsBackupIngestionAddress\": \"\",\n \"rtmpsIngestionAddress\": \"\",\n \"streamName\": \"\"\n },\n \"ingestionType\": \"\",\n \"resolution\": \"\"\n },\n \"contentDetails\": {\n \"closedCaptionsIngestionUrl\": \"\",\n \"isReusable\": false\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"channelId\": \"\",\n \"description\": \"\",\n \"isDefaultStream\": false,\n \"publishedAt\": \"\",\n \"title\": \"\"\n },\n \"status\": {\n \"healthStatus\": {\n \"configurationIssues\": [\n {\n \"description\": \"\",\n \"reason\": \"\",\n \"severity\": \"\",\n \"type\": \"\"\n }\n ],\n \"lastUpdateTimeSeconds\": \"\",\n \"status\": \"\"\n },\n \"streamStatus\": \"\"\n }\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/youtube/v3/liveStreams?part="
payload := strings.NewReader("{\n \"cdn\": {\n \"format\": \"\",\n \"frameRate\": \"\",\n \"ingestionInfo\": {\n \"backupIngestionAddress\": \"\",\n \"ingestionAddress\": \"\",\n \"rtmpsBackupIngestionAddress\": \"\",\n \"rtmpsIngestionAddress\": \"\",\n \"streamName\": \"\"\n },\n \"ingestionType\": \"\",\n \"resolution\": \"\"\n },\n \"contentDetails\": {\n \"closedCaptionsIngestionUrl\": \"\",\n \"isReusable\": false\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"channelId\": \"\",\n \"description\": \"\",\n \"isDefaultStream\": false,\n \"publishedAt\": \"\",\n \"title\": \"\"\n },\n \"status\": {\n \"healthStatus\": {\n \"configurationIssues\": [\n {\n \"description\": \"\",\n \"reason\": \"\",\n \"severity\": \"\",\n \"type\": \"\"\n }\n ],\n \"lastUpdateTimeSeconds\": \"\",\n \"status\": \"\"\n },\n \"streamStatus\": \"\"\n }\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PUT /baseUrl/youtube/v3/liveStreams?part= HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 845
{
"cdn": {
"format": "",
"frameRate": "",
"ingestionInfo": {
"backupIngestionAddress": "",
"ingestionAddress": "",
"rtmpsBackupIngestionAddress": "",
"rtmpsIngestionAddress": "",
"streamName": ""
},
"ingestionType": "",
"resolution": ""
},
"contentDetails": {
"closedCaptionsIngestionUrl": "",
"isReusable": false
},
"etag": "",
"id": "",
"kind": "",
"snippet": {
"channelId": "",
"description": "",
"isDefaultStream": false,
"publishedAt": "",
"title": ""
},
"status": {
"healthStatus": {
"configurationIssues": [
{
"description": "",
"reason": "",
"severity": "",
"type": ""
}
],
"lastUpdateTimeSeconds": "",
"status": ""
},
"streamStatus": ""
}
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/youtube/v3/liveStreams?part=")
.setHeader("content-type", "application/json")
.setBody("{\n \"cdn\": {\n \"format\": \"\",\n \"frameRate\": \"\",\n \"ingestionInfo\": {\n \"backupIngestionAddress\": \"\",\n \"ingestionAddress\": \"\",\n \"rtmpsBackupIngestionAddress\": \"\",\n \"rtmpsIngestionAddress\": \"\",\n \"streamName\": \"\"\n },\n \"ingestionType\": \"\",\n \"resolution\": \"\"\n },\n \"contentDetails\": {\n \"closedCaptionsIngestionUrl\": \"\",\n \"isReusable\": false\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"channelId\": \"\",\n \"description\": \"\",\n \"isDefaultStream\": false,\n \"publishedAt\": \"\",\n \"title\": \"\"\n },\n \"status\": {\n \"healthStatus\": {\n \"configurationIssues\": [\n {\n \"description\": \"\",\n \"reason\": \"\",\n \"severity\": \"\",\n \"type\": \"\"\n }\n ],\n \"lastUpdateTimeSeconds\": \"\",\n \"status\": \"\"\n },\n \"streamStatus\": \"\"\n }\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/youtube/v3/liveStreams?part="))
.header("content-type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString("{\n \"cdn\": {\n \"format\": \"\",\n \"frameRate\": \"\",\n \"ingestionInfo\": {\n \"backupIngestionAddress\": \"\",\n \"ingestionAddress\": \"\",\n \"rtmpsBackupIngestionAddress\": \"\",\n \"rtmpsIngestionAddress\": \"\",\n \"streamName\": \"\"\n },\n \"ingestionType\": \"\",\n \"resolution\": \"\"\n },\n \"contentDetails\": {\n \"closedCaptionsIngestionUrl\": \"\",\n \"isReusable\": false\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"channelId\": \"\",\n \"description\": \"\",\n \"isDefaultStream\": false,\n \"publishedAt\": \"\",\n \"title\": \"\"\n },\n \"status\": {\n \"healthStatus\": {\n \"configurationIssues\": [\n {\n \"description\": \"\",\n \"reason\": \"\",\n \"severity\": \"\",\n \"type\": \"\"\n }\n ],\n \"lastUpdateTimeSeconds\": \"\",\n \"status\": \"\"\n },\n \"streamStatus\": \"\"\n }\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"cdn\": {\n \"format\": \"\",\n \"frameRate\": \"\",\n \"ingestionInfo\": {\n \"backupIngestionAddress\": \"\",\n \"ingestionAddress\": \"\",\n \"rtmpsBackupIngestionAddress\": \"\",\n \"rtmpsIngestionAddress\": \"\",\n \"streamName\": \"\"\n },\n \"ingestionType\": \"\",\n \"resolution\": \"\"\n },\n \"contentDetails\": {\n \"closedCaptionsIngestionUrl\": \"\",\n \"isReusable\": false\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"channelId\": \"\",\n \"description\": \"\",\n \"isDefaultStream\": false,\n \"publishedAt\": \"\",\n \"title\": \"\"\n },\n \"status\": {\n \"healthStatus\": {\n \"configurationIssues\": [\n {\n \"description\": \"\",\n \"reason\": \"\",\n \"severity\": \"\",\n \"type\": \"\"\n }\n ],\n \"lastUpdateTimeSeconds\": \"\",\n \"status\": \"\"\n },\n \"streamStatus\": \"\"\n }\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/youtube/v3/liveStreams?part=")
.put(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/youtube/v3/liveStreams?part=")
.header("content-type", "application/json")
.body("{\n \"cdn\": {\n \"format\": \"\",\n \"frameRate\": \"\",\n \"ingestionInfo\": {\n \"backupIngestionAddress\": \"\",\n \"ingestionAddress\": \"\",\n \"rtmpsBackupIngestionAddress\": \"\",\n \"rtmpsIngestionAddress\": \"\",\n \"streamName\": \"\"\n },\n \"ingestionType\": \"\",\n \"resolution\": \"\"\n },\n \"contentDetails\": {\n \"closedCaptionsIngestionUrl\": \"\",\n \"isReusable\": false\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"channelId\": \"\",\n \"description\": \"\",\n \"isDefaultStream\": false,\n \"publishedAt\": \"\",\n \"title\": \"\"\n },\n \"status\": {\n \"healthStatus\": {\n \"configurationIssues\": [\n {\n \"description\": \"\",\n \"reason\": \"\",\n \"severity\": \"\",\n \"type\": \"\"\n }\n ],\n \"lastUpdateTimeSeconds\": \"\",\n \"status\": \"\"\n },\n \"streamStatus\": \"\"\n }\n}")
.asString();
const data = JSON.stringify({
cdn: {
format: '',
frameRate: '',
ingestionInfo: {
backupIngestionAddress: '',
ingestionAddress: '',
rtmpsBackupIngestionAddress: '',
rtmpsIngestionAddress: '',
streamName: ''
},
ingestionType: '',
resolution: ''
},
contentDetails: {
closedCaptionsIngestionUrl: '',
isReusable: false
},
etag: '',
id: '',
kind: '',
snippet: {
channelId: '',
description: '',
isDefaultStream: false,
publishedAt: '',
title: ''
},
status: {
healthStatus: {
configurationIssues: [
{
description: '',
reason: '',
severity: '',
type: ''
}
],
lastUpdateTimeSeconds: '',
status: ''
},
streamStatus: ''
}
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/youtube/v3/liveStreams?part=');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/youtube/v3/liveStreams',
params: {part: ''},
headers: {'content-type': 'application/json'},
data: {
cdn: {
format: '',
frameRate: '',
ingestionInfo: {
backupIngestionAddress: '',
ingestionAddress: '',
rtmpsBackupIngestionAddress: '',
rtmpsIngestionAddress: '',
streamName: ''
},
ingestionType: '',
resolution: ''
},
contentDetails: {closedCaptionsIngestionUrl: '', isReusable: false},
etag: '',
id: '',
kind: '',
snippet: {
channelId: '',
description: '',
isDefaultStream: false,
publishedAt: '',
title: ''
},
status: {
healthStatus: {
configurationIssues: [{description: '', reason: '', severity: '', type: ''}],
lastUpdateTimeSeconds: '',
status: ''
},
streamStatus: ''
}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/youtube/v3/liveStreams?part=';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"cdn":{"format":"","frameRate":"","ingestionInfo":{"backupIngestionAddress":"","ingestionAddress":"","rtmpsBackupIngestionAddress":"","rtmpsIngestionAddress":"","streamName":""},"ingestionType":"","resolution":""},"contentDetails":{"closedCaptionsIngestionUrl":"","isReusable":false},"etag":"","id":"","kind":"","snippet":{"channelId":"","description":"","isDefaultStream":false,"publishedAt":"","title":""},"status":{"healthStatus":{"configurationIssues":[{"description":"","reason":"","severity":"","type":""}],"lastUpdateTimeSeconds":"","status":""},"streamStatus":""}}'
};
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}}/youtube/v3/liveStreams?part=',
method: 'PUT',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "cdn": {\n "format": "",\n "frameRate": "",\n "ingestionInfo": {\n "backupIngestionAddress": "",\n "ingestionAddress": "",\n "rtmpsBackupIngestionAddress": "",\n "rtmpsIngestionAddress": "",\n "streamName": ""\n },\n "ingestionType": "",\n "resolution": ""\n },\n "contentDetails": {\n "closedCaptionsIngestionUrl": "",\n "isReusable": false\n },\n "etag": "",\n "id": "",\n "kind": "",\n "snippet": {\n "channelId": "",\n "description": "",\n "isDefaultStream": false,\n "publishedAt": "",\n "title": ""\n },\n "status": {\n "healthStatus": {\n "configurationIssues": [\n {\n "description": "",\n "reason": "",\n "severity": "",\n "type": ""\n }\n ],\n "lastUpdateTimeSeconds": "",\n "status": ""\n },\n "streamStatus": ""\n }\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"cdn\": {\n \"format\": \"\",\n \"frameRate\": \"\",\n \"ingestionInfo\": {\n \"backupIngestionAddress\": \"\",\n \"ingestionAddress\": \"\",\n \"rtmpsBackupIngestionAddress\": \"\",\n \"rtmpsIngestionAddress\": \"\",\n \"streamName\": \"\"\n },\n \"ingestionType\": \"\",\n \"resolution\": \"\"\n },\n \"contentDetails\": {\n \"closedCaptionsIngestionUrl\": \"\",\n \"isReusable\": false\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"channelId\": \"\",\n \"description\": \"\",\n \"isDefaultStream\": false,\n \"publishedAt\": \"\",\n \"title\": \"\"\n },\n \"status\": {\n \"healthStatus\": {\n \"configurationIssues\": [\n {\n \"description\": \"\",\n \"reason\": \"\",\n \"severity\": \"\",\n \"type\": \"\"\n }\n ],\n \"lastUpdateTimeSeconds\": \"\",\n \"status\": \"\"\n },\n \"streamStatus\": \"\"\n }\n}")
val request = Request.Builder()
.url("{{baseUrl}}/youtube/v3/liveStreams?part=")
.put(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PUT',
hostname: 'example.com',
port: null,
path: '/baseUrl/youtube/v3/liveStreams?part=',
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({
cdn: {
format: '',
frameRate: '',
ingestionInfo: {
backupIngestionAddress: '',
ingestionAddress: '',
rtmpsBackupIngestionAddress: '',
rtmpsIngestionAddress: '',
streamName: ''
},
ingestionType: '',
resolution: ''
},
contentDetails: {closedCaptionsIngestionUrl: '', isReusable: false},
etag: '',
id: '',
kind: '',
snippet: {
channelId: '',
description: '',
isDefaultStream: false,
publishedAt: '',
title: ''
},
status: {
healthStatus: {
configurationIssues: [{description: '', reason: '', severity: '', type: ''}],
lastUpdateTimeSeconds: '',
status: ''
},
streamStatus: ''
}
}));
req.end();
const request = require('request');
const options = {
method: 'PUT',
url: '{{baseUrl}}/youtube/v3/liveStreams',
qs: {part: ''},
headers: {'content-type': 'application/json'},
body: {
cdn: {
format: '',
frameRate: '',
ingestionInfo: {
backupIngestionAddress: '',
ingestionAddress: '',
rtmpsBackupIngestionAddress: '',
rtmpsIngestionAddress: '',
streamName: ''
},
ingestionType: '',
resolution: ''
},
contentDetails: {closedCaptionsIngestionUrl: '', isReusable: false},
etag: '',
id: '',
kind: '',
snippet: {
channelId: '',
description: '',
isDefaultStream: false,
publishedAt: '',
title: ''
},
status: {
healthStatus: {
configurationIssues: [{description: '', reason: '', severity: '', type: ''}],
lastUpdateTimeSeconds: '',
status: ''
},
streamStatus: ''
}
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PUT', '{{baseUrl}}/youtube/v3/liveStreams');
req.query({
part: ''
});
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
cdn: {
format: '',
frameRate: '',
ingestionInfo: {
backupIngestionAddress: '',
ingestionAddress: '',
rtmpsBackupIngestionAddress: '',
rtmpsIngestionAddress: '',
streamName: ''
},
ingestionType: '',
resolution: ''
},
contentDetails: {
closedCaptionsIngestionUrl: '',
isReusable: false
},
etag: '',
id: '',
kind: '',
snippet: {
channelId: '',
description: '',
isDefaultStream: false,
publishedAt: '',
title: ''
},
status: {
healthStatus: {
configurationIssues: [
{
description: '',
reason: '',
severity: '',
type: ''
}
],
lastUpdateTimeSeconds: '',
status: ''
},
streamStatus: ''
}
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'PUT',
url: '{{baseUrl}}/youtube/v3/liveStreams',
params: {part: ''},
headers: {'content-type': 'application/json'},
data: {
cdn: {
format: '',
frameRate: '',
ingestionInfo: {
backupIngestionAddress: '',
ingestionAddress: '',
rtmpsBackupIngestionAddress: '',
rtmpsIngestionAddress: '',
streamName: ''
},
ingestionType: '',
resolution: ''
},
contentDetails: {closedCaptionsIngestionUrl: '', isReusable: false},
etag: '',
id: '',
kind: '',
snippet: {
channelId: '',
description: '',
isDefaultStream: false,
publishedAt: '',
title: ''
},
status: {
healthStatus: {
configurationIssues: [{description: '', reason: '', severity: '', type: ''}],
lastUpdateTimeSeconds: '',
status: ''
},
streamStatus: ''
}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/youtube/v3/liveStreams?part=';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"cdn":{"format":"","frameRate":"","ingestionInfo":{"backupIngestionAddress":"","ingestionAddress":"","rtmpsBackupIngestionAddress":"","rtmpsIngestionAddress":"","streamName":""},"ingestionType":"","resolution":""},"contentDetails":{"closedCaptionsIngestionUrl":"","isReusable":false},"etag":"","id":"","kind":"","snippet":{"channelId":"","description":"","isDefaultStream":false,"publishedAt":"","title":""},"status":{"healthStatus":{"configurationIssues":[{"description":"","reason":"","severity":"","type":""}],"lastUpdateTimeSeconds":"","status":""},"streamStatus":""}}'
};
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 = @{ @"cdn": @{ @"format": @"", @"frameRate": @"", @"ingestionInfo": @{ @"backupIngestionAddress": @"", @"ingestionAddress": @"", @"rtmpsBackupIngestionAddress": @"", @"rtmpsIngestionAddress": @"", @"streamName": @"" }, @"ingestionType": @"", @"resolution": @"" },
@"contentDetails": @{ @"closedCaptionsIngestionUrl": @"", @"isReusable": @NO },
@"etag": @"",
@"id": @"",
@"kind": @"",
@"snippet": @{ @"channelId": @"", @"description": @"", @"isDefaultStream": @NO, @"publishedAt": @"", @"title": @"" },
@"status": @{ @"healthStatus": @{ @"configurationIssues": @[ @{ @"description": @"", @"reason": @"", @"severity": @"", @"type": @"" } ], @"lastUpdateTimeSeconds": @"", @"status": @"" }, @"streamStatus": @"" } };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/youtube/v3/liveStreams?part="]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PUT"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/youtube/v3/liveStreams?part=" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"cdn\": {\n \"format\": \"\",\n \"frameRate\": \"\",\n \"ingestionInfo\": {\n \"backupIngestionAddress\": \"\",\n \"ingestionAddress\": \"\",\n \"rtmpsBackupIngestionAddress\": \"\",\n \"rtmpsIngestionAddress\": \"\",\n \"streamName\": \"\"\n },\n \"ingestionType\": \"\",\n \"resolution\": \"\"\n },\n \"contentDetails\": {\n \"closedCaptionsIngestionUrl\": \"\",\n \"isReusable\": false\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"channelId\": \"\",\n \"description\": \"\",\n \"isDefaultStream\": false,\n \"publishedAt\": \"\",\n \"title\": \"\"\n },\n \"status\": {\n \"healthStatus\": {\n \"configurationIssues\": [\n {\n \"description\": \"\",\n \"reason\": \"\",\n \"severity\": \"\",\n \"type\": \"\"\n }\n ],\n \"lastUpdateTimeSeconds\": \"\",\n \"status\": \"\"\n },\n \"streamStatus\": \"\"\n }\n}" in
Client.call ~headers ~body `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/youtube/v3/liveStreams?part=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'cdn' => [
'format' => '',
'frameRate' => '',
'ingestionInfo' => [
'backupIngestionAddress' => '',
'ingestionAddress' => '',
'rtmpsBackupIngestionAddress' => '',
'rtmpsIngestionAddress' => '',
'streamName' => ''
],
'ingestionType' => '',
'resolution' => ''
],
'contentDetails' => [
'closedCaptionsIngestionUrl' => '',
'isReusable' => null
],
'etag' => '',
'id' => '',
'kind' => '',
'snippet' => [
'channelId' => '',
'description' => '',
'isDefaultStream' => null,
'publishedAt' => '',
'title' => ''
],
'status' => [
'healthStatus' => [
'configurationIssues' => [
[
'description' => '',
'reason' => '',
'severity' => '',
'type' => ''
]
],
'lastUpdateTimeSeconds' => '',
'status' => ''
],
'streamStatus' => ''
]
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('PUT', '{{baseUrl}}/youtube/v3/liveStreams?part=', [
'body' => '{
"cdn": {
"format": "",
"frameRate": "",
"ingestionInfo": {
"backupIngestionAddress": "",
"ingestionAddress": "",
"rtmpsBackupIngestionAddress": "",
"rtmpsIngestionAddress": "",
"streamName": ""
},
"ingestionType": "",
"resolution": ""
},
"contentDetails": {
"closedCaptionsIngestionUrl": "",
"isReusable": false
},
"etag": "",
"id": "",
"kind": "",
"snippet": {
"channelId": "",
"description": "",
"isDefaultStream": false,
"publishedAt": "",
"title": ""
},
"status": {
"healthStatus": {
"configurationIssues": [
{
"description": "",
"reason": "",
"severity": "",
"type": ""
}
],
"lastUpdateTimeSeconds": "",
"status": ""
},
"streamStatus": ""
}
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/youtube/v3/liveStreams');
$request->setMethod(HTTP_METH_PUT);
$request->setQueryData([
'part' => ''
]);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'cdn' => [
'format' => '',
'frameRate' => '',
'ingestionInfo' => [
'backupIngestionAddress' => '',
'ingestionAddress' => '',
'rtmpsBackupIngestionAddress' => '',
'rtmpsIngestionAddress' => '',
'streamName' => ''
],
'ingestionType' => '',
'resolution' => ''
],
'contentDetails' => [
'closedCaptionsIngestionUrl' => '',
'isReusable' => null
],
'etag' => '',
'id' => '',
'kind' => '',
'snippet' => [
'channelId' => '',
'description' => '',
'isDefaultStream' => null,
'publishedAt' => '',
'title' => ''
],
'status' => [
'healthStatus' => [
'configurationIssues' => [
[
'description' => '',
'reason' => '',
'severity' => '',
'type' => ''
]
],
'lastUpdateTimeSeconds' => '',
'status' => ''
],
'streamStatus' => ''
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'cdn' => [
'format' => '',
'frameRate' => '',
'ingestionInfo' => [
'backupIngestionAddress' => '',
'ingestionAddress' => '',
'rtmpsBackupIngestionAddress' => '',
'rtmpsIngestionAddress' => '',
'streamName' => ''
],
'ingestionType' => '',
'resolution' => ''
],
'contentDetails' => [
'closedCaptionsIngestionUrl' => '',
'isReusable' => null
],
'etag' => '',
'id' => '',
'kind' => '',
'snippet' => [
'channelId' => '',
'description' => '',
'isDefaultStream' => null,
'publishedAt' => '',
'title' => ''
],
'status' => [
'healthStatus' => [
'configurationIssues' => [
[
'description' => '',
'reason' => '',
'severity' => '',
'type' => ''
]
],
'lastUpdateTimeSeconds' => '',
'status' => ''
],
'streamStatus' => ''
]
]));
$request->setRequestUrl('{{baseUrl}}/youtube/v3/liveStreams');
$request->setRequestMethod('PUT');
$request->setBody($body);
$request->setQuery(new http\QueryString([
'part' => ''
]));
$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}}/youtube/v3/liveStreams?part=' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"cdn": {
"format": "",
"frameRate": "",
"ingestionInfo": {
"backupIngestionAddress": "",
"ingestionAddress": "",
"rtmpsBackupIngestionAddress": "",
"rtmpsIngestionAddress": "",
"streamName": ""
},
"ingestionType": "",
"resolution": ""
},
"contentDetails": {
"closedCaptionsIngestionUrl": "",
"isReusable": false
},
"etag": "",
"id": "",
"kind": "",
"snippet": {
"channelId": "",
"description": "",
"isDefaultStream": false,
"publishedAt": "",
"title": ""
},
"status": {
"healthStatus": {
"configurationIssues": [
{
"description": "",
"reason": "",
"severity": "",
"type": ""
}
],
"lastUpdateTimeSeconds": "",
"status": ""
},
"streamStatus": ""
}
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/youtube/v3/liveStreams?part=' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"cdn": {
"format": "",
"frameRate": "",
"ingestionInfo": {
"backupIngestionAddress": "",
"ingestionAddress": "",
"rtmpsBackupIngestionAddress": "",
"rtmpsIngestionAddress": "",
"streamName": ""
},
"ingestionType": "",
"resolution": ""
},
"contentDetails": {
"closedCaptionsIngestionUrl": "",
"isReusable": false
},
"etag": "",
"id": "",
"kind": "",
"snippet": {
"channelId": "",
"description": "",
"isDefaultStream": false,
"publishedAt": "",
"title": ""
},
"status": {
"healthStatus": {
"configurationIssues": [
{
"description": "",
"reason": "",
"severity": "",
"type": ""
}
],
"lastUpdateTimeSeconds": "",
"status": ""
},
"streamStatus": ""
}
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"cdn\": {\n \"format\": \"\",\n \"frameRate\": \"\",\n \"ingestionInfo\": {\n \"backupIngestionAddress\": \"\",\n \"ingestionAddress\": \"\",\n \"rtmpsBackupIngestionAddress\": \"\",\n \"rtmpsIngestionAddress\": \"\",\n \"streamName\": \"\"\n },\n \"ingestionType\": \"\",\n \"resolution\": \"\"\n },\n \"contentDetails\": {\n \"closedCaptionsIngestionUrl\": \"\",\n \"isReusable\": false\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"channelId\": \"\",\n \"description\": \"\",\n \"isDefaultStream\": false,\n \"publishedAt\": \"\",\n \"title\": \"\"\n },\n \"status\": {\n \"healthStatus\": {\n \"configurationIssues\": [\n {\n \"description\": \"\",\n \"reason\": \"\",\n \"severity\": \"\",\n \"type\": \"\"\n }\n ],\n \"lastUpdateTimeSeconds\": \"\",\n \"status\": \"\"\n },\n \"streamStatus\": \"\"\n }\n}"
headers = { 'content-type': "application/json" }
conn.request("PUT", "/baseUrl/youtube/v3/liveStreams?part=", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/youtube/v3/liveStreams"
querystring = {"part":""}
payload = {
"cdn": {
"format": "",
"frameRate": "",
"ingestionInfo": {
"backupIngestionAddress": "",
"ingestionAddress": "",
"rtmpsBackupIngestionAddress": "",
"rtmpsIngestionAddress": "",
"streamName": ""
},
"ingestionType": "",
"resolution": ""
},
"contentDetails": {
"closedCaptionsIngestionUrl": "",
"isReusable": False
},
"etag": "",
"id": "",
"kind": "",
"snippet": {
"channelId": "",
"description": "",
"isDefaultStream": False,
"publishedAt": "",
"title": ""
},
"status": {
"healthStatus": {
"configurationIssues": [
{
"description": "",
"reason": "",
"severity": "",
"type": ""
}
],
"lastUpdateTimeSeconds": "",
"status": ""
},
"streamStatus": ""
}
}
headers = {"content-type": "application/json"}
response = requests.put(url, json=payload, headers=headers, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/youtube/v3/liveStreams"
queryString <- list(part = "")
payload <- "{\n \"cdn\": {\n \"format\": \"\",\n \"frameRate\": \"\",\n \"ingestionInfo\": {\n \"backupIngestionAddress\": \"\",\n \"ingestionAddress\": \"\",\n \"rtmpsBackupIngestionAddress\": \"\",\n \"rtmpsIngestionAddress\": \"\",\n \"streamName\": \"\"\n },\n \"ingestionType\": \"\",\n \"resolution\": \"\"\n },\n \"contentDetails\": {\n \"closedCaptionsIngestionUrl\": \"\",\n \"isReusable\": false\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"channelId\": \"\",\n \"description\": \"\",\n \"isDefaultStream\": false,\n \"publishedAt\": \"\",\n \"title\": \"\"\n },\n \"status\": {\n \"healthStatus\": {\n \"configurationIssues\": [\n {\n \"description\": \"\",\n \"reason\": \"\",\n \"severity\": \"\",\n \"type\": \"\"\n }\n ],\n \"lastUpdateTimeSeconds\": \"\",\n \"status\": \"\"\n },\n \"streamStatus\": \"\"\n }\n}"
encode <- "json"
response <- VERB("PUT", url, body = payload, query = queryString, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/youtube/v3/liveStreams?part=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"cdn\": {\n \"format\": \"\",\n \"frameRate\": \"\",\n \"ingestionInfo\": {\n \"backupIngestionAddress\": \"\",\n \"ingestionAddress\": \"\",\n \"rtmpsBackupIngestionAddress\": \"\",\n \"rtmpsIngestionAddress\": \"\",\n \"streamName\": \"\"\n },\n \"ingestionType\": \"\",\n \"resolution\": \"\"\n },\n \"contentDetails\": {\n \"closedCaptionsIngestionUrl\": \"\",\n \"isReusable\": false\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"channelId\": \"\",\n \"description\": \"\",\n \"isDefaultStream\": false,\n \"publishedAt\": \"\",\n \"title\": \"\"\n },\n \"status\": {\n \"healthStatus\": {\n \"configurationIssues\": [\n {\n \"description\": \"\",\n \"reason\": \"\",\n \"severity\": \"\",\n \"type\": \"\"\n }\n ],\n \"lastUpdateTimeSeconds\": \"\",\n \"status\": \"\"\n },\n \"streamStatus\": \"\"\n }\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.put('/baseUrl/youtube/v3/liveStreams') do |req|
req.params['part'] = ''
req.body = "{\n \"cdn\": {\n \"format\": \"\",\n \"frameRate\": \"\",\n \"ingestionInfo\": {\n \"backupIngestionAddress\": \"\",\n \"ingestionAddress\": \"\",\n \"rtmpsBackupIngestionAddress\": \"\",\n \"rtmpsIngestionAddress\": \"\",\n \"streamName\": \"\"\n },\n \"ingestionType\": \"\",\n \"resolution\": \"\"\n },\n \"contentDetails\": {\n \"closedCaptionsIngestionUrl\": \"\",\n \"isReusable\": false\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"channelId\": \"\",\n \"description\": \"\",\n \"isDefaultStream\": false,\n \"publishedAt\": \"\",\n \"title\": \"\"\n },\n \"status\": {\n \"healthStatus\": {\n \"configurationIssues\": [\n {\n \"description\": \"\",\n \"reason\": \"\",\n \"severity\": \"\",\n \"type\": \"\"\n }\n ],\n \"lastUpdateTimeSeconds\": \"\",\n \"status\": \"\"\n },\n \"streamStatus\": \"\"\n }\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}}/youtube/v3/liveStreams";
let querystring = [
("part", ""),
];
let payload = json!({
"cdn": json!({
"format": "",
"frameRate": "",
"ingestionInfo": json!({
"backupIngestionAddress": "",
"ingestionAddress": "",
"rtmpsBackupIngestionAddress": "",
"rtmpsIngestionAddress": "",
"streamName": ""
}),
"ingestionType": "",
"resolution": ""
}),
"contentDetails": json!({
"closedCaptionsIngestionUrl": "",
"isReusable": false
}),
"etag": "",
"id": "",
"kind": "",
"snippet": json!({
"channelId": "",
"description": "",
"isDefaultStream": false,
"publishedAt": "",
"title": ""
}),
"status": json!({
"healthStatus": json!({
"configurationIssues": (
json!({
"description": "",
"reason": "",
"severity": "",
"type": ""
})
),
"lastUpdateTimeSeconds": "",
"status": ""
}),
"streamStatus": ""
})
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PUT").unwrap(), url)
.query(&querystring)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PUT \
--url '{{baseUrl}}/youtube/v3/liveStreams?part=' \
--header 'content-type: application/json' \
--data '{
"cdn": {
"format": "",
"frameRate": "",
"ingestionInfo": {
"backupIngestionAddress": "",
"ingestionAddress": "",
"rtmpsBackupIngestionAddress": "",
"rtmpsIngestionAddress": "",
"streamName": ""
},
"ingestionType": "",
"resolution": ""
},
"contentDetails": {
"closedCaptionsIngestionUrl": "",
"isReusable": false
},
"etag": "",
"id": "",
"kind": "",
"snippet": {
"channelId": "",
"description": "",
"isDefaultStream": false,
"publishedAt": "",
"title": ""
},
"status": {
"healthStatus": {
"configurationIssues": [
{
"description": "",
"reason": "",
"severity": "",
"type": ""
}
],
"lastUpdateTimeSeconds": "",
"status": ""
},
"streamStatus": ""
}
}'
echo '{
"cdn": {
"format": "",
"frameRate": "",
"ingestionInfo": {
"backupIngestionAddress": "",
"ingestionAddress": "",
"rtmpsBackupIngestionAddress": "",
"rtmpsIngestionAddress": "",
"streamName": ""
},
"ingestionType": "",
"resolution": ""
},
"contentDetails": {
"closedCaptionsIngestionUrl": "",
"isReusable": false
},
"etag": "",
"id": "",
"kind": "",
"snippet": {
"channelId": "",
"description": "",
"isDefaultStream": false,
"publishedAt": "",
"title": ""
},
"status": {
"healthStatus": {
"configurationIssues": [
{
"description": "",
"reason": "",
"severity": "",
"type": ""
}
],
"lastUpdateTimeSeconds": "",
"status": ""
},
"streamStatus": ""
}
}' | \
http PUT '{{baseUrl}}/youtube/v3/liveStreams?part=' \
content-type:application/json
wget --quiet \
--method PUT \
--header 'content-type: application/json' \
--body-data '{\n "cdn": {\n "format": "",\n "frameRate": "",\n "ingestionInfo": {\n "backupIngestionAddress": "",\n "ingestionAddress": "",\n "rtmpsBackupIngestionAddress": "",\n "rtmpsIngestionAddress": "",\n "streamName": ""\n },\n "ingestionType": "",\n "resolution": ""\n },\n "contentDetails": {\n "closedCaptionsIngestionUrl": "",\n "isReusable": false\n },\n "etag": "",\n "id": "",\n "kind": "",\n "snippet": {\n "channelId": "",\n "description": "",\n "isDefaultStream": false,\n "publishedAt": "",\n "title": ""\n },\n "status": {\n "healthStatus": {\n "configurationIssues": [\n {\n "description": "",\n "reason": "",\n "severity": "",\n "type": ""\n }\n ],\n "lastUpdateTimeSeconds": "",\n "status": ""\n },\n "streamStatus": ""\n }\n}' \
--output-document \
- '{{baseUrl}}/youtube/v3/liveStreams?part='
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"cdn": [
"format": "",
"frameRate": "",
"ingestionInfo": [
"backupIngestionAddress": "",
"ingestionAddress": "",
"rtmpsBackupIngestionAddress": "",
"rtmpsIngestionAddress": "",
"streamName": ""
],
"ingestionType": "",
"resolution": ""
],
"contentDetails": [
"closedCaptionsIngestionUrl": "",
"isReusable": false
],
"etag": "",
"id": "",
"kind": "",
"snippet": [
"channelId": "",
"description": "",
"isDefaultStream": false,
"publishedAt": "",
"title": ""
],
"status": [
"healthStatus": [
"configurationIssues": [
[
"description": "",
"reason": "",
"severity": "",
"type": ""
]
],
"lastUpdateTimeSeconds": "",
"status": ""
],
"streamStatus": ""
]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/youtube/v3/liveStreams?part=")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
youtube.members.list
{{baseUrl}}/youtube/v3/members
QUERY PARAMS
part
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/youtube/v3/members?part=");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/youtube/v3/members" {:query-params {:part ""}})
require "http/client"
url = "{{baseUrl}}/youtube/v3/members?part="
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}}/youtube/v3/members?part="),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/youtube/v3/members?part=");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/youtube/v3/members?part="
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/youtube/v3/members?part= HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/youtube/v3/members?part=")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/youtube/v3/members?part="))
.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}}/youtube/v3/members?part=")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/youtube/v3/members?part=")
.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}}/youtube/v3/members?part=');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/youtube/v3/members',
params: {part: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/youtube/v3/members?part=';
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}}/youtube/v3/members?part=',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/youtube/v3/members?part=")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/youtube/v3/members?part=',
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}}/youtube/v3/members',
qs: {part: ''}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/youtube/v3/members');
req.query({
part: ''
});
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}}/youtube/v3/members',
params: {part: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/youtube/v3/members?part=';
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}}/youtube/v3/members?part="]
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}}/youtube/v3/members?part=" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/youtube/v3/members?part=",
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}}/youtube/v3/members?part=');
echo $response->getBody();
setUrl('{{baseUrl}}/youtube/v3/members');
$request->setMethod(HTTP_METH_GET);
$request->setQueryData([
'part' => ''
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/youtube/v3/members');
$request->setRequestMethod('GET');
$request->setQuery(new http\QueryString([
'part' => ''
]));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/youtube/v3/members?part=' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/youtube/v3/members?part=' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/youtube/v3/members?part=")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/youtube/v3/members"
querystring = {"part":""}
response = requests.get(url, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/youtube/v3/members"
queryString <- list(part = "")
response <- VERB("GET", url, query = queryString, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/youtube/v3/members?part=")
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/youtube/v3/members') do |req|
req.params['part'] = ''
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/youtube/v3/members";
let querystring = [
("part", ""),
];
let client = reqwest::Client::new();
let response = client.get(url)
.query(&querystring)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url '{{baseUrl}}/youtube/v3/members?part='
http GET '{{baseUrl}}/youtube/v3/members?part='
wget --quiet \
--method GET \
--output-document \
- '{{baseUrl}}/youtube/v3/members?part='
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/youtube/v3/members?part=")! 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
youtube.membershipsLevels.list
{{baseUrl}}/youtube/v3/membershipsLevels
QUERY PARAMS
part
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/youtube/v3/membershipsLevels?part=");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/youtube/v3/membershipsLevels" {:query-params {:part ""}})
require "http/client"
url = "{{baseUrl}}/youtube/v3/membershipsLevels?part="
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}}/youtube/v3/membershipsLevels?part="),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/youtube/v3/membershipsLevels?part=");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/youtube/v3/membershipsLevels?part="
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/youtube/v3/membershipsLevels?part= HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/youtube/v3/membershipsLevels?part=")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/youtube/v3/membershipsLevels?part="))
.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}}/youtube/v3/membershipsLevels?part=")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/youtube/v3/membershipsLevels?part=")
.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}}/youtube/v3/membershipsLevels?part=');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/youtube/v3/membershipsLevels',
params: {part: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/youtube/v3/membershipsLevels?part=';
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}}/youtube/v3/membershipsLevels?part=',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/youtube/v3/membershipsLevels?part=")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/youtube/v3/membershipsLevels?part=',
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}}/youtube/v3/membershipsLevels',
qs: {part: ''}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/youtube/v3/membershipsLevels');
req.query({
part: ''
});
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}}/youtube/v3/membershipsLevels',
params: {part: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/youtube/v3/membershipsLevels?part=';
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}}/youtube/v3/membershipsLevels?part="]
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}}/youtube/v3/membershipsLevels?part=" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/youtube/v3/membershipsLevels?part=",
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}}/youtube/v3/membershipsLevels?part=');
echo $response->getBody();
setUrl('{{baseUrl}}/youtube/v3/membershipsLevels');
$request->setMethod(HTTP_METH_GET);
$request->setQueryData([
'part' => ''
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/youtube/v3/membershipsLevels');
$request->setRequestMethod('GET');
$request->setQuery(new http\QueryString([
'part' => ''
]));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/youtube/v3/membershipsLevels?part=' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/youtube/v3/membershipsLevels?part=' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/youtube/v3/membershipsLevels?part=")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/youtube/v3/membershipsLevels"
querystring = {"part":""}
response = requests.get(url, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/youtube/v3/membershipsLevels"
queryString <- list(part = "")
response <- VERB("GET", url, query = queryString, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/youtube/v3/membershipsLevels?part=")
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/youtube/v3/membershipsLevels') do |req|
req.params['part'] = ''
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/youtube/v3/membershipsLevels";
let querystring = [
("part", ""),
];
let client = reqwest::Client::new();
let response = client.get(url)
.query(&querystring)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url '{{baseUrl}}/youtube/v3/membershipsLevels?part='
http GET '{{baseUrl}}/youtube/v3/membershipsLevels?part='
wget --quiet \
--method GET \
--output-document \
- '{{baseUrl}}/youtube/v3/membershipsLevels?part='
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/youtube/v3/membershipsLevels?part=")! 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()
DELETE
youtube.playlistItems.delete
{{baseUrl}}/youtube/v3/playlistItems
QUERY PARAMS
id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/youtube/v3/playlistItems?id=");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/delete "{{baseUrl}}/youtube/v3/playlistItems" {:query-params {:id ""}})
require "http/client"
url = "{{baseUrl}}/youtube/v3/playlistItems?id="
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}}/youtube/v3/playlistItems?id="),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/youtube/v3/playlistItems?id=");
var request = new RestRequest("", Method.Delete);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/youtube/v3/playlistItems?id="
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/youtube/v3/playlistItems?id= HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/youtube/v3/playlistItems?id=")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/youtube/v3/playlistItems?id="))
.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}}/youtube/v3/playlistItems?id=")
.delete(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/youtube/v3/playlistItems?id=")
.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}}/youtube/v3/playlistItems?id=');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'DELETE',
url: '{{baseUrl}}/youtube/v3/playlistItems',
params: {id: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/youtube/v3/playlistItems?id=';
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}}/youtube/v3/playlistItems?id=',
method: 'DELETE',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/youtube/v3/playlistItems?id=")
.delete(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'DELETE',
hostname: 'example.com',
port: null,
path: '/baseUrl/youtube/v3/playlistItems?id=',
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}}/youtube/v3/playlistItems',
qs: {id: ''}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('DELETE', '{{baseUrl}}/youtube/v3/playlistItems');
req.query({
id: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'DELETE',
url: '{{baseUrl}}/youtube/v3/playlistItems',
params: {id: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/youtube/v3/playlistItems?id=';
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}}/youtube/v3/playlistItems?id="]
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}}/youtube/v3/playlistItems?id=" in
Client.call `DELETE uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/youtube/v3/playlistItems?id=",
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}}/youtube/v3/playlistItems?id=');
echo $response->getBody();
setUrl('{{baseUrl}}/youtube/v3/playlistItems');
$request->setMethod(HTTP_METH_DELETE);
$request->setQueryData([
'id' => ''
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/youtube/v3/playlistItems');
$request->setRequestMethod('DELETE');
$request->setQuery(new http\QueryString([
'id' => ''
]));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/youtube/v3/playlistItems?id=' -Method DELETE
$response = Invoke-RestMethod -Uri '{{baseUrl}}/youtube/v3/playlistItems?id=' -Method DELETE
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("DELETE", "/baseUrl/youtube/v3/playlistItems?id=")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/youtube/v3/playlistItems"
querystring = {"id":""}
response = requests.delete(url, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/youtube/v3/playlistItems"
queryString <- list(id = "")
response <- VERB("DELETE", url, query = queryString, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/youtube/v3/playlistItems?id=")
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/youtube/v3/playlistItems') do |req|
req.params['id'] = ''
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/youtube/v3/playlistItems";
let querystring = [
("id", ""),
];
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("DELETE").unwrap(), url)
.query(&querystring)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request DELETE \
--url '{{baseUrl}}/youtube/v3/playlistItems?id='
http DELETE '{{baseUrl}}/youtube/v3/playlistItems?id='
wget --quiet \
--method DELETE \
--output-document \
- '{{baseUrl}}/youtube/v3/playlistItems?id='
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/youtube/v3/playlistItems?id=")! 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()
POST
youtube.playlistItems.insert
{{baseUrl}}/youtube/v3/playlistItems
QUERY PARAMS
part
BODY json
{
"contentDetails": {
"endAt": "",
"note": "",
"startAt": "",
"videoId": "",
"videoPublishedAt": ""
},
"etag": "",
"id": "",
"kind": "",
"snippet": {
"channelId": "",
"channelTitle": "",
"description": "",
"playlistId": "",
"position": 0,
"publishedAt": "",
"resourceId": {
"channelId": "",
"kind": "",
"playlistId": "",
"videoId": ""
},
"thumbnails": {
"high": {
"height": 0,
"url": "",
"width": 0
},
"maxres": {},
"medium": {},
"standard": {}
},
"title": "",
"videoOwnerChannelId": "",
"videoOwnerChannelTitle": ""
},
"status": {
"privacyStatus": ""
}
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/youtube/v3/playlistItems?part=");
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 \"contentDetails\": {\n \"endAt\": \"\",\n \"note\": \"\",\n \"startAt\": \"\",\n \"videoId\": \"\",\n \"videoPublishedAt\": \"\"\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"channelId\": \"\",\n \"channelTitle\": \"\",\n \"description\": \"\",\n \"playlistId\": \"\",\n \"position\": 0,\n \"publishedAt\": \"\",\n \"resourceId\": {\n \"channelId\": \"\",\n \"kind\": \"\",\n \"playlistId\": \"\",\n \"videoId\": \"\"\n },\n \"thumbnails\": {\n \"high\": {\n \"height\": 0,\n \"url\": \"\",\n \"width\": 0\n },\n \"maxres\": {},\n \"medium\": {},\n \"standard\": {}\n },\n \"title\": \"\",\n \"videoOwnerChannelId\": \"\",\n \"videoOwnerChannelTitle\": \"\"\n },\n \"status\": {\n \"privacyStatus\": \"\"\n }\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/youtube/v3/playlistItems" {:query-params {:part ""}
:content-type :json
:form-params {:contentDetails {:endAt ""
:note ""
:startAt ""
:videoId ""
:videoPublishedAt ""}
:etag ""
:id ""
:kind ""
:snippet {:channelId ""
:channelTitle ""
:description ""
:playlistId ""
:position 0
:publishedAt ""
:resourceId {:channelId ""
:kind ""
:playlistId ""
:videoId ""}
:thumbnails {:high {:height 0
:url ""
:width 0}
:maxres {}
:medium {}
:standard {}}
:title ""
:videoOwnerChannelId ""
:videoOwnerChannelTitle ""}
:status {:privacyStatus ""}}})
require "http/client"
url = "{{baseUrl}}/youtube/v3/playlistItems?part="
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"contentDetails\": {\n \"endAt\": \"\",\n \"note\": \"\",\n \"startAt\": \"\",\n \"videoId\": \"\",\n \"videoPublishedAt\": \"\"\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"channelId\": \"\",\n \"channelTitle\": \"\",\n \"description\": \"\",\n \"playlistId\": \"\",\n \"position\": 0,\n \"publishedAt\": \"\",\n \"resourceId\": {\n \"channelId\": \"\",\n \"kind\": \"\",\n \"playlistId\": \"\",\n \"videoId\": \"\"\n },\n \"thumbnails\": {\n \"high\": {\n \"height\": 0,\n \"url\": \"\",\n \"width\": 0\n },\n \"maxres\": {},\n \"medium\": {},\n \"standard\": {}\n },\n \"title\": \"\",\n \"videoOwnerChannelId\": \"\",\n \"videoOwnerChannelTitle\": \"\"\n },\n \"status\": {\n \"privacyStatus\": \"\"\n }\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/youtube/v3/playlistItems?part="),
Content = new StringContent("{\n \"contentDetails\": {\n \"endAt\": \"\",\n \"note\": \"\",\n \"startAt\": \"\",\n \"videoId\": \"\",\n \"videoPublishedAt\": \"\"\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"channelId\": \"\",\n \"channelTitle\": \"\",\n \"description\": \"\",\n \"playlistId\": \"\",\n \"position\": 0,\n \"publishedAt\": \"\",\n \"resourceId\": {\n \"channelId\": \"\",\n \"kind\": \"\",\n \"playlistId\": \"\",\n \"videoId\": \"\"\n },\n \"thumbnails\": {\n \"high\": {\n \"height\": 0,\n \"url\": \"\",\n \"width\": 0\n },\n \"maxres\": {},\n \"medium\": {},\n \"standard\": {}\n },\n \"title\": \"\",\n \"videoOwnerChannelId\": \"\",\n \"videoOwnerChannelTitle\": \"\"\n },\n \"status\": {\n \"privacyStatus\": \"\"\n }\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/youtube/v3/playlistItems?part=");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"contentDetails\": {\n \"endAt\": \"\",\n \"note\": \"\",\n \"startAt\": \"\",\n \"videoId\": \"\",\n \"videoPublishedAt\": \"\"\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"channelId\": \"\",\n \"channelTitle\": \"\",\n \"description\": \"\",\n \"playlistId\": \"\",\n \"position\": 0,\n \"publishedAt\": \"\",\n \"resourceId\": {\n \"channelId\": \"\",\n \"kind\": \"\",\n \"playlistId\": \"\",\n \"videoId\": \"\"\n },\n \"thumbnails\": {\n \"high\": {\n \"height\": 0,\n \"url\": \"\",\n \"width\": 0\n },\n \"maxres\": {},\n \"medium\": {},\n \"standard\": {}\n },\n \"title\": \"\",\n \"videoOwnerChannelId\": \"\",\n \"videoOwnerChannelTitle\": \"\"\n },\n \"status\": {\n \"privacyStatus\": \"\"\n }\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/youtube/v3/playlistItems?part="
payload := strings.NewReader("{\n \"contentDetails\": {\n \"endAt\": \"\",\n \"note\": \"\",\n \"startAt\": \"\",\n \"videoId\": \"\",\n \"videoPublishedAt\": \"\"\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"channelId\": \"\",\n \"channelTitle\": \"\",\n \"description\": \"\",\n \"playlistId\": \"\",\n \"position\": 0,\n \"publishedAt\": \"\",\n \"resourceId\": {\n \"channelId\": \"\",\n \"kind\": \"\",\n \"playlistId\": \"\",\n \"videoId\": \"\"\n },\n \"thumbnails\": {\n \"high\": {\n \"height\": 0,\n \"url\": \"\",\n \"width\": 0\n },\n \"maxres\": {},\n \"medium\": {},\n \"standard\": {}\n },\n \"title\": \"\",\n \"videoOwnerChannelId\": \"\",\n \"videoOwnerChannelTitle\": \"\"\n },\n \"status\": {\n \"privacyStatus\": \"\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/youtube/v3/playlistItems?part= HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 727
{
"contentDetails": {
"endAt": "",
"note": "",
"startAt": "",
"videoId": "",
"videoPublishedAt": ""
},
"etag": "",
"id": "",
"kind": "",
"snippet": {
"channelId": "",
"channelTitle": "",
"description": "",
"playlistId": "",
"position": 0,
"publishedAt": "",
"resourceId": {
"channelId": "",
"kind": "",
"playlistId": "",
"videoId": ""
},
"thumbnails": {
"high": {
"height": 0,
"url": "",
"width": 0
},
"maxres": {},
"medium": {},
"standard": {}
},
"title": "",
"videoOwnerChannelId": "",
"videoOwnerChannelTitle": ""
},
"status": {
"privacyStatus": ""
}
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/youtube/v3/playlistItems?part=")
.setHeader("content-type", "application/json")
.setBody("{\n \"contentDetails\": {\n \"endAt\": \"\",\n \"note\": \"\",\n \"startAt\": \"\",\n \"videoId\": \"\",\n \"videoPublishedAt\": \"\"\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"channelId\": \"\",\n \"channelTitle\": \"\",\n \"description\": \"\",\n \"playlistId\": \"\",\n \"position\": 0,\n \"publishedAt\": \"\",\n \"resourceId\": {\n \"channelId\": \"\",\n \"kind\": \"\",\n \"playlistId\": \"\",\n \"videoId\": \"\"\n },\n \"thumbnails\": {\n \"high\": {\n \"height\": 0,\n \"url\": \"\",\n \"width\": 0\n },\n \"maxres\": {},\n \"medium\": {},\n \"standard\": {}\n },\n \"title\": \"\",\n \"videoOwnerChannelId\": \"\",\n \"videoOwnerChannelTitle\": \"\"\n },\n \"status\": {\n \"privacyStatus\": \"\"\n }\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/youtube/v3/playlistItems?part="))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"contentDetails\": {\n \"endAt\": \"\",\n \"note\": \"\",\n \"startAt\": \"\",\n \"videoId\": \"\",\n \"videoPublishedAt\": \"\"\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"channelId\": \"\",\n \"channelTitle\": \"\",\n \"description\": \"\",\n \"playlistId\": \"\",\n \"position\": 0,\n \"publishedAt\": \"\",\n \"resourceId\": {\n \"channelId\": \"\",\n \"kind\": \"\",\n \"playlistId\": \"\",\n \"videoId\": \"\"\n },\n \"thumbnails\": {\n \"high\": {\n \"height\": 0,\n \"url\": \"\",\n \"width\": 0\n },\n \"maxres\": {},\n \"medium\": {},\n \"standard\": {}\n },\n \"title\": \"\",\n \"videoOwnerChannelId\": \"\",\n \"videoOwnerChannelTitle\": \"\"\n },\n \"status\": {\n \"privacyStatus\": \"\"\n }\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"contentDetails\": {\n \"endAt\": \"\",\n \"note\": \"\",\n \"startAt\": \"\",\n \"videoId\": \"\",\n \"videoPublishedAt\": \"\"\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"channelId\": \"\",\n \"channelTitle\": \"\",\n \"description\": \"\",\n \"playlistId\": \"\",\n \"position\": 0,\n \"publishedAt\": \"\",\n \"resourceId\": {\n \"channelId\": \"\",\n \"kind\": \"\",\n \"playlistId\": \"\",\n \"videoId\": \"\"\n },\n \"thumbnails\": {\n \"high\": {\n \"height\": 0,\n \"url\": \"\",\n \"width\": 0\n },\n \"maxres\": {},\n \"medium\": {},\n \"standard\": {}\n },\n \"title\": \"\",\n \"videoOwnerChannelId\": \"\",\n \"videoOwnerChannelTitle\": \"\"\n },\n \"status\": {\n \"privacyStatus\": \"\"\n }\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/youtube/v3/playlistItems?part=")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/youtube/v3/playlistItems?part=")
.header("content-type", "application/json")
.body("{\n \"contentDetails\": {\n \"endAt\": \"\",\n \"note\": \"\",\n \"startAt\": \"\",\n \"videoId\": \"\",\n \"videoPublishedAt\": \"\"\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"channelId\": \"\",\n \"channelTitle\": \"\",\n \"description\": \"\",\n \"playlistId\": \"\",\n \"position\": 0,\n \"publishedAt\": \"\",\n \"resourceId\": {\n \"channelId\": \"\",\n \"kind\": \"\",\n \"playlistId\": \"\",\n \"videoId\": \"\"\n },\n \"thumbnails\": {\n \"high\": {\n \"height\": 0,\n \"url\": \"\",\n \"width\": 0\n },\n \"maxres\": {},\n \"medium\": {},\n \"standard\": {}\n },\n \"title\": \"\",\n \"videoOwnerChannelId\": \"\",\n \"videoOwnerChannelTitle\": \"\"\n },\n \"status\": {\n \"privacyStatus\": \"\"\n }\n}")
.asString();
const data = JSON.stringify({
contentDetails: {
endAt: '',
note: '',
startAt: '',
videoId: '',
videoPublishedAt: ''
},
etag: '',
id: '',
kind: '',
snippet: {
channelId: '',
channelTitle: '',
description: '',
playlistId: '',
position: 0,
publishedAt: '',
resourceId: {
channelId: '',
kind: '',
playlistId: '',
videoId: ''
},
thumbnails: {
high: {
height: 0,
url: '',
width: 0
},
maxres: {},
medium: {},
standard: {}
},
title: '',
videoOwnerChannelId: '',
videoOwnerChannelTitle: ''
},
status: {
privacyStatus: ''
}
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/youtube/v3/playlistItems?part=');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/youtube/v3/playlistItems',
params: {part: ''},
headers: {'content-type': 'application/json'},
data: {
contentDetails: {endAt: '', note: '', startAt: '', videoId: '', videoPublishedAt: ''},
etag: '',
id: '',
kind: '',
snippet: {
channelId: '',
channelTitle: '',
description: '',
playlistId: '',
position: 0,
publishedAt: '',
resourceId: {channelId: '', kind: '', playlistId: '', videoId: ''},
thumbnails: {high: {height: 0, url: '', width: 0}, maxres: {}, medium: {}, standard: {}},
title: '',
videoOwnerChannelId: '',
videoOwnerChannelTitle: ''
},
status: {privacyStatus: ''}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/youtube/v3/playlistItems?part=';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"contentDetails":{"endAt":"","note":"","startAt":"","videoId":"","videoPublishedAt":""},"etag":"","id":"","kind":"","snippet":{"channelId":"","channelTitle":"","description":"","playlistId":"","position":0,"publishedAt":"","resourceId":{"channelId":"","kind":"","playlistId":"","videoId":""},"thumbnails":{"high":{"height":0,"url":"","width":0},"maxres":{},"medium":{},"standard":{}},"title":"","videoOwnerChannelId":"","videoOwnerChannelTitle":""},"status":{"privacyStatus":""}}'
};
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}}/youtube/v3/playlistItems?part=',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "contentDetails": {\n "endAt": "",\n "note": "",\n "startAt": "",\n "videoId": "",\n "videoPublishedAt": ""\n },\n "etag": "",\n "id": "",\n "kind": "",\n "snippet": {\n "channelId": "",\n "channelTitle": "",\n "description": "",\n "playlistId": "",\n "position": 0,\n "publishedAt": "",\n "resourceId": {\n "channelId": "",\n "kind": "",\n "playlistId": "",\n "videoId": ""\n },\n "thumbnails": {\n "high": {\n "height": 0,\n "url": "",\n "width": 0\n },\n "maxres": {},\n "medium": {},\n "standard": {}\n },\n "title": "",\n "videoOwnerChannelId": "",\n "videoOwnerChannelTitle": ""\n },\n "status": {\n "privacyStatus": ""\n }\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"contentDetails\": {\n \"endAt\": \"\",\n \"note\": \"\",\n \"startAt\": \"\",\n \"videoId\": \"\",\n \"videoPublishedAt\": \"\"\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"channelId\": \"\",\n \"channelTitle\": \"\",\n \"description\": \"\",\n \"playlistId\": \"\",\n \"position\": 0,\n \"publishedAt\": \"\",\n \"resourceId\": {\n \"channelId\": \"\",\n \"kind\": \"\",\n \"playlistId\": \"\",\n \"videoId\": \"\"\n },\n \"thumbnails\": {\n \"high\": {\n \"height\": 0,\n \"url\": \"\",\n \"width\": 0\n },\n \"maxres\": {},\n \"medium\": {},\n \"standard\": {}\n },\n \"title\": \"\",\n \"videoOwnerChannelId\": \"\",\n \"videoOwnerChannelTitle\": \"\"\n },\n \"status\": {\n \"privacyStatus\": \"\"\n }\n}")
val request = Request.Builder()
.url("{{baseUrl}}/youtube/v3/playlistItems?part=")
.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/youtube/v3/playlistItems?part=',
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({
contentDetails: {endAt: '', note: '', startAt: '', videoId: '', videoPublishedAt: ''},
etag: '',
id: '',
kind: '',
snippet: {
channelId: '',
channelTitle: '',
description: '',
playlistId: '',
position: 0,
publishedAt: '',
resourceId: {channelId: '', kind: '', playlistId: '', videoId: ''},
thumbnails: {high: {height: 0, url: '', width: 0}, maxres: {}, medium: {}, standard: {}},
title: '',
videoOwnerChannelId: '',
videoOwnerChannelTitle: ''
},
status: {privacyStatus: ''}
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/youtube/v3/playlistItems',
qs: {part: ''},
headers: {'content-type': 'application/json'},
body: {
contentDetails: {endAt: '', note: '', startAt: '', videoId: '', videoPublishedAt: ''},
etag: '',
id: '',
kind: '',
snippet: {
channelId: '',
channelTitle: '',
description: '',
playlistId: '',
position: 0,
publishedAt: '',
resourceId: {channelId: '', kind: '', playlistId: '', videoId: ''},
thumbnails: {high: {height: 0, url: '', width: 0}, maxres: {}, medium: {}, standard: {}},
title: '',
videoOwnerChannelId: '',
videoOwnerChannelTitle: ''
},
status: {privacyStatus: ''}
},
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}}/youtube/v3/playlistItems');
req.query({
part: ''
});
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
contentDetails: {
endAt: '',
note: '',
startAt: '',
videoId: '',
videoPublishedAt: ''
},
etag: '',
id: '',
kind: '',
snippet: {
channelId: '',
channelTitle: '',
description: '',
playlistId: '',
position: 0,
publishedAt: '',
resourceId: {
channelId: '',
kind: '',
playlistId: '',
videoId: ''
},
thumbnails: {
high: {
height: 0,
url: '',
width: 0
},
maxres: {},
medium: {},
standard: {}
},
title: '',
videoOwnerChannelId: '',
videoOwnerChannelTitle: ''
},
status: {
privacyStatus: ''
}
});
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}}/youtube/v3/playlistItems',
params: {part: ''},
headers: {'content-type': 'application/json'},
data: {
contentDetails: {endAt: '', note: '', startAt: '', videoId: '', videoPublishedAt: ''},
etag: '',
id: '',
kind: '',
snippet: {
channelId: '',
channelTitle: '',
description: '',
playlistId: '',
position: 0,
publishedAt: '',
resourceId: {channelId: '', kind: '', playlistId: '', videoId: ''},
thumbnails: {high: {height: 0, url: '', width: 0}, maxres: {}, medium: {}, standard: {}},
title: '',
videoOwnerChannelId: '',
videoOwnerChannelTitle: ''
},
status: {privacyStatus: ''}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/youtube/v3/playlistItems?part=';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"contentDetails":{"endAt":"","note":"","startAt":"","videoId":"","videoPublishedAt":""},"etag":"","id":"","kind":"","snippet":{"channelId":"","channelTitle":"","description":"","playlistId":"","position":0,"publishedAt":"","resourceId":{"channelId":"","kind":"","playlistId":"","videoId":""},"thumbnails":{"high":{"height":0,"url":"","width":0},"maxres":{},"medium":{},"standard":{}},"title":"","videoOwnerChannelId":"","videoOwnerChannelTitle":""},"status":{"privacyStatus":""}}'
};
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 = @{ @"contentDetails": @{ @"endAt": @"", @"note": @"", @"startAt": @"", @"videoId": @"", @"videoPublishedAt": @"" },
@"etag": @"",
@"id": @"",
@"kind": @"",
@"snippet": @{ @"channelId": @"", @"channelTitle": @"", @"description": @"", @"playlistId": @"", @"position": @0, @"publishedAt": @"", @"resourceId": @{ @"channelId": @"", @"kind": @"", @"playlistId": @"", @"videoId": @"" }, @"thumbnails": @{ @"high": @{ @"height": @0, @"url": @"", @"width": @0 }, @"maxres": @{ }, @"medium": @{ }, @"standard": @{ } }, @"title": @"", @"videoOwnerChannelId": @"", @"videoOwnerChannelTitle": @"" },
@"status": @{ @"privacyStatus": @"" } };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/youtube/v3/playlistItems?part="]
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}}/youtube/v3/playlistItems?part=" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"contentDetails\": {\n \"endAt\": \"\",\n \"note\": \"\",\n \"startAt\": \"\",\n \"videoId\": \"\",\n \"videoPublishedAt\": \"\"\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"channelId\": \"\",\n \"channelTitle\": \"\",\n \"description\": \"\",\n \"playlistId\": \"\",\n \"position\": 0,\n \"publishedAt\": \"\",\n \"resourceId\": {\n \"channelId\": \"\",\n \"kind\": \"\",\n \"playlistId\": \"\",\n \"videoId\": \"\"\n },\n \"thumbnails\": {\n \"high\": {\n \"height\": 0,\n \"url\": \"\",\n \"width\": 0\n },\n \"maxres\": {},\n \"medium\": {},\n \"standard\": {}\n },\n \"title\": \"\",\n \"videoOwnerChannelId\": \"\",\n \"videoOwnerChannelTitle\": \"\"\n },\n \"status\": {\n \"privacyStatus\": \"\"\n }\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/youtube/v3/playlistItems?part=",
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([
'contentDetails' => [
'endAt' => '',
'note' => '',
'startAt' => '',
'videoId' => '',
'videoPublishedAt' => ''
],
'etag' => '',
'id' => '',
'kind' => '',
'snippet' => [
'channelId' => '',
'channelTitle' => '',
'description' => '',
'playlistId' => '',
'position' => 0,
'publishedAt' => '',
'resourceId' => [
'channelId' => '',
'kind' => '',
'playlistId' => '',
'videoId' => ''
],
'thumbnails' => [
'high' => [
'height' => 0,
'url' => '',
'width' => 0
],
'maxres' => [
],
'medium' => [
],
'standard' => [
]
],
'title' => '',
'videoOwnerChannelId' => '',
'videoOwnerChannelTitle' => ''
],
'status' => [
'privacyStatus' => ''
]
]),
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}}/youtube/v3/playlistItems?part=', [
'body' => '{
"contentDetails": {
"endAt": "",
"note": "",
"startAt": "",
"videoId": "",
"videoPublishedAt": ""
},
"etag": "",
"id": "",
"kind": "",
"snippet": {
"channelId": "",
"channelTitle": "",
"description": "",
"playlistId": "",
"position": 0,
"publishedAt": "",
"resourceId": {
"channelId": "",
"kind": "",
"playlistId": "",
"videoId": ""
},
"thumbnails": {
"high": {
"height": 0,
"url": "",
"width": 0
},
"maxres": {},
"medium": {},
"standard": {}
},
"title": "",
"videoOwnerChannelId": "",
"videoOwnerChannelTitle": ""
},
"status": {
"privacyStatus": ""
}
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/youtube/v3/playlistItems');
$request->setMethod(HTTP_METH_POST);
$request->setQueryData([
'part' => ''
]);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'contentDetails' => [
'endAt' => '',
'note' => '',
'startAt' => '',
'videoId' => '',
'videoPublishedAt' => ''
],
'etag' => '',
'id' => '',
'kind' => '',
'snippet' => [
'channelId' => '',
'channelTitle' => '',
'description' => '',
'playlistId' => '',
'position' => 0,
'publishedAt' => '',
'resourceId' => [
'channelId' => '',
'kind' => '',
'playlistId' => '',
'videoId' => ''
],
'thumbnails' => [
'high' => [
'height' => 0,
'url' => '',
'width' => 0
],
'maxres' => [
],
'medium' => [
],
'standard' => [
]
],
'title' => '',
'videoOwnerChannelId' => '',
'videoOwnerChannelTitle' => ''
],
'status' => [
'privacyStatus' => ''
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'contentDetails' => [
'endAt' => '',
'note' => '',
'startAt' => '',
'videoId' => '',
'videoPublishedAt' => ''
],
'etag' => '',
'id' => '',
'kind' => '',
'snippet' => [
'channelId' => '',
'channelTitle' => '',
'description' => '',
'playlistId' => '',
'position' => 0,
'publishedAt' => '',
'resourceId' => [
'channelId' => '',
'kind' => '',
'playlistId' => '',
'videoId' => ''
],
'thumbnails' => [
'high' => [
'height' => 0,
'url' => '',
'width' => 0
],
'maxres' => [
],
'medium' => [
],
'standard' => [
]
],
'title' => '',
'videoOwnerChannelId' => '',
'videoOwnerChannelTitle' => ''
],
'status' => [
'privacyStatus' => ''
]
]));
$request->setRequestUrl('{{baseUrl}}/youtube/v3/playlistItems');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setQuery(new http\QueryString([
'part' => ''
]));
$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}}/youtube/v3/playlistItems?part=' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"contentDetails": {
"endAt": "",
"note": "",
"startAt": "",
"videoId": "",
"videoPublishedAt": ""
},
"etag": "",
"id": "",
"kind": "",
"snippet": {
"channelId": "",
"channelTitle": "",
"description": "",
"playlistId": "",
"position": 0,
"publishedAt": "",
"resourceId": {
"channelId": "",
"kind": "",
"playlistId": "",
"videoId": ""
},
"thumbnails": {
"high": {
"height": 0,
"url": "",
"width": 0
},
"maxres": {},
"medium": {},
"standard": {}
},
"title": "",
"videoOwnerChannelId": "",
"videoOwnerChannelTitle": ""
},
"status": {
"privacyStatus": ""
}
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/youtube/v3/playlistItems?part=' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"contentDetails": {
"endAt": "",
"note": "",
"startAt": "",
"videoId": "",
"videoPublishedAt": ""
},
"etag": "",
"id": "",
"kind": "",
"snippet": {
"channelId": "",
"channelTitle": "",
"description": "",
"playlistId": "",
"position": 0,
"publishedAt": "",
"resourceId": {
"channelId": "",
"kind": "",
"playlistId": "",
"videoId": ""
},
"thumbnails": {
"high": {
"height": 0,
"url": "",
"width": 0
},
"maxres": {},
"medium": {},
"standard": {}
},
"title": "",
"videoOwnerChannelId": "",
"videoOwnerChannelTitle": ""
},
"status": {
"privacyStatus": ""
}
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"contentDetails\": {\n \"endAt\": \"\",\n \"note\": \"\",\n \"startAt\": \"\",\n \"videoId\": \"\",\n \"videoPublishedAt\": \"\"\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"channelId\": \"\",\n \"channelTitle\": \"\",\n \"description\": \"\",\n \"playlistId\": \"\",\n \"position\": 0,\n \"publishedAt\": \"\",\n \"resourceId\": {\n \"channelId\": \"\",\n \"kind\": \"\",\n \"playlistId\": \"\",\n \"videoId\": \"\"\n },\n \"thumbnails\": {\n \"high\": {\n \"height\": 0,\n \"url\": \"\",\n \"width\": 0\n },\n \"maxres\": {},\n \"medium\": {},\n \"standard\": {}\n },\n \"title\": \"\",\n \"videoOwnerChannelId\": \"\",\n \"videoOwnerChannelTitle\": \"\"\n },\n \"status\": {\n \"privacyStatus\": \"\"\n }\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/youtube/v3/playlistItems?part=", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/youtube/v3/playlistItems"
querystring = {"part":""}
payload = {
"contentDetails": {
"endAt": "",
"note": "",
"startAt": "",
"videoId": "",
"videoPublishedAt": ""
},
"etag": "",
"id": "",
"kind": "",
"snippet": {
"channelId": "",
"channelTitle": "",
"description": "",
"playlistId": "",
"position": 0,
"publishedAt": "",
"resourceId": {
"channelId": "",
"kind": "",
"playlistId": "",
"videoId": ""
},
"thumbnails": {
"high": {
"height": 0,
"url": "",
"width": 0
},
"maxres": {},
"medium": {},
"standard": {}
},
"title": "",
"videoOwnerChannelId": "",
"videoOwnerChannelTitle": ""
},
"status": { "privacyStatus": "" }
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/youtube/v3/playlistItems"
queryString <- list(part = "")
payload <- "{\n \"contentDetails\": {\n \"endAt\": \"\",\n \"note\": \"\",\n \"startAt\": \"\",\n \"videoId\": \"\",\n \"videoPublishedAt\": \"\"\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"channelId\": \"\",\n \"channelTitle\": \"\",\n \"description\": \"\",\n \"playlistId\": \"\",\n \"position\": 0,\n \"publishedAt\": \"\",\n \"resourceId\": {\n \"channelId\": \"\",\n \"kind\": \"\",\n \"playlistId\": \"\",\n \"videoId\": \"\"\n },\n \"thumbnails\": {\n \"high\": {\n \"height\": 0,\n \"url\": \"\",\n \"width\": 0\n },\n \"maxres\": {},\n \"medium\": {},\n \"standard\": {}\n },\n \"title\": \"\",\n \"videoOwnerChannelId\": \"\",\n \"videoOwnerChannelTitle\": \"\"\n },\n \"status\": {\n \"privacyStatus\": \"\"\n }\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, query = queryString, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/youtube/v3/playlistItems?part=")
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 \"contentDetails\": {\n \"endAt\": \"\",\n \"note\": \"\",\n \"startAt\": \"\",\n \"videoId\": \"\",\n \"videoPublishedAt\": \"\"\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"channelId\": \"\",\n \"channelTitle\": \"\",\n \"description\": \"\",\n \"playlistId\": \"\",\n \"position\": 0,\n \"publishedAt\": \"\",\n \"resourceId\": {\n \"channelId\": \"\",\n \"kind\": \"\",\n \"playlistId\": \"\",\n \"videoId\": \"\"\n },\n \"thumbnails\": {\n \"high\": {\n \"height\": 0,\n \"url\": \"\",\n \"width\": 0\n },\n \"maxres\": {},\n \"medium\": {},\n \"standard\": {}\n },\n \"title\": \"\",\n \"videoOwnerChannelId\": \"\",\n \"videoOwnerChannelTitle\": \"\"\n },\n \"status\": {\n \"privacyStatus\": \"\"\n }\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/youtube/v3/playlistItems') do |req|
req.params['part'] = ''
req.body = "{\n \"contentDetails\": {\n \"endAt\": \"\",\n \"note\": \"\",\n \"startAt\": \"\",\n \"videoId\": \"\",\n \"videoPublishedAt\": \"\"\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"channelId\": \"\",\n \"channelTitle\": \"\",\n \"description\": \"\",\n \"playlistId\": \"\",\n \"position\": 0,\n \"publishedAt\": \"\",\n \"resourceId\": {\n \"channelId\": \"\",\n \"kind\": \"\",\n \"playlistId\": \"\",\n \"videoId\": \"\"\n },\n \"thumbnails\": {\n \"high\": {\n \"height\": 0,\n \"url\": \"\",\n \"width\": 0\n },\n \"maxres\": {},\n \"medium\": {},\n \"standard\": {}\n },\n \"title\": \"\",\n \"videoOwnerChannelId\": \"\",\n \"videoOwnerChannelTitle\": \"\"\n },\n \"status\": {\n \"privacyStatus\": \"\"\n }\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/youtube/v3/playlistItems";
let querystring = [
("part", ""),
];
let payload = json!({
"contentDetails": json!({
"endAt": "",
"note": "",
"startAt": "",
"videoId": "",
"videoPublishedAt": ""
}),
"etag": "",
"id": "",
"kind": "",
"snippet": json!({
"channelId": "",
"channelTitle": "",
"description": "",
"playlistId": "",
"position": 0,
"publishedAt": "",
"resourceId": json!({
"channelId": "",
"kind": "",
"playlistId": "",
"videoId": ""
}),
"thumbnails": json!({
"high": json!({
"height": 0,
"url": "",
"width": 0
}),
"maxres": json!({}),
"medium": json!({}),
"standard": json!({})
}),
"title": "",
"videoOwnerChannelId": "",
"videoOwnerChannelTitle": ""
}),
"status": json!({"privacyStatus": ""})
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.query(&querystring)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/youtube/v3/playlistItems?part=' \
--header 'content-type: application/json' \
--data '{
"contentDetails": {
"endAt": "",
"note": "",
"startAt": "",
"videoId": "",
"videoPublishedAt": ""
},
"etag": "",
"id": "",
"kind": "",
"snippet": {
"channelId": "",
"channelTitle": "",
"description": "",
"playlistId": "",
"position": 0,
"publishedAt": "",
"resourceId": {
"channelId": "",
"kind": "",
"playlistId": "",
"videoId": ""
},
"thumbnails": {
"high": {
"height": 0,
"url": "",
"width": 0
},
"maxres": {},
"medium": {},
"standard": {}
},
"title": "",
"videoOwnerChannelId": "",
"videoOwnerChannelTitle": ""
},
"status": {
"privacyStatus": ""
}
}'
echo '{
"contentDetails": {
"endAt": "",
"note": "",
"startAt": "",
"videoId": "",
"videoPublishedAt": ""
},
"etag": "",
"id": "",
"kind": "",
"snippet": {
"channelId": "",
"channelTitle": "",
"description": "",
"playlistId": "",
"position": 0,
"publishedAt": "",
"resourceId": {
"channelId": "",
"kind": "",
"playlistId": "",
"videoId": ""
},
"thumbnails": {
"high": {
"height": 0,
"url": "",
"width": 0
},
"maxres": {},
"medium": {},
"standard": {}
},
"title": "",
"videoOwnerChannelId": "",
"videoOwnerChannelTitle": ""
},
"status": {
"privacyStatus": ""
}
}' | \
http POST '{{baseUrl}}/youtube/v3/playlistItems?part=' \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "contentDetails": {\n "endAt": "",\n "note": "",\n "startAt": "",\n "videoId": "",\n "videoPublishedAt": ""\n },\n "etag": "",\n "id": "",\n "kind": "",\n "snippet": {\n "channelId": "",\n "channelTitle": "",\n "description": "",\n "playlistId": "",\n "position": 0,\n "publishedAt": "",\n "resourceId": {\n "channelId": "",\n "kind": "",\n "playlistId": "",\n "videoId": ""\n },\n "thumbnails": {\n "high": {\n "height": 0,\n "url": "",\n "width": 0\n },\n "maxres": {},\n "medium": {},\n "standard": {}\n },\n "title": "",\n "videoOwnerChannelId": "",\n "videoOwnerChannelTitle": ""\n },\n "status": {\n "privacyStatus": ""\n }\n}' \
--output-document \
- '{{baseUrl}}/youtube/v3/playlistItems?part='
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"contentDetails": [
"endAt": "",
"note": "",
"startAt": "",
"videoId": "",
"videoPublishedAt": ""
],
"etag": "",
"id": "",
"kind": "",
"snippet": [
"channelId": "",
"channelTitle": "",
"description": "",
"playlistId": "",
"position": 0,
"publishedAt": "",
"resourceId": [
"channelId": "",
"kind": "",
"playlistId": "",
"videoId": ""
],
"thumbnails": [
"high": [
"height": 0,
"url": "",
"width": 0
],
"maxres": [],
"medium": [],
"standard": []
],
"title": "",
"videoOwnerChannelId": "",
"videoOwnerChannelTitle": ""
],
"status": ["privacyStatus": ""]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/youtube/v3/playlistItems?part=")! 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()
GET
youtube.playlistItems.list
{{baseUrl}}/youtube/v3/playlistItems
QUERY PARAMS
part
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/youtube/v3/playlistItems?part=");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/youtube/v3/playlistItems" {:query-params {:part ""}})
require "http/client"
url = "{{baseUrl}}/youtube/v3/playlistItems?part="
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}}/youtube/v3/playlistItems?part="),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/youtube/v3/playlistItems?part=");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/youtube/v3/playlistItems?part="
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/youtube/v3/playlistItems?part= HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/youtube/v3/playlistItems?part=")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/youtube/v3/playlistItems?part="))
.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}}/youtube/v3/playlistItems?part=")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/youtube/v3/playlistItems?part=")
.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}}/youtube/v3/playlistItems?part=');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/youtube/v3/playlistItems',
params: {part: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/youtube/v3/playlistItems?part=';
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}}/youtube/v3/playlistItems?part=',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/youtube/v3/playlistItems?part=")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/youtube/v3/playlistItems?part=',
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}}/youtube/v3/playlistItems',
qs: {part: ''}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/youtube/v3/playlistItems');
req.query({
part: ''
});
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}}/youtube/v3/playlistItems',
params: {part: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/youtube/v3/playlistItems?part=';
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}}/youtube/v3/playlistItems?part="]
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}}/youtube/v3/playlistItems?part=" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/youtube/v3/playlistItems?part=",
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}}/youtube/v3/playlistItems?part=');
echo $response->getBody();
setUrl('{{baseUrl}}/youtube/v3/playlistItems');
$request->setMethod(HTTP_METH_GET);
$request->setQueryData([
'part' => ''
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/youtube/v3/playlistItems');
$request->setRequestMethod('GET');
$request->setQuery(new http\QueryString([
'part' => ''
]));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/youtube/v3/playlistItems?part=' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/youtube/v3/playlistItems?part=' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/youtube/v3/playlistItems?part=")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/youtube/v3/playlistItems"
querystring = {"part":""}
response = requests.get(url, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/youtube/v3/playlistItems"
queryString <- list(part = "")
response <- VERB("GET", url, query = queryString, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/youtube/v3/playlistItems?part=")
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/youtube/v3/playlistItems') do |req|
req.params['part'] = ''
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/youtube/v3/playlistItems";
let querystring = [
("part", ""),
];
let client = reqwest::Client::new();
let response = client.get(url)
.query(&querystring)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url '{{baseUrl}}/youtube/v3/playlistItems?part='
http GET '{{baseUrl}}/youtube/v3/playlistItems?part='
wget --quiet \
--method GET \
--output-document \
- '{{baseUrl}}/youtube/v3/playlistItems?part='
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/youtube/v3/playlistItems?part=")! 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()
PUT
youtube.playlistItems.update
{{baseUrl}}/youtube/v3/playlistItems
QUERY PARAMS
part
BODY json
{
"contentDetails": {
"endAt": "",
"note": "",
"startAt": "",
"videoId": "",
"videoPublishedAt": ""
},
"etag": "",
"id": "",
"kind": "",
"snippet": {
"channelId": "",
"channelTitle": "",
"description": "",
"playlistId": "",
"position": 0,
"publishedAt": "",
"resourceId": {
"channelId": "",
"kind": "",
"playlistId": "",
"videoId": ""
},
"thumbnails": {
"high": {
"height": 0,
"url": "",
"width": 0
},
"maxres": {},
"medium": {},
"standard": {}
},
"title": "",
"videoOwnerChannelId": "",
"videoOwnerChannelTitle": ""
},
"status": {
"privacyStatus": ""
}
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/youtube/v3/playlistItems?part=");
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 \"contentDetails\": {\n \"endAt\": \"\",\n \"note\": \"\",\n \"startAt\": \"\",\n \"videoId\": \"\",\n \"videoPublishedAt\": \"\"\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"channelId\": \"\",\n \"channelTitle\": \"\",\n \"description\": \"\",\n \"playlistId\": \"\",\n \"position\": 0,\n \"publishedAt\": \"\",\n \"resourceId\": {\n \"channelId\": \"\",\n \"kind\": \"\",\n \"playlistId\": \"\",\n \"videoId\": \"\"\n },\n \"thumbnails\": {\n \"high\": {\n \"height\": 0,\n \"url\": \"\",\n \"width\": 0\n },\n \"maxres\": {},\n \"medium\": {},\n \"standard\": {}\n },\n \"title\": \"\",\n \"videoOwnerChannelId\": \"\",\n \"videoOwnerChannelTitle\": \"\"\n },\n \"status\": {\n \"privacyStatus\": \"\"\n }\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/youtube/v3/playlistItems" {:query-params {:part ""}
:content-type :json
:form-params {:contentDetails {:endAt ""
:note ""
:startAt ""
:videoId ""
:videoPublishedAt ""}
:etag ""
:id ""
:kind ""
:snippet {:channelId ""
:channelTitle ""
:description ""
:playlistId ""
:position 0
:publishedAt ""
:resourceId {:channelId ""
:kind ""
:playlistId ""
:videoId ""}
:thumbnails {:high {:height 0
:url ""
:width 0}
:maxres {}
:medium {}
:standard {}}
:title ""
:videoOwnerChannelId ""
:videoOwnerChannelTitle ""}
:status {:privacyStatus ""}}})
require "http/client"
url = "{{baseUrl}}/youtube/v3/playlistItems?part="
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"contentDetails\": {\n \"endAt\": \"\",\n \"note\": \"\",\n \"startAt\": \"\",\n \"videoId\": \"\",\n \"videoPublishedAt\": \"\"\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"channelId\": \"\",\n \"channelTitle\": \"\",\n \"description\": \"\",\n \"playlistId\": \"\",\n \"position\": 0,\n \"publishedAt\": \"\",\n \"resourceId\": {\n \"channelId\": \"\",\n \"kind\": \"\",\n \"playlistId\": \"\",\n \"videoId\": \"\"\n },\n \"thumbnails\": {\n \"high\": {\n \"height\": 0,\n \"url\": \"\",\n \"width\": 0\n },\n \"maxres\": {},\n \"medium\": {},\n \"standard\": {}\n },\n \"title\": \"\",\n \"videoOwnerChannelId\": \"\",\n \"videoOwnerChannelTitle\": \"\"\n },\n \"status\": {\n \"privacyStatus\": \"\"\n }\n}"
response = HTTP::Client.put url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Put,
RequestUri = new Uri("{{baseUrl}}/youtube/v3/playlistItems?part="),
Content = new StringContent("{\n \"contentDetails\": {\n \"endAt\": \"\",\n \"note\": \"\",\n \"startAt\": \"\",\n \"videoId\": \"\",\n \"videoPublishedAt\": \"\"\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"channelId\": \"\",\n \"channelTitle\": \"\",\n \"description\": \"\",\n \"playlistId\": \"\",\n \"position\": 0,\n \"publishedAt\": \"\",\n \"resourceId\": {\n \"channelId\": \"\",\n \"kind\": \"\",\n \"playlistId\": \"\",\n \"videoId\": \"\"\n },\n \"thumbnails\": {\n \"high\": {\n \"height\": 0,\n \"url\": \"\",\n \"width\": 0\n },\n \"maxres\": {},\n \"medium\": {},\n \"standard\": {}\n },\n \"title\": \"\",\n \"videoOwnerChannelId\": \"\",\n \"videoOwnerChannelTitle\": \"\"\n },\n \"status\": {\n \"privacyStatus\": \"\"\n }\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/youtube/v3/playlistItems?part=");
var request = new RestRequest("", Method.Put);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"contentDetails\": {\n \"endAt\": \"\",\n \"note\": \"\",\n \"startAt\": \"\",\n \"videoId\": \"\",\n \"videoPublishedAt\": \"\"\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"channelId\": \"\",\n \"channelTitle\": \"\",\n \"description\": \"\",\n \"playlistId\": \"\",\n \"position\": 0,\n \"publishedAt\": \"\",\n \"resourceId\": {\n \"channelId\": \"\",\n \"kind\": \"\",\n \"playlistId\": \"\",\n \"videoId\": \"\"\n },\n \"thumbnails\": {\n \"high\": {\n \"height\": 0,\n \"url\": \"\",\n \"width\": 0\n },\n \"maxres\": {},\n \"medium\": {},\n \"standard\": {}\n },\n \"title\": \"\",\n \"videoOwnerChannelId\": \"\",\n \"videoOwnerChannelTitle\": \"\"\n },\n \"status\": {\n \"privacyStatus\": \"\"\n }\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/youtube/v3/playlistItems?part="
payload := strings.NewReader("{\n \"contentDetails\": {\n \"endAt\": \"\",\n \"note\": \"\",\n \"startAt\": \"\",\n \"videoId\": \"\",\n \"videoPublishedAt\": \"\"\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"channelId\": \"\",\n \"channelTitle\": \"\",\n \"description\": \"\",\n \"playlistId\": \"\",\n \"position\": 0,\n \"publishedAt\": \"\",\n \"resourceId\": {\n \"channelId\": \"\",\n \"kind\": \"\",\n \"playlistId\": \"\",\n \"videoId\": \"\"\n },\n \"thumbnails\": {\n \"high\": {\n \"height\": 0,\n \"url\": \"\",\n \"width\": 0\n },\n \"maxres\": {},\n \"medium\": {},\n \"standard\": {}\n },\n \"title\": \"\",\n \"videoOwnerChannelId\": \"\",\n \"videoOwnerChannelTitle\": \"\"\n },\n \"status\": {\n \"privacyStatus\": \"\"\n }\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PUT /baseUrl/youtube/v3/playlistItems?part= HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 727
{
"contentDetails": {
"endAt": "",
"note": "",
"startAt": "",
"videoId": "",
"videoPublishedAt": ""
},
"etag": "",
"id": "",
"kind": "",
"snippet": {
"channelId": "",
"channelTitle": "",
"description": "",
"playlistId": "",
"position": 0,
"publishedAt": "",
"resourceId": {
"channelId": "",
"kind": "",
"playlistId": "",
"videoId": ""
},
"thumbnails": {
"high": {
"height": 0,
"url": "",
"width": 0
},
"maxres": {},
"medium": {},
"standard": {}
},
"title": "",
"videoOwnerChannelId": "",
"videoOwnerChannelTitle": ""
},
"status": {
"privacyStatus": ""
}
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/youtube/v3/playlistItems?part=")
.setHeader("content-type", "application/json")
.setBody("{\n \"contentDetails\": {\n \"endAt\": \"\",\n \"note\": \"\",\n \"startAt\": \"\",\n \"videoId\": \"\",\n \"videoPublishedAt\": \"\"\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"channelId\": \"\",\n \"channelTitle\": \"\",\n \"description\": \"\",\n \"playlistId\": \"\",\n \"position\": 0,\n \"publishedAt\": \"\",\n \"resourceId\": {\n \"channelId\": \"\",\n \"kind\": \"\",\n \"playlistId\": \"\",\n \"videoId\": \"\"\n },\n \"thumbnails\": {\n \"high\": {\n \"height\": 0,\n \"url\": \"\",\n \"width\": 0\n },\n \"maxres\": {},\n \"medium\": {},\n \"standard\": {}\n },\n \"title\": \"\",\n \"videoOwnerChannelId\": \"\",\n \"videoOwnerChannelTitle\": \"\"\n },\n \"status\": {\n \"privacyStatus\": \"\"\n }\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/youtube/v3/playlistItems?part="))
.header("content-type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString("{\n \"contentDetails\": {\n \"endAt\": \"\",\n \"note\": \"\",\n \"startAt\": \"\",\n \"videoId\": \"\",\n \"videoPublishedAt\": \"\"\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"channelId\": \"\",\n \"channelTitle\": \"\",\n \"description\": \"\",\n \"playlistId\": \"\",\n \"position\": 0,\n \"publishedAt\": \"\",\n \"resourceId\": {\n \"channelId\": \"\",\n \"kind\": \"\",\n \"playlistId\": \"\",\n \"videoId\": \"\"\n },\n \"thumbnails\": {\n \"high\": {\n \"height\": 0,\n \"url\": \"\",\n \"width\": 0\n },\n \"maxres\": {},\n \"medium\": {},\n \"standard\": {}\n },\n \"title\": \"\",\n \"videoOwnerChannelId\": \"\",\n \"videoOwnerChannelTitle\": \"\"\n },\n \"status\": {\n \"privacyStatus\": \"\"\n }\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"contentDetails\": {\n \"endAt\": \"\",\n \"note\": \"\",\n \"startAt\": \"\",\n \"videoId\": \"\",\n \"videoPublishedAt\": \"\"\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"channelId\": \"\",\n \"channelTitle\": \"\",\n \"description\": \"\",\n \"playlistId\": \"\",\n \"position\": 0,\n \"publishedAt\": \"\",\n \"resourceId\": {\n \"channelId\": \"\",\n \"kind\": \"\",\n \"playlistId\": \"\",\n \"videoId\": \"\"\n },\n \"thumbnails\": {\n \"high\": {\n \"height\": 0,\n \"url\": \"\",\n \"width\": 0\n },\n \"maxres\": {},\n \"medium\": {},\n \"standard\": {}\n },\n \"title\": \"\",\n \"videoOwnerChannelId\": \"\",\n \"videoOwnerChannelTitle\": \"\"\n },\n \"status\": {\n \"privacyStatus\": \"\"\n }\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/youtube/v3/playlistItems?part=")
.put(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/youtube/v3/playlistItems?part=")
.header("content-type", "application/json")
.body("{\n \"contentDetails\": {\n \"endAt\": \"\",\n \"note\": \"\",\n \"startAt\": \"\",\n \"videoId\": \"\",\n \"videoPublishedAt\": \"\"\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"channelId\": \"\",\n \"channelTitle\": \"\",\n \"description\": \"\",\n \"playlistId\": \"\",\n \"position\": 0,\n \"publishedAt\": \"\",\n \"resourceId\": {\n \"channelId\": \"\",\n \"kind\": \"\",\n \"playlistId\": \"\",\n \"videoId\": \"\"\n },\n \"thumbnails\": {\n \"high\": {\n \"height\": 0,\n \"url\": \"\",\n \"width\": 0\n },\n \"maxres\": {},\n \"medium\": {},\n \"standard\": {}\n },\n \"title\": \"\",\n \"videoOwnerChannelId\": \"\",\n \"videoOwnerChannelTitle\": \"\"\n },\n \"status\": {\n \"privacyStatus\": \"\"\n }\n}")
.asString();
const data = JSON.stringify({
contentDetails: {
endAt: '',
note: '',
startAt: '',
videoId: '',
videoPublishedAt: ''
},
etag: '',
id: '',
kind: '',
snippet: {
channelId: '',
channelTitle: '',
description: '',
playlistId: '',
position: 0,
publishedAt: '',
resourceId: {
channelId: '',
kind: '',
playlistId: '',
videoId: ''
},
thumbnails: {
high: {
height: 0,
url: '',
width: 0
},
maxres: {},
medium: {},
standard: {}
},
title: '',
videoOwnerChannelId: '',
videoOwnerChannelTitle: ''
},
status: {
privacyStatus: ''
}
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/youtube/v3/playlistItems?part=');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/youtube/v3/playlistItems',
params: {part: ''},
headers: {'content-type': 'application/json'},
data: {
contentDetails: {endAt: '', note: '', startAt: '', videoId: '', videoPublishedAt: ''},
etag: '',
id: '',
kind: '',
snippet: {
channelId: '',
channelTitle: '',
description: '',
playlistId: '',
position: 0,
publishedAt: '',
resourceId: {channelId: '', kind: '', playlistId: '', videoId: ''},
thumbnails: {high: {height: 0, url: '', width: 0}, maxres: {}, medium: {}, standard: {}},
title: '',
videoOwnerChannelId: '',
videoOwnerChannelTitle: ''
},
status: {privacyStatus: ''}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/youtube/v3/playlistItems?part=';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"contentDetails":{"endAt":"","note":"","startAt":"","videoId":"","videoPublishedAt":""},"etag":"","id":"","kind":"","snippet":{"channelId":"","channelTitle":"","description":"","playlistId":"","position":0,"publishedAt":"","resourceId":{"channelId":"","kind":"","playlistId":"","videoId":""},"thumbnails":{"high":{"height":0,"url":"","width":0},"maxres":{},"medium":{},"standard":{}},"title":"","videoOwnerChannelId":"","videoOwnerChannelTitle":""},"status":{"privacyStatus":""}}'
};
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}}/youtube/v3/playlistItems?part=',
method: 'PUT',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "contentDetails": {\n "endAt": "",\n "note": "",\n "startAt": "",\n "videoId": "",\n "videoPublishedAt": ""\n },\n "etag": "",\n "id": "",\n "kind": "",\n "snippet": {\n "channelId": "",\n "channelTitle": "",\n "description": "",\n "playlistId": "",\n "position": 0,\n "publishedAt": "",\n "resourceId": {\n "channelId": "",\n "kind": "",\n "playlistId": "",\n "videoId": ""\n },\n "thumbnails": {\n "high": {\n "height": 0,\n "url": "",\n "width": 0\n },\n "maxres": {},\n "medium": {},\n "standard": {}\n },\n "title": "",\n "videoOwnerChannelId": "",\n "videoOwnerChannelTitle": ""\n },\n "status": {\n "privacyStatus": ""\n }\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"contentDetails\": {\n \"endAt\": \"\",\n \"note\": \"\",\n \"startAt\": \"\",\n \"videoId\": \"\",\n \"videoPublishedAt\": \"\"\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"channelId\": \"\",\n \"channelTitle\": \"\",\n \"description\": \"\",\n \"playlistId\": \"\",\n \"position\": 0,\n \"publishedAt\": \"\",\n \"resourceId\": {\n \"channelId\": \"\",\n \"kind\": \"\",\n \"playlistId\": \"\",\n \"videoId\": \"\"\n },\n \"thumbnails\": {\n \"high\": {\n \"height\": 0,\n \"url\": \"\",\n \"width\": 0\n },\n \"maxres\": {},\n \"medium\": {},\n \"standard\": {}\n },\n \"title\": \"\",\n \"videoOwnerChannelId\": \"\",\n \"videoOwnerChannelTitle\": \"\"\n },\n \"status\": {\n \"privacyStatus\": \"\"\n }\n}")
val request = Request.Builder()
.url("{{baseUrl}}/youtube/v3/playlistItems?part=")
.put(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PUT',
hostname: 'example.com',
port: null,
path: '/baseUrl/youtube/v3/playlistItems?part=',
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({
contentDetails: {endAt: '', note: '', startAt: '', videoId: '', videoPublishedAt: ''},
etag: '',
id: '',
kind: '',
snippet: {
channelId: '',
channelTitle: '',
description: '',
playlistId: '',
position: 0,
publishedAt: '',
resourceId: {channelId: '', kind: '', playlistId: '', videoId: ''},
thumbnails: {high: {height: 0, url: '', width: 0}, maxres: {}, medium: {}, standard: {}},
title: '',
videoOwnerChannelId: '',
videoOwnerChannelTitle: ''
},
status: {privacyStatus: ''}
}));
req.end();
const request = require('request');
const options = {
method: 'PUT',
url: '{{baseUrl}}/youtube/v3/playlistItems',
qs: {part: ''},
headers: {'content-type': 'application/json'},
body: {
contentDetails: {endAt: '', note: '', startAt: '', videoId: '', videoPublishedAt: ''},
etag: '',
id: '',
kind: '',
snippet: {
channelId: '',
channelTitle: '',
description: '',
playlistId: '',
position: 0,
publishedAt: '',
resourceId: {channelId: '', kind: '', playlistId: '', videoId: ''},
thumbnails: {high: {height: 0, url: '', width: 0}, maxres: {}, medium: {}, standard: {}},
title: '',
videoOwnerChannelId: '',
videoOwnerChannelTitle: ''
},
status: {privacyStatus: ''}
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PUT', '{{baseUrl}}/youtube/v3/playlistItems');
req.query({
part: ''
});
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
contentDetails: {
endAt: '',
note: '',
startAt: '',
videoId: '',
videoPublishedAt: ''
},
etag: '',
id: '',
kind: '',
snippet: {
channelId: '',
channelTitle: '',
description: '',
playlistId: '',
position: 0,
publishedAt: '',
resourceId: {
channelId: '',
kind: '',
playlistId: '',
videoId: ''
},
thumbnails: {
high: {
height: 0,
url: '',
width: 0
},
maxres: {},
medium: {},
standard: {}
},
title: '',
videoOwnerChannelId: '',
videoOwnerChannelTitle: ''
},
status: {
privacyStatus: ''
}
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'PUT',
url: '{{baseUrl}}/youtube/v3/playlistItems',
params: {part: ''},
headers: {'content-type': 'application/json'},
data: {
contentDetails: {endAt: '', note: '', startAt: '', videoId: '', videoPublishedAt: ''},
etag: '',
id: '',
kind: '',
snippet: {
channelId: '',
channelTitle: '',
description: '',
playlistId: '',
position: 0,
publishedAt: '',
resourceId: {channelId: '', kind: '', playlistId: '', videoId: ''},
thumbnails: {high: {height: 0, url: '', width: 0}, maxres: {}, medium: {}, standard: {}},
title: '',
videoOwnerChannelId: '',
videoOwnerChannelTitle: ''
},
status: {privacyStatus: ''}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/youtube/v3/playlistItems?part=';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"contentDetails":{"endAt":"","note":"","startAt":"","videoId":"","videoPublishedAt":""},"etag":"","id":"","kind":"","snippet":{"channelId":"","channelTitle":"","description":"","playlistId":"","position":0,"publishedAt":"","resourceId":{"channelId":"","kind":"","playlistId":"","videoId":""},"thumbnails":{"high":{"height":0,"url":"","width":0},"maxres":{},"medium":{},"standard":{}},"title":"","videoOwnerChannelId":"","videoOwnerChannelTitle":""},"status":{"privacyStatus":""}}'
};
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 = @{ @"contentDetails": @{ @"endAt": @"", @"note": @"", @"startAt": @"", @"videoId": @"", @"videoPublishedAt": @"" },
@"etag": @"",
@"id": @"",
@"kind": @"",
@"snippet": @{ @"channelId": @"", @"channelTitle": @"", @"description": @"", @"playlistId": @"", @"position": @0, @"publishedAt": @"", @"resourceId": @{ @"channelId": @"", @"kind": @"", @"playlistId": @"", @"videoId": @"" }, @"thumbnails": @{ @"high": @{ @"height": @0, @"url": @"", @"width": @0 }, @"maxres": @{ }, @"medium": @{ }, @"standard": @{ } }, @"title": @"", @"videoOwnerChannelId": @"", @"videoOwnerChannelTitle": @"" },
@"status": @{ @"privacyStatus": @"" } };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/youtube/v3/playlistItems?part="]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PUT"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/youtube/v3/playlistItems?part=" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"contentDetails\": {\n \"endAt\": \"\",\n \"note\": \"\",\n \"startAt\": \"\",\n \"videoId\": \"\",\n \"videoPublishedAt\": \"\"\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"channelId\": \"\",\n \"channelTitle\": \"\",\n \"description\": \"\",\n \"playlistId\": \"\",\n \"position\": 0,\n \"publishedAt\": \"\",\n \"resourceId\": {\n \"channelId\": \"\",\n \"kind\": \"\",\n \"playlistId\": \"\",\n \"videoId\": \"\"\n },\n \"thumbnails\": {\n \"high\": {\n \"height\": 0,\n \"url\": \"\",\n \"width\": 0\n },\n \"maxres\": {},\n \"medium\": {},\n \"standard\": {}\n },\n \"title\": \"\",\n \"videoOwnerChannelId\": \"\",\n \"videoOwnerChannelTitle\": \"\"\n },\n \"status\": {\n \"privacyStatus\": \"\"\n }\n}" in
Client.call ~headers ~body `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/youtube/v3/playlistItems?part=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'contentDetails' => [
'endAt' => '',
'note' => '',
'startAt' => '',
'videoId' => '',
'videoPublishedAt' => ''
],
'etag' => '',
'id' => '',
'kind' => '',
'snippet' => [
'channelId' => '',
'channelTitle' => '',
'description' => '',
'playlistId' => '',
'position' => 0,
'publishedAt' => '',
'resourceId' => [
'channelId' => '',
'kind' => '',
'playlistId' => '',
'videoId' => ''
],
'thumbnails' => [
'high' => [
'height' => 0,
'url' => '',
'width' => 0
],
'maxres' => [
],
'medium' => [
],
'standard' => [
]
],
'title' => '',
'videoOwnerChannelId' => '',
'videoOwnerChannelTitle' => ''
],
'status' => [
'privacyStatus' => ''
]
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('PUT', '{{baseUrl}}/youtube/v3/playlistItems?part=', [
'body' => '{
"contentDetails": {
"endAt": "",
"note": "",
"startAt": "",
"videoId": "",
"videoPublishedAt": ""
},
"etag": "",
"id": "",
"kind": "",
"snippet": {
"channelId": "",
"channelTitle": "",
"description": "",
"playlistId": "",
"position": 0,
"publishedAt": "",
"resourceId": {
"channelId": "",
"kind": "",
"playlistId": "",
"videoId": ""
},
"thumbnails": {
"high": {
"height": 0,
"url": "",
"width": 0
},
"maxres": {},
"medium": {},
"standard": {}
},
"title": "",
"videoOwnerChannelId": "",
"videoOwnerChannelTitle": ""
},
"status": {
"privacyStatus": ""
}
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/youtube/v3/playlistItems');
$request->setMethod(HTTP_METH_PUT);
$request->setQueryData([
'part' => ''
]);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'contentDetails' => [
'endAt' => '',
'note' => '',
'startAt' => '',
'videoId' => '',
'videoPublishedAt' => ''
],
'etag' => '',
'id' => '',
'kind' => '',
'snippet' => [
'channelId' => '',
'channelTitle' => '',
'description' => '',
'playlistId' => '',
'position' => 0,
'publishedAt' => '',
'resourceId' => [
'channelId' => '',
'kind' => '',
'playlistId' => '',
'videoId' => ''
],
'thumbnails' => [
'high' => [
'height' => 0,
'url' => '',
'width' => 0
],
'maxres' => [
],
'medium' => [
],
'standard' => [
]
],
'title' => '',
'videoOwnerChannelId' => '',
'videoOwnerChannelTitle' => ''
],
'status' => [
'privacyStatus' => ''
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'contentDetails' => [
'endAt' => '',
'note' => '',
'startAt' => '',
'videoId' => '',
'videoPublishedAt' => ''
],
'etag' => '',
'id' => '',
'kind' => '',
'snippet' => [
'channelId' => '',
'channelTitle' => '',
'description' => '',
'playlistId' => '',
'position' => 0,
'publishedAt' => '',
'resourceId' => [
'channelId' => '',
'kind' => '',
'playlistId' => '',
'videoId' => ''
],
'thumbnails' => [
'high' => [
'height' => 0,
'url' => '',
'width' => 0
],
'maxres' => [
],
'medium' => [
],
'standard' => [
]
],
'title' => '',
'videoOwnerChannelId' => '',
'videoOwnerChannelTitle' => ''
],
'status' => [
'privacyStatus' => ''
]
]));
$request->setRequestUrl('{{baseUrl}}/youtube/v3/playlistItems');
$request->setRequestMethod('PUT');
$request->setBody($body);
$request->setQuery(new http\QueryString([
'part' => ''
]));
$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}}/youtube/v3/playlistItems?part=' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"contentDetails": {
"endAt": "",
"note": "",
"startAt": "",
"videoId": "",
"videoPublishedAt": ""
},
"etag": "",
"id": "",
"kind": "",
"snippet": {
"channelId": "",
"channelTitle": "",
"description": "",
"playlistId": "",
"position": 0,
"publishedAt": "",
"resourceId": {
"channelId": "",
"kind": "",
"playlistId": "",
"videoId": ""
},
"thumbnails": {
"high": {
"height": 0,
"url": "",
"width": 0
},
"maxres": {},
"medium": {},
"standard": {}
},
"title": "",
"videoOwnerChannelId": "",
"videoOwnerChannelTitle": ""
},
"status": {
"privacyStatus": ""
}
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/youtube/v3/playlistItems?part=' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"contentDetails": {
"endAt": "",
"note": "",
"startAt": "",
"videoId": "",
"videoPublishedAt": ""
},
"etag": "",
"id": "",
"kind": "",
"snippet": {
"channelId": "",
"channelTitle": "",
"description": "",
"playlistId": "",
"position": 0,
"publishedAt": "",
"resourceId": {
"channelId": "",
"kind": "",
"playlistId": "",
"videoId": ""
},
"thumbnails": {
"high": {
"height": 0,
"url": "",
"width": 0
},
"maxres": {},
"medium": {},
"standard": {}
},
"title": "",
"videoOwnerChannelId": "",
"videoOwnerChannelTitle": ""
},
"status": {
"privacyStatus": ""
}
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"contentDetails\": {\n \"endAt\": \"\",\n \"note\": \"\",\n \"startAt\": \"\",\n \"videoId\": \"\",\n \"videoPublishedAt\": \"\"\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"channelId\": \"\",\n \"channelTitle\": \"\",\n \"description\": \"\",\n \"playlistId\": \"\",\n \"position\": 0,\n \"publishedAt\": \"\",\n \"resourceId\": {\n \"channelId\": \"\",\n \"kind\": \"\",\n \"playlistId\": \"\",\n \"videoId\": \"\"\n },\n \"thumbnails\": {\n \"high\": {\n \"height\": 0,\n \"url\": \"\",\n \"width\": 0\n },\n \"maxres\": {},\n \"medium\": {},\n \"standard\": {}\n },\n \"title\": \"\",\n \"videoOwnerChannelId\": \"\",\n \"videoOwnerChannelTitle\": \"\"\n },\n \"status\": {\n \"privacyStatus\": \"\"\n }\n}"
headers = { 'content-type': "application/json" }
conn.request("PUT", "/baseUrl/youtube/v3/playlistItems?part=", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/youtube/v3/playlistItems"
querystring = {"part":""}
payload = {
"contentDetails": {
"endAt": "",
"note": "",
"startAt": "",
"videoId": "",
"videoPublishedAt": ""
},
"etag": "",
"id": "",
"kind": "",
"snippet": {
"channelId": "",
"channelTitle": "",
"description": "",
"playlistId": "",
"position": 0,
"publishedAt": "",
"resourceId": {
"channelId": "",
"kind": "",
"playlistId": "",
"videoId": ""
},
"thumbnails": {
"high": {
"height": 0,
"url": "",
"width": 0
},
"maxres": {},
"medium": {},
"standard": {}
},
"title": "",
"videoOwnerChannelId": "",
"videoOwnerChannelTitle": ""
},
"status": { "privacyStatus": "" }
}
headers = {"content-type": "application/json"}
response = requests.put(url, json=payload, headers=headers, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/youtube/v3/playlistItems"
queryString <- list(part = "")
payload <- "{\n \"contentDetails\": {\n \"endAt\": \"\",\n \"note\": \"\",\n \"startAt\": \"\",\n \"videoId\": \"\",\n \"videoPublishedAt\": \"\"\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"channelId\": \"\",\n \"channelTitle\": \"\",\n \"description\": \"\",\n \"playlistId\": \"\",\n \"position\": 0,\n \"publishedAt\": \"\",\n \"resourceId\": {\n \"channelId\": \"\",\n \"kind\": \"\",\n \"playlistId\": \"\",\n \"videoId\": \"\"\n },\n \"thumbnails\": {\n \"high\": {\n \"height\": 0,\n \"url\": \"\",\n \"width\": 0\n },\n \"maxres\": {},\n \"medium\": {},\n \"standard\": {}\n },\n \"title\": \"\",\n \"videoOwnerChannelId\": \"\",\n \"videoOwnerChannelTitle\": \"\"\n },\n \"status\": {\n \"privacyStatus\": \"\"\n }\n}"
encode <- "json"
response <- VERB("PUT", url, body = payload, query = queryString, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/youtube/v3/playlistItems?part=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"contentDetails\": {\n \"endAt\": \"\",\n \"note\": \"\",\n \"startAt\": \"\",\n \"videoId\": \"\",\n \"videoPublishedAt\": \"\"\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"channelId\": \"\",\n \"channelTitle\": \"\",\n \"description\": \"\",\n \"playlistId\": \"\",\n \"position\": 0,\n \"publishedAt\": \"\",\n \"resourceId\": {\n \"channelId\": \"\",\n \"kind\": \"\",\n \"playlistId\": \"\",\n \"videoId\": \"\"\n },\n \"thumbnails\": {\n \"high\": {\n \"height\": 0,\n \"url\": \"\",\n \"width\": 0\n },\n \"maxres\": {},\n \"medium\": {},\n \"standard\": {}\n },\n \"title\": \"\",\n \"videoOwnerChannelId\": \"\",\n \"videoOwnerChannelTitle\": \"\"\n },\n \"status\": {\n \"privacyStatus\": \"\"\n }\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.put('/baseUrl/youtube/v3/playlistItems') do |req|
req.params['part'] = ''
req.body = "{\n \"contentDetails\": {\n \"endAt\": \"\",\n \"note\": \"\",\n \"startAt\": \"\",\n \"videoId\": \"\",\n \"videoPublishedAt\": \"\"\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"channelId\": \"\",\n \"channelTitle\": \"\",\n \"description\": \"\",\n \"playlistId\": \"\",\n \"position\": 0,\n \"publishedAt\": \"\",\n \"resourceId\": {\n \"channelId\": \"\",\n \"kind\": \"\",\n \"playlistId\": \"\",\n \"videoId\": \"\"\n },\n \"thumbnails\": {\n \"high\": {\n \"height\": 0,\n \"url\": \"\",\n \"width\": 0\n },\n \"maxres\": {},\n \"medium\": {},\n \"standard\": {}\n },\n \"title\": \"\",\n \"videoOwnerChannelId\": \"\",\n \"videoOwnerChannelTitle\": \"\"\n },\n \"status\": {\n \"privacyStatus\": \"\"\n }\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}}/youtube/v3/playlistItems";
let querystring = [
("part", ""),
];
let payload = json!({
"contentDetails": json!({
"endAt": "",
"note": "",
"startAt": "",
"videoId": "",
"videoPublishedAt": ""
}),
"etag": "",
"id": "",
"kind": "",
"snippet": json!({
"channelId": "",
"channelTitle": "",
"description": "",
"playlistId": "",
"position": 0,
"publishedAt": "",
"resourceId": json!({
"channelId": "",
"kind": "",
"playlistId": "",
"videoId": ""
}),
"thumbnails": json!({
"high": json!({
"height": 0,
"url": "",
"width": 0
}),
"maxres": json!({}),
"medium": json!({}),
"standard": json!({})
}),
"title": "",
"videoOwnerChannelId": "",
"videoOwnerChannelTitle": ""
}),
"status": json!({"privacyStatus": ""})
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PUT").unwrap(), url)
.query(&querystring)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PUT \
--url '{{baseUrl}}/youtube/v3/playlistItems?part=' \
--header 'content-type: application/json' \
--data '{
"contentDetails": {
"endAt": "",
"note": "",
"startAt": "",
"videoId": "",
"videoPublishedAt": ""
},
"etag": "",
"id": "",
"kind": "",
"snippet": {
"channelId": "",
"channelTitle": "",
"description": "",
"playlistId": "",
"position": 0,
"publishedAt": "",
"resourceId": {
"channelId": "",
"kind": "",
"playlistId": "",
"videoId": ""
},
"thumbnails": {
"high": {
"height": 0,
"url": "",
"width": 0
},
"maxres": {},
"medium": {},
"standard": {}
},
"title": "",
"videoOwnerChannelId": "",
"videoOwnerChannelTitle": ""
},
"status": {
"privacyStatus": ""
}
}'
echo '{
"contentDetails": {
"endAt": "",
"note": "",
"startAt": "",
"videoId": "",
"videoPublishedAt": ""
},
"etag": "",
"id": "",
"kind": "",
"snippet": {
"channelId": "",
"channelTitle": "",
"description": "",
"playlistId": "",
"position": 0,
"publishedAt": "",
"resourceId": {
"channelId": "",
"kind": "",
"playlistId": "",
"videoId": ""
},
"thumbnails": {
"high": {
"height": 0,
"url": "",
"width": 0
},
"maxres": {},
"medium": {},
"standard": {}
},
"title": "",
"videoOwnerChannelId": "",
"videoOwnerChannelTitle": ""
},
"status": {
"privacyStatus": ""
}
}' | \
http PUT '{{baseUrl}}/youtube/v3/playlistItems?part=' \
content-type:application/json
wget --quiet \
--method PUT \
--header 'content-type: application/json' \
--body-data '{\n "contentDetails": {\n "endAt": "",\n "note": "",\n "startAt": "",\n "videoId": "",\n "videoPublishedAt": ""\n },\n "etag": "",\n "id": "",\n "kind": "",\n "snippet": {\n "channelId": "",\n "channelTitle": "",\n "description": "",\n "playlistId": "",\n "position": 0,\n "publishedAt": "",\n "resourceId": {\n "channelId": "",\n "kind": "",\n "playlistId": "",\n "videoId": ""\n },\n "thumbnails": {\n "high": {\n "height": 0,\n "url": "",\n "width": 0\n },\n "maxres": {},\n "medium": {},\n "standard": {}\n },\n "title": "",\n "videoOwnerChannelId": "",\n "videoOwnerChannelTitle": ""\n },\n "status": {\n "privacyStatus": ""\n }\n}' \
--output-document \
- '{{baseUrl}}/youtube/v3/playlistItems?part='
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"contentDetails": [
"endAt": "",
"note": "",
"startAt": "",
"videoId": "",
"videoPublishedAt": ""
],
"etag": "",
"id": "",
"kind": "",
"snippet": [
"channelId": "",
"channelTitle": "",
"description": "",
"playlistId": "",
"position": 0,
"publishedAt": "",
"resourceId": [
"channelId": "",
"kind": "",
"playlistId": "",
"videoId": ""
],
"thumbnails": [
"high": [
"height": 0,
"url": "",
"width": 0
],
"maxres": [],
"medium": [],
"standard": []
],
"title": "",
"videoOwnerChannelId": "",
"videoOwnerChannelTitle": ""
],
"status": ["privacyStatus": ""]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/youtube/v3/playlistItems?part=")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
DELETE
youtube.playlists.delete
{{baseUrl}}/youtube/v3/playlists
QUERY PARAMS
id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/youtube/v3/playlists?id=");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/delete "{{baseUrl}}/youtube/v3/playlists" {:query-params {:id ""}})
require "http/client"
url = "{{baseUrl}}/youtube/v3/playlists?id="
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}}/youtube/v3/playlists?id="),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/youtube/v3/playlists?id=");
var request = new RestRequest("", Method.Delete);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/youtube/v3/playlists?id="
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/youtube/v3/playlists?id= HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/youtube/v3/playlists?id=")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/youtube/v3/playlists?id="))
.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}}/youtube/v3/playlists?id=")
.delete(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/youtube/v3/playlists?id=")
.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}}/youtube/v3/playlists?id=');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'DELETE',
url: '{{baseUrl}}/youtube/v3/playlists',
params: {id: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/youtube/v3/playlists?id=';
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}}/youtube/v3/playlists?id=',
method: 'DELETE',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/youtube/v3/playlists?id=")
.delete(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'DELETE',
hostname: 'example.com',
port: null,
path: '/baseUrl/youtube/v3/playlists?id=',
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}}/youtube/v3/playlists',
qs: {id: ''}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('DELETE', '{{baseUrl}}/youtube/v3/playlists');
req.query({
id: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'DELETE',
url: '{{baseUrl}}/youtube/v3/playlists',
params: {id: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/youtube/v3/playlists?id=';
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}}/youtube/v3/playlists?id="]
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}}/youtube/v3/playlists?id=" in
Client.call `DELETE uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/youtube/v3/playlists?id=",
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}}/youtube/v3/playlists?id=');
echo $response->getBody();
setUrl('{{baseUrl}}/youtube/v3/playlists');
$request->setMethod(HTTP_METH_DELETE);
$request->setQueryData([
'id' => ''
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/youtube/v3/playlists');
$request->setRequestMethod('DELETE');
$request->setQuery(new http\QueryString([
'id' => ''
]));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/youtube/v3/playlists?id=' -Method DELETE
$response = Invoke-RestMethod -Uri '{{baseUrl}}/youtube/v3/playlists?id=' -Method DELETE
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("DELETE", "/baseUrl/youtube/v3/playlists?id=")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/youtube/v3/playlists"
querystring = {"id":""}
response = requests.delete(url, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/youtube/v3/playlists"
queryString <- list(id = "")
response <- VERB("DELETE", url, query = queryString, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/youtube/v3/playlists?id=")
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/youtube/v3/playlists') do |req|
req.params['id'] = ''
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/youtube/v3/playlists";
let querystring = [
("id", ""),
];
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("DELETE").unwrap(), url)
.query(&querystring)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request DELETE \
--url '{{baseUrl}}/youtube/v3/playlists?id='
http DELETE '{{baseUrl}}/youtube/v3/playlists?id='
wget --quiet \
--method DELETE \
--output-document \
- '{{baseUrl}}/youtube/v3/playlists?id='
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/youtube/v3/playlists?id=")! 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()
POST
youtube.playlists.insert
{{baseUrl}}/youtube/v3/playlists
QUERY PARAMS
part
BODY json
{
"contentDetails": {
"itemCount": 0
},
"etag": "",
"id": "",
"kind": "",
"localizations": {},
"player": {
"embedHtml": ""
},
"snippet": {
"channelId": "",
"channelTitle": "",
"defaultLanguage": "",
"description": "",
"localized": {
"description": "",
"title": ""
},
"publishedAt": "",
"tags": [],
"thumbnailVideoId": "",
"thumbnails": {
"high": {
"height": 0,
"url": "",
"width": 0
},
"maxres": {},
"medium": {},
"standard": {}
},
"title": ""
},
"status": {
"privacyStatus": ""
}
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/youtube/v3/playlists?part=");
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 \"contentDetails\": {\n \"itemCount\": 0\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"localizations\": {},\n \"player\": {\n \"embedHtml\": \"\"\n },\n \"snippet\": {\n \"channelId\": \"\",\n \"channelTitle\": \"\",\n \"defaultLanguage\": \"\",\n \"description\": \"\",\n \"localized\": {\n \"description\": \"\",\n \"title\": \"\"\n },\n \"publishedAt\": \"\",\n \"tags\": [],\n \"thumbnailVideoId\": \"\",\n \"thumbnails\": {\n \"high\": {\n \"height\": 0,\n \"url\": \"\",\n \"width\": 0\n },\n \"maxres\": {},\n \"medium\": {},\n \"standard\": {}\n },\n \"title\": \"\"\n },\n \"status\": {\n \"privacyStatus\": \"\"\n }\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/youtube/v3/playlists" {:query-params {:part ""}
:content-type :json
:form-params {:contentDetails {:itemCount 0}
:etag ""
:id ""
:kind ""
:localizations {}
:player {:embedHtml ""}
:snippet {:channelId ""
:channelTitle ""
:defaultLanguage ""
:description ""
:localized {:description ""
:title ""}
:publishedAt ""
:tags []
:thumbnailVideoId ""
:thumbnails {:high {:height 0
:url ""
:width 0}
:maxres {}
:medium {}
:standard {}}
:title ""}
:status {:privacyStatus ""}}})
require "http/client"
url = "{{baseUrl}}/youtube/v3/playlists?part="
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"contentDetails\": {\n \"itemCount\": 0\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"localizations\": {},\n \"player\": {\n \"embedHtml\": \"\"\n },\n \"snippet\": {\n \"channelId\": \"\",\n \"channelTitle\": \"\",\n \"defaultLanguage\": \"\",\n \"description\": \"\",\n \"localized\": {\n \"description\": \"\",\n \"title\": \"\"\n },\n \"publishedAt\": \"\",\n \"tags\": [],\n \"thumbnailVideoId\": \"\",\n \"thumbnails\": {\n \"high\": {\n \"height\": 0,\n \"url\": \"\",\n \"width\": 0\n },\n \"maxres\": {},\n \"medium\": {},\n \"standard\": {}\n },\n \"title\": \"\"\n },\n \"status\": {\n \"privacyStatus\": \"\"\n }\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/youtube/v3/playlists?part="),
Content = new StringContent("{\n \"contentDetails\": {\n \"itemCount\": 0\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"localizations\": {},\n \"player\": {\n \"embedHtml\": \"\"\n },\n \"snippet\": {\n \"channelId\": \"\",\n \"channelTitle\": \"\",\n \"defaultLanguage\": \"\",\n \"description\": \"\",\n \"localized\": {\n \"description\": \"\",\n \"title\": \"\"\n },\n \"publishedAt\": \"\",\n \"tags\": [],\n \"thumbnailVideoId\": \"\",\n \"thumbnails\": {\n \"high\": {\n \"height\": 0,\n \"url\": \"\",\n \"width\": 0\n },\n \"maxres\": {},\n \"medium\": {},\n \"standard\": {}\n },\n \"title\": \"\"\n },\n \"status\": {\n \"privacyStatus\": \"\"\n }\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/youtube/v3/playlists?part=");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"contentDetails\": {\n \"itemCount\": 0\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"localizations\": {},\n \"player\": {\n \"embedHtml\": \"\"\n },\n \"snippet\": {\n \"channelId\": \"\",\n \"channelTitle\": \"\",\n \"defaultLanguage\": \"\",\n \"description\": \"\",\n \"localized\": {\n \"description\": \"\",\n \"title\": \"\"\n },\n \"publishedAt\": \"\",\n \"tags\": [],\n \"thumbnailVideoId\": \"\",\n \"thumbnails\": {\n \"high\": {\n \"height\": 0,\n \"url\": \"\",\n \"width\": 0\n },\n \"maxres\": {},\n \"medium\": {},\n \"standard\": {}\n },\n \"title\": \"\"\n },\n \"status\": {\n \"privacyStatus\": \"\"\n }\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/youtube/v3/playlists?part="
payload := strings.NewReader("{\n \"contentDetails\": {\n \"itemCount\": 0\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"localizations\": {},\n \"player\": {\n \"embedHtml\": \"\"\n },\n \"snippet\": {\n \"channelId\": \"\",\n \"channelTitle\": \"\",\n \"defaultLanguage\": \"\",\n \"description\": \"\",\n \"localized\": {\n \"description\": \"\",\n \"title\": \"\"\n },\n \"publishedAt\": \"\",\n \"tags\": [],\n \"thumbnailVideoId\": \"\",\n \"thumbnails\": {\n \"high\": {\n \"height\": 0,\n \"url\": \"\",\n \"width\": 0\n },\n \"maxres\": {},\n \"medium\": {},\n \"standard\": {}\n },\n \"title\": \"\"\n },\n \"status\": {\n \"privacyStatus\": \"\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/youtube/v3/playlists?part= HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 632
{
"contentDetails": {
"itemCount": 0
},
"etag": "",
"id": "",
"kind": "",
"localizations": {},
"player": {
"embedHtml": ""
},
"snippet": {
"channelId": "",
"channelTitle": "",
"defaultLanguage": "",
"description": "",
"localized": {
"description": "",
"title": ""
},
"publishedAt": "",
"tags": [],
"thumbnailVideoId": "",
"thumbnails": {
"high": {
"height": 0,
"url": "",
"width": 0
},
"maxres": {},
"medium": {},
"standard": {}
},
"title": ""
},
"status": {
"privacyStatus": ""
}
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/youtube/v3/playlists?part=")
.setHeader("content-type", "application/json")
.setBody("{\n \"contentDetails\": {\n \"itemCount\": 0\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"localizations\": {},\n \"player\": {\n \"embedHtml\": \"\"\n },\n \"snippet\": {\n \"channelId\": \"\",\n \"channelTitle\": \"\",\n \"defaultLanguage\": \"\",\n \"description\": \"\",\n \"localized\": {\n \"description\": \"\",\n \"title\": \"\"\n },\n \"publishedAt\": \"\",\n \"tags\": [],\n \"thumbnailVideoId\": \"\",\n \"thumbnails\": {\n \"high\": {\n \"height\": 0,\n \"url\": \"\",\n \"width\": 0\n },\n \"maxres\": {},\n \"medium\": {},\n \"standard\": {}\n },\n \"title\": \"\"\n },\n \"status\": {\n \"privacyStatus\": \"\"\n }\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/youtube/v3/playlists?part="))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"contentDetails\": {\n \"itemCount\": 0\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"localizations\": {},\n \"player\": {\n \"embedHtml\": \"\"\n },\n \"snippet\": {\n \"channelId\": \"\",\n \"channelTitle\": \"\",\n \"defaultLanguage\": \"\",\n \"description\": \"\",\n \"localized\": {\n \"description\": \"\",\n \"title\": \"\"\n },\n \"publishedAt\": \"\",\n \"tags\": [],\n \"thumbnailVideoId\": \"\",\n \"thumbnails\": {\n \"high\": {\n \"height\": 0,\n \"url\": \"\",\n \"width\": 0\n },\n \"maxres\": {},\n \"medium\": {},\n \"standard\": {}\n },\n \"title\": \"\"\n },\n \"status\": {\n \"privacyStatus\": \"\"\n }\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"contentDetails\": {\n \"itemCount\": 0\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"localizations\": {},\n \"player\": {\n \"embedHtml\": \"\"\n },\n \"snippet\": {\n \"channelId\": \"\",\n \"channelTitle\": \"\",\n \"defaultLanguage\": \"\",\n \"description\": \"\",\n \"localized\": {\n \"description\": \"\",\n \"title\": \"\"\n },\n \"publishedAt\": \"\",\n \"tags\": [],\n \"thumbnailVideoId\": \"\",\n \"thumbnails\": {\n \"high\": {\n \"height\": 0,\n \"url\": \"\",\n \"width\": 0\n },\n \"maxres\": {},\n \"medium\": {},\n \"standard\": {}\n },\n \"title\": \"\"\n },\n \"status\": {\n \"privacyStatus\": \"\"\n }\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/youtube/v3/playlists?part=")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/youtube/v3/playlists?part=")
.header("content-type", "application/json")
.body("{\n \"contentDetails\": {\n \"itemCount\": 0\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"localizations\": {},\n \"player\": {\n \"embedHtml\": \"\"\n },\n \"snippet\": {\n \"channelId\": \"\",\n \"channelTitle\": \"\",\n \"defaultLanguage\": \"\",\n \"description\": \"\",\n \"localized\": {\n \"description\": \"\",\n \"title\": \"\"\n },\n \"publishedAt\": \"\",\n \"tags\": [],\n \"thumbnailVideoId\": \"\",\n \"thumbnails\": {\n \"high\": {\n \"height\": 0,\n \"url\": \"\",\n \"width\": 0\n },\n \"maxres\": {},\n \"medium\": {},\n \"standard\": {}\n },\n \"title\": \"\"\n },\n \"status\": {\n \"privacyStatus\": \"\"\n }\n}")
.asString();
const data = JSON.stringify({
contentDetails: {
itemCount: 0
},
etag: '',
id: '',
kind: '',
localizations: {},
player: {
embedHtml: ''
},
snippet: {
channelId: '',
channelTitle: '',
defaultLanguage: '',
description: '',
localized: {
description: '',
title: ''
},
publishedAt: '',
tags: [],
thumbnailVideoId: '',
thumbnails: {
high: {
height: 0,
url: '',
width: 0
},
maxres: {},
medium: {},
standard: {}
},
title: ''
},
status: {
privacyStatus: ''
}
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/youtube/v3/playlists?part=');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/youtube/v3/playlists',
params: {part: ''},
headers: {'content-type': 'application/json'},
data: {
contentDetails: {itemCount: 0},
etag: '',
id: '',
kind: '',
localizations: {},
player: {embedHtml: ''},
snippet: {
channelId: '',
channelTitle: '',
defaultLanguage: '',
description: '',
localized: {description: '', title: ''},
publishedAt: '',
tags: [],
thumbnailVideoId: '',
thumbnails: {high: {height: 0, url: '', width: 0}, maxres: {}, medium: {}, standard: {}},
title: ''
},
status: {privacyStatus: ''}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/youtube/v3/playlists?part=';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"contentDetails":{"itemCount":0},"etag":"","id":"","kind":"","localizations":{},"player":{"embedHtml":""},"snippet":{"channelId":"","channelTitle":"","defaultLanguage":"","description":"","localized":{"description":"","title":""},"publishedAt":"","tags":[],"thumbnailVideoId":"","thumbnails":{"high":{"height":0,"url":"","width":0},"maxres":{},"medium":{},"standard":{}},"title":""},"status":{"privacyStatus":""}}'
};
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}}/youtube/v3/playlists?part=',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "contentDetails": {\n "itemCount": 0\n },\n "etag": "",\n "id": "",\n "kind": "",\n "localizations": {},\n "player": {\n "embedHtml": ""\n },\n "snippet": {\n "channelId": "",\n "channelTitle": "",\n "defaultLanguage": "",\n "description": "",\n "localized": {\n "description": "",\n "title": ""\n },\n "publishedAt": "",\n "tags": [],\n "thumbnailVideoId": "",\n "thumbnails": {\n "high": {\n "height": 0,\n "url": "",\n "width": 0\n },\n "maxres": {},\n "medium": {},\n "standard": {}\n },\n "title": ""\n },\n "status": {\n "privacyStatus": ""\n }\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"contentDetails\": {\n \"itemCount\": 0\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"localizations\": {},\n \"player\": {\n \"embedHtml\": \"\"\n },\n \"snippet\": {\n \"channelId\": \"\",\n \"channelTitle\": \"\",\n \"defaultLanguage\": \"\",\n \"description\": \"\",\n \"localized\": {\n \"description\": \"\",\n \"title\": \"\"\n },\n \"publishedAt\": \"\",\n \"tags\": [],\n \"thumbnailVideoId\": \"\",\n \"thumbnails\": {\n \"high\": {\n \"height\": 0,\n \"url\": \"\",\n \"width\": 0\n },\n \"maxres\": {},\n \"medium\": {},\n \"standard\": {}\n },\n \"title\": \"\"\n },\n \"status\": {\n \"privacyStatus\": \"\"\n }\n}")
val request = Request.Builder()
.url("{{baseUrl}}/youtube/v3/playlists?part=")
.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/youtube/v3/playlists?part=',
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({
contentDetails: {itemCount: 0},
etag: '',
id: '',
kind: '',
localizations: {},
player: {embedHtml: ''},
snippet: {
channelId: '',
channelTitle: '',
defaultLanguage: '',
description: '',
localized: {description: '', title: ''},
publishedAt: '',
tags: [],
thumbnailVideoId: '',
thumbnails: {high: {height: 0, url: '', width: 0}, maxres: {}, medium: {}, standard: {}},
title: ''
},
status: {privacyStatus: ''}
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/youtube/v3/playlists',
qs: {part: ''},
headers: {'content-type': 'application/json'},
body: {
contentDetails: {itemCount: 0},
etag: '',
id: '',
kind: '',
localizations: {},
player: {embedHtml: ''},
snippet: {
channelId: '',
channelTitle: '',
defaultLanguage: '',
description: '',
localized: {description: '', title: ''},
publishedAt: '',
tags: [],
thumbnailVideoId: '',
thumbnails: {high: {height: 0, url: '', width: 0}, maxres: {}, medium: {}, standard: {}},
title: ''
},
status: {privacyStatus: ''}
},
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}}/youtube/v3/playlists');
req.query({
part: ''
});
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
contentDetails: {
itemCount: 0
},
etag: '',
id: '',
kind: '',
localizations: {},
player: {
embedHtml: ''
},
snippet: {
channelId: '',
channelTitle: '',
defaultLanguage: '',
description: '',
localized: {
description: '',
title: ''
},
publishedAt: '',
tags: [],
thumbnailVideoId: '',
thumbnails: {
high: {
height: 0,
url: '',
width: 0
},
maxres: {},
medium: {},
standard: {}
},
title: ''
},
status: {
privacyStatus: ''
}
});
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}}/youtube/v3/playlists',
params: {part: ''},
headers: {'content-type': 'application/json'},
data: {
contentDetails: {itemCount: 0},
etag: '',
id: '',
kind: '',
localizations: {},
player: {embedHtml: ''},
snippet: {
channelId: '',
channelTitle: '',
defaultLanguage: '',
description: '',
localized: {description: '', title: ''},
publishedAt: '',
tags: [],
thumbnailVideoId: '',
thumbnails: {high: {height: 0, url: '', width: 0}, maxres: {}, medium: {}, standard: {}},
title: ''
},
status: {privacyStatus: ''}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/youtube/v3/playlists?part=';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"contentDetails":{"itemCount":0},"etag":"","id":"","kind":"","localizations":{},"player":{"embedHtml":""},"snippet":{"channelId":"","channelTitle":"","defaultLanguage":"","description":"","localized":{"description":"","title":""},"publishedAt":"","tags":[],"thumbnailVideoId":"","thumbnails":{"high":{"height":0,"url":"","width":0},"maxres":{},"medium":{},"standard":{}},"title":""},"status":{"privacyStatus":""}}'
};
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 = @{ @"contentDetails": @{ @"itemCount": @0 },
@"etag": @"",
@"id": @"",
@"kind": @"",
@"localizations": @{ },
@"player": @{ @"embedHtml": @"" },
@"snippet": @{ @"channelId": @"", @"channelTitle": @"", @"defaultLanguage": @"", @"description": @"", @"localized": @{ @"description": @"", @"title": @"" }, @"publishedAt": @"", @"tags": @[ ], @"thumbnailVideoId": @"", @"thumbnails": @{ @"high": @{ @"height": @0, @"url": @"", @"width": @0 }, @"maxres": @{ }, @"medium": @{ }, @"standard": @{ } }, @"title": @"" },
@"status": @{ @"privacyStatus": @"" } };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/youtube/v3/playlists?part="]
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}}/youtube/v3/playlists?part=" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"contentDetails\": {\n \"itemCount\": 0\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"localizations\": {},\n \"player\": {\n \"embedHtml\": \"\"\n },\n \"snippet\": {\n \"channelId\": \"\",\n \"channelTitle\": \"\",\n \"defaultLanguage\": \"\",\n \"description\": \"\",\n \"localized\": {\n \"description\": \"\",\n \"title\": \"\"\n },\n \"publishedAt\": \"\",\n \"tags\": [],\n \"thumbnailVideoId\": \"\",\n \"thumbnails\": {\n \"high\": {\n \"height\": 0,\n \"url\": \"\",\n \"width\": 0\n },\n \"maxres\": {},\n \"medium\": {},\n \"standard\": {}\n },\n \"title\": \"\"\n },\n \"status\": {\n \"privacyStatus\": \"\"\n }\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/youtube/v3/playlists?part=",
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([
'contentDetails' => [
'itemCount' => 0
],
'etag' => '',
'id' => '',
'kind' => '',
'localizations' => [
],
'player' => [
'embedHtml' => ''
],
'snippet' => [
'channelId' => '',
'channelTitle' => '',
'defaultLanguage' => '',
'description' => '',
'localized' => [
'description' => '',
'title' => ''
],
'publishedAt' => '',
'tags' => [
],
'thumbnailVideoId' => '',
'thumbnails' => [
'high' => [
'height' => 0,
'url' => '',
'width' => 0
],
'maxres' => [
],
'medium' => [
],
'standard' => [
]
],
'title' => ''
],
'status' => [
'privacyStatus' => ''
]
]),
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}}/youtube/v3/playlists?part=', [
'body' => '{
"contentDetails": {
"itemCount": 0
},
"etag": "",
"id": "",
"kind": "",
"localizations": {},
"player": {
"embedHtml": ""
},
"snippet": {
"channelId": "",
"channelTitle": "",
"defaultLanguage": "",
"description": "",
"localized": {
"description": "",
"title": ""
},
"publishedAt": "",
"tags": [],
"thumbnailVideoId": "",
"thumbnails": {
"high": {
"height": 0,
"url": "",
"width": 0
},
"maxres": {},
"medium": {},
"standard": {}
},
"title": ""
},
"status": {
"privacyStatus": ""
}
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/youtube/v3/playlists');
$request->setMethod(HTTP_METH_POST);
$request->setQueryData([
'part' => ''
]);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'contentDetails' => [
'itemCount' => 0
],
'etag' => '',
'id' => '',
'kind' => '',
'localizations' => [
],
'player' => [
'embedHtml' => ''
],
'snippet' => [
'channelId' => '',
'channelTitle' => '',
'defaultLanguage' => '',
'description' => '',
'localized' => [
'description' => '',
'title' => ''
],
'publishedAt' => '',
'tags' => [
],
'thumbnailVideoId' => '',
'thumbnails' => [
'high' => [
'height' => 0,
'url' => '',
'width' => 0
],
'maxres' => [
],
'medium' => [
],
'standard' => [
]
],
'title' => ''
],
'status' => [
'privacyStatus' => ''
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'contentDetails' => [
'itemCount' => 0
],
'etag' => '',
'id' => '',
'kind' => '',
'localizations' => [
],
'player' => [
'embedHtml' => ''
],
'snippet' => [
'channelId' => '',
'channelTitle' => '',
'defaultLanguage' => '',
'description' => '',
'localized' => [
'description' => '',
'title' => ''
],
'publishedAt' => '',
'tags' => [
],
'thumbnailVideoId' => '',
'thumbnails' => [
'high' => [
'height' => 0,
'url' => '',
'width' => 0
],
'maxres' => [
],
'medium' => [
],
'standard' => [
]
],
'title' => ''
],
'status' => [
'privacyStatus' => ''
]
]));
$request->setRequestUrl('{{baseUrl}}/youtube/v3/playlists');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setQuery(new http\QueryString([
'part' => ''
]));
$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}}/youtube/v3/playlists?part=' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"contentDetails": {
"itemCount": 0
},
"etag": "",
"id": "",
"kind": "",
"localizations": {},
"player": {
"embedHtml": ""
},
"snippet": {
"channelId": "",
"channelTitle": "",
"defaultLanguage": "",
"description": "",
"localized": {
"description": "",
"title": ""
},
"publishedAt": "",
"tags": [],
"thumbnailVideoId": "",
"thumbnails": {
"high": {
"height": 0,
"url": "",
"width": 0
},
"maxres": {},
"medium": {},
"standard": {}
},
"title": ""
},
"status": {
"privacyStatus": ""
}
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/youtube/v3/playlists?part=' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"contentDetails": {
"itemCount": 0
},
"etag": "",
"id": "",
"kind": "",
"localizations": {},
"player": {
"embedHtml": ""
},
"snippet": {
"channelId": "",
"channelTitle": "",
"defaultLanguage": "",
"description": "",
"localized": {
"description": "",
"title": ""
},
"publishedAt": "",
"tags": [],
"thumbnailVideoId": "",
"thumbnails": {
"high": {
"height": 0,
"url": "",
"width": 0
},
"maxres": {},
"medium": {},
"standard": {}
},
"title": ""
},
"status": {
"privacyStatus": ""
}
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"contentDetails\": {\n \"itemCount\": 0\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"localizations\": {},\n \"player\": {\n \"embedHtml\": \"\"\n },\n \"snippet\": {\n \"channelId\": \"\",\n \"channelTitle\": \"\",\n \"defaultLanguage\": \"\",\n \"description\": \"\",\n \"localized\": {\n \"description\": \"\",\n \"title\": \"\"\n },\n \"publishedAt\": \"\",\n \"tags\": [],\n \"thumbnailVideoId\": \"\",\n \"thumbnails\": {\n \"high\": {\n \"height\": 0,\n \"url\": \"\",\n \"width\": 0\n },\n \"maxres\": {},\n \"medium\": {},\n \"standard\": {}\n },\n \"title\": \"\"\n },\n \"status\": {\n \"privacyStatus\": \"\"\n }\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/youtube/v3/playlists?part=", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/youtube/v3/playlists"
querystring = {"part":""}
payload = {
"contentDetails": { "itemCount": 0 },
"etag": "",
"id": "",
"kind": "",
"localizations": {},
"player": { "embedHtml": "" },
"snippet": {
"channelId": "",
"channelTitle": "",
"defaultLanguage": "",
"description": "",
"localized": {
"description": "",
"title": ""
},
"publishedAt": "",
"tags": [],
"thumbnailVideoId": "",
"thumbnails": {
"high": {
"height": 0,
"url": "",
"width": 0
},
"maxres": {},
"medium": {},
"standard": {}
},
"title": ""
},
"status": { "privacyStatus": "" }
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/youtube/v3/playlists"
queryString <- list(part = "")
payload <- "{\n \"contentDetails\": {\n \"itemCount\": 0\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"localizations\": {},\n \"player\": {\n \"embedHtml\": \"\"\n },\n \"snippet\": {\n \"channelId\": \"\",\n \"channelTitle\": \"\",\n \"defaultLanguage\": \"\",\n \"description\": \"\",\n \"localized\": {\n \"description\": \"\",\n \"title\": \"\"\n },\n \"publishedAt\": \"\",\n \"tags\": [],\n \"thumbnailVideoId\": \"\",\n \"thumbnails\": {\n \"high\": {\n \"height\": 0,\n \"url\": \"\",\n \"width\": 0\n },\n \"maxres\": {},\n \"medium\": {},\n \"standard\": {}\n },\n \"title\": \"\"\n },\n \"status\": {\n \"privacyStatus\": \"\"\n }\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, query = queryString, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/youtube/v3/playlists?part=")
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 \"contentDetails\": {\n \"itemCount\": 0\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"localizations\": {},\n \"player\": {\n \"embedHtml\": \"\"\n },\n \"snippet\": {\n \"channelId\": \"\",\n \"channelTitle\": \"\",\n \"defaultLanguage\": \"\",\n \"description\": \"\",\n \"localized\": {\n \"description\": \"\",\n \"title\": \"\"\n },\n \"publishedAt\": \"\",\n \"tags\": [],\n \"thumbnailVideoId\": \"\",\n \"thumbnails\": {\n \"high\": {\n \"height\": 0,\n \"url\": \"\",\n \"width\": 0\n },\n \"maxres\": {},\n \"medium\": {},\n \"standard\": {}\n },\n \"title\": \"\"\n },\n \"status\": {\n \"privacyStatus\": \"\"\n }\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/youtube/v3/playlists') do |req|
req.params['part'] = ''
req.body = "{\n \"contentDetails\": {\n \"itemCount\": 0\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"localizations\": {},\n \"player\": {\n \"embedHtml\": \"\"\n },\n \"snippet\": {\n \"channelId\": \"\",\n \"channelTitle\": \"\",\n \"defaultLanguage\": \"\",\n \"description\": \"\",\n \"localized\": {\n \"description\": \"\",\n \"title\": \"\"\n },\n \"publishedAt\": \"\",\n \"tags\": [],\n \"thumbnailVideoId\": \"\",\n \"thumbnails\": {\n \"high\": {\n \"height\": 0,\n \"url\": \"\",\n \"width\": 0\n },\n \"maxres\": {},\n \"medium\": {},\n \"standard\": {}\n },\n \"title\": \"\"\n },\n \"status\": {\n \"privacyStatus\": \"\"\n }\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/youtube/v3/playlists";
let querystring = [
("part", ""),
];
let payload = json!({
"contentDetails": json!({"itemCount": 0}),
"etag": "",
"id": "",
"kind": "",
"localizations": json!({}),
"player": json!({"embedHtml": ""}),
"snippet": json!({
"channelId": "",
"channelTitle": "",
"defaultLanguage": "",
"description": "",
"localized": json!({
"description": "",
"title": ""
}),
"publishedAt": "",
"tags": (),
"thumbnailVideoId": "",
"thumbnails": json!({
"high": json!({
"height": 0,
"url": "",
"width": 0
}),
"maxres": json!({}),
"medium": json!({}),
"standard": json!({})
}),
"title": ""
}),
"status": json!({"privacyStatus": ""})
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.query(&querystring)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/youtube/v3/playlists?part=' \
--header 'content-type: application/json' \
--data '{
"contentDetails": {
"itemCount": 0
},
"etag": "",
"id": "",
"kind": "",
"localizations": {},
"player": {
"embedHtml": ""
},
"snippet": {
"channelId": "",
"channelTitle": "",
"defaultLanguage": "",
"description": "",
"localized": {
"description": "",
"title": ""
},
"publishedAt": "",
"tags": [],
"thumbnailVideoId": "",
"thumbnails": {
"high": {
"height": 0,
"url": "",
"width": 0
},
"maxres": {},
"medium": {},
"standard": {}
},
"title": ""
},
"status": {
"privacyStatus": ""
}
}'
echo '{
"contentDetails": {
"itemCount": 0
},
"etag": "",
"id": "",
"kind": "",
"localizations": {},
"player": {
"embedHtml": ""
},
"snippet": {
"channelId": "",
"channelTitle": "",
"defaultLanguage": "",
"description": "",
"localized": {
"description": "",
"title": ""
},
"publishedAt": "",
"tags": [],
"thumbnailVideoId": "",
"thumbnails": {
"high": {
"height": 0,
"url": "",
"width": 0
},
"maxres": {},
"medium": {},
"standard": {}
},
"title": ""
},
"status": {
"privacyStatus": ""
}
}' | \
http POST '{{baseUrl}}/youtube/v3/playlists?part=' \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "contentDetails": {\n "itemCount": 0\n },\n "etag": "",\n "id": "",\n "kind": "",\n "localizations": {},\n "player": {\n "embedHtml": ""\n },\n "snippet": {\n "channelId": "",\n "channelTitle": "",\n "defaultLanguage": "",\n "description": "",\n "localized": {\n "description": "",\n "title": ""\n },\n "publishedAt": "",\n "tags": [],\n "thumbnailVideoId": "",\n "thumbnails": {\n "high": {\n "height": 0,\n "url": "",\n "width": 0\n },\n "maxres": {},\n "medium": {},\n "standard": {}\n },\n "title": ""\n },\n "status": {\n "privacyStatus": ""\n }\n}' \
--output-document \
- '{{baseUrl}}/youtube/v3/playlists?part='
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"contentDetails": ["itemCount": 0],
"etag": "",
"id": "",
"kind": "",
"localizations": [],
"player": ["embedHtml": ""],
"snippet": [
"channelId": "",
"channelTitle": "",
"defaultLanguage": "",
"description": "",
"localized": [
"description": "",
"title": ""
],
"publishedAt": "",
"tags": [],
"thumbnailVideoId": "",
"thumbnails": [
"high": [
"height": 0,
"url": "",
"width": 0
],
"maxres": [],
"medium": [],
"standard": []
],
"title": ""
],
"status": ["privacyStatus": ""]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/youtube/v3/playlists?part=")! 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()
GET
youtube.playlists.list
{{baseUrl}}/youtube/v3/playlists
QUERY PARAMS
part
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/youtube/v3/playlists?part=");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/youtube/v3/playlists" {:query-params {:part ""}})
require "http/client"
url = "{{baseUrl}}/youtube/v3/playlists?part="
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}}/youtube/v3/playlists?part="),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/youtube/v3/playlists?part=");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/youtube/v3/playlists?part="
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/youtube/v3/playlists?part= HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/youtube/v3/playlists?part=")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/youtube/v3/playlists?part="))
.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}}/youtube/v3/playlists?part=")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/youtube/v3/playlists?part=")
.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}}/youtube/v3/playlists?part=');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/youtube/v3/playlists',
params: {part: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/youtube/v3/playlists?part=';
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}}/youtube/v3/playlists?part=',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/youtube/v3/playlists?part=")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/youtube/v3/playlists?part=',
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}}/youtube/v3/playlists',
qs: {part: ''}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/youtube/v3/playlists');
req.query({
part: ''
});
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}}/youtube/v3/playlists',
params: {part: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/youtube/v3/playlists?part=';
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}}/youtube/v3/playlists?part="]
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}}/youtube/v3/playlists?part=" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/youtube/v3/playlists?part=",
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}}/youtube/v3/playlists?part=');
echo $response->getBody();
setUrl('{{baseUrl}}/youtube/v3/playlists');
$request->setMethod(HTTP_METH_GET);
$request->setQueryData([
'part' => ''
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/youtube/v3/playlists');
$request->setRequestMethod('GET');
$request->setQuery(new http\QueryString([
'part' => ''
]));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/youtube/v3/playlists?part=' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/youtube/v3/playlists?part=' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/youtube/v3/playlists?part=")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/youtube/v3/playlists"
querystring = {"part":""}
response = requests.get(url, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/youtube/v3/playlists"
queryString <- list(part = "")
response <- VERB("GET", url, query = queryString, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/youtube/v3/playlists?part=")
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/youtube/v3/playlists') do |req|
req.params['part'] = ''
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/youtube/v3/playlists";
let querystring = [
("part", ""),
];
let client = reqwest::Client::new();
let response = client.get(url)
.query(&querystring)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url '{{baseUrl}}/youtube/v3/playlists?part='
http GET '{{baseUrl}}/youtube/v3/playlists?part='
wget --quiet \
--method GET \
--output-document \
- '{{baseUrl}}/youtube/v3/playlists?part='
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/youtube/v3/playlists?part=")! 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()
PUT
youtube.playlists.update
{{baseUrl}}/youtube/v3/playlists
QUERY PARAMS
part
BODY json
{
"contentDetails": {
"itemCount": 0
},
"etag": "",
"id": "",
"kind": "",
"localizations": {},
"player": {
"embedHtml": ""
},
"snippet": {
"channelId": "",
"channelTitle": "",
"defaultLanguage": "",
"description": "",
"localized": {
"description": "",
"title": ""
},
"publishedAt": "",
"tags": [],
"thumbnailVideoId": "",
"thumbnails": {
"high": {
"height": 0,
"url": "",
"width": 0
},
"maxres": {},
"medium": {},
"standard": {}
},
"title": ""
},
"status": {
"privacyStatus": ""
}
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/youtube/v3/playlists?part=");
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 \"contentDetails\": {\n \"itemCount\": 0\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"localizations\": {},\n \"player\": {\n \"embedHtml\": \"\"\n },\n \"snippet\": {\n \"channelId\": \"\",\n \"channelTitle\": \"\",\n \"defaultLanguage\": \"\",\n \"description\": \"\",\n \"localized\": {\n \"description\": \"\",\n \"title\": \"\"\n },\n \"publishedAt\": \"\",\n \"tags\": [],\n \"thumbnailVideoId\": \"\",\n \"thumbnails\": {\n \"high\": {\n \"height\": 0,\n \"url\": \"\",\n \"width\": 0\n },\n \"maxres\": {},\n \"medium\": {},\n \"standard\": {}\n },\n \"title\": \"\"\n },\n \"status\": {\n \"privacyStatus\": \"\"\n }\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/youtube/v3/playlists" {:query-params {:part ""}
:content-type :json
:form-params {:contentDetails {:itemCount 0}
:etag ""
:id ""
:kind ""
:localizations {}
:player {:embedHtml ""}
:snippet {:channelId ""
:channelTitle ""
:defaultLanguage ""
:description ""
:localized {:description ""
:title ""}
:publishedAt ""
:tags []
:thumbnailVideoId ""
:thumbnails {:high {:height 0
:url ""
:width 0}
:maxres {}
:medium {}
:standard {}}
:title ""}
:status {:privacyStatus ""}}})
require "http/client"
url = "{{baseUrl}}/youtube/v3/playlists?part="
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"contentDetails\": {\n \"itemCount\": 0\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"localizations\": {},\n \"player\": {\n \"embedHtml\": \"\"\n },\n \"snippet\": {\n \"channelId\": \"\",\n \"channelTitle\": \"\",\n \"defaultLanguage\": \"\",\n \"description\": \"\",\n \"localized\": {\n \"description\": \"\",\n \"title\": \"\"\n },\n \"publishedAt\": \"\",\n \"tags\": [],\n \"thumbnailVideoId\": \"\",\n \"thumbnails\": {\n \"high\": {\n \"height\": 0,\n \"url\": \"\",\n \"width\": 0\n },\n \"maxres\": {},\n \"medium\": {},\n \"standard\": {}\n },\n \"title\": \"\"\n },\n \"status\": {\n \"privacyStatus\": \"\"\n }\n}"
response = HTTP::Client.put url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Put,
RequestUri = new Uri("{{baseUrl}}/youtube/v3/playlists?part="),
Content = new StringContent("{\n \"contentDetails\": {\n \"itemCount\": 0\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"localizations\": {},\n \"player\": {\n \"embedHtml\": \"\"\n },\n \"snippet\": {\n \"channelId\": \"\",\n \"channelTitle\": \"\",\n \"defaultLanguage\": \"\",\n \"description\": \"\",\n \"localized\": {\n \"description\": \"\",\n \"title\": \"\"\n },\n \"publishedAt\": \"\",\n \"tags\": [],\n \"thumbnailVideoId\": \"\",\n \"thumbnails\": {\n \"high\": {\n \"height\": 0,\n \"url\": \"\",\n \"width\": 0\n },\n \"maxres\": {},\n \"medium\": {},\n \"standard\": {}\n },\n \"title\": \"\"\n },\n \"status\": {\n \"privacyStatus\": \"\"\n }\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/youtube/v3/playlists?part=");
var request = new RestRequest("", Method.Put);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"contentDetails\": {\n \"itemCount\": 0\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"localizations\": {},\n \"player\": {\n \"embedHtml\": \"\"\n },\n \"snippet\": {\n \"channelId\": \"\",\n \"channelTitle\": \"\",\n \"defaultLanguage\": \"\",\n \"description\": \"\",\n \"localized\": {\n \"description\": \"\",\n \"title\": \"\"\n },\n \"publishedAt\": \"\",\n \"tags\": [],\n \"thumbnailVideoId\": \"\",\n \"thumbnails\": {\n \"high\": {\n \"height\": 0,\n \"url\": \"\",\n \"width\": 0\n },\n \"maxres\": {},\n \"medium\": {},\n \"standard\": {}\n },\n \"title\": \"\"\n },\n \"status\": {\n \"privacyStatus\": \"\"\n }\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/youtube/v3/playlists?part="
payload := strings.NewReader("{\n \"contentDetails\": {\n \"itemCount\": 0\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"localizations\": {},\n \"player\": {\n \"embedHtml\": \"\"\n },\n \"snippet\": {\n \"channelId\": \"\",\n \"channelTitle\": \"\",\n \"defaultLanguage\": \"\",\n \"description\": \"\",\n \"localized\": {\n \"description\": \"\",\n \"title\": \"\"\n },\n \"publishedAt\": \"\",\n \"tags\": [],\n \"thumbnailVideoId\": \"\",\n \"thumbnails\": {\n \"high\": {\n \"height\": 0,\n \"url\": \"\",\n \"width\": 0\n },\n \"maxres\": {},\n \"medium\": {},\n \"standard\": {}\n },\n \"title\": \"\"\n },\n \"status\": {\n \"privacyStatus\": \"\"\n }\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PUT /baseUrl/youtube/v3/playlists?part= HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 632
{
"contentDetails": {
"itemCount": 0
},
"etag": "",
"id": "",
"kind": "",
"localizations": {},
"player": {
"embedHtml": ""
},
"snippet": {
"channelId": "",
"channelTitle": "",
"defaultLanguage": "",
"description": "",
"localized": {
"description": "",
"title": ""
},
"publishedAt": "",
"tags": [],
"thumbnailVideoId": "",
"thumbnails": {
"high": {
"height": 0,
"url": "",
"width": 0
},
"maxres": {},
"medium": {},
"standard": {}
},
"title": ""
},
"status": {
"privacyStatus": ""
}
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/youtube/v3/playlists?part=")
.setHeader("content-type", "application/json")
.setBody("{\n \"contentDetails\": {\n \"itemCount\": 0\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"localizations\": {},\n \"player\": {\n \"embedHtml\": \"\"\n },\n \"snippet\": {\n \"channelId\": \"\",\n \"channelTitle\": \"\",\n \"defaultLanguage\": \"\",\n \"description\": \"\",\n \"localized\": {\n \"description\": \"\",\n \"title\": \"\"\n },\n \"publishedAt\": \"\",\n \"tags\": [],\n \"thumbnailVideoId\": \"\",\n \"thumbnails\": {\n \"high\": {\n \"height\": 0,\n \"url\": \"\",\n \"width\": 0\n },\n \"maxres\": {},\n \"medium\": {},\n \"standard\": {}\n },\n \"title\": \"\"\n },\n \"status\": {\n \"privacyStatus\": \"\"\n }\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/youtube/v3/playlists?part="))
.header("content-type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString("{\n \"contentDetails\": {\n \"itemCount\": 0\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"localizations\": {},\n \"player\": {\n \"embedHtml\": \"\"\n },\n \"snippet\": {\n \"channelId\": \"\",\n \"channelTitle\": \"\",\n \"defaultLanguage\": \"\",\n \"description\": \"\",\n \"localized\": {\n \"description\": \"\",\n \"title\": \"\"\n },\n \"publishedAt\": \"\",\n \"tags\": [],\n \"thumbnailVideoId\": \"\",\n \"thumbnails\": {\n \"high\": {\n \"height\": 0,\n \"url\": \"\",\n \"width\": 0\n },\n \"maxres\": {},\n \"medium\": {},\n \"standard\": {}\n },\n \"title\": \"\"\n },\n \"status\": {\n \"privacyStatus\": \"\"\n }\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"contentDetails\": {\n \"itemCount\": 0\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"localizations\": {},\n \"player\": {\n \"embedHtml\": \"\"\n },\n \"snippet\": {\n \"channelId\": \"\",\n \"channelTitle\": \"\",\n \"defaultLanguage\": \"\",\n \"description\": \"\",\n \"localized\": {\n \"description\": \"\",\n \"title\": \"\"\n },\n \"publishedAt\": \"\",\n \"tags\": [],\n \"thumbnailVideoId\": \"\",\n \"thumbnails\": {\n \"high\": {\n \"height\": 0,\n \"url\": \"\",\n \"width\": 0\n },\n \"maxres\": {},\n \"medium\": {},\n \"standard\": {}\n },\n \"title\": \"\"\n },\n \"status\": {\n \"privacyStatus\": \"\"\n }\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/youtube/v3/playlists?part=")
.put(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/youtube/v3/playlists?part=")
.header("content-type", "application/json")
.body("{\n \"contentDetails\": {\n \"itemCount\": 0\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"localizations\": {},\n \"player\": {\n \"embedHtml\": \"\"\n },\n \"snippet\": {\n \"channelId\": \"\",\n \"channelTitle\": \"\",\n \"defaultLanguage\": \"\",\n \"description\": \"\",\n \"localized\": {\n \"description\": \"\",\n \"title\": \"\"\n },\n \"publishedAt\": \"\",\n \"tags\": [],\n \"thumbnailVideoId\": \"\",\n \"thumbnails\": {\n \"high\": {\n \"height\": 0,\n \"url\": \"\",\n \"width\": 0\n },\n \"maxres\": {},\n \"medium\": {},\n \"standard\": {}\n },\n \"title\": \"\"\n },\n \"status\": {\n \"privacyStatus\": \"\"\n }\n}")
.asString();
const data = JSON.stringify({
contentDetails: {
itemCount: 0
},
etag: '',
id: '',
kind: '',
localizations: {},
player: {
embedHtml: ''
},
snippet: {
channelId: '',
channelTitle: '',
defaultLanguage: '',
description: '',
localized: {
description: '',
title: ''
},
publishedAt: '',
tags: [],
thumbnailVideoId: '',
thumbnails: {
high: {
height: 0,
url: '',
width: 0
},
maxres: {},
medium: {},
standard: {}
},
title: ''
},
status: {
privacyStatus: ''
}
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/youtube/v3/playlists?part=');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/youtube/v3/playlists',
params: {part: ''},
headers: {'content-type': 'application/json'},
data: {
contentDetails: {itemCount: 0},
etag: '',
id: '',
kind: '',
localizations: {},
player: {embedHtml: ''},
snippet: {
channelId: '',
channelTitle: '',
defaultLanguage: '',
description: '',
localized: {description: '', title: ''},
publishedAt: '',
tags: [],
thumbnailVideoId: '',
thumbnails: {high: {height: 0, url: '', width: 0}, maxres: {}, medium: {}, standard: {}},
title: ''
},
status: {privacyStatus: ''}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/youtube/v3/playlists?part=';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"contentDetails":{"itemCount":0},"etag":"","id":"","kind":"","localizations":{},"player":{"embedHtml":""},"snippet":{"channelId":"","channelTitle":"","defaultLanguage":"","description":"","localized":{"description":"","title":""},"publishedAt":"","tags":[],"thumbnailVideoId":"","thumbnails":{"high":{"height":0,"url":"","width":0},"maxres":{},"medium":{},"standard":{}},"title":""},"status":{"privacyStatus":""}}'
};
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}}/youtube/v3/playlists?part=',
method: 'PUT',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "contentDetails": {\n "itemCount": 0\n },\n "etag": "",\n "id": "",\n "kind": "",\n "localizations": {},\n "player": {\n "embedHtml": ""\n },\n "snippet": {\n "channelId": "",\n "channelTitle": "",\n "defaultLanguage": "",\n "description": "",\n "localized": {\n "description": "",\n "title": ""\n },\n "publishedAt": "",\n "tags": [],\n "thumbnailVideoId": "",\n "thumbnails": {\n "high": {\n "height": 0,\n "url": "",\n "width": 0\n },\n "maxres": {},\n "medium": {},\n "standard": {}\n },\n "title": ""\n },\n "status": {\n "privacyStatus": ""\n }\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"contentDetails\": {\n \"itemCount\": 0\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"localizations\": {},\n \"player\": {\n \"embedHtml\": \"\"\n },\n \"snippet\": {\n \"channelId\": \"\",\n \"channelTitle\": \"\",\n \"defaultLanguage\": \"\",\n \"description\": \"\",\n \"localized\": {\n \"description\": \"\",\n \"title\": \"\"\n },\n \"publishedAt\": \"\",\n \"tags\": [],\n \"thumbnailVideoId\": \"\",\n \"thumbnails\": {\n \"high\": {\n \"height\": 0,\n \"url\": \"\",\n \"width\": 0\n },\n \"maxres\": {},\n \"medium\": {},\n \"standard\": {}\n },\n \"title\": \"\"\n },\n \"status\": {\n \"privacyStatus\": \"\"\n }\n}")
val request = Request.Builder()
.url("{{baseUrl}}/youtube/v3/playlists?part=")
.put(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PUT',
hostname: 'example.com',
port: null,
path: '/baseUrl/youtube/v3/playlists?part=',
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({
contentDetails: {itemCount: 0},
etag: '',
id: '',
kind: '',
localizations: {},
player: {embedHtml: ''},
snippet: {
channelId: '',
channelTitle: '',
defaultLanguage: '',
description: '',
localized: {description: '', title: ''},
publishedAt: '',
tags: [],
thumbnailVideoId: '',
thumbnails: {high: {height: 0, url: '', width: 0}, maxres: {}, medium: {}, standard: {}},
title: ''
},
status: {privacyStatus: ''}
}));
req.end();
const request = require('request');
const options = {
method: 'PUT',
url: '{{baseUrl}}/youtube/v3/playlists',
qs: {part: ''},
headers: {'content-type': 'application/json'},
body: {
contentDetails: {itemCount: 0},
etag: '',
id: '',
kind: '',
localizations: {},
player: {embedHtml: ''},
snippet: {
channelId: '',
channelTitle: '',
defaultLanguage: '',
description: '',
localized: {description: '', title: ''},
publishedAt: '',
tags: [],
thumbnailVideoId: '',
thumbnails: {high: {height: 0, url: '', width: 0}, maxres: {}, medium: {}, standard: {}},
title: ''
},
status: {privacyStatus: ''}
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PUT', '{{baseUrl}}/youtube/v3/playlists');
req.query({
part: ''
});
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
contentDetails: {
itemCount: 0
},
etag: '',
id: '',
kind: '',
localizations: {},
player: {
embedHtml: ''
},
snippet: {
channelId: '',
channelTitle: '',
defaultLanguage: '',
description: '',
localized: {
description: '',
title: ''
},
publishedAt: '',
tags: [],
thumbnailVideoId: '',
thumbnails: {
high: {
height: 0,
url: '',
width: 0
},
maxres: {},
medium: {},
standard: {}
},
title: ''
},
status: {
privacyStatus: ''
}
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'PUT',
url: '{{baseUrl}}/youtube/v3/playlists',
params: {part: ''},
headers: {'content-type': 'application/json'},
data: {
contentDetails: {itemCount: 0},
etag: '',
id: '',
kind: '',
localizations: {},
player: {embedHtml: ''},
snippet: {
channelId: '',
channelTitle: '',
defaultLanguage: '',
description: '',
localized: {description: '', title: ''},
publishedAt: '',
tags: [],
thumbnailVideoId: '',
thumbnails: {high: {height: 0, url: '', width: 0}, maxres: {}, medium: {}, standard: {}},
title: ''
},
status: {privacyStatus: ''}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/youtube/v3/playlists?part=';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"contentDetails":{"itemCount":0},"etag":"","id":"","kind":"","localizations":{},"player":{"embedHtml":""},"snippet":{"channelId":"","channelTitle":"","defaultLanguage":"","description":"","localized":{"description":"","title":""},"publishedAt":"","tags":[],"thumbnailVideoId":"","thumbnails":{"high":{"height":0,"url":"","width":0},"maxres":{},"medium":{},"standard":{}},"title":""},"status":{"privacyStatus":""}}'
};
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 = @{ @"contentDetails": @{ @"itemCount": @0 },
@"etag": @"",
@"id": @"",
@"kind": @"",
@"localizations": @{ },
@"player": @{ @"embedHtml": @"" },
@"snippet": @{ @"channelId": @"", @"channelTitle": @"", @"defaultLanguage": @"", @"description": @"", @"localized": @{ @"description": @"", @"title": @"" }, @"publishedAt": @"", @"tags": @[ ], @"thumbnailVideoId": @"", @"thumbnails": @{ @"high": @{ @"height": @0, @"url": @"", @"width": @0 }, @"maxres": @{ }, @"medium": @{ }, @"standard": @{ } }, @"title": @"" },
@"status": @{ @"privacyStatus": @"" } };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/youtube/v3/playlists?part="]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PUT"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/youtube/v3/playlists?part=" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"contentDetails\": {\n \"itemCount\": 0\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"localizations\": {},\n \"player\": {\n \"embedHtml\": \"\"\n },\n \"snippet\": {\n \"channelId\": \"\",\n \"channelTitle\": \"\",\n \"defaultLanguage\": \"\",\n \"description\": \"\",\n \"localized\": {\n \"description\": \"\",\n \"title\": \"\"\n },\n \"publishedAt\": \"\",\n \"tags\": [],\n \"thumbnailVideoId\": \"\",\n \"thumbnails\": {\n \"high\": {\n \"height\": 0,\n \"url\": \"\",\n \"width\": 0\n },\n \"maxres\": {},\n \"medium\": {},\n \"standard\": {}\n },\n \"title\": \"\"\n },\n \"status\": {\n \"privacyStatus\": \"\"\n }\n}" in
Client.call ~headers ~body `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/youtube/v3/playlists?part=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'contentDetails' => [
'itemCount' => 0
],
'etag' => '',
'id' => '',
'kind' => '',
'localizations' => [
],
'player' => [
'embedHtml' => ''
],
'snippet' => [
'channelId' => '',
'channelTitle' => '',
'defaultLanguage' => '',
'description' => '',
'localized' => [
'description' => '',
'title' => ''
],
'publishedAt' => '',
'tags' => [
],
'thumbnailVideoId' => '',
'thumbnails' => [
'high' => [
'height' => 0,
'url' => '',
'width' => 0
],
'maxres' => [
],
'medium' => [
],
'standard' => [
]
],
'title' => ''
],
'status' => [
'privacyStatus' => ''
]
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('PUT', '{{baseUrl}}/youtube/v3/playlists?part=', [
'body' => '{
"contentDetails": {
"itemCount": 0
},
"etag": "",
"id": "",
"kind": "",
"localizations": {},
"player": {
"embedHtml": ""
},
"snippet": {
"channelId": "",
"channelTitle": "",
"defaultLanguage": "",
"description": "",
"localized": {
"description": "",
"title": ""
},
"publishedAt": "",
"tags": [],
"thumbnailVideoId": "",
"thumbnails": {
"high": {
"height": 0,
"url": "",
"width": 0
},
"maxres": {},
"medium": {},
"standard": {}
},
"title": ""
},
"status": {
"privacyStatus": ""
}
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/youtube/v3/playlists');
$request->setMethod(HTTP_METH_PUT);
$request->setQueryData([
'part' => ''
]);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'contentDetails' => [
'itemCount' => 0
],
'etag' => '',
'id' => '',
'kind' => '',
'localizations' => [
],
'player' => [
'embedHtml' => ''
],
'snippet' => [
'channelId' => '',
'channelTitle' => '',
'defaultLanguage' => '',
'description' => '',
'localized' => [
'description' => '',
'title' => ''
],
'publishedAt' => '',
'tags' => [
],
'thumbnailVideoId' => '',
'thumbnails' => [
'high' => [
'height' => 0,
'url' => '',
'width' => 0
],
'maxres' => [
],
'medium' => [
],
'standard' => [
]
],
'title' => ''
],
'status' => [
'privacyStatus' => ''
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'contentDetails' => [
'itemCount' => 0
],
'etag' => '',
'id' => '',
'kind' => '',
'localizations' => [
],
'player' => [
'embedHtml' => ''
],
'snippet' => [
'channelId' => '',
'channelTitle' => '',
'defaultLanguage' => '',
'description' => '',
'localized' => [
'description' => '',
'title' => ''
],
'publishedAt' => '',
'tags' => [
],
'thumbnailVideoId' => '',
'thumbnails' => [
'high' => [
'height' => 0,
'url' => '',
'width' => 0
],
'maxres' => [
],
'medium' => [
],
'standard' => [
]
],
'title' => ''
],
'status' => [
'privacyStatus' => ''
]
]));
$request->setRequestUrl('{{baseUrl}}/youtube/v3/playlists');
$request->setRequestMethod('PUT');
$request->setBody($body);
$request->setQuery(new http\QueryString([
'part' => ''
]));
$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}}/youtube/v3/playlists?part=' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"contentDetails": {
"itemCount": 0
},
"etag": "",
"id": "",
"kind": "",
"localizations": {},
"player": {
"embedHtml": ""
},
"snippet": {
"channelId": "",
"channelTitle": "",
"defaultLanguage": "",
"description": "",
"localized": {
"description": "",
"title": ""
},
"publishedAt": "",
"tags": [],
"thumbnailVideoId": "",
"thumbnails": {
"high": {
"height": 0,
"url": "",
"width": 0
},
"maxres": {},
"medium": {},
"standard": {}
},
"title": ""
},
"status": {
"privacyStatus": ""
}
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/youtube/v3/playlists?part=' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"contentDetails": {
"itemCount": 0
},
"etag": "",
"id": "",
"kind": "",
"localizations": {},
"player": {
"embedHtml": ""
},
"snippet": {
"channelId": "",
"channelTitle": "",
"defaultLanguage": "",
"description": "",
"localized": {
"description": "",
"title": ""
},
"publishedAt": "",
"tags": [],
"thumbnailVideoId": "",
"thumbnails": {
"high": {
"height": 0,
"url": "",
"width": 0
},
"maxres": {},
"medium": {},
"standard": {}
},
"title": ""
},
"status": {
"privacyStatus": ""
}
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"contentDetails\": {\n \"itemCount\": 0\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"localizations\": {},\n \"player\": {\n \"embedHtml\": \"\"\n },\n \"snippet\": {\n \"channelId\": \"\",\n \"channelTitle\": \"\",\n \"defaultLanguage\": \"\",\n \"description\": \"\",\n \"localized\": {\n \"description\": \"\",\n \"title\": \"\"\n },\n \"publishedAt\": \"\",\n \"tags\": [],\n \"thumbnailVideoId\": \"\",\n \"thumbnails\": {\n \"high\": {\n \"height\": 0,\n \"url\": \"\",\n \"width\": 0\n },\n \"maxres\": {},\n \"medium\": {},\n \"standard\": {}\n },\n \"title\": \"\"\n },\n \"status\": {\n \"privacyStatus\": \"\"\n }\n}"
headers = { 'content-type': "application/json" }
conn.request("PUT", "/baseUrl/youtube/v3/playlists?part=", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/youtube/v3/playlists"
querystring = {"part":""}
payload = {
"contentDetails": { "itemCount": 0 },
"etag": "",
"id": "",
"kind": "",
"localizations": {},
"player": { "embedHtml": "" },
"snippet": {
"channelId": "",
"channelTitle": "",
"defaultLanguage": "",
"description": "",
"localized": {
"description": "",
"title": ""
},
"publishedAt": "",
"tags": [],
"thumbnailVideoId": "",
"thumbnails": {
"high": {
"height": 0,
"url": "",
"width": 0
},
"maxres": {},
"medium": {},
"standard": {}
},
"title": ""
},
"status": { "privacyStatus": "" }
}
headers = {"content-type": "application/json"}
response = requests.put(url, json=payload, headers=headers, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/youtube/v3/playlists"
queryString <- list(part = "")
payload <- "{\n \"contentDetails\": {\n \"itemCount\": 0\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"localizations\": {},\n \"player\": {\n \"embedHtml\": \"\"\n },\n \"snippet\": {\n \"channelId\": \"\",\n \"channelTitle\": \"\",\n \"defaultLanguage\": \"\",\n \"description\": \"\",\n \"localized\": {\n \"description\": \"\",\n \"title\": \"\"\n },\n \"publishedAt\": \"\",\n \"tags\": [],\n \"thumbnailVideoId\": \"\",\n \"thumbnails\": {\n \"high\": {\n \"height\": 0,\n \"url\": \"\",\n \"width\": 0\n },\n \"maxres\": {},\n \"medium\": {},\n \"standard\": {}\n },\n \"title\": \"\"\n },\n \"status\": {\n \"privacyStatus\": \"\"\n }\n}"
encode <- "json"
response <- VERB("PUT", url, body = payload, query = queryString, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/youtube/v3/playlists?part=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"contentDetails\": {\n \"itemCount\": 0\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"localizations\": {},\n \"player\": {\n \"embedHtml\": \"\"\n },\n \"snippet\": {\n \"channelId\": \"\",\n \"channelTitle\": \"\",\n \"defaultLanguage\": \"\",\n \"description\": \"\",\n \"localized\": {\n \"description\": \"\",\n \"title\": \"\"\n },\n \"publishedAt\": \"\",\n \"tags\": [],\n \"thumbnailVideoId\": \"\",\n \"thumbnails\": {\n \"high\": {\n \"height\": 0,\n \"url\": \"\",\n \"width\": 0\n },\n \"maxres\": {},\n \"medium\": {},\n \"standard\": {}\n },\n \"title\": \"\"\n },\n \"status\": {\n \"privacyStatus\": \"\"\n }\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.put('/baseUrl/youtube/v3/playlists') do |req|
req.params['part'] = ''
req.body = "{\n \"contentDetails\": {\n \"itemCount\": 0\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"localizations\": {},\n \"player\": {\n \"embedHtml\": \"\"\n },\n \"snippet\": {\n \"channelId\": \"\",\n \"channelTitle\": \"\",\n \"defaultLanguage\": \"\",\n \"description\": \"\",\n \"localized\": {\n \"description\": \"\",\n \"title\": \"\"\n },\n \"publishedAt\": \"\",\n \"tags\": [],\n \"thumbnailVideoId\": \"\",\n \"thumbnails\": {\n \"high\": {\n \"height\": 0,\n \"url\": \"\",\n \"width\": 0\n },\n \"maxres\": {},\n \"medium\": {},\n \"standard\": {}\n },\n \"title\": \"\"\n },\n \"status\": {\n \"privacyStatus\": \"\"\n }\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}}/youtube/v3/playlists";
let querystring = [
("part", ""),
];
let payload = json!({
"contentDetails": json!({"itemCount": 0}),
"etag": "",
"id": "",
"kind": "",
"localizations": json!({}),
"player": json!({"embedHtml": ""}),
"snippet": json!({
"channelId": "",
"channelTitle": "",
"defaultLanguage": "",
"description": "",
"localized": json!({
"description": "",
"title": ""
}),
"publishedAt": "",
"tags": (),
"thumbnailVideoId": "",
"thumbnails": json!({
"high": json!({
"height": 0,
"url": "",
"width": 0
}),
"maxres": json!({}),
"medium": json!({}),
"standard": json!({})
}),
"title": ""
}),
"status": json!({"privacyStatus": ""})
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PUT").unwrap(), url)
.query(&querystring)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PUT \
--url '{{baseUrl}}/youtube/v3/playlists?part=' \
--header 'content-type: application/json' \
--data '{
"contentDetails": {
"itemCount": 0
},
"etag": "",
"id": "",
"kind": "",
"localizations": {},
"player": {
"embedHtml": ""
},
"snippet": {
"channelId": "",
"channelTitle": "",
"defaultLanguage": "",
"description": "",
"localized": {
"description": "",
"title": ""
},
"publishedAt": "",
"tags": [],
"thumbnailVideoId": "",
"thumbnails": {
"high": {
"height": 0,
"url": "",
"width": 0
},
"maxres": {},
"medium": {},
"standard": {}
},
"title": ""
},
"status": {
"privacyStatus": ""
}
}'
echo '{
"contentDetails": {
"itemCount": 0
},
"etag": "",
"id": "",
"kind": "",
"localizations": {},
"player": {
"embedHtml": ""
},
"snippet": {
"channelId": "",
"channelTitle": "",
"defaultLanguage": "",
"description": "",
"localized": {
"description": "",
"title": ""
},
"publishedAt": "",
"tags": [],
"thumbnailVideoId": "",
"thumbnails": {
"high": {
"height": 0,
"url": "",
"width": 0
},
"maxres": {},
"medium": {},
"standard": {}
},
"title": ""
},
"status": {
"privacyStatus": ""
}
}' | \
http PUT '{{baseUrl}}/youtube/v3/playlists?part=' \
content-type:application/json
wget --quiet \
--method PUT \
--header 'content-type: application/json' \
--body-data '{\n "contentDetails": {\n "itemCount": 0\n },\n "etag": "",\n "id": "",\n "kind": "",\n "localizations": {},\n "player": {\n "embedHtml": ""\n },\n "snippet": {\n "channelId": "",\n "channelTitle": "",\n "defaultLanguage": "",\n "description": "",\n "localized": {\n "description": "",\n "title": ""\n },\n "publishedAt": "",\n "tags": [],\n "thumbnailVideoId": "",\n "thumbnails": {\n "high": {\n "height": 0,\n "url": "",\n "width": 0\n },\n "maxres": {},\n "medium": {},\n "standard": {}\n },\n "title": ""\n },\n "status": {\n "privacyStatus": ""\n }\n}' \
--output-document \
- '{{baseUrl}}/youtube/v3/playlists?part='
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"contentDetails": ["itemCount": 0],
"etag": "",
"id": "",
"kind": "",
"localizations": [],
"player": ["embedHtml": ""],
"snippet": [
"channelId": "",
"channelTitle": "",
"defaultLanguage": "",
"description": "",
"localized": [
"description": "",
"title": ""
],
"publishedAt": "",
"tags": [],
"thumbnailVideoId": "",
"thumbnails": [
"high": [
"height": 0,
"url": "",
"width": 0
],
"maxres": [],
"medium": [],
"standard": []
],
"title": ""
],
"status": ["privacyStatus": ""]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/youtube/v3/playlists?part=")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
youtube.search.list
{{baseUrl}}/youtube/v3/search
QUERY PARAMS
part
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/youtube/v3/search?part=");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/youtube/v3/search" {:query-params {:part ""}})
require "http/client"
url = "{{baseUrl}}/youtube/v3/search?part="
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}}/youtube/v3/search?part="),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/youtube/v3/search?part=");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/youtube/v3/search?part="
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/youtube/v3/search?part= HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/youtube/v3/search?part=")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/youtube/v3/search?part="))
.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}}/youtube/v3/search?part=")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/youtube/v3/search?part=")
.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}}/youtube/v3/search?part=');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/youtube/v3/search',
params: {part: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/youtube/v3/search?part=';
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}}/youtube/v3/search?part=',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/youtube/v3/search?part=")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/youtube/v3/search?part=',
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}}/youtube/v3/search',
qs: {part: ''}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/youtube/v3/search');
req.query({
part: ''
});
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}}/youtube/v3/search',
params: {part: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/youtube/v3/search?part=';
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}}/youtube/v3/search?part="]
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}}/youtube/v3/search?part=" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/youtube/v3/search?part=",
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}}/youtube/v3/search?part=');
echo $response->getBody();
setUrl('{{baseUrl}}/youtube/v3/search');
$request->setMethod(HTTP_METH_GET);
$request->setQueryData([
'part' => ''
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/youtube/v3/search');
$request->setRequestMethod('GET');
$request->setQuery(new http\QueryString([
'part' => ''
]));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/youtube/v3/search?part=' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/youtube/v3/search?part=' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/youtube/v3/search?part=")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/youtube/v3/search"
querystring = {"part":""}
response = requests.get(url, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/youtube/v3/search"
queryString <- list(part = "")
response <- VERB("GET", url, query = queryString, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/youtube/v3/search?part=")
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/youtube/v3/search') do |req|
req.params['part'] = ''
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/youtube/v3/search";
let querystring = [
("part", ""),
];
let client = reqwest::Client::new();
let response = client.get(url)
.query(&querystring)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url '{{baseUrl}}/youtube/v3/search?part='
http GET '{{baseUrl}}/youtube/v3/search?part='
wget --quiet \
--method GET \
--output-document \
- '{{baseUrl}}/youtube/v3/search?part='
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/youtube/v3/search?part=")! 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()
DELETE
youtube.subscriptions.delete
{{baseUrl}}/youtube/v3/subscriptions
QUERY PARAMS
id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/youtube/v3/subscriptions?id=");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/delete "{{baseUrl}}/youtube/v3/subscriptions" {:query-params {:id ""}})
require "http/client"
url = "{{baseUrl}}/youtube/v3/subscriptions?id="
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}}/youtube/v3/subscriptions?id="),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/youtube/v3/subscriptions?id=");
var request = new RestRequest("", Method.Delete);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/youtube/v3/subscriptions?id="
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/youtube/v3/subscriptions?id= HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/youtube/v3/subscriptions?id=")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/youtube/v3/subscriptions?id="))
.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}}/youtube/v3/subscriptions?id=")
.delete(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/youtube/v3/subscriptions?id=")
.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}}/youtube/v3/subscriptions?id=');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'DELETE',
url: '{{baseUrl}}/youtube/v3/subscriptions',
params: {id: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/youtube/v3/subscriptions?id=';
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}}/youtube/v3/subscriptions?id=',
method: 'DELETE',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/youtube/v3/subscriptions?id=")
.delete(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'DELETE',
hostname: 'example.com',
port: null,
path: '/baseUrl/youtube/v3/subscriptions?id=',
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}}/youtube/v3/subscriptions',
qs: {id: ''}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('DELETE', '{{baseUrl}}/youtube/v3/subscriptions');
req.query({
id: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'DELETE',
url: '{{baseUrl}}/youtube/v3/subscriptions',
params: {id: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/youtube/v3/subscriptions?id=';
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}}/youtube/v3/subscriptions?id="]
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}}/youtube/v3/subscriptions?id=" in
Client.call `DELETE uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/youtube/v3/subscriptions?id=",
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}}/youtube/v3/subscriptions?id=');
echo $response->getBody();
setUrl('{{baseUrl}}/youtube/v3/subscriptions');
$request->setMethod(HTTP_METH_DELETE);
$request->setQueryData([
'id' => ''
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/youtube/v3/subscriptions');
$request->setRequestMethod('DELETE');
$request->setQuery(new http\QueryString([
'id' => ''
]));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/youtube/v3/subscriptions?id=' -Method DELETE
$response = Invoke-RestMethod -Uri '{{baseUrl}}/youtube/v3/subscriptions?id=' -Method DELETE
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("DELETE", "/baseUrl/youtube/v3/subscriptions?id=")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/youtube/v3/subscriptions"
querystring = {"id":""}
response = requests.delete(url, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/youtube/v3/subscriptions"
queryString <- list(id = "")
response <- VERB("DELETE", url, query = queryString, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/youtube/v3/subscriptions?id=")
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/youtube/v3/subscriptions') do |req|
req.params['id'] = ''
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/youtube/v3/subscriptions";
let querystring = [
("id", ""),
];
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("DELETE").unwrap(), url)
.query(&querystring)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request DELETE \
--url '{{baseUrl}}/youtube/v3/subscriptions?id='
http DELETE '{{baseUrl}}/youtube/v3/subscriptions?id='
wget --quiet \
--method DELETE \
--output-document \
- '{{baseUrl}}/youtube/v3/subscriptions?id='
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/youtube/v3/subscriptions?id=")! 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()
POST
youtube.subscriptions.insert
{{baseUrl}}/youtube/v3/subscriptions
QUERY PARAMS
part
BODY json
{
"contentDetails": {
"activityType": "",
"newItemCount": 0,
"totalItemCount": 0
},
"etag": "",
"id": "",
"kind": "",
"snippet": {
"channelId": "",
"channelTitle": "",
"description": "",
"publishedAt": "",
"resourceId": {
"channelId": "",
"kind": "",
"playlistId": "",
"videoId": ""
},
"thumbnails": {
"high": {
"height": 0,
"url": "",
"width": 0
},
"maxres": {},
"medium": {},
"standard": {}
},
"title": ""
},
"subscriberSnippet": {
"channelId": "",
"description": "",
"thumbnails": {},
"title": ""
}
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/youtube/v3/subscriptions?part=");
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 \"contentDetails\": {\n \"activityType\": \"\",\n \"newItemCount\": 0,\n \"totalItemCount\": 0\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"channelId\": \"\",\n \"channelTitle\": \"\",\n \"description\": \"\",\n \"publishedAt\": \"\",\n \"resourceId\": {\n \"channelId\": \"\",\n \"kind\": \"\",\n \"playlistId\": \"\",\n \"videoId\": \"\"\n },\n \"thumbnails\": {\n \"high\": {\n \"height\": 0,\n \"url\": \"\",\n \"width\": 0\n },\n \"maxres\": {},\n \"medium\": {},\n \"standard\": {}\n },\n \"title\": \"\"\n },\n \"subscriberSnippet\": {\n \"channelId\": \"\",\n \"description\": \"\",\n \"thumbnails\": {},\n \"title\": \"\"\n }\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/youtube/v3/subscriptions" {:query-params {:part ""}
:content-type :json
:form-params {:contentDetails {:activityType ""
:newItemCount 0
:totalItemCount 0}
:etag ""
:id ""
:kind ""
:snippet {:channelId ""
:channelTitle ""
:description ""
:publishedAt ""
:resourceId {:channelId ""
:kind ""
:playlistId ""
:videoId ""}
:thumbnails {:high {:height 0
:url ""
:width 0}
:maxres {}
:medium {}
:standard {}}
:title ""}
:subscriberSnippet {:channelId ""
:description ""
:thumbnails {}
:title ""}}})
require "http/client"
url = "{{baseUrl}}/youtube/v3/subscriptions?part="
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"contentDetails\": {\n \"activityType\": \"\",\n \"newItemCount\": 0,\n \"totalItemCount\": 0\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"channelId\": \"\",\n \"channelTitle\": \"\",\n \"description\": \"\",\n \"publishedAt\": \"\",\n \"resourceId\": {\n \"channelId\": \"\",\n \"kind\": \"\",\n \"playlistId\": \"\",\n \"videoId\": \"\"\n },\n \"thumbnails\": {\n \"high\": {\n \"height\": 0,\n \"url\": \"\",\n \"width\": 0\n },\n \"maxres\": {},\n \"medium\": {},\n \"standard\": {}\n },\n \"title\": \"\"\n },\n \"subscriberSnippet\": {\n \"channelId\": \"\",\n \"description\": \"\",\n \"thumbnails\": {},\n \"title\": \"\"\n }\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/youtube/v3/subscriptions?part="),
Content = new StringContent("{\n \"contentDetails\": {\n \"activityType\": \"\",\n \"newItemCount\": 0,\n \"totalItemCount\": 0\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"channelId\": \"\",\n \"channelTitle\": \"\",\n \"description\": \"\",\n \"publishedAt\": \"\",\n \"resourceId\": {\n \"channelId\": \"\",\n \"kind\": \"\",\n \"playlistId\": \"\",\n \"videoId\": \"\"\n },\n \"thumbnails\": {\n \"high\": {\n \"height\": 0,\n \"url\": \"\",\n \"width\": 0\n },\n \"maxres\": {},\n \"medium\": {},\n \"standard\": {}\n },\n \"title\": \"\"\n },\n \"subscriberSnippet\": {\n \"channelId\": \"\",\n \"description\": \"\",\n \"thumbnails\": {},\n \"title\": \"\"\n }\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/youtube/v3/subscriptions?part=");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"contentDetails\": {\n \"activityType\": \"\",\n \"newItemCount\": 0,\n \"totalItemCount\": 0\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"channelId\": \"\",\n \"channelTitle\": \"\",\n \"description\": \"\",\n \"publishedAt\": \"\",\n \"resourceId\": {\n \"channelId\": \"\",\n \"kind\": \"\",\n \"playlistId\": \"\",\n \"videoId\": \"\"\n },\n \"thumbnails\": {\n \"high\": {\n \"height\": 0,\n \"url\": \"\",\n \"width\": 0\n },\n \"maxres\": {},\n \"medium\": {},\n \"standard\": {}\n },\n \"title\": \"\"\n },\n \"subscriberSnippet\": {\n \"channelId\": \"\",\n \"description\": \"\",\n \"thumbnails\": {},\n \"title\": \"\"\n }\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/youtube/v3/subscriptions?part="
payload := strings.NewReader("{\n \"contentDetails\": {\n \"activityType\": \"\",\n \"newItemCount\": 0,\n \"totalItemCount\": 0\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"channelId\": \"\",\n \"channelTitle\": \"\",\n \"description\": \"\",\n \"publishedAt\": \"\",\n \"resourceId\": {\n \"channelId\": \"\",\n \"kind\": \"\",\n \"playlistId\": \"\",\n \"videoId\": \"\"\n },\n \"thumbnails\": {\n \"high\": {\n \"height\": 0,\n \"url\": \"\",\n \"width\": 0\n },\n \"maxres\": {},\n \"medium\": {},\n \"standard\": {}\n },\n \"title\": \"\"\n },\n \"subscriberSnippet\": {\n \"channelId\": \"\",\n \"description\": \"\",\n \"thumbnails\": {},\n \"title\": \"\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/youtube/v3/subscriptions?part= HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 663
{
"contentDetails": {
"activityType": "",
"newItemCount": 0,
"totalItemCount": 0
},
"etag": "",
"id": "",
"kind": "",
"snippet": {
"channelId": "",
"channelTitle": "",
"description": "",
"publishedAt": "",
"resourceId": {
"channelId": "",
"kind": "",
"playlistId": "",
"videoId": ""
},
"thumbnails": {
"high": {
"height": 0,
"url": "",
"width": 0
},
"maxres": {},
"medium": {},
"standard": {}
},
"title": ""
},
"subscriberSnippet": {
"channelId": "",
"description": "",
"thumbnails": {},
"title": ""
}
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/youtube/v3/subscriptions?part=")
.setHeader("content-type", "application/json")
.setBody("{\n \"contentDetails\": {\n \"activityType\": \"\",\n \"newItemCount\": 0,\n \"totalItemCount\": 0\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"channelId\": \"\",\n \"channelTitle\": \"\",\n \"description\": \"\",\n \"publishedAt\": \"\",\n \"resourceId\": {\n \"channelId\": \"\",\n \"kind\": \"\",\n \"playlistId\": \"\",\n \"videoId\": \"\"\n },\n \"thumbnails\": {\n \"high\": {\n \"height\": 0,\n \"url\": \"\",\n \"width\": 0\n },\n \"maxres\": {},\n \"medium\": {},\n \"standard\": {}\n },\n \"title\": \"\"\n },\n \"subscriberSnippet\": {\n \"channelId\": \"\",\n \"description\": \"\",\n \"thumbnails\": {},\n \"title\": \"\"\n }\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/youtube/v3/subscriptions?part="))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"contentDetails\": {\n \"activityType\": \"\",\n \"newItemCount\": 0,\n \"totalItemCount\": 0\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"channelId\": \"\",\n \"channelTitle\": \"\",\n \"description\": \"\",\n \"publishedAt\": \"\",\n \"resourceId\": {\n \"channelId\": \"\",\n \"kind\": \"\",\n \"playlistId\": \"\",\n \"videoId\": \"\"\n },\n \"thumbnails\": {\n \"high\": {\n \"height\": 0,\n \"url\": \"\",\n \"width\": 0\n },\n \"maxres\": {},\n \"medium\": {},\n \"standard\": {}\n },\n \"title\": \"\"\n },\n \"subscriberSnippet\": {\n \"channelId\": \"\",\n \"description\": \"\",\n \"thumbnails\": {},\n \"title\": \"\"\n }\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"contentDetails\": {\n \"activityType\": \"\",\n \"newItemCount\": 0,\n \"totalItemCount\": 0\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"channelId\": \"\",\n \"channelTitle\": \"\",\n \"description\": \"\",\n \"publishedAt\": \"\",\n \"resourceId\": {\n \"channelId\": \"\",\n \"kind\": \"\",\n \"playlistId\": \"\",\n \"videoId\": \"\"\n },\n \"thumbnails\": {\n \"high\": {\n \"height\": 0,\n \"url\": \"\",\n \"width\": 0\n },\n \"maxres\": {},\n \"medium\": {},\n \"standard\": {}\n },\n \"title\": \"\"\n },\n \"subscriberSnippet\": {\n \"channelId\": \"\",\n \"description\": \"\",\n \"thumbnails\": {},\n \"title\": \"\"\n }\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/youtube/v3/subscriptions?part=")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/youtube/v3/subscriptions?part=")
.header("content-type", "application/json")
.body("{\n \"contentDetails\": {\n \"activityType\": \"\",\n \"newItemCount\": 0,\n \"totalItemCount\": 0\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"channelId\": \"\",\n \"channelTitle\": \"\",\n \"description\": \"\",\n \"publishedAt\": \"\",\n \"resourceId\": {\n \"channelId\": \"\",\n \"kind\": \"\",\n \"playlistId\": \"\",\n \"videoId\": \"\"\n },\n \"thumbnails\": {\n \"high\": {\n \"height\": 0,\n \"url\": \"\",\n \"width\": 0\n },\n \"maxres\": {},\n \"medium\": {},\n \"standard\": {}\n },\n \"title\": \"\"\n },\n \"subscriberSnippet\": {\n \"channelId\": \"\",\n \"description\": \"\",\n \"thumbnails\": {},\n \"title\": \"\"\n }\n}")
.asString();
const data = JSON.stringify({
contentDetails: {
activityType: '',
newItemCount: 0,
totalItemCount: 0
},
etag: '',
id: '',
kind: '',
snippet: {
channelId: '',
channelTitle: '',
description: '',
publishedAt: '',
resourceId: {
channelId: '',
kind: '',
playlistId: '',
videoId: ''
},
thumbnails: {
high: {
height: 0,
url: '',
width: 0
},
maxres: {},
medium: {},
standard: {}
},
title: ''
},
subscriberSnippet: {
channelId: '',
description: '',
thumbnails: {},
title: ''
}
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/youtube/v3/subscriptions?part=');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/youtube/v3/subscriptions',
params: {part: ''},
headers: {'content-type': 'application/json'},
data: {
contentDetails: {activityType: '', newItemCount: 0, totalItemCount: 0},
etag: '',
id: '',
kind: '',
snippet: {
channelId: '',
channelTitle: '',
description: '',
publishedAt: '',
resourceId: {channelId: '', kind: '', playlistId: '', videoId: ''},
thumbnails: {high: {height: 0, url: '', width: 0}, maxres: {}, medium: {}, standard: {}},
title: ''
},
subscriberSnippet: {channelId: '', description: '', thumbnails: {}, title: ''}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/youtube/v3/subscriptions?part=';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"contentDetails":{"activityType":"","newItemCount":0,"totalItemCount":0},"etag":"","id":"","kind":"","snippet":{"channelId":"","channelTitle":"","description":"","publishedAt":"","resourceId":{"channelId":"","kind":"","playlistId":"","videoId":""},"thumbnails":{"high":{"height":0,"url":"","width":0},"maxres":{},"medium":{},"standard":{}},"title":""},"subscriberSnippet":{"channelId":"","description":"","thumbnails":{},"title":""}}'
};
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}}/youtube/v3/subscriptions?part=',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "contentDetails": {\n "activityType": "",\n "newItemCount": 0,\n "totalItemCount": 0\n },\n "etag": "",\n "id": "",\n "kind": "",\n "snippet": {\n "channelId": "",\n "channelTitle": "",\n "description": "",\n "publishedAt": "",\n "resourceId": {\n "channelId": "",\n "kind": "",\n "playlistId": "",\n "videoId": ""\n },\n "thumbnails": {\n "high": {\n "height": 0,\n "url": "",\n "width": 0\n },\n "maxres": {},\n "medium": {},\n "standard": {}\n },\n "title": ""\n },\n "subscriberSnippet": {\n "channelId": "",\n "description": "",\n "thumbnails": {},\n "title": ""\n }\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"contentDetails\": {\n \"activityType\": \"\",\n \"newItemCount\": 0,\n \"totalItemCount\": 0\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"channelId\": \"\",\n \"channelTitle\": \"\",\n \"description\": \"\",\n \"publishedAt\": \"\",\n \"resourceId\": {\n \"channelId\": \"\",\n \"kind\": \"\",\n \"playlistId\": \"\",\n \"videoId\": \"\"\n },\n \"thumbnails\": {\n \"high\": {\n \"height\": 0,\n \"url\": \"\",\n \"width\": 0\n },\n \"maxres\": {},\n \"medium\": {},\n \"standard\": {}\n },\n \"title\": \"\"\n },\n \"subscriberSnippet\": {\n \"channelId\": \"\",\n \"description\": \"\",\n \"thumbnails\": {},\n \"title\": \"\"\n }\n}")
val request = Request.Builder()
.url("{{baseUrl}}/youtube/v3/subscriptions?part=")
.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/youtube/v3/subscriptions?part=',
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({
contentDetails: {activityType: '', newItemCount: 0, totalItemCount: 0},
etag: '',
id: '',
kind: '',
snippet: {
channelId: '',
channelTitle: '',
description: '',
publishedAt: '',
resourceId: {channelId: '', kind: '', playlistId: '', videoId: ''},
thumbnails: {high: {height: 0, url: '', width: 0}, maxres: {}, medium: {}, standard: {}},
title: ''
},
subscriberSnippet: {channelId: '', description: '', thumbnails: {}, title: ''}
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/youtube/v3/subscriptions',
qs: {part: ''},
headers: {'content-type': 'application/json'},
body: {
contentDetails: {activityType: '', newItemCount: 0, totalItemCount: 0},
etag: '',
id: '',
kind: '',
snippet: {
channelId: '',
channelTitle: '',
description: '',
publishedAt: '',
resourceId: {channelId: '', kind: '', playlistId: '', videoId: ''},
thumbnails: {high: {height: 0, url: '', width: 0}, maxres: {}, medium: {}, standard: {}},
title: ''
},
subscriberSnippet: {channelId: '', description: '', thumbnails: {}, title: ''}
},
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}}/youtube/v3/subscriptions');
req.query({
part: ''
});
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
contentDetails: {
activityType: '',
newItemCount: 0,
totalItemCount: 0
},
etag: '',
id: '',
kind: '',
snippet: {
channelId: '',
channelTitle: '',
description: '',
publishedAt: '',
resourceId: {
channelId: '',
kind: '',
playlistId: '',
videoId: ''
},
thumbnails: {
high: {
height: 0,
url: '',
width: 0
},
maxres: {},
medium: {},
standard: {}
},
title: ''
},
subscriberSnippet: {
channelId: '',
description: '',
thumbnails: {},
title: ''
}
});
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}}/youtube/v3/subscriptions',
params: {part: ''},
headers: {'content-type': 'application/json'},
data: {
contentDetails: {activityType: '', newItemCount: 0, totalItemCount: 0},
etag: '',
id: '',
kind: '',
snippet: {
channelId: '',
channelTitle: '',
description: '',
publishedAt: '',
resourceId: {channelId: '', kind: '', playlistId: '', videoId: ''},
thumbnails: {high: {height: 0, url: '', width: 0}, maxres: {}, medium: {}, standard: {}},
title: ''
},
subscriberSnippet: {channelId: '', description: '', thumbnails: {}, title: ''}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/youtube/v3/subscriptions?part=';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"contentDetails":{"activityType":"","newItemCount":0,"totalItemCount":0},"etag":"","id":"","kind":"","snippet":{"channelId":"","channelTitle":"","description":"","publishedAt":"","resourceId":{"channelId":"","kind":"","playlistId":"","videoId":""},"thumbnails":{"high":{"height":0,"url":"","width":0},"maxres":{},"medium":{},"standard":{}},"title":""},"subscriberSnippet":{"channelId":"","description":"","thumbnails":{},"title":""}}'
};
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 = @{ @"contentDetails": @{ @"activityType": @"", @"newItemCount": @0, @"totalItemCount": @0 },
@"etag": @"",
@"id": @"",
@"kind": @"",
@"snippet": @{ @"channelId": @"", @"channelTitle": @"", @"description": @"", @"publishedAt": @"", @"resourceId": @{ @"channelId": @"", @"kind": @"", @"playlistId": @"", @"videoId": @"" }, @"thumbnails": @{ @"high": @{ @"height": @0, @"url": @"", @"width": @0 }, @"maxres": @{ }, @"medium": @{ }, @"standard": @{ } }, @"title": @"" },
@"subscriberSnippet": @{ @"channelId": @"", @"description": @"", @"thumbnails": @{ }, @"title": @"" } };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/youtube/v3/subscriptions?part="]
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}}/youtube/v3/subscriptions?part=" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"contentDetails\": {\n \"activityType\": \"\",\n \"newItemCount\": 0,\n \"totalItemCount\": 0\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"channelId\": \"\",\n \"channelTitle\": \"\",\n \"description\": \"\",\n \"publishedAt\": \"\",\n \"resourceId\": {\n \"channelId\": \"\",\n \"kind\": \"\",\n \"playlistId\": \"\",\n \"videoId\": \"\"\n },\n \"thumbnails\": {\n \"high\": {\n \"height\": 0,\n \"url\": \"\",\n \"width\": 0\n },\n \"maxres\": {},\n \"medium\": {},\n \"standard\": {}\n },\n \"title\": \"\"\n },\n \"subscriberSnippet\": {\n \"channelId\": \"\",\n \"description\": \"\",\n \"thumbnails\": {},\n \"title\": \"\"\n }\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/youtube/v3/subscriptions?part=",
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([
'contentDetails' => [
'activityType' => '',
'newItemCount' => 0,
'totalItemCount' => 0
],
'etag' => '',
'id' => '',
'kind' => '',
'snippet' => [
'channelId' => '',
'channelTitle' => '',
'description' => '',
'publishedAt' => '',
'resourceId' => [
'channelId' => '',
'kind' => '',
'playlistId' => '',
'videoId' => ''
],
'thumbnails' => [
'high' => [
'height' => 0,
'url' => '',
'width' => 0
],
'maxres' => [
],
'medium' => [
],
'standard' => [
]
],
'title' => ''
],
'subscriberSnippet' => [
'channelId' => '',
'description' => '',
'thumbnails' => [
],
'title' => ''
]
]),
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}}/youtube/v3/subscriptions?part=', [
'body' => '{
"contentDetails": {
"activityType": "",
"newItemCount": 0,
"totalItemCount": 0
},
"etag": "",
"id": "",
"kind": "",
"snippet": {
"channelId": "",
"channelTitle": "",
"description": "",
"publishedAt": "",
"resourceId": {
"channelId": "",
"kind": "",
"playlistId": "",
"videoId": ""
},
"thumbnails": {
"high": {
"height": 0,
"url": "",
"width": 0
},
"maxres": {},
"medium": {},
"standard": {}
},
"title": ""
},
"subscriberSnippet": {
"channelId": "",
"description": "",
"thumbnails": {},
"title": ""
}
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/youtube/v3/subscriptions');
$request->setMethod(HTTP_METH_POST);
$request->setQueryData([
'part' => ''
]);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'contentDetails' => [
'activityType' => '',
'newItemCount' => 0,
'totalItemCount' => 0
],
'etag' => '',
'id' => '',
'kind' => '',
'snippet' => [
'channelId' => '',
'channelTitle' => '',
'description' => '',
'publishedAt' => '',
'resourceId' => [
'channelId' => '',
'kind' => '',
'playlistId' => '',
'videoId' => ''
],
'thumbnails' => [
'high' => [
'height' => 0,
'url' => '',
'width' => 0
],
'maxres' => [
],
'medium' => [
],
'standard' => [
]
],
'title' => ''
],
'subscriberSnippet' => [
'channelId' => '',
'description' => '',
'thumbnails' => [
],
'title' => ''
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'contentDetails' => [
'activityType' => '',
'newItemCount' => 0,
'totalItemCount' => 0
],
'etag' => '',
'id' => '',
'kind' => '',
'snippet' => [
'channelId' => '',
'channelTitle' => '',
'description' => '',
'publishedAt' => '',
'resourceId' => [
'channelId' => '',
'kind' => '',
'playlistId' => '',
'videoId' => ''
],
'thumbnails' => [
'high' => [
'height' => 0,
'url' => '',
'width' => 0
],
'maxres' => [
],
'medium' => [
],
'standard' => [
]
],
'title' => ''
],
'subscriberSnippet' => [
'channelId' => '',
'description' => '',
'thumbnails' => [
],
'title' => ''
]
]));
$request->setRequestUrl('{{baseUrl}}/youtube/v3/subscriptions');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setQuery(new http\QueryString([
'part' => ''
]));
$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}}/youtube/v3/subscriptions?part=' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"contentDetails": {
"activityType": "",
"newItemCount": 0,
"totalItemCount": 0
},
"etag": "",
"id": "",
"kind": "",
"snippet": {
"channelId": "",
"channelTitle": "",
"description": "",
"publishedAt": "",
"resourceId": {
"channelId": "",
"kind": "",
"playlistId": "",
"videoId": ""
},
"thumbnails": {
"high": {
"height": 0,
"url": "",
"width": 0
},
"maxres": {},
"medium": {},
"standard": {}
},
"title": ""
},
"subscriberSnippet": {
"channelId": "",
"description": "",
"thumbnails": {},
"title": ""
}
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/youtube/v3/subscriptions?part=' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"contentDetails": {
"activityType": "",
"newItemCount": 0,
"totalItemCount": 0
},
"etag": "",
"id": "",
"kind": "",
"snippet": {
"channelId": "",
"channelTitle": "",
"description": "",
"publishedAt": "",
"resourceId": {
"channelId": "",
"kind": "",
"playlistId": "",
"videoId": ""
},
"thumbnails": {
"high": {
"height": 0,
"url": "",
"width": 0
},
"maxres": {},
"medium": {},
"standard": {}
},
"title": ""
},
"subscriberSnippet": {
"channelId": "",
"description": "",
"thumbnails": {},
"title": ""
}
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"contentDetails\": {\n \"activityType\": \"\",\n \"newItemCount\": 0,\n \"totalItemCount\": 0\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"channelId\": \"\",\n \"channelTitle\": \"\",\n \"description\": \"\",\n \"publishedAt\": \"\",\n \"resourceId\": {\n \"channelId\": \"\",\n \"kind\": \"\",\n \"playlistId\": \"\",\n \"videoId\": \"\"\n },\n \"thumbnails\": {\n \"high\": {\n \"height\": 0,\n \"url\": \"\",\n \"width\": 0\n },\n \"maxres\": {},\n \"medium\": {},\n \"standard\": {}\n },\n \"title\": \"\"\n },\n \"subscriberSnippet\": {\n \"channelId\": \"\",\n \"description\": \"\",\n \"thumbnails\": {},\n \"title\": \"\"\n }\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/youtube/v3/subscriptions?part=", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/youtube/v3/subscriptions"
querystring = {"part":""}
payload = {
"contentDetails": {
"activityType": "",
"newItemCount": 0,
"totalItemCount": 0
},
"etag": "",
"id": "",
"kind": "",
"snippet": {
"channelId": "",
"channelTitle": "",
"description": "",
"publishedAt": "",
"resourceId": {
"channelId": "",
"kind": "",
"playlistId": "",
"videoId": ""
},
"thumbnails": {
"high": {
"height": 0,
"url": "",
"width": 0
},
"maxres": {},
"medium": {},
"standard": {}
},
"title": ""
},
"subscriberSnippet": {
"channelId": "",
"description": "",
"thumbnails": {},
"title": ""
}
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/youtube/v3/subscriptions"
queryString <- list(part = "")
payload <- "{\n \"contentDetails\": {\n \"activityType\": \"\",\n \"newItemCount\": 0,\n \"totalItemCount\": 0\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"channelId\": \"\",\n \"channelTitle\": \"\",\n \"description\": \"\",\n \"publishedAt\": \"\",\n \"resourceId\": {\n \"channelId\": \"\",\n \"kind\": \"\",\n \"playlistId\": \"\",\n \"videoId\": \"\"\n },\n \"thumbnails\": {\n \"high\": {\n \"height\": 0,\n \"url\": \"\",\n \"width\": 0\n },\n \"maxres\": {},\n \"medium\": {},\n \"standard\": {}\n },\n \"title\": \"\"\n },\n \"subscriberSnippet\": {\n \"channelId\": \"\",\n \"description\": \"\",\n \"thumbnails\": {},\n \"title\": \"\"\n }\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, query = queryString, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/youtube/v3/subscriptions?part=")
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 \"contentDetails\": {\n \"activityType\": \"\",\n \"newItemCount\": 0,\n \"totalItemCount\": 0\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"channelId\": \"\",\n \"channelTitle\": \"\",\n \"description\": \"\",\n \"publishedAt\": \"\",\n \"resourceId\": {\n \"channelId\": \"\",\n \"kind\": \"\",\n \"playlistId\": \"\",\n \"videoId\": \"\"\n },\n \"thumbnails\": {\n \"high\": {\n \"height\": 0,\n \"url\": \"\",\n \"width\": 0\n },\n \"maxres\": {},\n \"medium\": {},\n \"standard\": {}\n },\n \"title\": \"\"\n },\n \"subscriberSnippet\": {\n \"channelId\": \"\",\n \"description\": \"\",\n \"thumbnails\": {},\n \"title\": \"\"\n }\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/youtube/v3/subscriptions') do |req|
req.params['part'] = ''
req.body = "{\n \"contentDetails\": {\n \"activityType\": \"\",\n \"newItemCount\": 0,\n \"totalItemCount\": 0\n },\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"channelId\": \"\",\n \"channelTitle\": \"\",\n \"description\": \"\",\n \"publishedAt\": \"\",\n \"resourceId\": {\n \"channelId\": \"\",\n \"kind\": \"\",\n \"playlistId\": \"\",\n \"videoId\": \"\"\n },\n \"thumbnails\": {\n \"high\": {\n \"height\": 0,\n \"url\": \"\",\n \"width\": 0\n },\n \"maxres\": {},\n \"medium\": {},\n \"standard\": {}\n },\n \"title\": \"\"\n },\n \"subscriberSnippet\": {\n \"channelId\": \"\",\n \"description\": \"\",\n \"thumbnails\": {},\n \"title\": \"\"\n }\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/youtube/v3/subscriptions";
let querystring = [
("part", ""),
];
let payload = json!({
"contentDetails": json!({
"activityType": "",
"newItemCount": 0,
"totalItemCount": 0
}),
"etag": "",
"id": "",
"kind": "",
"snippet": json!({
"channelId": "",
"channelTitle": "",
"description": "",
"publishedAt": "",
"resourceId": json!({
"channelId": "",
"kind": "",
"playlistId": "",
"videoId": ""
}),
"thumbnails": json!({
"high": json!({
"height": 0,
"url": "",
"width": 0
}),
"maxres": json!({}),
"medium": json!({}),
"standard": json!({})
}),
"title": ""
}),
"subscriberSnippet": json!({
"channelId": "",
"description": "",
"thumbnails": json!({}),
"title": ""
})
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.query(&querystring)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/youtube/v3/subscriptions?part=' \
--header 'content-type: application/json' \
--data '{
"contentDetails": {
"activityType": "",
"newItemCount": 0,
"totalItemCount": 0
},
"etag": "",
"id": "",
"kind": "",
"snippet": {
"channelId": "",
"channelTitle": "",
"description": "",
"publishedAt": "",
"resourceId": {
"channelId": "",
"kind": "",
"playlistId": "",
"videoId": ""
},
"thumbnails": {
"high": {
"height": 0,
"url": "",
"width": 0
},
"maxres": {},
"medium": {},
"standard": {}
},
"title": ""
},
"subscriberSnippet": {
"channelId": "",
"description": "",
"thumbnails": {},
"title": ""
}
}'
echo '{
"contentDetails": {
"activityType": "",
"newItemCount": 0,
"totalItemCount": 0
},
"etag": "",
"id": "",
"kind": "",
"snippet": {
"channelId": "",
"channelTitle": "",
"description": "",
"publishedAt": "",
"resourceId": {
"channelId": "",
"kind": "",
"playlistId": "",
"videoId": ""
},
"thumbnails": {
"high": {
"height": 0,
"url": "",
"width": 0
},
"maxres": {},
"medium": {},
"standard": {}
},
"title": ""
},
"subscriberSnippet": {
"channelId": "",
"description": "",
"thumbnails": {},
"title": ""
}
}' | \
http POST '{{baseUrl}}/youtube/v3/subscriptions?part=' \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "contentDetails": {\n "activityType": "",\n "newItemCount": 0,\n "totalItemCount": 0\n },\n "etag": "",\n "id": "",\n "kind": "",\n "snippet": {\n "channelId": "",\n "channelTitle": "",\n "description": "",\n "publishedAt": "",\n "resourceId": {\n "channelId": "",\n "kind": "",\n "playlistId": "",\n "videoId": ""\n },\n "thumbnails": {\n "high": {\n "height": 0,\n "url": "",\n "width": 0\n },\n "maxres": {},\n "medium": {},\n "standard": {}\n },\n "title": ""\n },\n "subscriberSnippet": {\n "channelId": "",\n "description": "",\n "thumbnails": {},\n "title": ""\n }\n}' \
--output-document \
- '{{baseUrl}}/youtube/v3/subscriptions?part='
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"contentDetails": [
"activityType": "",
"newItemCount": 0,
"totalItemCount": 0
],
"etag": "",
"id": "",
"kind": "",
"snippet": [
"channelId": "",
"channelTitle": "",
"description": "",
"publishedAt": "",
"resourceId": [
"channelId": "",
"kind": "",
"playlistId": "",
"videoId": ""
],
"thumbnails": [
"high": [
"height": 0,
"url": "",
"width": 0
],
"maxres": [],
"medium": [],
"standard": []
],
"title": ""
],
"subscriberSnippet": [
"channelId": "",
"description": "",
"thumbnails": [],
"title": ""
]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/youtube/v3/subscriptions?part=")! 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()
GET
youtube.subscriptions.list
{{baseUrl}}/youtube/v3/subscriptions
QUERY PARAMS
part
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/youtube/v3/subscriptions?part=");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/youtube/v3/subscriptions" {:query-params {:part ""}})
require "http/client"
url = "{{baseUrl}}/youtube/v3/subscriptions?part="
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}}/youtube/v3/subscriptions?part="),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/youtube/v3/subscriptions?part=");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/youtube/v3/subscriptions?part="
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/youtube/v3/subscriptions?part= HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/youtube/v3/subscriptions?part=")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/youtube/v3/subscriptions?part="))
.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}}/youtube/v3/subscriptions?part=")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/youtube/v3/subscriptions?part=")
.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}}/youtube/v3/subscriptions?part=');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/youtube/v3/subscriptions',
params: {part: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/youtube/v3/subscriptions?part=';
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}}/youtube/v3/subscriptions?part=',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/youtube/v3/subscriptions?part=")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/youtube/v3/subscriptions?part=',
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}}/youtube/v3/subscriptions',
qs: {part: ''}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/youtube/v3/subscriptions');
req.query({
part: ''
});
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}}/youtube/v3/subscriptions',
params: {part: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/youtube/v3/subscriptions?part=';
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}}/youtube/v3/subscriptions?part="]
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}}/youtube/v3/subscriptions?part=" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/youtube/v3/subscriptions?part=",
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}}/youtube/v3/subscriptions?part=');
echo $response->getBody();
setUrl('{{baseUrl}}/youtube/v3/subscriptions');
$request->setMethod(HTTP_METH_GET);
$request->setQueryData([
'part' => ''
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/youtube/v3/subscriptions');
$request->setRequestMethod('GET');
$request->setQuery(new http\QueryString([
'part' => ''
]));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/youtube/v3/subscriptions?part=' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/youtube/v3/subscriptions?part=' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/youtube/v3/subscriptions?part=")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/youtube/v3/subscriptions"
querystring = {"part":""}
response = requests.get(url, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/youtube/v3/subscriptions"
queryString <- list(part = "")
response <- VERB("GET", url, query = queryString, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/youtube/v3/subscriptions?part=")
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/youtube/v3/subscriptions') do |req|
req.params['part'] = ''
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/youtube/v3/subscriptions";
let querystring = [
("part", ""),
];
let client = reqwest::Client::new();
let response = client.get(url)
.query(&querystring)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url '{{baseUrl}}/youtube/v3/subscriptions?part='
http GET '{{baseUrl}}/youtube/v3/subscriptions?part='
wget --quiet \
--method GET \
--output-document \
- '{{baseUrl}}/youtube/v3/subscriptions?part='
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/youtube/v3/subscriptions?part=")! 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
youtube.superChatEvents.list
{{baseUrl}}/youtube/v3/superChatEvents
QUERY PARAMS
part
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/youtube/v3/superChatEvents?part=");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/youtube/v3/superChatEvents" {:query-params {:part ""}})
require "http/client"
url = "{{baseUrl}}/youtube/v3/superChatEvents?part="
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}}/youtube/v3/superChatEvents?part="),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/youtube/v3/superChatEvents?part=");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/youtube/v3/superChatEvents?part="
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/youtube/v3/superChatEvents?part= HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/youtube/v3/superChatEvents?part=")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/youtube/v3/superChatEvents?part="))
.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}}/youtube/v3/superChatEvents?part=")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/youtube/v3/superChatEvents?part=")
.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}}/youtube/v3/superChatEvents?part=');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/youtube/v3/superChatEvents',
params: {part: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/youtube/v3/superChatEvents?part=';
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}}/youtube/v3/superChatEvents?part=',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/youtube/v3/superChatEvents?part=")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/youtube/v3/superChatEvents?part=',
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}}/youtube/v3/superChatEvents',
qs: {part: ''}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/youtube/v3/superChatEvents');
req.query({
part: ''
});
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}}/youtube/v3/superChatEvents',
params: {part: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/youtube/v3/superChatEvents?part=';
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}}/youtube/v3/superChatEvents?part="]
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}}/youtube/v3/superChatEvents?part=" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/youtube/v3/superChatEvents?part=",
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}}/youtube/v3/superChatEvents?part=');
echo $response->getBody();
setUrl('{{baseUrl}}/youtube/v3/superChatEvents');
$request->setMethod(HTTP_METH_GET);
$request->setQueryData([
'part' => ''
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/youtube/v3/superChatEvents');
$request->setRequestMethod('GET');
$request->setQuery(new http\QueryString([
'part' => ''
]));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/youtube/v3/superChatEvents?part=' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/youtube/v3/superChatEvents?part=' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/youtube/v3/superChatEvents?part=")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/youtube/v3/superChatEvents"
querystring = {"part":""}
response = requests.get(url, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/youtube/v3/superChatEvents"
queryString <- list(part = "")
response <- VERB("GET", url, query = queryString, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/youtube/v3/superChatEvents?part=")
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/youtube/v3/superChatEvents') do |req|
req.params['part'] = ''
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/youtube/v3/superChatEvents";
let querystring = [
("part", ""),
];
let client = reqwest::Client::new();
let response = client.get(url)
.query(&querystring)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url '{{baseUrl}}/youtube/v3/superChatEvents?part='
http GET '{{baseUrl}}/youtube/v3/superChatEvents?part='
wget --quiet \
--method GET \
--output-document \
- '{{baseUrl}}/youtube/v3/superChatEvents?part='
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/youtube/v3/superChatEvents?part=")! 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()
POST
youtube.tests.insert
{{baseUrl}}/youtube/v3/tests
QUERY PARAMS
part
BODY json
{
"featuredPart": false,
"gaia": "",
"id": "",
"snippet": {}
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/youtube/v3/tests?part=");
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 \"featuredPart\": false,\n \"gaia\": \"\",\n \"id\": \"\",\n \"snippet\": {}\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/youtube/v3/tests" {:query-params {:part ""}
:content-type :json
:form-params {:featuredPart false
:gaia ""
:id ""
:snippet {}}})
require "http/client"
url = "{{baseUrl}}/youtube/v3/tests?part="
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"featuredPart\": false,\n \"gaia\": \"\",\n \"id\": \"\",\n \"snippet\": {}\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}}/youtube/v3/tests?part="),
Content = new StringContent("{\n \"featuredPart\": false,\n \"gaia\": \"\",\n \"id\": \"\",\n \"snippet\": {}\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}}/youtube/v3/tests?part=");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"featuredPart\": false,\n \"gaia\": \"\",\n \"id\": \"\",\n \"snippet\": {}\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/youtube/v3/tests?part="
payload := strings.NewReader("{\n \"featuredPart\": false,\n \"gaia\": \"\",\n \"id\": \"\",\n \"snippet\": {}\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/youtube/v3/tests?part= HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 70
{
"featuredPart": false,
"gaia": "",
"id": "",
"snippet": {}
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/youtube/v3/tests?part=")
.setHeader("content-type", "application/json")
.setBody("{\n \"featuredPart\": false,\n \"gaia\": \"\",\n \"id\": \"\",\n \"snippet\": {}\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/youtube/v3/tests?part="))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"featuredPart\": false,\n \"gaia\": \"\",\n \"id\": \"\",\n \"snippet\": {}\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 \"featuredPart\": false,\n \"gaia\": \"\",\n \"id\": \"\",\n \"snippet\": {}\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/youtube/v3/tests?part=")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/youtube/v3/tests?part=")
.header("content-type", "application/json")
.body("{\n \"featuredPart\": false,\n \"gaia\": \"\",\n \"id\": \"\",\n \"snippet\": {}\n}")
.asString();
const data = JSON.stringify({
featuredPart: false,
gaia: '',
id: '',
snippet: {}
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/youtube/v3/tests?part=');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/youtube/v3/tests',
params: {part: ''},
headers: {'content-type': 'application/json'},
data: {featuredPart: false, gaia: '', id: '', snippet: {}}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/youtube/v3/tests?part=';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"featuredPart":false,"gaia":"","id":"","snippet":{}}'
};
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}}/youtube/v3/tests?part=',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "featuredPart": false,\n "gaia": "",\n "id": "",\n "snippet": {}\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"featuredPart\": false,\n \"gaia\": \"\",\n \"id\": \"\",\n \"snippet\": {}\n}")
val request = Request.Builder()
.url("{{baseUrl}}/youtube/v3/tests?part=")
.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/youtube/v3/tests?part=',
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({featuredPart: false, gaia: '', id: '', snippet: {}}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/youtube/v3/tests',
qs: {part: ''},
headers: {'content-type': 'application/json'},
body: {featuredPart: false, gaia: '', id: '', snippet: {}},
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}}/youtube/v3/tests');
req.query({
part: ''
});
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
featuredPart: false,
gaia: '',
id: '',
snippet: {}
});
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}}/youtube/v3/tests',
params: {part: ''},
headers: {'content-type': 'application/json'},
data: {featuredPart: false, gaia: '', id: '', snippet: {}}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/youtube/v3/tests?part=';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"featuredPart":false,"gaia":"","id":"","snippet":{}}'
};
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 = @{ @"featuredPart": @NO,
@"gaia": @"",
@"id": @"",
@"snippet": @{ } };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/youtube/v3/tests?part="]
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}}/youtube/v3/tests?part=" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"featuredPart\": false,\n \"gaia\": \"\",\n \"id\": \"\",\n \"snippet\": {}\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/youtube/v3/tests?part=",
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([
'featuredPart' => null,
'gaia' => '',
'id' => '',
'snippet' => [
]
]),
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}}/youtube/v3/tests?part=', [
'body' => '{
"featuredPart": false,
"gaia": "",
"id": "",
"snippet": {}
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/youtube/v3/tests');
$request->setMethod(HTTP_METH_POST);
$request->setQueryData([
'part' => ''
]);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'featuredPart' => null,
'gaia' => '',
'id' => '',
'snippet' => [
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'featuredPart' => null,
'gaia' => '',
'id' => '',
'snippet' => [
]
]));
$request->setRequestUrl('{{baseUrl}}/youtube/v3/tests');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setQuery(new http\QueryString([
'part' => ''
]));
$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}}/youtube/v3/tests?part=' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"featuredPart": false,
"gaia": "",
"id": "",
"snippet": {}
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/youtube/v3/tests?part=' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"featuredPart": false,
"gaia": "",
"id": "",
"snippet": {}
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"featuredPart\": false,\n \"gaia\": \"\",\n \"id\": \"\",\n \"snippet\": {}\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/youtube/v3/tests?part=", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/youtube/v3/tests"
querystring = {"part":""}
payload = {
"featuredPart": False,
"gaia": "",
"id": "",
"snippet": {}
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/youtube/v3/tests"
queryString <- list(part = "")
payload <- "{\n \"featuredPart\": false,\n \"gaia\": \"\",\n \"id\": \"\",\n \"snippet\": {}\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, query = queryString, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/youtube/v3/tests?part=")
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 \"featuredPart\": false,\n \"gaia\": \"\",\n \"id\": \"\",\n \"snippet\": {}\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/youtube/v3/tests') do |req|
req.params['part'] = ''
req.body = "{\n \"featuredPart\": false,\n \"gaia\": \"\",\n \"id\": \"\",\n \"snippet\": {}\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/youtube/v3/tests";
let querystring = [
("part", ""),
];
let payload = json!({
"featuredPart": false,
"gaia": "",
"id": "",
"snippet": json!({})
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.query(&querystring)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/youtube/v3/tests?part=' \
--header 'content-type: application/json' \
--data '{
"featuredPart": false,
"gaia": "",
"id": "",
"snippet": {}
}'
echo '{
"featuredPart": false,
"gaia": "",
"id": "",
"snippet": {}
}' | \
http POST '{{baseUrl}}/youtube/v3/tests?part=' \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "featuredPart": false,\n "gaia": "",\n "id": "",\n "snippet": {}\n}' \
--output-document \
- '{{baseUrl}}/youtube/v3/tests?part='
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"featuredPart": false,
"gaia": "",
"id": "",
"snippet": []
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/youtube/v3/tests?part=")! 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()
DELETE
youtube.thirdPartyLinks.delete
{{baseUrl}}/youtube/v3/thirdPartyLinks
QUERY PARAMS
linkingToken
type
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/youtube/v3/thirdPartyLinks?linkingToken=&type=");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/delete "{{baseUrl}}/youtube/v3/thirdPartyLinks" {:query-params {:linkingToken ""
:type ""}})
require "http/client"
url = "{{baseUrl}}/youtube/v3/thirdPartyLinks?linkingToken=&type="
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}}/youtube/v3/thirdPartyLinks?linkingToken=&type="),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/youtube/v3/thirdPartyLinks?linkingToken=&type=");
var request = new RestRequest("", Method.Delete);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/youtube/v3/thirdPartyLinks?linkingToken=&type="
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/youtube/v3/thirdPartyLinks?linkingToken=&type= HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/youtube/v3/thirdPartyLinks?linkingToken=&type=")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/youtube/v3/thirdPartyLinks?linkingToken=&type="))
.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}}/youtube/v3/thirdPartyLinks?linkingToken=&type=")
.delete(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/youtube/v3/thirdPartyLinks?linkingToken=&type=")
.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}}/youtube/v3/thirdPartyLinks?linkingToken=&type=');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'DELETE',
url: '{{baseUrl}}/youtube/v3/thirdPartyLinks',
params: {linkingToken: '', type: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/youtube/v3/thirdPartyLinks?linkingToken=&type=';
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}}/youtube/v3/thirdPartyLinks?linkingToken=&type=',
method: 'DELETE',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/youtube/v3/thirdPartyLinks?linkingToken=&type=")
.delete(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'DELETE',
hostname: 'example.com',
port: null,
path: '/baseUrl/youtube/v3/thirdPartyLinks?linkingToken=&type=',
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}}/youtube/v3/thirdPartyLinks',
qs: {linkingToken: '', type: ''}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('DELETE', '{{baseUrl}}/youtube/v3/thirdPartyLinks');
req.query({
linkingToken: '',
type: ''
});
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}}/youtube/v3/thirdPartyLinks',
params: {linkingToken: '', type: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/youtube/v3/thirdPartyLinks?linkingToken=&type=';
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}}/youtube/v3/thirdPartyLinks?linkingToken=&type="]
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}}/youtube/v3/thirdPartyLinks?linkingToken=&type=" in
Client.call `DELETE uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/youtube/v3/thirdPartyLinks?linkingToken=&type=",
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}}/youtube/v3/thirdPartyLinks?linkingToken=&type=');
echo $response->getBody();
setUrl('{{baseUrl}}/youtube/v3/thirdPartyLinks');
$request->setMethod(HTTP_METH_DELETE);
$request->setQueryData([
'linkingToken' => '',
'type' => ''
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/youtube/v3/thirdPartyLinks');
$request->setRequestMethod('DELETE');
$request->setQuery(new http\QueryString([
'linkingToken' => '',
'type' => ''
]));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/youtube/v3/thirdPartyLinks?linkingToken=&type=' -Method DELETE
$response = Invoke-RestMethod -Uri '{{baseUrl}}/youtube/v3/thirdPartyLinks?linkingToken=&type=' -Method DELETE
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("DELETE", "/baseUrl/youtube/v3/thirdPartyLinks?linkingToken=&type=")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/youtube/v3/thirdPartyLinks"
querystring = {"linkingToken":"","type":""}
response = requests.delete(url, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/youtube/v3/thirdPartyLinks"
queryString <- list(
linkingToken = "",
type = ""
)
response <- VERB("DELETE", url, query = queryString, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/youtube/v3/thirdPartyLinks?linkingToken=&type=")
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/youtube/v3/thirdPartyLinks') do |req|
req.params['linkingToken'] = ''
req.params['type'] = ''
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/youtube/v3/thirdPartyLinks";
let querystring = [
("linkingToken", ""),
("type", ""),
];
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("DELETE").unwrap(), url)
.query(&querystring)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request DELETE \
--url '{{baseUrl}}/youtube/v3/thirdPartyLinks?linkingToken=&type='
http DELETE '{{baseUrl}}/youtube/v3/thirdPartyLinks?linkingToken=&type='
wget --quiet \
--method DELETE \
--output-document \
- '{{baseUrl}}/youtube/v3/thirdPartyLinks?linkingToken=&type='
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/youtube/v3/thirdPartyLinks?linkingToken=&type=")! 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()
POST
youtube.thirdPartyLinks.insert
{{baseUrl}}/youtube/v3/thirdPartyLinks
QUERY PARAMS
part
BODY json
{
"etag": "",
"kind": "",
"linkingToken": "",
"snippet": {
"channelToStoreLink": {
"merchantId": "",
"storeName": "",
"storeUrl": ""
},
"type": ""
},
"status": {
"linkStatus": ""
}
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/youtube/v3/thirdPartyLinks?part=");
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 \"etag\": \"\",\n \"kind\": \"\",\n \"linkingToken\": \"\",\n \"snippet\": {\n \"channelToStoreLink\": {\n \"merchantId\": \"\",\n \"storeName\": \"\",\n \"storeUrl\": \"\"\n },\n \"type\": \"\"\n },\n \"status\": {\n \"linkStatus\": \"\"\n }\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/youtube/v3/thirdPartyLinks" {:query-params {:part ""}
:content-type :json
:form-params {:etag ""
:kind ""
:linkingToken ""
:snippet {:channelToStoreLink {:merchantId ""
:storeName ""
:storeUrl ""}
:type ""}
:status {:linkStatus ""}}})
require "http/client"
url = "{{baseUrl}}/youtube/v3/thirdPartyLinks?part="
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"etag\": \"\",\n \"kind\": \"\",\n \"linkingToken\": \"\",\n \"snippet\": {\n \"channelToStoreLink\": {\n \"merchantId\": \"\",\n \"storeName\": \"\",\n \"storeUrl\": \"\"\n },\n \"type\": \"\"\n },\n \"status\": {\n \"linkStatus\": \"\"\n }\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/youtube/v3/thirdPartyLinks?part="),
Content = new StringContent("{\n \"etag\": \"\",\n \"kind\": \"\",\n \"linkingToken\": \"\",\n \"snippet\": {\n \"channelToStoreLink\": {\n \"merchantId\": \"\",\n \"storeName\": \"\",\n \"storeUrl\": \"\"\n },\n \"type\": \"\"\n },\n \"status\": {\n \"linkStatus\": \"\"\n }\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/youtube/v3/thirdPartyLinks?part=");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"etag\": \"\",\n \"kind\": \"\",\n \"linkingToken\": \"\",\n \"snippet\": {\n \"channelToStoreLink\": {\n \"merchantId\": \"\",\n \"storeName\": \"\",\n \"storeUrl\": \"\"\n },\n \"type\": \"\"\n },\n \"status\": {\n \"linkStatus\": \"\"\n }\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/youtube/v3/thirdPartyLinks?part="
payload := strings.NewReader("{\n \"etag\": \"\",\n \"kind\": \"\",\n \"linkingToken\": \"\",\n \"snippet\": {\n \"channelToStoreLink\": {\n \"merchantId\": \"\",\n \"storeName\": \"\",\n \"storeUrl\": \"\"\n },\n \"type\": \"\"\n },\n \"status\": {\n \"linkStatus\": \"\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/youtube/v3/thirdPartyLinks?part= HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 230
{
"etag": "",
"kind": "",
"linkingToken": "",
"snippet": {
"channelToStoreLink": {
"merchantId": "",
"storeName": "",
"storeUrl": ""
},
"type": ""
},
"status": {
"linkStatus": ""
}
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/youtube/v3/thirdPartyLinks?part=")
.setHeader("content-type", "application/json")
.setBody("{\n \"etag\": \"\",\n \"kind\": \"\",\n \"linkingToken\": \"\",\n \"snippet\": {\n \"channelToStoreLink\": {\n \"merchantId\": \"\",\n \"storeName\": \"\",\n \"storeUrl\": \"\"\n },\n \"type\": \"\"\n },\n \"status\": {\n \"linkStatus\": \"\"\n }\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/youtube/v3/thirdPartyLinks?part="))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"etag\": \"\",\n \"kind\": \"\",\n \"linkingToken\": \"\",\n \"snippet\": {\n \"channelToStoreLink\": {\n \"merchantId\": \"\",\n \"storeName\": \"\",\n \"storeUrl\": \"\"\n },\n \"type\": \"\"\n },\n \"status\": {\n \"linkStatus\": \"\"\n }\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"etag\": \"\",\n \"kind\": \"\",\n \"linkingToken\": \"\",\n \"snippet\": {\n \"channelToStoreLink\": {\n \"merchantId\": \"\",\n \"storeName\": \"\",\n \"storeUrl\": \"\"\n },\n \"type\": \"\"\n },\n \"status\": {\n \"linkStatus\": \"\"\n }\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/youtube/v3/thirdPartyLinks?part=")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/youtube/v3/thirdPartyLinks?part=")
.header("content-type", "application/json")
.body("{\n \"etag\": \"\",\n \"kind\": \"\",\n \"linkingToken\": \"\",\n \"snippet\": {\n \"channelToStoreLink\": {\n \"merchantId\": \"\",\n \"storeName\": \"\",\n \"storeUrl\": \"\"\n },\n \"type\": \"\"\n },\n \"status\": {\n \"linkStatus\": \"\"\n }\n}")
.asString();
const data = JSON.stringify({
etag: '',
kind: '',
linkingToken: '',
snippet: {
channelToStoreLink: {
merchantId: '',
storeName: '',
storeUrl: ''
},
type: ''
},
status: {
linkStatus: ''
}
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/youtube/v3/thirdPartyLinks?part=');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/youtube/v3/thirdPartyLinks',
params: {part: ''},
headers: {'content-type': 'application/json'},
data: {
etag: '',
kind: '',
linkingToken: '',
snippet: {channelToStoreLink: {merchantId: '', storeName: '', storeUrl: ''}, type: ''},
status: {linkStatus: ''}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/youtube/v3/thirdPartyLinks?part=';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"etag":"","kind":"","linkingToken":"","snippet":{"channelToStoreLink":{"merchantId":"","storeName":"","storeUrl":""},"type":""},"status":{"linkStatus":""}}'
};
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}}/youtube/v3/thirdPartyLinks?part=',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "etag": "",\n "kind": "",\n "linkingToken": "",\n "snippet": {\n "channelToStoreLink": {\n "merchantId": "",\n "storeName": "",\n "storeUrl": ""\n },\n "type": ""\n },\n "status": {\n "linkStatus": ""\n }\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"etag\": \"\",\n \"kind\": \"\",\n \"linkingToken\": \"\",\n \"snippet\": {\n \"channelToStoreLink\": {\n \"merchantId\": \"\",\n \"storeName\": \"\",\n \"storeUrl\": \"\"\n },\n \"type\": \"\"\n },\n \"status\": {\n \"linkStatus\": \"\"\n }\n}")
val request = Request.Builder()
.url("{{baseUrl}}/youtube/v3/thirdPartyLinks?part=")
.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/youtube/v3/thirdPartyLinks?part=',
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({
etag: '',
kind: '',
linkingToken: '',
snippet: {channelToStoreLink: {merchantId: '', storeName: '', storeUrl: ''}, type: ''},
status: {linkStatus: ''}
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/youtube/v3/thirdPartyLinks',
qs: {part: ''},
headers: {'content-type': 'application/json'},
body: {
etag: '',
kind: '',
linkingToken: '',
snippet: {channelToStoreLink: {merchantId: '', storeName: '', storeUrl: ''}, type: ''},
status: {linkStatus: ''}
},
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}}/youtube/v3/thirdPartyLinks');
req.query({
part: ''
});
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
etag: '',
kind: '',
linkingToken: '',
snippet: {
channelToStoreLink: {
merchantId: '',
storeName: '',
storeUrl: ''
},
type: ''
},
status: {
linkStatus: ''
}
});
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}}/youtube/v3/thirdPartyLinks',
params: {part: ''},
headers: {'content-type': 'application/json'},
data: {
etag: '',
kind: '',
linkingToken: '',
snippet: {channelToStoreLink: {merchantId: '', storeName: '', storeUrl: ''}, type: ''},
status: {linkStatus: ''}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/youtube/v3/thirdPartyLinks?part=';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"etag":"","kind":"","linkingToken":"","snippet":{"channelToStoreLink":{"merchantId":"","storeName":"","storeUrl":""},"type":""},"status":{"linkStatus":""}}'
};
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 = @{ @"etag": @"",
@"kind": @"",
@"linkingToken": @"",
@"snippet": @{ @"channelToStoreLink": @{ @"merchantId": @"", @"storeName": @"", @"storeUrl": @"" }, @"type": @"" },
@"status": @{ @"linkStatus": @"" } };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/youtube/v3/thirdPartyLinks?part="]
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}}/youtube/v3/thirdPartyLinks?part=" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"etag\": \"\",\n \"kind\": \"\",\n \"linkingToken\": \"\",\n \"snippet\": {\n \"channelToStoreLink\": {\n \"merchantId\": \"\",\n \"storeName\": \"\",\n \"storeUrl\": \"\"\n },\n \"type\": \"\"\n },\n \"status\": {\n \"linkStatus\": \"\"\n }\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/youtube/v3/thirdPartyLinks?part=",
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([
'etag' => '',
'kind' => '',
'linkingToken' => '',
'snippet' => [
'channelToStoreLink' => [
'merchantId' => '',
'storeName' => '',
'storeUrl' => ''
],
'type' => ''
],
'status' => [
'linkStatus' => ''
]
]),
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}}/youtube/v3/thirdPartyLinks?part=', [
'body' => '{
"etag": "",
"kind": "",
"linkingToken": "",
"snippet": {
"channelToStoreLink": {
"merchantId": "",
"storeName": "",
"storeUrl": ""
},
"type": ""
},
"status": {
"linkStatus": ""
}
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/youtube/v3/thirdPartyLinks');
$request->setMethod(HTTP_METH_POST);
$request->setQueryData([
'part' => ''
]);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'etag' => '',
'kind' => '',
'linkingToken' => '',
'snippet' => [
'channelToStoreLink' => [
'merchantId' => '',
'storeName' => '',
'storeUrl' => ''
],
'type' => ''
],
'status' => [
'linkStatus' => ''
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'etag' => '',
'kind' => '',
'linkingToken' => '',
'snippet' => [
'channelToStoreLink' => [
'merchantId' => '',
'storeName' => '',
'storeUrl' => ''
],
'type' => ''
],
'status' => [
'linkStatus' => ''
]
]));
$request->setRequestUrl('{{baseUrl}}/youtube/v3/thirdPartyLinks');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setQuery(new http\QueryString([
'part' => ''
]));
$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}}/youtube/v3/thirdPartyLinks?part=' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"etag": "",
"kind": "",
"linkingToken": "",
"snippet": {
"channelToStoreLink": {
"merchantId": "",
"storeName": "",
"storeUrl": ""
},
"type": ""
},
"status": {
"linkStatus": ""
}
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/youtube/v3/thirdPartyLinks?part=' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"etag": "",
"kind": "",
"linkingToken": "",
"snippet": {
"channelToStoreLink": {
"merchantId": "",
"storeName": "",
"storeUrl": ""
},
"type": ""
},
"status": {
"linkStatus": ""
}
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"etag\": \"\",\n \"kind\": \"\",\n \"linkingToken\": \"\",\n \"snippet\": {\n \"channelToStoreLink\": {\n \"merchantId\": \"\",\n \"storeName\": \"\",\n \"storeUrl\": \"\"\n },\n \"type\": \"\"\n },\n \"status\": {\n \"linkStatus\": \"\"\n }\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/youtube/v3/thirdPartyLinks?part=", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/youtube/v3/thirdPartyLinks"
querystring = {"part":""}
payload = {
"etag": "",
"kind": "",
"linkingToken": "",
"snippet": {
"channelToStoreLink": {
"merchantId": "",
"storeName": "",
"storeUrl": ""
},
"type": ""
},
"status": { "linkStatus": "" }
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/youtube/v3/thirdPartyLinks"
queryString <- list(part = "")
payload <- "{\n \"etag\": \"\",\n \"kind\": \"\",\n \"linkingToken\": \"\",\n \"snippet\": {\n \"channelToStoreLink\": {\n \"merchantId\": \"\",\n \"storeName\": \"\",\n \"storeUrl\": \"\"\n },\n \"type\": \"\"\n },\n \"status\": {\n \"linkStatus\": \"\"\n }\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, query = queryString, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/youtube/v3/thirdPartyLinks?part=")
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 \"etag\": \"\",\n \"kind\": \"\",\n \"linkingToken\": \"\",\n \"snippet\": {\n \"channelToStoreLink\": {\n \"merchantId\": \"\",\n \"storeName\": \"\",\n \"storeUrl\": \"\"\n },\n \"type\": \"\"\n },\n \"status\": {\n \"linkStatus\": \"\"\n }\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/youtube/v3/thirdPartyLinks') do |req|
req.params['part'] = ''
req.body = "{\n \"etag\": \"\",\n \"kind\": \"\",\n \"linkingToken\": \"\",\n \"snippet\": {\n \"channelToStoreLink\": {\n \"merchantId\": \"\",\n \"storeName\": \"\",\n \"storeUrl\": \"\"\n },\n \"type\": \"\"\n },\n \"status\": {\n \"linkStatus\": \"\"\n }\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/youtube/v3/thirdPartyLinks";
let querystring = [
("part", ""),
];
let payload = json!({
"etag": "",
"kind": "",
"linkingToken": "",
"snippet": json!({
"channelToStoreLink": json!({
"merchantId": "",
"storeName": "",
"storeUrl": ""
}),
"type": ""
}),
"status": json!({"linkStatus": ""})
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.query(&querystring)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/youtube/v3/thirdPartyLinks?part=' \
--header 'content-type: application/json' \
--data '{
"etag": "",
"kind": "",
"linkingToken": "",
"snippet": {
"channelToStoreLink": {
"merchantId": "",
"storeName": "",
"storeUrl": ""
},
"type": ""
},
"status": {
"linkStatus": ""
}
}'
echo '{
"etag": "",
"kind": "",
"linkingToken": "",
"snippet": {
"channelToStoreLink": {
"merchantId": "",
"storeName": "",
"storeUrl": ""
},
"type": ""
},
"status": {
"linkStatus": ""
}
}' | \
http POST '{{baseUrl}}/youtube/v3/thirdPartyLinks?part=' \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "etag": "",\n "kind": "",\n "linkingToken": "",\n "snippet": {\n "channelToStoreLink": {\n "merchantId": "",\n "storeName": "",\n "storeUrl": ""\n },\n "type": ""\n },\n "status": {\n "linkStatus": ""\n }\n}' \
--output-document \
- '{{baseUrl}}/youtube/v3/thirdPartyLinks?part='
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"etag": "",
"kind": "",
"linkingToken": "",
"snippet": [
"channelToStoreLink": [
"merchantId": "",
"storeName": "",
"storeUrl": ""
],
"type": ""
],
"status": ["linkStatus": ""]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/youtube/v3/thirdPartyLinks?part=")! 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()
GET
youtube.thirdPartyLinks.list
{{baseUrl}}/youtube/v3/thirdPartyLinks
QUERY PARAMS
part
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/youtube/v3/thirdPartyLinks?part=");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/youtube/v3/thirdPartyLinks" {:query-params {:part ""}})
require "http/client"
url = "{{baseUrl}}/youtube/v3/thirdPartyLinks?part="
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}}/youtube/v3/thirdPartyLinks?part="),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/youtube/v3/thirdPartyLinks?part=");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/youtube/v3/thirdPartyLinks?part="
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/youtube/v3/thirdPartyLinks?part= HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/youtube/v3/thirdPartyLinks?part=")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/youtube/v3/thirdPartyLinks?part="))
.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}}/youtube/v3/thirdPartyLinks?part=")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/youtube/v3/thirdPartyLinks?part=")
.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}}/youtube/v3/thirdPartyLinks?part=');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/youtube/v3/thirdPartyLinks',
params: {part: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/youtube/v3/thirdPartyLinks?part=';
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}}/youtube/v3/thirdPartyLinks?part=',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/youtube/v3/thirdPartyLinks?part=")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/youtube/v3/thirdPartyLinks?part=',
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}}/youtube/v3/thirdPartyLinks',
qs: {part: ''}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/youtube/v3/thirdPartyLinks');
req.query({
part: ''
});
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}}/youtube/v3/thirdPartyLinks',
params: {part: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/youtube/v3/thirdPartyLinks?part=';
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}}/youtube/v3/thirdPartyLinks?part="]
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}}/youtube/v3/thirdPartyLinks?part=" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/youtube/v3/thirdPartyLinks?part=",
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}}/youtube/v3/thirdPartyLinks?part=');
echo $response->getBody();
setUrl('{{baseUrl}}/youtube/v3/thirdPartyLinks');
$request->setMethod(HTTP_METH_GET);
$request->setQueryData([
'part' => ''
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/youtube/v3/thirdPartyLinks');
$request->setRequestMethod('GET');
$request->setQuery(new http\QueryString([
'part' => ''
]));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/youtube/v3/thirdPartyLinks?part=' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/youtube/v3/thirdPartyLinks?part=' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/youtube/v3/thirdPartyLinks?part=")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/youtube/v3/thirdPartyLinks"
querystring = {"part":""}
response = requests.get(url, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/youtube/v3/thirdPartyLinks"
queryString <- list(part = "")
response <- VERB("GET", url, query = queryString, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/youtube/v3/thirdPartyLinks?part=")
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/youtube/v3/thirdPartyLinks') do |req|
req.params['part'] = ''
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/youtube/v3/thirdPartyLinks";
let querystring = [
("part", ""),
];
let client = reqwest::Client::new();
let response = client.get(url)
.query(&querystring)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url '{{baseUrl}}/youtube/v3/thirdPartyLinks?part='
http GET '{{baseUrl}}/youtube/v3/thirdPartyLinks?part='
wget --quiet \
--method GET \
--output-document \
- '{{baseUrl}}/youtube/v3/thirdPartyLinks?part='
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/youtube/v3/thirdPartyLinks?part=")! 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()
PUT
youtube.thirdPartyLinks.update
{{baseUrl}}/youtube/v3/thirdPartyLinks
QUERY PARAMS
part
BODY json
{
"etag": "",
"kind": "",
"linkingToken": "",
"snippet": {
"channelToStoreLink": {
"merchantId": "",
"storeName": "",
"storeUrl": ""
},
"type": ""
},
"status": {
"linkStatus": ""
}
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/youtube/v3/thirdPartyLinks?part=");
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 \"etag\": \"\",\n \"kind\": \"\",\n \"linkingToken\": \"\",\n \"snippet\": {\n \"channelToStoreLink\": {\n \"merchantId\": \"\",\n \"storeName\": \"\",\n \"storeUrl\": \"\"\n },\n \"type\": \"\"\n },\n \"status\": {\n \"linkStatus\": \"\"\n }\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/youtube/v3/thirdPartyLinks" {:query-params {:part ""}
:content-type :json
:form-params {:etag ""
:kind ""
:linkingToken ""
:snippet {:channelToStoreLink {:merchantId ""
:storeName ""
:storeUrl ""}
:type ""}
:status {:linkStatus ""}}})
require "http/client"
url = "{{baseUrl}}/youtube/v3/thirdPartyLinks?part="
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"etag\": \"\",\n \"kind\": \"\",\n \"linkingToken\": \"\",\n \"snippet\": {\n \"channelToStoreLink\": {\n \"merchantId\": \"\",\n \"storeName\": \"\",\n \"storeUrl\": \"\"\n },\n \"type\": \"\"\n },\n \"status\": {\n \"linkStatus\": \"\"\n }\n}"
response = HTTP::Client.put url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Put,
RequestUri = new Uri("{{baseUrl}}/youtube/v3/thirdPartyLinks?part="),
Content = new StringContent("{\n \"etag\": \"\",\n \"kind\": \"\",\n \"linkingToken\": \"\",\n \"snippet\": {\n \"channelToStoreLink\": {\n \"merchantId\": \"\",\n \"storeName\": \"\",\n \"storeUrl\": \"\"\n },\n \"type\": \"\"\n },\n \"status\": {\n \"linkStatus\": \"\"\n }\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/youtube/v3/thirdPartyLinks?part=");
var request = new RestRequest("", Method.Put);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"etag\": \"\",\n \"kind\": \"\",\n \"linkingToken\": \"\",\n \"snippet\": {\n \"channelToStoreLink\": {\n \"merchantId\": \"\",\n \"storeName\": \"\",\n \"storeUrl\": \"\"\n },\n \"type\": \"\"\n },\n \"status\": {\n \"linkStatus\": \"\"\n }\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/youtube/v3/thirdPartyLinks?part="
payload := strings.NewReader("{\n \"etag\": \"\",\n \"kind\": \"\",\n \"linkingToken\": \"\",\n \"snippet\": {\n \"channelToStoreLink\": {\n \"merchantId\": \"\",\n \"storeName\": \"\",\n \"storeUrl\": \"\"\n },\n \"type\": \"\"\n },\n \"status\": {\n \"linkStatus\": \"\"\n }\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PUT /baseUrl/youtube/v3/thirdPartyLinks?part= HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 230
{
"etag": "",
"kind": "",
"linkingToken": "",
"snippet": {
"channelToStoreLink": {
"merchantId": "",
"storeName": "",
"storeUrl": ""
},
"type": ""
},
"status": {
"linkStatus": ""
}
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/youtube/v3/thirdPartyLinks?part=")
.setHeader("content-type", "application/json")
.setBody("{\n \"etag\": \"\",\n \"kind\": \"\",\n \"linkingToken\": \"\",\n \"snippet\": {\n \"channelToStoreLink\": {\n \"merchantId\": \"\",\n \"storeName\": \"\",\n \"storeUrl\": \"\"\n },\n \"type\": \"\"\n },\n \"status\": {\n \"linkStatus\": \"\"\n }\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/youtube/v3/thirdPartyLinks?part="))
.header("content-type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString("{\n \"etag\": \"\",\n \"kind\": \"\",\n \"linkingToken\": \"\",\n \"snippet\": {\n \"channelToStoreLink\": {\n \"merchantId\": \"\",\n \"storeName\": \"\",\n \"storeUrl\": \"\"\n },\n \"type\": \"\"\n },\n \"status\": {\n \"linkStatus\": \"\"\n }\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"etag\": \"\",\n \"kind\": \"\",\n \"linkingToken\": \"\",\n \"snippet\": {\n \"channelToStoreLink\": {\n \"merchantId\": \"\",\n \"storeName\": \"\",\n \"storeUrl\": \"\"\n },\n \"type\": \"\"\n },\n \"status\": {\n \"linkStatus\": \"\"\n }\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/youtube/v3/thirdPartyLinks?part=")
.put(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/youtube/v3/thirdPartyLinks?part=")
.header("content-type", "application/json")
.body("{\n \"etag\": \"\",\n \"kind\": \"\",\n \"linkingToken\": \"\",\n \"snippet\": {\n \"channelToStoreLink\": {\n \"merchantId\": \"\",\n \"storeName\": \"\",\n \"storeUrl\": \"\"\n },\n \"type\": \"\"\n },\n \"status\": {\n \"linkStatus\": \"\"\n }\n}")
.asString();
const data = JSON.stringify({
etag: '',
kind: '',
linkingToken: '',
snippet: {
channelToStoreLink: {
merchantId: '',
storeName: '',
storeUrl: ''
},
type: ''
},
status: {
linkStatus: ''
}
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/youtube/v3/thirdPartyLinks?part=');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/youtube/v3/thirdPartyLinks',
params: {part: ''},
headers: {'content-type': 'application/json'},
data: {
etag: '',
kind: '',
linkingToken: '',
snippet: {channelToStoreLink: {merchantId: '', storeName: '', storeUrl: ''}, type: ''},
status: {linkStatus: ''}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/youtube/v3/thirdPartyLinks?part=';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"etag":"","kind":"","linkingToken":"","snippet":{"channelToStoreLink":{"merchantId":"","storeName":"","storeUrl":""},"type":""},"status":{"linkStatus":""}}'
};
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}}/youtube/v3/thirdPartyLinks?part=',
method: 'PUT',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "etag": "",\n "kind": "",\n "linkingToken": "",\n "snippet": {\n "channelToStoreLink": {\n "merchantId": "",\n "storeName": "",\n "storeUrl": ""\n },\n "type": ""\n },\n "status": {\n "linkStatus": ""\n }\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"etag\": \"\",\n \"kind\": \"\",\n \"linkingToken\": \"\",\n \"snippet\": {\n \"channelToStoreLink\": {\n \"merchantId\": \"\",\n \"storeName\": \"\",\n \"storeUrl\": \"\"\n },\n \"type\": \"\"\n },\n \"status\": {\n \"linkStatus\": \"\"\n }\n}")
val request = Request.Builder()
.url("{{baseUrl}}/youtube/v3/thirdPartyLinks?part=")
.put(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PUT',
hostname: 'example.com',
port: null,
path: '/baseUrl/youtube/v3/thirdPartyLinks?part=',
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({
etag: '',
kind: '',
linkingToken: '',
snippet: {channelToStoreLink: {merchantId: '', storeName: '', storeUrl: ''}, type: ''},
status: {linkStatus: ''}
}));
req.end();
const request = require('request');
const options = {
method: 'PUT',
url: '{{baseUrl}}/youtube/v3/thirdPartyLinks',
qs: {part: ''},
headers: {'content-type': 'application/json'},
body: {
etag: '',
kind: '',
linkingToken: '',
snippet: {channelToStoreLink: {merchantId: '', storeName: '', storeUrl: ''}, type: ''},
status: {linkStatus: ''}
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PUT', '{{baseUrl}}/youtube/v3/thirdPartyLinks');
req.query({
part: ''
});
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
etag: '',
kind: '',
linkingToken: '',
snippet: {
channelToStoreLink: {
merchantId: '',
storeName: '',
storeUrl: ''
},
type: ''
},
status: {
linkStatus: ''
}
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'PUT',
url: '{{baseUrl}}/youtube/v3/thirdPartyLinks',
params: {part: ''},
headers: {'content-type': 'application/json'},
data: {
etag: '',
kind: '',
linkingToken: '',
snippet: {channelToStoreLink: {merchantId: '', storeName: '', storeUrl: ''}, type: ''},
status: {linkStatus: ''}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/youtube/v3/thirdPartyLinks?part=';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"etag":"","kind":"","linkingToken":"","snippet":{"channelToStoreLink":{"merchantId":"","storeName":"","storeUrl":""},"type":""},"status":{"linkStatus":""}}'
};
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 = @{ @"etag": @"",
@"kind": @"",
@"linkingToken": @"",
@"snippet": @{ @"channelToStoreLink": @{ @"merchantId": @"", @"storeName": @"", @"storeUrl": @"" }, @"type": @"" },
@"status": @{ @"linkStatus": @"" } };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/youtube/v3/thirdPartyLinks?part="]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PUT"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/youtube/v3/thirdPartyLinks?part=" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"etag\": \"\",\n \"kind\": \"\",\n \"linkingToken\": \"\",\n \"snippet\": {\n \"channelToStoreLink\": {\n \"merchantId\": \"\",\n \"storeName\": \"\",\n \"storeUrl\": \"\"\n },\n \"type\": \"\"\n },\n \"status\": {\n \"linkStatus\": \"\"\n }\n}" in
Client.call ~headers ~body `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/youtube/v3/thirdPartyLinks?part=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'etag' => '',
'kind' => '',
'linkingToken' => '',
'snippet' => [
'channelToStoreLink' => [
'merchantId' => '',
'storeName' => '',
'storeUrl' => ''
],
'type' => ''
],
'status' => [
'linkStatus' => ''
]
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('PUT', '{{baseUrl}}/youtube/v3/thirdPartyLinks?part=', [
'body' => '{
"etag": "",
"kind": "",
"linkingToken": "",
"snippet": {
"channelToStoreLink": {
"merchantId": "",
"storeName": "",
"storeUrl": ""
},
"type": ""
},
"status": {
"linkStatus": ""
}
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/youtube/v3/thirdPartyLinks');
$request->setMethod(HTTP_METH_PUT);
$request->setQueryData([
'part' => ''
]);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'etag' => '',
'kind' => '',
'linkingToken' => '',
'snippet' => [
'channelToStoreLink' => [
'merchantId' => '',
'storeName' => '',
'storeUrl' => ''
],
'type' => ''
],
'status' => [
'linkStatus' => ''
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'etag' => '',
'kind' => '',
'linkingToken' => '',
'snippet' => [
'channelToStoreLink' => [
'merchantId' => '',
'storeName' => '',
'storeUrl' => ''
],
'type' => ''
],
'status' => [
'linkStatus' => ''
]
]));
$request->setRequestUrl('{{baseUrl}}/youtube/v3/thirdPartyLinks');
$request->setRequestMethod('PUT');
$request->setBody($body);
$request->setQuery(new http\QueryString([
'part' => ''
]));
$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}}/youtube/v3/thirdPartyLinks?part=' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"etag": "",
"kind": "",
"linkingToken": "",
"snippet": {
"channelToStoreLink": {
"merchantId": "",
"storeName": "",
"storeUrl": ""
},
"type": ""
},
"status": {
"linkStatus": ""
}
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/youtube/v3/thirdPartyLinks?part=' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"etag": "",
"kind": "",
"linkingToken": "",
"snippet": {
"channelToStoreLink": {
"merchantId": "",
"storeName": "",
"storeUrl": ""
},
"type": ""
},
"status": {
"linkStatus": ""
}
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"etag\": \"\",\n \"kind\": \"\",\n \"linkingToken\": \"\",\n \"snippet\": {\n \"channelToStoreLink\": {\n \"merchantId\": \"\",\n \"storeName\": \"\",\n \"storeUrl\": \"\"\n },\n \"type\": \"\"\n },\n \"status\": {\n \"linkStatus\": \"\"\n }\n}"
headers = { 'content-type': "application/json" }
conn.request("PUT", "/baseUrl/youtube/v3/thirdPartyLinks?part=", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/youtube/v3/thirdPartyLinks"
querystring = {"part":""}
payload = {
"etag": "",
"kind": "",
"linkingToken": "",
"snippet": {
"channelToStoreLink": {
"merchantId": "",
"storeName": "",
"storeUrl": ""
},
"type": ""
},
"status": { "linkStatus": "" }
}
headers = {"content-type": "application/json"}
response = requests.put(url, json=payload, headers=headers, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/youtube/v3/thirdPartyLinks"
queryString <- list(part = "")
payload <- "{\n \"etag\": \"\",\n \"kind\": \"\",\n \"linkingToken\": \"\",\n \"snippet\": {\n \"channelToStoreLink\": {\n \"merchantId\": \"\",\n \"storeName\": \"\",\n \"storeUrl\": \"\"\n },\n \"type\": \"\"\n },\n \"status\": {\n \"linkStatus\": \"\"\n }\n}"
encode <- "json"
response <- VERB("PUT", url, body = payload, query = queryString, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/youtube/v3/thirdPartyLinks?part=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"etag\": \"\",\n \"kind\": \"\",\n \"linkingToken\": \"\",\n \"snippet\": {\n \"channelToStoreLink\": {\n \"merchantId\": \"\",\n \"storeName\": \"\",\n \"storeUrl\": \"\"\n },\n \"type\": \"\"\n },\n \"status\": {\n \"linkStatus\": \"\"\n }\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.put('/baseUrl/youtube/v3/thirdPartyLinks') do |req|
req.params['part'] = ''
req.body = "{\n \"etag\": \"\",\n \"kind\": \"\",\n \"linkingToken\": \"\",\n \"snippet\": {\n \"channelToStoreLink\": {\n \"merchantId\": \"\",\n \"storeName\": \"\",\n \"storeUrl\": \"\"\n },\n \"type\": \"\"\n },\n \"status\": {\n \"linkStatus\": \"\"\n }\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}}/youtube/v3/thirdPartyLinks";
let querystring = [
("part", ""),
];
let payload = json!({
"etag": "",
"kind": "",
"linkingToken": "",
"snippet": json!({
"channelToStoreLink": json!({
"merchantId": "",
"storeName": "",
"storeUrl": ""
}),
"type": ""
}),
"status": json!({"linkStatus": ""})
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PUT").unwrap(), url)
.query(&querystring)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PUT \
--url '{{baseUrl}}/youtube/v3/thirdPartyLinks?part=' \
--header 'content-type: application/json' \
--data '{
"etag": "",
"kind": "",
"linkingToken": "",
"snippet": {
"channelToStoreLink": {
"merchantId": "",
"storeName": "",
"storeUrl": ""
},
"type": ""
},
"status": {
"linkStatus": ""
}
}'
echo '{
"etag": "",
"kind": "",
"linkingToken": "",
"snippet": {
"channelToStoreLink": {
"merchantId": "",
"storeName": "",
"storeUrl": ""
},
"type": ""
},
"status": {
"linkStatus": ""
}
}' | \
http PUT '{{baseUrl}}/youtube/v3/thirdPartyLinks?part=' \
content-type:application/json
wget --quiet \
--method PUT \
--header 'content-type: application/json' \
--body-data '{\n "etag": "",\n "kind": "",\n "linkingToken": "",\n "snippet": {\n "channelToStoreLink": {\n "merchantId": "",\n "storeName": "",\n "storeUrl": ""\n },\n "type": ""\n },\n "status": {\n "linkStatus": ""\n }\n}' \
--output-document \
- '{{baseUrl}}/youtube/v3/thirdPartyLinks?part='
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"etag": "",
"kind": "",
"linkingToken": "",
"snippet": [
"channelToStoreLink": [
"merchantId": "",
"storeName": "",
"storeUrl": ""
],
"type": ""
],
"status": ["linkStatus": ""]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/youtube/v3/thirdPartyLinks?part=")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
youtube.thumbnails.set
{{baseUrl}}/youtube/v3/thumbnails/set
QUERY PARAMS
videoId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/youtube/v3/thumbnails/set?videoId=");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/youtube/v3/thumbnails/set" {:query-params {:videoId ""}})
require "http/client"
url = "{{baseUrl}}/youtube/v3/thumbnails/set?videoId="
response = HTTP::Client.post url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/youtube/v3/thumbnails/set?videoId="),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/youtube/v3/thumbnails/set?videoId=");
var request = new RestRequest("", Method.Post);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/youtube/v3/thumbnails/set?videoId="
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/youtube/v3/thumbnails/set?videoId= HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/youtube/v3/thumbnails/set?videoId=")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/youtube/v3/thumbnails/set?videoId="))
.method("POST", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/youtube/v3/thumbnails/set?videoId=")
.post(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/youtube/v3/thumbnails/set?videoId=")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/youtube/v3/thumbnails/set?videoId=');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/youtube/v3/thumbnails/set',
params: {videoId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/youtube/v3/thumbnails/set?videoId=';
const options = {method: 'POST'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/youtube/v3/thumbnails/set?videoId=',
method: 'POST',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/youtube/v3/thumbnails/set?videoId=")
.post(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/youtube/v3/thumbnails/set?videoId=',
headers: {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/youtube/v3/thumbnails/set',
qs: {videoId: ''}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/youtube/v3/thumbnails/set');
req.query({
videoId: ''
});
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}}/youtube/v3/thumbnails/set',
params: {videoId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/youtube/v3/thumbnails/set?videoId=';
const options = {method: 'POST'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/youtube/v3/thumbnails/set?videoId="]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/youtube/v3/thumbnails/set?videoId=" in
Client.call `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/youtube/v3/thumbnails/set?videoId=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/youtube/v3/thumbnails/set?videoId=');
echo $response->getBody();
setUrl('{{baseUrl}}/youtube/v3/thumbnails/set');
$request->setMethod(HTTP_METH_POST);
$request->setQueryData([
'videoId' => ''
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/youtube/v3/thumbnails/set');
$request->setRequestMethod('POST');
$request->setQuery(new http\QueryString([
'videoId' => ''
]));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/youtube/v3/thumbnails/set?videoId=' -Method POST
$response = Invoke-RestMethod -Uri '{{baseUrl}}/youtube/v3/thumbnails/set?videoId=' -Method POST
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("POST", "/baseUrl/youtube/v3/thumbnails/set?videoId=")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/youtube/v3/thumbnails/set"
querystring = {"videoId":""}
response = requests.post(url, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/youtube/v3/thumbnails/set"
queryString <- list(videoId = "")
response <- VERB("POST", url, query = queryString, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/youtube/v3/thumbnails/set?videoId=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.post('/baseUrl/youtube/v3/thumbnails/set') do |req|
req.params['videoId'] = ''
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/youtube/v3/thumbnails/set";
let querystring = [
("videoId", ""),
];
let client = reqwest::Client::new();
let response = client.post(url)
.query(&querystring)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/youtube/v3/thumbnails/set?videoId='
http POST '{{baseUrl}}/youtube/v3/thumbnails/set?videoId='
wget --quiet \
--method POST \
--output-document \
- '{{baseUrl}}/youtube/v3/thumbnails/set?videoId='
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/youtube/v3/thumbnails/set?videoId=")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
youtube.videoAbuseReportReasons.list
{{baseUrl}}/youtube/v3/videoAbuseReportReasons
QUERY PARAMS
part
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/youtube/v3/videoAbuseReportReasons?part=");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/youtube/v3/videoAbuseReportReasons" {:query-params {:part ""}})
require "http/client"
url = "{{baseUrl}}/youtube/v3/videoAbuseReportReasons?part="
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}}/youtube/v3/videoAbuseReportReasons?part="),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/youtube/v3/videoAbuseReportReasons?part=");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/youtube/v3/videoAbuseReportReasons?part="
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/youtube/v3/videoAbuseReportReasons?part= HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/youtube/v3/videoAbuseReportReasons?part=")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/youtube/v3/videoAbuseReportReasons?part="))
.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}}/youtube/v3/videoAbuseReportReasons?part=")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/youtube/v3/videoAbuseReportReasons?part=")
.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}}/youtube/v3/videoAbuseReportReasons?part=');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/youtube/v3/videoAbuseReportReasons',
params: {part: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/youtube/v3/videoAbuseReportReasons?part=';
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}}/youtube/v3/videoAbuseReportReasons?part=',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/youtube/v3/videoAbuseReportReasons?part=")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/youtube/v3/videoAbuseReportReasons?part=',
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}}/youtube/v3/videoAbuseReportReasons',
qs: {part: ''}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/youtube/v3/videoAbuseReportReasons');
req.query({
part: ''
});
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}}/youtube/v3/videoAbuseReportReasons',
params: {part: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/youtube/v3/videoAbuseReportReasons?part=';
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}}/youtube/v3/videoAbuseReportReasons?part="]
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}}/youtube/v3/videoAbuseReportReasons?part=" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/youtube/v3/videoAbuseReportReasons?part=",
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}}/youtube/v3/videoAbuseReportReasons?part=');
echo $response->getBody();
setUrl('{{baseUrl}}/youtube/v3/videoAbuseReportReasons');
$request->setMethod(HTTP_METH_GET);
$request->setQueryData([
'part' => ''
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/youtube/v3/videoAbuseReportReasons');
$request->setRequestMethod('GET');
$request->setQuery(new http\QueryString([
'part' => ''
]));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/youtube/v3/videoAbuseReportReasons?part=' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/youtube/v3/videoAbuseReportReasons?part=' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/youtube/v3/videoAbuseReportReasons?part=")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/youtube/v3/videoAbuseReportReasons"
querystring = {"part":""}
response = requests.get(url, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/youtube/v3/videoAbuseReportReasons"
queryString <- list(part = "")
response <- VERB("GET", url, query = queryString, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/youtube/v3/videoAbuseReportReasons?part=")
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/youtube/v3/videoAbuseReportReasons') do |req|
req.params['part'] = ''
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/youtube/v3/videoAbuseReportReasons";
let querystring = [
("part", ""),
];
let client = reqwest::Client::new();
let response = client.get(url)
.query(&querystring)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url '{{baseUrl}}/youtube/v3/videoAbuseReportReasons?part='
http GET '{{baseUrl}}/youtube/v3/videoAbuseReportReasons?part='
wget --quiet \
--method GET \
--output-document \
- '{{baseUrl}}/youtube/v3/videoAbuseReportReasons?part='
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/youtube/v3/videoAbuseReportReasons?part=")! 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
youtube.videoCategories.list
{{baseUrl}}/youtube/v3/videoCategories
QUERY PARAMS
part
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/youtube/v3/videoCategories?part=");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/youtube/v3/videoCategories" {:query-params {:part ""}})
require "http/client"
url = "{{baseUrl}}/youtube/v3/videoCategories?part="
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}}/youtube/v3/videoCategories?part="),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/youtube/v3/videoCategories?part=");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/youtube/v3/videoCategories?part="
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/youtube/v3/videoCategories?part= HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/youtube/v3/videoCategories?part=")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/youtube/v3/videoCategories?part="))
.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}}/youtube/v3/videoCategories?part=")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/youtube/v3/videoCategories?part=")
.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}}/youtube/v3/videoCategories?part=');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/youtube/v3/videoCategories',
params: {part: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/youtube/v3/videoCategories?part=';
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}}/youtube/v3/videoCategories?part=',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/youtube/v3/videoCategories?part=")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/youtube/v3/videoCategories?part=',
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}}/youtube/v3/videoCategories',
qs: {part: ''}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/youtube/v3/videoCategories');
req.query({
part: ''
});
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}}/youtube/v3/videoCategories',
params: {part: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/youtube/v3/videoCategories?part=';
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}}/youtube/v3/videoCategories?part="]
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}}/youtube/v3/videoCategories?part=" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/youtube/v3/videoCategories?part=",
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}}/youtube/v3/videoCategories?part=');
echo $response->getBody();
setUrl('{{baseUrl}}/youtube/v3/videoCategories');
$request->setMethod(HTTP_METH_GET);
$request->setQueryData([
'part' => ''
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/youtube/v3/videoCategories');
$request->setRequestMethod('GET');
$request->setQuery(new http\QueryString([
'part' => ''
]));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/youtube/v3/videoCategories?part=' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/youtube/v3/videoCategories?part=' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/youtube/v3/videoCategories?part=")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/youtube/v3/videoCategories"
querystring = {"part":""}
response = requests.get(url, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/youtube/v3/videoCategories"
queryString <- list(part = "")
response <- VERB("GET", url, query = queryString, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/youtube/v3/videoCategories?part=")
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/youtube/v3/videoCategories') do |req|
req.params['part'] = ''
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/youtube/v3/videoCategories";
let querystring = [
("part", ""),
];
let client = reqwest::Client::new();
let response = client.get(url)
.query(&querystring)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url '{{baseUrl}}/youtube/v3/videoCategories?part='
http GET '{{baseUrl}}/youtube/v3/videoCategories?part='
wget --quiet \
--method GET \
--output-document \
- '{{baseUrl}}/youtube/v3/videoCategories?part='
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/youtube/v3/videoCategories?part=")! 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()
DELETE
youtube.videos.delete
{{baseUrl}}/youtube/v3/videos
QUERY PARAMS
id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/youtube/v3/videos?id=");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/delete "{{baseUrl}}/youtube/v3/videos" {:query-params {:id ""}})
require "http/client"
url = "{{baseUrl}}/youtube/v3/videos?id="
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}}/youtube/v3/videos?id="),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/youtube/v3/videos?id=");
var request = new RestRequest("", Method.Delete);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/youtube/v3/videos?id="
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/youtube/v3/videos?id= HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/youtube/v3/videos?id=")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/youtube/v3/videos?id="))
.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}}/youtube/v3/videos?id=")
.delete(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/youtube/v3/videos?id=")
.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}}/youtube/v3/videos?id=');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'DELETE',
url: '{{baseUrl}}/youtube/v3/videos',
params: {id: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/youtube/v3/videos?id=';
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}}/youtube/v3/videos?id=',
method: 'DELETE',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/youtube/v3/videos?id=")
.delete(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'DELETE',
hostname: 'example.com',
port: null,
path: '/baseUrl/youtube/v3/videos?id=',
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}}/youtube/v3/videos',
qs: {id: ''}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('DELETE', '{{baseUrl}}/youtube/v3/videos');
req.query({
id: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'DELETE',
url: '{{baseUrl}}/youtube/v3/videos',
params: {id: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/youtube/v3/videos?id=';
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}}/youtube/v3/videos?id="]
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}}/youtube/v3/videos?id=" in
Client.call `DELETE uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/youtube/v3/videos?id=",
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}}/youtube/v3/videos?id=');
echo $response->getBody();
setUrl('{{baseUrl}}/youtube/v3/videos');
$request->setMethod(HTTP_METH_DELETE);
$request->setQueryData([
'id' => ''
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/youtube/v3/videos');
$request->setRequestMethod('DELETE');
$request->setQuery(new http\QueryString([
'id' => ''
]));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/youtube/v3/videos?id=' -Method DELETE
$response = Invoke-RestMethod -Uri '{{baseUrl}}/youtube/v3/videos?id=' -Method DELETE
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("DELETE", "/baseUrl/youtube/v3/videos?id=")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/youtube/v3/videos"
querystring = {"id":""}
response = requests.delete(url, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/youtube/v3/videos"
queryString <- list(id = "")
response <- VERB("DELETE", url, query = queryString, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/youtube/v3/videos?id=")
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/youtube/v3/videos') do |req|
req.params['id'] = ''
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/youtube/v3/videos";
let querystring = [
("id", ""),
];
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("DELETE").unwrap(), url)
.query(&querystring)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request DELETE \
--url '{{baseUrl}}/youtube/v3/videos?id='
http DELETE '{{baseUrl}}/youtube/v3/videos?id='
wget --quiet \
--method DELETE \
--output-document \
- '{{baseUrl}}/youtube/v3/videos?id='
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/youtube/v3/videos?id=")! 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
youtube.videos.getRating
{{baseUrl}}/youtube/v3/videos/getRating
QUERY PARAMS
id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/youtube/v3/videos/getRating?id=");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/youtube/v3/videos/getRating" {:query-params {:id ""}})
require "http/client"
url = "{{baseUrl}}/youtube/v3/videos/getRating?id="
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}}/youtube/v3/videos/getRating?id="),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/youtube/v3/videos/getRating?id=");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/youtube/v3/videos/getRating?id="
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/youtube/v3/videos/getRating?id= HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/youtube/v3/videos/getRating?id=")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/youtube/v3/videos/getRating?id="))
.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}}/youtube/v3/videos/getRating?id=")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/youtube/v3/videos/getRating?id=")
.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}}/youtube/v3/videos/getRating?id=');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/youtube/v3/videos/getRating',
params: {id: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/youtube/v3/videos/getRating?id=';
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}}/youtube/v3/videos/getRating?id=',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/youtube/v3/videos/getRating?id=")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/youtube/v3/videos/getRating?id=',
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}}/youtube/v3/videos/getRating',
qs: {id: ''}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/youtube/v3/videos/getRating');
req.query({
id: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/youtube/v3/videos/getRating',
params: {id: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/youtube/v3/videos/getRating?id=';
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}}/youtube/v3/videos/getRating?id="]
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}}/youtube/v3/videos/getRating?id=" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/youtube/v3/videos/getRating?id=",
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}}/youtube/v3/videos/getRating?id=');
echo $response->getBody();
setUrl('{{baseUrl}}/youtube/v3/videos/getRating');
$request->setMethod(HTTP_METH_GET);
$request->setQueryData([
'id' => ''
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/youtube/v3/videos/getRating');
$request->setRequestMethod('GET');
$request->setQuery(new http\QueryString([
'id' => ''
]));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/youtube/v3/videos/getRating?id=' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/youtube/v3/videos/getRating?id=' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/youtube/v3/videos/getRating?id=")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/youtube/v3/videos/getRating"
querystring = {"id":""}
response = requests.get(url, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/youtube/v3/videos/getRating"
queryString <- list(id = "")
response <- VERB("GET", url, query = queryString, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/youtube/v3/videos/getRating?id=")
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/youtube/v3/videos/getRating') do |req|
req.params['id'] = ''
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/youtube/v3/videos/getRating";
let querystring = [
("id", ""),
];
let client = reqwest::Client::new();
let response = client.get(url)
.query(&querystring)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url '{{baseUrl}}/youtube/v3/videos/getRating?id='
http GET '{{baseUrl}}/youtube/v3/videos/getRating?id='
wget --quiet \
--method GET \
--output-document \
- '{{baseUrl}}/youtube/v3/videos/getRating?id='
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/youtube/v3/videos/getRating?id=")! 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()
POST
youtube.videos.insert
{{baseUrl}}/youtube/v3/videos
QUERY PARAMS
part
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/youtube/v3/videos?part=");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/youtube/v3/videos" {:query-params {:part ""}})
require "http/client"
url = "{{baseUrl}}/youtube/v3/videos?part="
response = HTTP::Client.post url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/youtube/v3/videos?part="),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/youtube/v3/videos?part=");
var request = new RestRequest("", Method.Post);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/youtube/v3/videos?part="
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/youtube/v3/videos?part= HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/youtube/v3/videos?part=")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/youtube/v3/videos?part="))
.method("POST", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/youtube/v3/videos?part=")
.post(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/youtube/v3/videos?part=")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/youtube/v3/videos?part=');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/youtube/v3/videos',
params: {part: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/youtube/v3/videos?part=';
const options = {method: 'POST'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/youtube/v3/videos?part=',
method: 'POST',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/youtube/v3/videos?part=")
.post(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/youtube/v3/videos?part=',
headers: {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/youtube/v3/videos',
qs: {part: ''}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/youtube/v3/videos');
req.query({
part: ''
});
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}}/youtube/v3/videos',
params: {part: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/youtube/v3/videos?part=';
const options = {method: 'POST'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/youtube/v3/videos?part="]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/youtube/v3/videos?part=" in
Client.call `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/youtube/v3/videos?part=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/youtube/v3/videos?part=');
echo $response->getBody();
setUrl('{{baseUrl}}/youtube/v3/videos');
$request->setMethod(HTTP_METH_POST);
$request->setQueryData([
'part' => ''
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/youtube/v3/videos');
$request->setRequestMethod('POST');
$request->setQuery(new http\QueryString([
'part' => ''
]));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/youtube/v3/videos?part=' -Method POST
$response = Invoke-RestMethod -Uri '{{baseUrl}}/youtube/v3/videos?part=' -Method POST
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("POST", "/baseUrl/youtube/v3/videos?part=")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/youtube/v3/videos"
querystring = {"part":""}
response = requests.post(url, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/youtube/v3/videos"
queryString <- list(part = "")
response <- VERB("POST", url, query = queryString, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/youtube/v3/videos?part=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.post('/baseUrl/youtube/v3/videos') do |req|
req.params['part'] = ''
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/youtube/v3/videos";
let querystring = [
("part", ""),
];
let client = reqwest::Client::new();
let response = client.post(url)
.query(&querystring)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/youtube/v3/videos?part='
http POST '{{baseUrl}}/youtube/v3/videos?part='
wget --quiet \
--method POST \
--output-document \
- '{{baseUrl}}/youtube/v3/videos?part='
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/youtube/v3/videos?part=")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
youtube.videos.list
{{baseUrl}}/youtube/v3/videos
QUERY PARAMS
part
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/youtube/v3/videos?part=");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/youtube/v3/videos" {:query-params {:part ""}})
require "http/client"
url = "{{baseUrl}}/youtube/v3/videos?part="
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}}/youtube/v3/videos?part="),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/youtube/v3/videos?part=");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/youtube/v3/videos?part="
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/youtube/v3/videos?part= HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/youtube/v3/videos?part=")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/youtube/v3/videos?part="))
.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}}/youtube/v3/videos?part=")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/youtube/v3/videos?part=")
.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}}/youtube/v3/videos?part=');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/youtube/v3/videos',
params: {part: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/youtube/v3/videos?part=';
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}}/youtube/v3/videos?part=',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/youtube/v3/videos?part=")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/youtube/v3/videos?part=',
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}}/youtube/v3/videos',
qs: {part: ''}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/youtube/v3/videos');
req.query({
part: ''
});
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}}/youtube/v3/videos',
params: {part: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/youtube/v3/videos?part=';
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}}/youtube/v3/videos?part="]
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}}/youtube/v3/videos?part=" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/youtube/v3/videos?part=",
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}}/youtube/v3/videos?part=');
echo $response->getBody();
setUrl('{{baseUrl}}/youtube/v3/videos');
$request->setMethod(HTTP_METH_GET);
$request->setQueryData([
'part' => ''
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/youtube/v3/videos');
$request->setRequestMethod('GET');
$request->setQuery(new http\QueryString([
'part' => ''
]));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/youtube/v3/videos?part=' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/youtube/v3/videos?part=' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/youtube/v3/videos?part=")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/youtube/v3/videos"
querystring = {"part":""}
response = requests.get(url, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/youtube/v3/videos"
queryString <- list(part = "")
response <- VERB("GET", url, query = queryString, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/youtube/v3/videos?part=")
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/youtube/v3/videos') do |req|
req.params['part'] = ''
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/youtube/v3/videos";
let querystring = [
("part", ""),
];
let client = reqwest::Client::new();
let response = client.get(url)
.query(&querystring)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url '{{baseUrl}}/youtube/v3/videos?part='
http GET '{{baseUrl}}/youtube/v3/videos?part='
wget --quiet \
--method GET \
--output-document \
- '{{baseUrl}}/youtube/v3/videos?part='
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/youtube/v3/videos?part=")! 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()
POST
youtube.videos.rate
{{baseUrl}}/youtube/v3/videos/rate
QUERY PARAMS
id
rating
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/youtube/v3/videos/rate?id=&rating=");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/youtube/v3/videos/rate" {:query-params {:id ""
:rating ""}})
require "http/client"
url = "{{baseUrl}}/youtube/v3/videos/rate?id=&rating="
response = HTTP::Client.post url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/youtube/v3/videos/rate?id=&rating="),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/youtube/v3/videos/rate?id=&rating=");
var request = new RestRequest("", Method.Post);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/youtube/v3/videos/rate?id=&rating="
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/youtube/v3/videos/rate?id=&rating= HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/youtube/v3/videos/rate?id=&rating=")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/youtube/v3/videos/rate?id=&rating="))
.method("POST", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/youtube/v3/videos/rate?id=&rating=")
.post(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/youtube/v3/videos/rate?id=&rating=")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/youtube/v3/videos/rate?id=&rating=');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/youtube/v3/videos/rate',
params: {id: '', rating: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/youtube/v3/videos/rate?id=&rating=';
const options = {method: 'POST'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/youtube/v3/videos/rate?id=&rating=',
method: 'POST',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/youtube/v3/videos/rate?id=&rating=")
.post(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/youtube/v3/videos/rate?id=&rating=',
headers: {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/youtube/v3/videos/rate',
qs: {id: '', rating: ''}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/youtube/v3/videos/rate');
req.query({
id: '',
rating: ''
});
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}}/youtube/v3/videos/rate',
params: {id: '', rating: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/youtube/v3/videos/rate?id=&rating=';
const options = {method: 'POST'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/youtube/v3/videos/rate?id=&rating="]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/youtube/v3/videos/rate?id=&rating=" in
Client.call `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/youtube/v3/videos/rate?id=&rating=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/youtube/v3/videos/rate?id=&rating=');
echo $response->getBody();
setUrl('{{baseUrl}}/youtube/v3/videos/rate');
$request->setMethod(HTTP_METH_POST);
$request->setQueryData([
'id' => '',
'rating' => ''
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/youtube/v3/videos/rate');
$request->setRequestMethod('POST');
$request->setQuery(new http\QueryString([
'id' => '',
'rating' => ''
]));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/youtube/v3/videos/rate?id=&rating=' -Method POST
$response = Invoke-RestMethod -Uri '{{baseUrl}}/youtube/v3/videos/rate?id=&rating=' -Method POST
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("POST", "/baseUrl/youtube/v3/videos/rate?id=&rating=")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/youtube/v3/videos/rate"
querystring = {"id":"","rating":""}
response = requests.post(url, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/youtube/v3/videos/rate"
queryString <- list(
id = "",
rating = ""
)
response <- VERB("POST", url, query = queryString, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/youtube/v3/videos/rate?id=&rating=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.post('/baseUrl/youtube/v3/videos/rate') do |req|
req.params['id'] = ''
req.params['rating'] = ''
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/youtube/v3/videos/rate";
let querystring = [
("id", ""),
("rating", ""),
];
let client = reqwest::Client::new();
let response = client.post(url)
.query(&querystring)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/youtube/v3/videos/rate?id=&rating='
http POST '{{baseUrl}}/youtube/v3/videos/rate?id=&rating='
wget --quiet \
--method POST \
--output-document \
- '{{baseUrl}}/youtube/v3/videos/rate?id=&rating='
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/youtube/v3/videos/rate?id=&rating=")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
youtube.videos.reportAbuse
{{baseUrl}}/youtube/v3/videos/reportAbuse
BODY json
{
"comments": "",
"language": "",
"reasonId": "",
"secondaryReasonId": "",
"videoId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/youtube/v3/videos/reportAbuse");
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 \"comments\": \"\",\n \"language\": \"\",\n \"reasonId\": \"\",\n \"secondaryReasonId\": \"\",\n \"videoId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/youtube/v3/videos/reportAbuse" {:content-type :json
:form-params {:comments ""
:language ""
:reasonId ""
:secondaryReasonId ""
:videoId ""}})
require "http/client"
url = "{{baseUrl}}/youtube/v3/videos/reportAbuse"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"comments\": \"\",\n \"language\": \"\",\n \"reasonId\": \"\",\n \"secondaryReasonId\": \"\",\n \"videoId\": \"\"\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}}/youtube/v3/videos/reportAbuse"),
Content = new StringContent("{\n \"comments\": \"\",\n \"language\": \"\",\n \"reasonId\": \"\",\n \"secondaryReasonId\": \"\",\n \"videoId\": \"\"\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}}/youtube/v3/videos/reportAbuse");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"comments\": \"\",\n \"language\": \"\",\n \"reasonId\": \"\",\n \"secondaryReasonId\": \"\",\n \"videoId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/youtube/v3/videos/reportAbuse"
payload := strings.NewReader("{\n \"comments\": \"\",\n \"language\": \"\",\n \"reasonId\": \"\",\n \"secondaryReasonId\": \"\",\n \"videoId\": \"\"\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/youtube/v3/videos/reportAbuse HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 100
{
"comments": "",
"language": "",
"reasonId": "",
"secondaryReasonId": "",
"videoId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/youtube/v3/videos/reportAbuse")
.setHeader("content-type", "application/json")
.setBody("{\n \"comments\": \"\",\n \"language\": \"\",\n \"reasonId\": \"\",\n \"secondaryReasonId\": \"\",\n \"videoId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/youtube/v3/videos/reportAbuse"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"comments\": \"\",\n \"language\": \"\",\n \"reasonId\": \"\",\n \"secondaryReasonId\": \"\",\n \"videoId\": \"\"\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 \"comments\": \"\",\n \"language\": \"\",\n \"reasonId\": \"\",\n \"secondaryReasonId\": \"\",\n \"videoId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/youtube/v3/videos/reportAbuse")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/youtube/v3/videos/reportAbuse")
.header("content-type", "application/json")
.body("{\n \"comments\": \"\",\n \"language\": \"\",\n \"reasonId\": \"\",\n \"secondaryReasonId\": \"\",\n \"videoId\": \"\"\n}")
.asString();
const data = JSON.stringify({
comments: '',
language: '',
reasonId: '',
secondaryReasonId: '',
videoId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/youtube/v3/videos/reportAbuse');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/youtube/v3/videos/reportAbuse',
headers: {'content-type': 'application/json'},
data: {comments: '', language: '', reasonId: '', secondaryReasonId: '', videoId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/youtube/v3/videos/reportAbuse';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"comments":"","language":"","reasonId":"","secondaryReasonId":"","videoId":""}'
};
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}}/youtube/v3/videos/reportAbuse',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "comments": "",\n "language": "",\n "reasonId": "",\n "secondaryReasonId": "",\n "videoId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"comments\": \"\",\n \"language\": \"\",\n \"reasonId\": \"\",\n \"secondaryReasonId\": \"\",\n \"videoId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/youtube/v3/videos/reportAbuse")
.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/youtube/v3/videos/reportAbuse',
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({comments: '', language: '', reasonId: '', secondaryReasonId: '', videoId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/youtube/v3/videos/reportAbuse',
headers: {'content-type': 'application/json'},
body: {comments: '', language: '', reasonId: '', secondaryReasonId: '', videoId: ''},
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}}/youtube/v3/videos/reportAbuse');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
comments: '',
language: '',
reasonId: '',
secondaryReasonId: '',
videoId: ''
});
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}}/youtube/v3/videos/reportAbuse',
headers: {'content-type': 'application/json'},
data: {comments: '', language: '', reasonId: '', secondaryReasonId: '', videoId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/youtube/v3/videos/reportAbuse';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"comments":"","language":"","reasonId":"","secondaryReasonId":"","videoId":""}'
};
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 = @{ @"comments": @"",
@"language": @"",
@"reasonId": @"",
@"secondaryReasonId": @"",
@"videoId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/youtube/v3/videos/reportAbuse"]
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}}/youtube/v3/videos/reportAbuse" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"comments\": \"\",\n \"language\": \"\",\n \"reasonId\": \"\",\n \"secondaryReasonId\": \"\",\n \"videoId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/youtube/v3/videos/reportAbuse",
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([
'comments' => '',
'language' => '',
'reasonId' => '',
'secondaryReasonId' => '',
'videoId' => ''
]),
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}}/youtube/v3/videos/reportAbuse', [
'body' => '{
"comments": "",
"language": "",
"reasonId": "",
"secondaryReasonId": "",
"videoId": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/youtube/v3/videos/reportAbuse');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'comments' => '',
'language' => '',
'reasonId' => '',
'secondaryReasonId' => '',
'videoId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'comments' => '',
'language' => '',
'reasonId' => '',
'secondaryReasonId' => '',
'videoId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/youtube/v3/videos/reportAbuse');
$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}}/youtube/v3/videos/reportAbuse' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"comments": "",
"language": "",
"reasonId": "",
"secondaryReasonId": "",
"videoId": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/youtube/v3/videos/reportAbuse' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"comments": "",
"language": "",
"reasonId": "",
"secondaryReasonId": "",
"videoId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"comments\": \"\",\n \"language\": \"\",\n \"reasonId\": \"\",\n \"secondaryReasonId\": \"\",\n \"videoId\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/youtube/v3/videos/reportAbuse", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/youtube/v3/videos/reportAbuse"
payload = {
"comments": "",
"language": "",
"reasonId": "",
"secondaryReasonId": "",
"videoId": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/youtube/v3/videos/reportAbuse"
payload <- "{\n \"comments\": \"\",\n \"language\": \"\",\n \"reasonId\": \"\",\n \"secondaryReasonId\": \"\",\n \"videoId\": \"\"\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}}/youtube/v3/videos/reportAbuse")
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 \"comments\": \"\",\n \"language\": \"\",\n \"reasonId\": \"\",\n \"secondaryReasonId\": \"\",\n \"videoId\": \"\"\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/youtube/v3/videos/reportAbuse') do |req|
req.body = "{\n \"comments\": \"\",\n \"language\": \"\",\n \"reasonId\": \"\",\n \"secondaryReasonId\": \"\",\n \"videoId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/youtube/v3/videos/reportAbuse";
let payload = json!({
"comments": "",
"language": "",
"reasonId": "",
"secondaryReasonId": "",
"videoId": ""
});
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}}/youtube/v3/videos/reportAbuse \
--header 'content-type: application/json' \
--data '{
"comments": "",
"language": "",
"reasonId": "",
"secondaryReasonId": "",
"videoId": ""
}'
echo '{
"comments": "",
"language": "",
"reasonId": "",
"secondaryReasonId": "",
"videoId": ""
}' | \
http POST {{baseUrl}}/youtube/v3/videos/reportAbuse \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "comments": "",\n "language": "",\n "reasonId": "",\n "secondaryReasonId": "",\n "videoId": ""\n}' \
--output-document \
- {{baseUrl}}/youtube/v3/videos/reportAbuse
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"comments": "",
"language": "",
"reasonId": "",
"secondaryReasonId": "",
"videoId": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/youtube/v3/videos/reportAbuse")! 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()
PUT
youtube.videos.update
{{baseUrl}}/youtube/v3/videos
QUERY PARAMS
part
BODY json
{
"ageGating": {
"alcoholContent": false,
"restricted": false,
"videoGameRating": ""
},
"contentDetails": {
"caption": "",
"contentRating": {
"acbRating": "",
"agcomRating": "",
"anatelRating": "",
"bbfcRating": "",
"bfvcRating": "",
"bmukkRating": "",
"catvRating": "",
"catvfrRating": "",
"cbfcRating": "",
"cccRating": "",
"cceRating": "",
"chfilmRating": "",
"chvrsRating": "",
"cicfRating": "",
"cnaRating": "",
"cncRating": "",
"csaRating": "",
"cscfRating": "",
"czfilmRating": "",
"djctqRating": "",
"djctqRatingReasons": [],
"ecbmctRating": "",
"eefilmRating": "",
"egfilmRating": "",
"eirinRating": "",
"fcbmRating": "",
"fcoRating": "",
"fmocRating": "",
"fpbRating": "",
"fpbRatingReasons": [],
"fskRating": "",
"grfilmRating": "",
"icaaRating": "",
"ifcoRating": "",
"ilfilmRating": "",
"incaaRating": "",
"kfcbRating": "",
"kijkwijzerRating": "",
"kmrbRating": "",
"lsfRating": "",
"mccaaRating": "",
"mccypRating": "",
"mcstRating": "",
"mdaRating": "",
"medietilsynetRating": "",
"mekuRating": "",
"menaMpaaRating": "",
"mibacRating": "",
"mocRating": "",
"moctwRating": "",
"mpaaRating": "",
"mpaatRating": "",
"mtrcbRating": "",
"nbcRating": "",
"nbcplRating": "",
"nfrcRating": "",
"nfvcbRating": "",
"nkclvRating": "",
"nmcRating": "",
"oflcRating": "",
"pefilmRating": "",
"rcnofRating": "",
"resorteviolenciaRating": "",
"rtcRating": "",
"rteRating": "",
"russiaRating": "",
"skfilmRating": "",
"smaisRating": "",
"smsaRating": "",
"tvpgRating": "",
"ytRating": ""
},
"countryRestriction": {
"allowed": false,
"exception": []
},
"definition": "",
"dimension": "",
"duration": "",
"hasCustomThumbnail": false,
"licensedContent": false,
"projection": "",
"regionRestriction": {
"allowed": [],
"blocked": []
}
},
"etag": "",
"fileDetails": {
"audioStreams": [
{
"bitrateBps": "",
"channelCount": 0,
"codec": "",
"vendor": ""
}
],
"bitrateBps": "",
"container": "",
"creationTime": "",
"durationMs": "",
"fileName": "",
"fileSize": "",
"fileType": "",
"videoStreams": [
{
"aspectRatio": "",
"bitrateBps": "",
"codec": "",
"frameRateFps": "",
"heightPixels": 0,
"rotation": "",
"vendor": "",
"widthPixels": 0
}
]
},
"id": "",
"kind": "",
"liveStreamingDetails": {
"activeLiveChatId": "",
"actualEndTime": "",
"actualStartTime": "",
"concurrentViewers": "",
"scheduledEndTime": "",
"scheduledStartTime": ""
},
"localizations": {},
"monetizationDetails": {
"access": {}
},
"player": {
"embedHeight": "",
"embedHtml": "",
"embedWidth": ""
},
"processingDetails": {
"editorSuggestionsAvailability": "",
"fileDetailsAvailability": "",
"processingFailureReason": "",
"processingIssuesAvailability": "",
"processingProgress": {
"partsProcessed": "",
"partsTotal": "",
"timeLeftMs": ""
},
"processingStatus": "",
"tagSuggestionsAvailability": "",
"thumbnailsAvailability": ""
},
"projectDetails": {},
"recordingDetails": {
"location": {
"altitude": "",
"latitude": "",
"longitude": ""
},
"locationDescription": "",
"recordingDate": ""
},
"snippet": {
"categoryId": "",
"channelId": "",
"channelTitle": "",
"defaultAudioLanguage": "",
"defaultLanguage": "",
"description": "",
"liveBroadcastContent": "",
"localized": {
"description": "",
"title": ""
},
"publishedAt": "",
"tags": [],
"thumbnails": {
"high": {
"height": 0,
"url": "",
"width": 0
},
"maxres": {},
"medium": {},
"standard": {}
},
"title": ""
},
"statistics": {
"commentCount": "",
"dislikeCount": "",
"favoriteCount": "",
"likeCount": "",
"viewCount": ""
},
"status": {
"embeddable": false,
"failureReason": "",
"license": "",
"madeForKids": false,
"privacyStatus": "",
"publicStatsViewable": false,
"publishAt": "",
"rejectionReason": "",
"selfDeclaredMadeForKids": false,
"uploadStatus": ""
},
"suggestions": {
"editorSuggestions": [],
"processingErrors": [],
"processingHints": [],
"processingWarnings": [],
"tagSuggestions": [
{
"categoryRestricts": [],
"tag": ""
}
]
},
"topicDetails": {
"relevantTopicIds": [],
"topicCategories": [],
"topicIds": []
}
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/youtube/v3/videos?part=");
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 \"ageGating\": {\n \"alcoholContent\": false,\n \"restricted\": false,\n \"videoGameRating\": \"\"\n },\n \"contentDetails\": {\n \"caption\": \"\",\n \"contentRating\": {\n \"acbRating\": \"\",\n \"agcomRating\": \"\",\n \"anatelRating\": \"\",\n \"bbfcRating\": \"\",\n \"bfvcRating\": \"\",\n \"bmukkRating\": \"\",\n \"catvRating\": \"\",\n \"catvfrRating\": \"\",\n \"cbfcRating\": \"\",\n \"cccRating\": \"\",\n \"cceRating\": \"\",\n \"chfilmRating\": \"\",\n \"chvrsRating\": \"\",\n \"cicfRating\": \"\",\n \"cnaRating\": \"\",\n \"cncRating\": \"\",\n \"csaRating\": \"\",\n \"cscfRating\": \"\",\n \"czfilmRating\": \"\",\n \"djctqRating\": \"\",\n \"djctqRatingReasons\": [],\n \"ecbmctRating\": \"\",\n \"eefilmRating\": \"\",\n \"egfilmRating\": \"\",\n \"eirinRating\": \"\",\n \"fcbmRating\": \"\",\n \"fcoRating\": \"\",\n \"fmocRating\": \"\",\n \"fpbRating\": \"\",\n \"fpbRatingReasons\": [],\n \"fskRating\": \"\",\n \"grfilmRating\": \"\",\n \"icaaRating\": \"\",\n \"ifcoRating\": \"\",\n \"ilfilmRating\": \"\",\n \"incaaRating\": \"\",\n \"kfcbRating\": \"\",\n \"kijkwijzerRating\": \"\",\n \"kmrbRating\": \"\",\n \"lsfRating\": \"\",\n \"mccaaRating\": \"\",\n \"mccypRating\": \"\",\n \"mcstRating\": \"\",\n \"mdaRating\": \"\",\n \"medietilsynetRating\": \"\",\n \"mekuRating\": \"\",\n \"menaMpaaRating\": \"\",\n \"mibacRating\": \"\",\n \"mocRating\": \"\",\n \"moctwRating\": \"\",\n \"mpaaRating\": \"\",\n \"mpaatRating\": \"\",\n \"mtrcbRating\": \"\",\n \"nbcRating\": \"\",\n \"nbcplRating\": \"\",\n \"nfrcRating\": \"\",\n \"nfvcbRating\": \"\",\n \"nkclvRating\": \"\",\n \"nmcRating\": \"\",\n \"oflcRating\": \"\",\n \"pefilmRating\": \"\",\n \"rcnofRating\": \"\",\n \"resorteviolenciaRating\": \"\",\n \"rtcRating\": \"\",\n \"rteRating\": \"\",\n \"russiaRating\": \"\",\n \"skfilmRating\": \"\",\n \"smaisRating\": \"\",\n \"smsaRating\": \"\",\n \"tvpgRating\": \"\",\n \"ytRating\": \"\"\n },\n \"countryRestriction\": {\n \"allowed\": false,\n \"exception\": []\n },\n \"definition\": \"\",\n \"dimension\": \"\",\n \"duration\": \"\",\n \"hasCustomThumbnail\": false,\n \"licensedContent\": false,\n \"projection\": \"\",\n \"regionRestriction\": {\n \"allowed\": [],\n \"blocked\": []\n }\n },\n \"etag\": \"\",\n \"fileDetails\": {\n \"audioStreams\": [\n {\n \"bitrateBps\": \"\",\n \"channelCount\": 0,\n \"codec\": \"\",\n \"vendor\": \"\"\n }\n ],\n \"bitrateBps\": \"\",\n \"container\": \"\",\n \"creationTime\": \"\",\n \"durationMs\": \"\",\n \"fileName\": \"\",\n \"fileSize\": \"\",\n \"fileType\": \"\",\n \"videoStreams\": [\n {\n \"aspectRatio\": \"\",\n \"bitrateBps\": \"\",\n \"codec\": \"\",\n \"frameRateFps\": \"\",\n \"heightPixels\": 0,\n \"rotation\": \"\",\n \"vendor\": \"\",\n \"widthPixels\": 0\n }\n ]\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"liveStreamingDetails\": {\n \"activeLiveChatId\": \"\",\n \"actualEndTime\": \"\",\n \"actualStartTime\": \"\",\n \"concurrentViewers\": \"\",\n \"scheduledEndTime\": \"\",\n \"scheduledStartTime\": \"\"\n },\n \"localizations\": {},\n \"monetizationDetails\": {\n \"access\": {}\n },\n \"player\": {\n \"embedHeight\": \"\",\n \"embedHtml\": \"\",\n \"embedWidth\": \"\"\n },\n \"processingDetails\": {\n \"editorSuggestionsAvailability\": \"\",\n \"fileDetailsAvailability\": \"\",\n \"processingFailureReason\": \"\",\n \"processingIssuesAvailability\": \"\",\n \"processingProgress\": {\n \"partsProcessed\": \"\",\n \"partsTotal\": \"\",\n \"timeLeftMs\": \"\"\n },\n \"processingStatus\": \"\",\n \"tagSuggestionsAvailability\": \"\",\n \"thumbnailsAvailability\": \"\"\n },\n \"projectDetails\": {},\n \"recordingDetails\": {\n \"location\": {\n \"altitude\": \"\",\n \"latitude\": \"\",\n \"longitude\": \"\"\n },\n \"locationDescription\": \"\",\n \"recordingDate\": \"\"\n },\n \"snippet\": {\n \"categoryId\": \"\",\n \"channelId\": \"\",\n \"channelTitle\": \"\",\n \"defaultAudioLanguage\": \"\",\n \"defaultLanguage\": \"\",\n \"description\": \"\",\n \"liveBroadcastContent\": \"\",\n \"localized\": {\n \"description\": \"\",\n \"title\": \"\"\n },\n \"publishedAt\": \"\",\n \"tags\": [],\n \"thumbnails\": {\n \"high\": {\n \"height\": 0,\n \"url\": \"\",\n \"width\": 0\n },\n \"maxres\": {},\n \"medium\": {},\n \"standard\": {}\n },\n \"title\": \"\"\n },\n \"statistics\": {\n \"commentCount\": \"\",\n \"dislikeCount\": \"\",\n \"favoriteCount\": \"\",\n \"likeCount\": \"\",\n \"viewCount\": \"\"\n },\n \"status\": {\n \"embeddable\": false,\n \"failureReason\": \"\",\n \"license\": \"\",\n \"madeForKids\": false,\n \"privacyStatus\": \"\",\n \"publicStatsViewable\": false,\n \"publishAt\": \"\",\n \"rejectionReason\": \"\",\n \"selfDeclaredMadeForKids\": false,\n \"uploadStatus\": \"\"\n },\n \"suggestions\": {\n \"editorSuggestions\": [],\n \"processingErrors\": [],\n \"processingHints\": [],\n \"processingWarnings\": [],\n \"tagSuggestions\": [\n {\n \"categoryRestricts\": [],\n \"tag\": \"\"\n }\n ]\n },\n \"topicDetails\": {\n \"relevantTopicIds\": [],\n \"topicCategories\": [],\n \"topicIds\": []\n }\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/youtube/v3/videos" {:query-params {:part ""}
:content-type :json
:form-params {:ageGating {:alcoholContent false
:restricted false
:videoGameRating ""}
:contentDetails {:caption ""
:contentRating {:acbRating ""
:agcomRating ""
:anatelRating ""
:bbfcRating ""
:bfvcRating ""
:bmukkRating ""
:catvRating ""
:catvfrRating ""
:cbfcRating ""
:cccRating ""
:cceRating ""
:chfilmRating ""
:chvrsRating ""
:cicfRating ""
:cnaRating ""
:cncRating ""
:csaRating ""
:cscfRating ""
:czfilmRating ""
:djctqRating ""
:djctqRatingReasons []
:ecbmctRating ""
:eefilmRating ""
:egfilmRating ""
:eirinRating ""
:fcbmRating ""
:fcoRating ""
:fmocRating ""
:fpbRating ""
:fpbRatingReasons []
:fskRating ""
:grfilmRating ""
:icaaRating ""
:ifcoRating ""
:ilfilmRating ""
:incaaRating ""
:kfcbRating ""
:kijkwijzerRating ""
:kmrbRating ""
:lsfRating ""
:mccaaRating ""
:mccypRating ""
:mcstRating ""
:mdaRating ""
:medietilsynetRating ""
:mekuRating ""
:menaMpaaRating ""
:mibacRating ""
:mocRating ""
:moctwRating ""
:mpaaRating ""
:mpaatRating ""
:mtrcbRating ""
:nbcRating ""
:nbcplRating ""
:nfrcRating ""
:nfvcbRating ""
:nkclvRating ""
:nmcRating ""
:oflcRating ""
:pefilmRating ""
:rcnofRating ""
:resorteviolenciaRating ""
:rtcRating ""
:rteRating ""
:russiaRating ""
:skfilmRating ""
:smaisRating ""
:smsaRating ""
:tvpgRating ""
:ytRating ""}
:countryRestriction {:allowed false
:exception []}
:definition ""
:dimension ""
:duration ""
:hasCustomThumbnail false
:licensedContent false
:projection ""
:regionRestriction {:allowed []
:blocked []}}
:etag ""
:fileDetails {:audioStreams [{:bitrateBps ""
:channelCount 0
:codec ""
:vendor ""}]
:bitrateBps ""
:container ""
:creationTime ""
:durationMs ""
:fileName ""
:fileSize ""
:fileType ""
:videoStreams [{:aspectRatio ""
:bitrateBps ""
:codec ""
:frameRateFps ""
:heightPixels 0
:rotation ""
:vendor ""
:widthPixels 0}]}
:id ""
:kind ""
:liveStreamingDetails {:activeLiveChatId ""
:actualEndTime ""
:actualStartTime ""
:concurrentViewers ""
:scheduledEndTime ""
:scheduledStartTime ""}
:localizations {}
:monetizationDetails {:access {}}
:player {:embedHeight ""
:embedHtml ""
:embedWidth ""}
:processingDetails {:editorSuggestionsAvailability ""
:fileDetailsAvailability ""
:processingFailureReason ""
:processingIssuesAvailability ""
:processingProgress {:partsProcessed ""
:partsTotal ""
:timeLeftMs ""}
:processingStatus ""
:tagSuggestionsAvailability ""
:thumbnailsAvailability ""}
:projectDetails {}
:recordingDetails {:location {:altitude ""
:latitude ""
:longitude ""}
:locationDescription ""
:recordingDate ""}
:snippet {:categoryId ""
:channelId ""
:channelTitle ""
:defaultAudioLanguage ""
:defaultLanguage ""
:description ""
:liveBroadcastContent ""
:localized {:description ""
:title ""}
:publishedAt ""
:tags []
:thumbnails {:high {:height 0
:url ""
:width 0}
:maxres {}
:medium {}
:standard {}}
:title ""}
:statistics {:commentCount ""
:dislikeCount ""
:favoriteCount ""
:likeCount ""
:viewCount ""}
:status {:embeddable false
:failureReason ""
:license ""
:madeForKids false
:privacyStatus ""
:publicStatsViewable false
:publishAt ""
:rejectionReason ""
:selfDeclaredMadeForKids false
:uploadStatus ""}
:suggestions {:editorSuggestions []
:processingErrors []
:processingHints []
:processingWarnings []
:tagSuggestions [{:categoryRestricts []
:tag ""}]}
:topicDetails {:relevantTopicIds []
:topicCategories []
:topicIds []}}})
require "http/client"
url = "{{baseUrl}}/youtube/v3/videos?part="
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"ageGating\": {\n \"alcoholContent\": false,\n \"restricted\": false,\n \"videoGameRating\": \"\"\n },\n \"contentDetails\": {\n \"caption\": \"\",\n \"contentRating\": {\n \"acbRating\": \"\",\n \"agcomRating\": \"\",\n \"anatelRating\": \"\",\n \"bbfcRating\": \"\",\n \"bfvcRating\": \"\",\n \"bmukkRating\": \"\",\n \"catvRating\": \"\",\n \"catvfrRating\": \"\",\n \"cbfcRating\": \"\",\n \"cccRating\": \"\",\n \"cceRating\": \"\",\n \"chfilmRating\": \"\",\n \"chvrsRating\": \"\",\n \"cicfRating\": \"\",\n \"cnaRating\": \"\",\n \"cncRating\": \"\",\n \"csaRating\": \"\",\n \"cscfRating\": \"\",\n \"czfilmRating\": \"\",\n \"djctqRating\": \"\",\n \"djctqRatingReasons\": [],\n \"ecbmctRating\": \"\",\n \"eefilmRating\": \"\",\n \"egfilmRating\": \"\",\n \"eirinRating\": \"\",\n \"fcbmRating\": \"\",\n \"fcoRating\": \"\",\n \"fmocRating\": \"\",\n \"fpbRating\": \"\",\n \"fpbRatingReasons\": [],\n \"fskRating\": \"\",\n \"grfilmRating\": \"\",\n \"icaaRating\": \"\",\n \"ifcoRating\": \"\",\n \"ilfilmRating\": \"\",\n \"incaaRating\": \"\",\n \"kfcbRating\": \"\",\n \"kijkwijzerRating\": \"\",\n \"kmrbRating\": \"\",\n \"lsfRating\": \"\",\n \"mccaaRating\": \"\",\n \"mccypRating\": \"\",\n \"mcstRating\": \"\",\n \"mdaRating\": \"\",\n \"medietilsynetRating\": \"\",\n \"mekuRating\": \"\",\n \"menaMpaaRating\": \"\",\n \"mibacRating\": \"\",\n \"mocRating\": \"\",\n \"moctwRating\": \"\",\n \"mpaaRating\": \"\",\n \"mpaatRating\": \"\",\n \"mtrcbRating\": \"\",\n \"nbcRating\": \"\",\n \"nbcplRating\": \"\",\n \"nfrcRating\": \"\",\n \"nfvcbRating\": \"\",\n \"nkclvRating\": \"\",\n \"nmcRating\": \"\",\n \"oflcRating\": \"\",\n \"pefilmRating\": \"\",\n \"rcnofRating\": \"\",\n \"resorteviolenciaRating\": \"\",\n \"rtcRating\": \"\",\n \"rteRating\": \"\",\n \"russiaRating\": \"\",\n \"skfilmRating\": \"\",\n \"smaisRating\": \"\",\n \"smsaRating\": \"\",\n \"tvpgRating\": \"\",\n \"ytRating\": \"\"\n },\n \"countryRestriction\": {\n \"allowed\": false,\n \"exception\": []\n },\n \"definition\": \"\",\n \"dimension\": \"\",\n \"duration\": \"\",\n \"hasCustomThumbnail\": false,\n \"licensedContent\": false,\n \"projection\": \"\",\n \"regionRestriction\": {\n \"allowed\": [],\n \"blocked\": []\n }\n },\n \"etag\": \"\",\n \"fileDetails\": {\n \"audioStreams\": [\n {\n \"bitrateBps\": \"\",\n \"channelCount\": 0,\n \"codec\": \"\",\n \"vendor\": \"\"\n }\n ],\n \"bitrateBps\": \"\",\n \"container\": \"\",\n \"creationTime\": \"\",\n \"durationMs\": \"\",\n \"fileName\": \"\",\n \"fileSize\": \"\",\n \"fileType\": \"\",\n \"videoStreams\": [\n {\n \"aspectRatio\": \"\",\n \"bitrateBps\": \"\",\n \"codec\": \"\",\n \"frameRateFps\": \"\",\n \"heightPixels\": 0,\n \"rotation\": \"\",\n \"vendor\": \"\",\n \"widthPixels\": 0\n }\n ]\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"liveStreamingDetails\": {\n \"activeLiveChatId\": \"\",\n \"actualEndTime\": \"\",\n \"actualStartTime\": \"\",\n \"concurrentViewers\": \"\",\n \"scheduledEndTime\": \"\",\n \"scheduledStartTime\": \"\"\n },\n \"localizations\": {},\n \"monetizationDetails\": {\n \"access\": {}\n },\n \"player\": {\n \"embedHeight\": \"\",\n \"embedHtml\": \"\",\n \"embedWidth\": \"\"\n },\n \"processingDetails\": {\n \"editorSuggestionsAvailability\": \"\",\n \"fileDetailsAvailability\": \"\",\n \"processingFailureReason\": \"\",\n \"processingIssuesAvailability\": \"\",\n \"processingProgress\": {\n \"partsProcessed\": \"\",\n \"partsTotal\": \"\",\n \"timeLeftMs\": \"\"\n },\n \"processingStatus\": \"\",\n \"tagSuggestionsAvailability\": \"\",\n \"thumbnailsAvailability\": \"\"\n },\n \"projectDetails\": {},\n \"recordingDetails\": {\n \"location\": {\n \"altitude\": \"\",\n \"latitude\": \"\",\n \"longitude\": \"\"\n },\n \"locationDescription\": \"\",\n \"recordingDate\": \"\"\n },\n \"snippet\": {\n \"categoryId\": \"\",\n \"channelId\": \"\",\n \"channelTitle\": \"\",\n \"defaultAudioLanguage\": \"\",\n \"defaultLanguage\": \"\",\n \"description\": \"\",\n \"liveBroadcastContent\": \"\",\n \"localized\": {\n \"description\": \"\",\n \"title\": \"\"\n },\n \"publishedAt\": \"\",\n \"tags\": [],\n \"thumbnails\": {\n \"high\": {\n \"height\": 0,\n \"url\": \"\",\n \"width\": 0\n },\n \"maxres\": {},\n \"medium\": {},\n \"standard\": {}\n },\n \"title\": \"\"\n },\n \"statistics\": {\n \"commentCount\": \"\",\n \"dislikeCount\": \"\",\n \"favoriteCount\": \"\",\n \"likeCount\": \"\",\n \"viewCount\": \"\"\n },\n \"status\": {\n \"embeddable\": false,\n \"failureReason\": \"\",\n \"license\": \"\",\n \"madeForKids\": false,\n \"privacyStatus\": \"\",\n \"publicStatsViewable\": false,\n \"publishAt\": \"\",\n \"rejectionReason\": \"\",\n \"selfDeclaredMadeForKids\": false,\n \"uploadStatus\": \"\"\n },\n \"suggestions\": {\n \"editorSuggestions\": [],\n \"processingErrors\": [],\n \"processingHints\": [],\n \"processingWarnings\": [],\n \"tagSuggestions\": [\n {\n \"categoryRestricts\": [],\n \"tag\": \"\"\n }\n ]\n },\n \"topicDetails\": {\n \"relevantTopicIds\": [],\n \"topicCategories\": [],\n \"topicIds\": []\n }\n}"
response = HTTP::Client.put url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Put,
RequestUri = new Uri("{{baseUrl}}/youtube/v3/videos?part="),
Content = new StringContent("{\n \"ageGating\": {\n \"alcoholContent\": false,\n \"restricted\": false,\n \"videoGameRating\": \"\"\n },\n \"contentDetails\": {\n \"caption\": \"\",\n \"contentRating\": {\n \"acbRating\": \"\",\n \"agcomRating\": \"\",\n \"anatelRating\": \"\",\n \"bbfcRating\": \"\",\n \"bfvcRating\": \"\",\n \"bmukkRating\": \"\",\n \"catvRating\": \"\",\n \"catvfrRating\": \"\",\n \"cbfcRating\": \"\",\n \"cccRating\": \"\",\n \"cceRating\": \"\",\n \"chfilmRating\": \"\",\n \"chvrsRating\": \"\",\n \"cicfRating\": \"\",\n \"cnaRating\": \"\",\n \"cncRating\": \"\",\n \"csaRating\": \"\",\n \"cscfRating\": \"\",\n \"czfilmRating\": \"\",\n \"djctqRating\": \"\",\n \"djctqRatingReasons\": [],\n \"ecbmctRating\": \"\",\n \"eefilmRating\": \"\",\n \"egfilmRating\": \"\",\n \"eirinRating\": \"\",\n \"fcbmRating\": \"\",\n \"fcoRating\": \"\",\n \"fmocRating\": \"\",\n \"fpbRating\": \"\",\n \"fpbRatingReasons\": [],\n \"fskRating\": \"\",\n \"grfilmRating\": \"\",\n \"icaaRating\": \"\",\n \"ifcoRating\": \"\",\n \"ilfilmRating\": \"\",\n \"incaaRating\": \"\",\n \"kfcbRating\": \"\",\n \"kijkwijzerRating\": \"\",\n \"kmrbRating\": \"\",\n \"lsfRating\": \"\",\n \"mccaaRating\": \"\",\n \"mccypRating\": \"\",\n \"mcstRating\": \"\",\n \"mdaRating\": \"\",\n \"medietilsynetRating\": \"\",\n \"mekuRating\": \"\",\n \"menaMpaaRating\": \"\",\n \"mibacRating\": \"\",\n \"mocRating\": \"\",\n \"moctwRating\": \"\",\n \"mpaaRating\": \"\",\n \"mpaatRating\": \"\",\n \"mtrcbRating\": \"\",\n \"nbcRating\": \"\",\n \"nbcplRating\": \"\",\n \"nfrcRating\": \"\",\n \"nfvcbRating\": \"\",\n \"nkclvRating\": \"\",\n \"nmcRating\": \"\",\n \"oflcRating\": \"\",\n \"pefilmRating\": \"\",\n \"rcnofRating\": \"\",\n \"resorteviolenciaRating\": \"\",\n \"rtcRating\": \"\",\n \"rteRating\": \"\",\n \"russiaRating\": \"\",\n \"skfilmRating\": \"\",\n \"smaisRating\": \"\",\n \"smsaRating\": \"\",\n \"tvpgRating\": \"\",\n \"ytRating\": \"\"\n },\n \"countryRestriction\": {\n \"allowed\": false,\n \"exception\": []\n },\n \"definition\": \"\",\n \"dimension\": \"\",\n \"duration\": \"\",\n \"hasCustomThumbnail\": false,\n \"licensedContent\": false,\n \"projection\": \"\",\n \"regionRestriction\": {\n \"allowed\": [],\n \"blocked\": []\n }\n },\n \"etag\": \"\",\n \"fileDetails\": {\n \"audioStreams\": [\n {\n \"bitrateBps\": \"\",\n \"channelCount\": 0,\n \"codec\": \"\",\n \"vendor\": \"\"\n }\n ],\n \"bitrateBps\": \"\",\n \"container\": \"\",\n \"creationTime\": \"\",\n \"durationMs\": \"\",\n \"fileName\": \"\",\n \"fileSize\": \"\",\n \"fileType\": \"\",\n \"videoStreams\": [\n {\n \"aspectRatio\": \"\",\n \"bitrateBps\": \"\",\n \"codec\": \"\",\n \"frameRateFps\": \"\",\n \"heightPixels\": 0,\n \"rotation\": \"\",\n \"vendor\": \"\",\n \"widthPixels\": 0\n }\n ]\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"liveStreamingDetails\": {\n \"activeLiveChatId\": \"\",\n \"actualEndTime\": \"\",\n \"actualStartTime\": \"\",\n \"concurrentViewers\": \"\",\n \"scheduledEndTime\": \"\",\n \"scheduledStartTime\": \"\"\n },\n \"localizations\": {},\n \"monetizationDetails\": {\n \"access\": {}\n },\n \"player\": {\n \"embedHeight\": \"\",\n \"embedHtml\": \"\",\n \"embedWidth\": \"\"\n },\n \"processingDetails\": {\n \"editorSuggestionsAvailability\": \"\",\n \"fileDetailsAvailability\": \"\",\n \"processingFailureReason\": \"\",\n \"processingIssuesAvailability\": \"\",\n \"processingProgress\": {\n \"partsProcessed\": \"\",\n \"partsTotal\": \"\",\n \"timeLeftMs\": \"\"\n },\n \"processingStatus\": \"\",\n \"tagSuggestionsAvailability\": \"\",\n \"thumbnailsAvailability\": \"\"\n },\n \"projectDetails\": {},\n \"recordingDetails\": {\n \"location\": {\n \"altitude\": \"\",\n \"latitude\": \"\",\n \"longitude\": \"\"\n },\n \"locationDescription\": \"\",\n \"recordingDate\": \"\"\n },\n \"snippet\": {\n \"categoryId\": \"\",\n \"channelId\": \"\",\n \"channelTitle\": \"\",\n \"defaultAudioLanguage\": \"\",\n \"defaultLanguage\": \"\",\n \"description\": \"\",\n \"liveBroadcastContent\": \"\",\n \"localized\": {\n \"description\": \"\",\n \"title\": \"\"\n },\n \"publishedAt\": \"\",\n \"tags\": [],\n \"thumbnails\": {\n \"high\": {\n \"height\": 0,\n \"url\": \"\",\n \"width\": 0\n },\n \"maxres\": {},\n \"medium\": {},\n \"standard\": {}\n },\n \"title\": \"\"\n },\n \"statistics\": {\n \"commentCount\": \"\",\n \"dislikeCount\": \"\",\n \"favoriteCount\": \"\",\n \"likeCount\": \"\",\n \"viewCount\": \"\"\n },\n \"status\": {\n \"embeddable\": false,\n \"failureReason\": \"\",\n \"license\": \"\",\n \"madeForKids\": false,\n \"privacyStatus\": \"\",\n \"publicStatsViewable\": false,\n \"publishAt\": \"\",\n \"rejectionReason\": \"\",\n \"selfDeclaredMadeForKids\": false,\n \"uploadStatus\": \"\"\n },\n \"suggestions\": {\n \"editorSuggestions\": [],\n \"processingErrors\": [],\n \"processingHints\": [],\n \"processingWarnings\": [],\n \"tagSuggestions\": [\n {\n \"categoryRestricts\": [],\n \"tag\": \"\"\n }\n ]\n },\n \"topicDetails\": {\n \"relevantTopicIds\": [],\n \"topicCategories\": [],\n \"topicIds\": []\n }\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/youtube/v3/videos?part=");
var request = new RestRequest("", Method.Put);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"ageGating\": {\n \"alcoholContent\": false,\n \"restricted\": false,\n \"videoGameRating\": \"\"\n },\n \"contentDetails\": {\n \"caption\": \"\",\n \"contentRating\": {\n \"acbRating\": \"\",\n \"agcomRating\": \"\",\n \"anatelRating\": \"\",\n \"bbfcRating\": \"\",\n \"bfvcRating\": \"\",\n \"bmukkRating\": \"\",\n \"catvRating\": \"\",\n \"catvfrRating\": \"\",\n \"cbfcRating\": \"\",\n \"cccRating\": \"\",\n \"cceRating\": \"\",\n \"chfilmRating\": \"\",\n \"chvrsRating\": \"\",\n \"cicfRating\": \"\",\n \"cnaRating\": \"\",\n \"cncRating\": \"\",\n \"csaRating\": \"\",\n \"cscfRating\": \"\",\n \"czfilmRating\": \"\",\n \"djctqRating\": \"\",\n \"djctqRatingReasons\": [],\n \"ecbmctRating\": \"\",\n \"eefilmRating\": \"\",\n \"egfilmRating\": \"\",\n \"eirinRating\": \"\",\n \"fcbmRating\": \"\",\n \"fcoRating\": \"\",\n \"fmocRating\": \"\",\n \"fpbRating\": \"\",\n \"fpbRatingReasons\": [],\n \"fskRating\": \"\",\n \"grfilmRating\": \"\",\n \"icaaRating\": \"\",\n \"ifcoRating\": \"\",\n \"ilfilmRating\": \"\",\n \"incaaRating\": \"\",\n \"kfcbRating\": \"\",\n \"kijkwijzerRating\": \"\",\n \"kmrbRating\": \"\",\n \"lsfRating\": \"\",\n \"mccaaRating\": \"\",\n \"mccypRating\": \"\",\n \"mcstRating\": \"\",\n \"mdaRating\": \"\",\n \"medietilsynetRating\": \"\",\n \"mekuRating\": \"\",\n \"menaMpaaRating\": \"\",\n \"mibacRating\": \"\",\n \"mocRating\": \"\",\n \"moctwRating\": \"\",\n \"mpaaRating\": \"\",\n \"mpaatRating\": \"\",\n \"mtrcbRating\": \"\",\n \"nbcRating\": \"\",\n \"nbcplRating\": \"\",\n \"nfrcRating\": \"\",\n \"nfvcbRating\": \"\",\n \"nkclvRating\": \"\",\n \"nmcRating\": \"\",\n \"oflcRating\": \"\",\n \"pefilmRating\": \"\",\n \"rcnofRating\": \"\",\n \"resorteviolenciaRating\": \"\",\n \"rtcRating\": \"\",\n \"rteRating\": \"\",\n \"russiaRating\": \"\",\n \"skfilmRating\": \"\",\n \"smaisRating\": \"\",\n \"smsaRating\": \"\",\n \"tvpgRating\": \"\",\n \"ytRating\": \"\"\n },\n \"countryRestriction\": {\n \"allowed\": false,\n \"exception\": []\n },\n \"definition\": \"\",\n \"dimension\": \"\",\n \"duration\": \"\",\n \"hasCustomThumbnail\": false,\n \"licensedContent\": false,\n \"projection\": \"\",\n \"regionRestriction\": {\n \"allowed\": [],\n \"blocked\": []\n }\n },\n \"etag\": \"\",\n \"fileDetails\": {\n \"audioStreams\": [\n {\n \"bitrateBps\": \"\",\n \"channelCount\": 0,\n \"codec\": \"\",\n \"vendor\": \"\"\n }\n ],\n \"bitrateBps\": \"\",\n \"container\": \"\",\n \"creationTime\": \"\",\n \"durationMs\": \"\",\n \"fileName\": \"\",\n \"fileSize\": \"\",\n \"fileType\": \"\",\n \"videoStreams\": [\n {\n \"aspectRatio\": \"\",\n \"bitrateBps\": \"\",\n \"codec\": \"\",\n \"frameRateFps\": \"\",\n \"heightPixels\": 0,\n \"rotation\": \"\",\n \"vendor\": \"\",\n \"widthPixels\": 0\n }\n ]\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"liveStreamingDetails\": {\n \"activeLiveChatId\": \"\",\n \"actualEndTime\": \"\",\n \"actualStartTime\": \"\",\n \"concurrentViewers\": \"\",\n \"scheduledEndTime\": \"\",\n \"scheduledStartTime\": \"\"\n },\n \"localizations\": {},\n \"monetizationDetails\": {\n \"access\": {}\n },\n \"player\": {\n \"embedHeight\": \"\",\n \"embedHtml\": \"\",\n \"embedWidth\": \"\"\n },\n \"processingDetails\": {\n \"editorSuggestionsAvailability\": \"\",\n \"fileDetailsAvailability\": \"\",\n \"processingFailureReason\": \"\",\n \"processingIssuesAvailability\": \"\",\n \"processingProgress\": {\n \"partsProcessed\": \"\",\n \"partsTotal\": \"\",\n \"timeLeftMs\": \"\"\n },\n \"processingStatus\": \"\",\n \"tagSuggestionsAvailability\": \"\",\n \"thumbnailsAvailability\": \"\"\n },\n \"projectDetails\": {},\n \"recordingDetails\": {\n \"location\": {\n \"altitude\": \"\",\n \"latitude\": \"\",\n \"longitude\": \"\"\n },\n \"locationDescription\": \"\",\n \"recordingDate\": \"\"\n },\n \"snippet\": {\n \"categoryId\": \"\",\n \"channelId\": \"\",\n \"channelTitle\": \"\",\n \"defaultAudioLanguage\": \"\",\n \"defaultLanguage\": \"\",\n \"description\": \"\",\n \"liveBroadcastContent\": \"\",\n \"localized\": {\n \"description\": \"\",\n \"title\": \"\"\n },\n \"publishedAt\": \"\",\n \"tags\": [],\n \"thumbnails\": {\n \"high\": {\n \"height\": 0,\n \"url\": \"\",\n \"width\": 0\n },\n \"maxres\": {},\n \"medium\": {},\n \"standard\": {}\n },\n \"title\": \"\"\n },\n \"statistics\": {\n \"commentCount\": \"\",\n \"dislikeCount\": \"\",\n \"favoriteCount\": \"\",\n \"likeCount\": \"\",\n \"viewCount\": \"\"\n },\n \"status\": {\n \"embeddable\": false,\n \"failureReason\": \"\",\n \"license\": \"\",\n \"madeForKids\": false,\n \"privacyStatus\": \"\",\n \"publicStatsViewable\": false,\n \"publishAt\": \"\",\n \"rejectionReason\": \"\",\n \"selfDeclaredMadeForKids\": false,\n \"uploadStatus\": \"\"\n },\n \"suggestions\": {\n \"editorSuggestions\": [],\n \"processingErrors\": [],\n \"processingHints\": [],\n \"processingWarnings\": [],\n \"tagSuggestions\": [\n {\n \"categoryRestricts\": [],\n \"tag\": \"\"\n }\n ]\n },\n \"topicDetails\": {\n \"relevantTopicIds\": [],\n \"topicCategories\": [],\n \"topicIds\": []\n }\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/youtube/v3/videos?part="
payload := strings.NewReader("{\n \"ageGating\": {\n \"alcoholContent\": false,\n \"restricted\": false,\n \"videoGameRating\": \"\"\n },\n \"contentDetails\": {\n \"caption\": \"\",\n \"contentRating\": {\n \"acbRating\": \"\",\n \"agcomRating\": \"\",\n \"anatelRating\": \"\",\n \"bbfcRating\": \"\",\n \"bfvcRating\": \"\",\n \"bmukkRating\": \"\",\n \"catvRating\": \"\",\n \"catvfrRating\": \"\",\n \"cbfcRating\": \"\",\n \"cccRating\": \"\",\n \"cceRating\": \"\",\n \"chfilmRating\": \"\",\n \"chvrsRating\": \"\",\n \"cicfRating\": \"\",\n \"cnaRating\": \"\",\n \"cncRating\": \"\",\n \"csaRating\": \"\",\n \"cscfRating\": \"\",\n \"czfilmRating\": \"\",\n \"djctqRating\": \"\",\n \"djctqRatingReasons\": [],\n \"ecbmctRating\": \"\",\n \"eefilmRating\": \"\",\n \"egfilmRating\": \"\",\n \"eirinRating\": \"\",\n \"fcbmRating\": \"\",\n \"fcoRating\": \"\",\n \"fmocRating\": \"\",\n \"fpbRating\": \"\",\n \"fpbRatingReasons\": [],\n \"fskRating\": \"\",\n \"grfilmRating\": \"\",\n \"icaaRating\": \"\",\n \"ifcoRating\": \"\",\n \"ilfilmRating\": \"\",\n \"incaaRating\": \"\",\n \"kfcbRating\": \"\",\n \"kijkwijzerRating\": \"\",\n \"kmrbRating\": \"\",\n \"lsfRating\": \"\",\n \"mccaaRating\": \"\",\n \"mccypRating\": \"\",\n \"mcstRating\": \"\",\n \"mdaRating\": \"\",\n \"medietilsynetRating\": \"\",\n \"mekuRating\": \"\",\n \"menaMpaaRating\": \"\",\n \"mibacRating\": \"\",\n \"mocRating\": \"\",\n \"moctwRating\": \"\",\n \"mpaaRating\": \"\",\n \"mpaatRating\": \"\",\n \"mtrcbRating\": \"\",\n \"nbcRating\": \"\",\n \"nbcplRating\": \"\",\n \"nfrcRating\": \"\",\n \"nfvcbRating\": \"\",\n \"nkclvRating\": \"\",\n \"nmcRating\": \"\",\n \"oflcRating\": \"\",\n \"pefilmRating\": \"\",\n \"rcnofRating\": \"\",\n \"resorteviolenciaRating\": \"\",\n \"rtcRating\": \"\",\n \"rteRating\": \"\",\n \"russiaRating\": \"\",\n \"skfilmRating\": \"\",\n \"smaisRating\": \"\",\n \"smsaRating\": \"\",\n \"tvpgRating\": \"\",\n \"ytRating\": \"\"\n },\n \"countryRestriction\": {\n \"allowed\": false,\n \"exception\": []\n },\n \"definition\": \"\",\n \"dimension\": \"\",\n \"duration\": \"\",\n \"hasCustomThumbnail\": false,\n \"licensedContent\": false,\n \"projection\": \"\",\n \"regionRestriction\": {\n \"allowed\": [],\n \"blocked\": []\n }\n },\n \"etag\": \"\",\n \"fileDetails\": {\n \"audioStreams\": [\n {\n \"bitrateBps\": \"\",\n \"channelCount\": 0,\n \"codec\": \"\",\n \"vendor\": \"\"\n }\n ],\n \"bitrateBps\": \"\",\n \"container\": \"\",\n \"creationTime\": \"\",\n \"durationMs\": \"\",\n \"fileName\": \"\",\n \"fileSize\": \"\",\n \"fileType\": \"\",\n \"videoStreams\": [\n {\n \"aspectRatio\": \"\",\n \"bitrateBps\": \"\",\n \"codec\": \"\",\n \"frameRateFps\": \"\",\n \"heightPixels\": 0,\n \"rotation\": \"\",\n \"vendor\": \"\",\n \"widthPixels\": 0\n }\n ]\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"liveStreamingDetails\": {\n \"activeLiveChatId\": \"\",\n \"actualEndTime\": \"\",\n \"actualStartTime\": \"\",\n \"concurrentViewers\": \"\",\n \"scheduledEndTime\": \"\",\n \"scheduledStartTime\": \"\"\n },\n \"localizations\": {},\n \"monetizationDetails\": {\n \"access\": {}\n },\n \"player\": {\n \"embedHeight\": \"\",\n \"embedHtml\": \"\",\n \"embedWidth\": \"\"\n },\n \"processingDetails\": {\n \"editorSuggestionsAvailability\": \"\",\n \"fileDetailsAvailability\": \"\",\n \"processingFailureReason\": \"\",\n \"processingIssuesAvailability\": \"\",\n \"processingProgress\": {\n \"partsProcessed\": \"\",\n \"partsTotal\": \"\",\n \"timeLeftMs\": \"\"\n },\n \"processingStatus\": \"\",\n \"tagSuggestionsAvailability\": \"\",\n \"thumbnailsAvailability\": \"\"\n },\n \"projectDetails\": {},\n \"recordingDetails\": {\n \"location\": {\n \"altitude\": \"\",\n \"latitude\": \"\",\n \"longitude\": \"\"\n },\n \"locationDescription\": \"\",\n \"recordingDate\": \"\"\n },\n \"snippet\": {\n \"categoryId\": \"\",\n \"channelId\": \"\",\n \"channelTitle\": \"\",\n \"defaultAudioLanguage\": \"\",\n \"defaultLanguage\": \"\",\n \"description\": \"\",\n \"liveBroadcastContent\": \"\",\n \"localized\": {\n \"description\": \"\",\n \"title\": \"\"\n },\n \"publishedAt\": \"\",\n \"tags\": [],\n \"thumbnails\": {\n \"high\": {\n \"height\": 0,\n \"url\": \"\",\n \"width\": 0\n },\n \"maxres\": {},\n \"medium\": {},\n \"standard\": {}\n },\n \"title\": \"\"\n },\n \"statistics\": {\n \"commentCount\": \"\",\n \"dislikeCount\": \"\",\n \"favoriteCount\": \"\",\n \"likeCount\": \"\",\n \"viewCount\": \"\"\n },\n \"status\": {\n \"embeddable\": false,\n \"failureReason\": \"\",\n \"license\": \"\",\n \"madeForKids\": false,\n \"privacyStatus\": \"\",\n \"publicStatsViewable\": false,\n \"publishAt\": \"\",\n \"rejectionReason\": \"\",\n \"selfDeclaredMadeForKids\": false,\n \"uploadStatus\": \"\"\n },\n \"suggestions\": {\n \"editorSuggestions\": [],\n \"processingErrors\": [],\n \"processingHints\": [],\n \"processingWarnings\": [],\n \"tagSuggestions\": [\n {\n \"categoryRestricts\": [],\n \"tag\": \"\"\n }\n ]\n },\n \"topicDetails\": {\n \"relevantTopicIds\": [],\n \"topicCategories\": [],\n \"topicIds\": []\n }\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PUT /baseUrl/youtube/v3/videos?part= HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 5045
{
"ageGating": {
"alcoholContent": false,
"restricted": false,
"videoGameRating": ""
},
"contentDetails": {
"caption": "",
"contentRating": {
"acbRating": "",
"agcomRating": "",
"anatelRating": "",
"bbfcRating": "",
"bfvcRating": "",
"bmukkRating": "",
"catvRating": "",
"catvfrRating": "",
"cbfcRating": "",
"cccRating": "",
"cceRating": "",
"chfilmRating": "",
"chvrsRating": "",
"cicfRating": "",
"cnaRating": "",
"cncRating": "",
"csaRating": "",
"cscfRating": "",
"czfilmRating": "",
"djctqRating": "",
"djctqRatingReasons": [],
"ecbmctRating": "",
"eefilmRating": "",
"egfilmRating": "",
"eirinRating": "",
"fcbmRating": "",
"fcoRating": "",
"fmocRating": "",
"fpbRating": "",
"fpbRatingReasons": [],
"fskRating": "",
"grfilmRating": "",
"icaaRating": "",
"ifcoRating": "",
"ilfilmRating": "",
"incaaRating": "",
"kfcbRating": "",
"kijkwijzerRating": "",
"kmrbRating": "",
"lsfRating": "",
"mccaaRating": "",
"mccypRating": "",
"mcstRating": "",
"mdaRating": "",
"medietilsynetRating": "",
"mekuRating": "",
"menaMpaaRating": "",
"mibacRating": "",
"mocRating": "",
"moctwRating": "",
"mpaaRating": "",
"mpaatRating": "",
"mtrcbRating": "",
"nbcRating": "",
"nbcplRating": "",
"nfrcRating": "",
"nfvcbRating": "",
"nkclvRating": "",
"nmcRating": "",
"oflcRating": "",
"pefilmRating": "",
"rcnofRating": "",
"resorteviolenciaRating": "",
"rtcRating": "",
"rteRating": "",
"russiaRating": "",
"skfilmRating": "",
"smaisRating": "",
"smsaRating": "",
"tvpgRating": "",
"ytRating": ""
},
"countryRestriction": {
"allowed": false,
"exception": []
},
"definition": "",
"dimension": "",
"duration": "",
"hasCustomThumbnail": false,
"licensedContent": false,
"projection": "",
"regionRestriction": {
"allowed": [],
"blocked": []
}
},
"etag": "",
"fileDetails": {
"audioStreams": [
{
"bitrateBps": "",
"channelCount": 0,
"codec": "",
"vendor": ""
}
],
"bitrateBps": "",
"container": "",
"creationTime": "",
"durationMs": "",
"fileName": "",
"fileSize": "",
"fileType": "",
"videoStreams": [
{
"aspectRatio": "",
"bitrateBps": "",
"codec": "",
"frameRateFps": "",
"heightPixels": 0,
"rotation": "",
"vendor": "",
"widthPixels": 0
}
]
},
"id": "",
"kind": "",
"liveStreamingDetails": {
"activeLiveChatId": "",
"actualEndTime": "",
"actualStartTime": "",
"concurrentViewers": "",
"scheduledEndTime": "",
"scheduledStartTime": ""
},
"localizations": {},
"monetizationDetails": {
"access": {}
},
"player": {
"embedHeight": "",
"embedHtml": "",
"embedWidth": ""
},
"processingDetails": {
"editorSuggestionsAvailability": "",
"fileDetailsAvailability": "",
"processingFailureReason": "",
"processingIssuesAvailability": "",
"processingProgress": {
"partsProcessed": "",
"partsTotal": "",
"timeLeftMs": ""
},
"processingStatus": "",
"tagSuggestionsAvailability": "",
"thumbnailsAvailability": ""
},
"projectDetails": {},
"recordingDetails": {
"location": {
"altitude": "",
"latitude": "",
"longitude": ""
},
"locationDescription": "",
"recordingDate": ""
},
"snippet": {
"categoryId": "",
"channelId": "",
"channelTitle": "",
"defaultAudioLanguage": "",
"defaultLanguage": "",
"description": "",
"liveBroadcastContent": "",
"localized": {
"description": "",
"title": ""
},
"publishedAt": "",
"tags": [],
"thumbnails": {
"high": {
"height": 0,
"url": "",
"width": 0
},
"maxres": {},
"medium": {},
"standard": {}
},
"title": ""
},
"statistics": {
"commentCount": "",
"dislikeCount": "",
"favoriteCount": "",
"likeCount": "",
"viewCount": ""
},
"status": {
"embeddable": false,
"failureReason": "",
"license": "",
"madeForKids": false,
"privacyStatus": "",
"publicStatsViewable": false,
"publishAt": "",
"rejectionReason": "",
"selfDeclaredMadeForKids": false,
"uploadStatus": ""
},
"suggestions": {
"editorSuggestions": [],
"processingErrors": [],
"processingHints": [],
"processingWarnings": [],
"tagSuggestions": [
{
"categoryRestricts": [],
"tag": ""
}
]
},
"topicDetails": {
"relevantTopicIds": [],
"topicCategories": [],
"topicIds": []
}
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/youtube/v3/videos?part=")
.setHeader("content-type", "application/json")
.setBody("{\n \"ageGating\": {\n \"alcoholContent\": false,\n \"restricted\": false,\n \"videoGameRating\": \"\"\n },\n \"contentDetails\": {\n \"caption\": \"\",\n \"contentRating\": {\n \"acbRating\": \"\",\n \"agcomRating\": \"\",\n \"anatelRating\": \"\",\n \"bbfcRating\": \"\",\n \"bfvcRating\": \"\",\n \"bmukkRating\": \"\",\n \"catvRating\": \"\",\n \"catvfrRating\": \"\",\n \"cbfcRating\": \"\",\n \"cccRating\": \"\",\n \"cceRating\": \"\",\n \"chfilmRating\": \"\",\n \"chvrsRating\": \"\",\n \"cicfRating\": \"\",\n \"cnaRating\": \"\",\n \"cncRating\": \"\",\n \"csaRating\": \"\",\n \"cscfRating\": \"\",\n \"czfilmRating\": \"\",\n \"djctqRating\": \"\",\n \"djctqRatingReasons\": [],\n \"ecbmctRating\": \"\",\n \"eefilmRating\": \"\",\n \"egfilmRating\": \"\",\n \"eirinRating\": \"\",\n \"fcbmRating\": \"\",\n \"fcoRating\": \"\",\n \"fmocRating\": \"\",\n \"fpbRating\": \"\",\n \"fpbRatingReasons\": [],\n \"fskRating\": \"\",\n \"grfilmRating\": \"\",\n \"icaaRating\": \"\",\n \"ifcoRating\": \"\",\n \"ilfilmRating\": \"\",\n \"incaaRating\": \"\",\n \"kfcbRating\": \"\",\n \"kijkwijzerRating\": \"\",\n \"kmrbRating\": \"\",\n \"lsfRating\": \"\",\n \"mccaaRating\": \"\",\n \"mccypRating\": \"\",\n \"mcstRating\": \"\",\n \"mdaRating\": \"\",\n \"medietilsynetRating\": \"\",\n \"mekuRating\": \"\",\n \"menaMpaaRating\": \"\",\n \"mibacRating\": \"\",\n \"mocRating\": \"\",\n \"moctwRating\": \"\",\n \"mpaaRating\": \"\",\n \"mpaatRating\": \"\",\n \"mtrcbRating\": \"\",\n \"nbcRating\": \"\",\n \"nbcplRating\": \"\",\n \"nfrcRating\": \"\",\n \"nfvcbRating\": \"\",\n \"nkclvRating\": \"\",\n \"nmcRating\": \"\",\n \"oflcRating\": \"\",\n \"pefilmRating\": \"\",\n \"rcnofRating\": \"\",\n \"resorteviolenciaRating\": \"\",\n \"rtcRating\": \"\",\n \"rteRating\": \"\",\n \"russiaRating\": \"\",\n \"skfilmRating\": \"\",\n \"smaisRating\": \"\",\n \"smsaRating\": \"\",\n \"tvpgRating\": \"\",\n \"ytRating\": \"\"\n },\n \"countryRestriction\": {\n \"allowed\": false,\n \"exception\": []\n },\n \"definition\": \"\",\n \"dimension\": \"\",\n \"duration\": \"\",\n \"hasCustomThumbnail\": false,\n \"licensedContent\": false,\n \"projection\": \"\",\n \"regionRestriction\": {\n \"allowed\": [],\n \"blocked\": []\n }\n },\n \"etag\": \"\",\n \"fileDetails\": {\n \"audioStreams\": [\n {\n \"bitrateBps\": \"\",\n \"channelCount\": 0,\n \"codec\": \"\",\n \"vendor\": \"\"\n }\n ],\n \"bitrateBps\": \"\",\n \"container\": \"\",\n \"creationTime\": \"\",\n \"durationMs\": \"\",\n \"fileName\": \"\",\n \"fileSize\": \"\",\n \"fileType\": \"\",\n \"videoStreams\": [\n {\n \"aspectRatio\": \"\",\n \"bitrateBps\": \"\",\n \"codec\": \"\",\n \"frameRateFps\": \"\",\n \"heightPixels\": 0,\n \"rotation\": \"\",\n \"vendor\": \"\",\n \"widthPixels\": 0\n }\n ]\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"liveStreamingDetails\": {\n \"activeLiveChatId\": \"\",\n \"actualEndTime\": \"\",\n \"actualStartTime\": \"\",\n \"concurrentViewers\": \"\",\n \"scheduledEndTime\": \"\",\n \"scheduledStartTime\": \"\"\n },\n \"localizations\": {},\n \"monetizationDetails\": {\n \"access\": {}\n },\n \"player\": {\n \"embedHeight\": \"\",\n \"embedHtml\": \"\",\n \"embedWidth\": \"\"\n },\n \"processingDetails\": {\n \"editorSuggestionsAvailability\": \"\",\n \"fileDetailsAvailability\": \"\",\n \"processingFailureReason\": \"\",\n \"processingIssuesAvailability\": \"\",\n \"processingProgress\": {\n \"partsProcessed\": \"\",\n \"partsTotal\": \"\",\n \"timeLeftMs\": \"\"\n },\n \"processingStatus\": \"\",\n \"tagSuggestionsAvailability\": \"\",\n \"thumbnailsAvailability\": \"\"\n },\n \"projectDetails\": {},\n \"recordingDetails\": {\n \"location\": {\n \"altitude\": \"\",\n \"latitude\": \"\",\n \"longitude\": \"\"\n },\n \"locationDescription\": \"\",\n \"recordingDate\": \"\"\n },\n \"snippet\": {\n \"categoryId\": \"\",\n \"channelId\": \"\",\n \"channelTitle\": \"\",\n \"defaultAudioLanguage\": \"\",\n \"defaultLanguage\": \"\",\n \"description\": \"\",\n \"liveBroadcastContent\": \"\",\n \"localized\": {\n \"description\": \"\",\n \"title\": \"\"\n },\n \"publishedAt\": \"\",\n \"tags\": [],\n \"thumbnails\": {\n \"high\": {\n \"height\": 0,\n \"url\": \"\",\n \"width\": 0\n },\n \"maxres\": {},\n \"medium\": {},\n \"standard\": {}\n },\n \"title\": \"\"\n },\n \"statistics\": {\n \"commentCount\": \"\",\n \"dislikeCount\": \"\",\n \"favoriteCount\": \"\",\n \"likeCount\": \"\",\n \"viewCount\": \"\"\n },\n \"status\": {\n \"embeddable\": false,\n \"failureReason\": \"\",\n \"license\": \"\",\n \"madeForKids\": false,\n \"privacyStatus\": \"\",\n \"publicStatsViewable\": false,\n \"publishAt\": \"\",\n \"rejectionReason\": \"\",\n \"selfDeclaredMadeForKids\": false,\n \"uploadStatus\": \"\"\n },\n \"suggestions\": {\n \"editorSuggestions\": [],\n \"processingErrors\": [],\n \"processingHints\": [],\n \"processingWarnings\": [],\n \"tagSuggestions\": [\n {\n \"categoryRestricts\": [],\n \"tag\": \"\"\n }\n ]\n },\n \"topicDetails\": {\n \"relevantTopicIds\": [],\n \"topicCategories\": [],\n \"topicIds\": []\n }\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/youtube/v3/videos?part="))
.header("content-type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString("{\n \"ageGating\": {\n \"alcoholContent\": false,\n \"restricted\": false,\n \"videoGameRating\": \"\"\n },\n \"contentDetails\": {\n \"caption\": \"\",\n \"contentRating\": {\n \"acbRating\": \"\",\n \"agcomRating\": \"\",\n \"anatelRating\": \"\",\n \"bbfcRating\": \"\",\n \"bfvcRating\": \"\",\n \"bmukkRating\": \"\",\n \"catvRating\": \"\",\n \"catvfrRating\": \"\",\n \"cbfcRating\": \"\",\n \"cccRating\": \"\",\n \"cceRating\": \"\",\n \"chfilmRating\": \"\",\n \"chvrsRating\": \"\",\n \"cicfRating\": \"\",\n \"cnaRating\": \"\",\n \"cncRating\": \"\",\n \"csaRating\": \"\",\n \"cscfRating\": \"\",\n \"czfilmRating\": \"\",\n \"djctqRating\": \"\",\n \"djctqRatingReasons\": [],\n \"ecbmctRating\": \"\",\n \"eefilmRating\": \"\",\n \"egfilmRating\": \"\",\n \"eirinRating\": \"\",\n \"fcbmRating\": \"\",\n \"fcoRating\": \"\",\n \"fmocRating\": \"\",\n \"fpbRating\": \"\",\n \"fpbRatingReasons\": [],\n \"fskRating\": \"\",\n \"grfilmRating\": \"\",\n \"icaaRating\": \"\",\n \"ifcoRating\": \"\",\n \"ilfilmRating\": \"\",\n \"incaaRating\": \"\",\n \"kfcbRating\": \"\",\n \"kijkwijzerRating\": \"\",\n \"kmrbRating\": \"\",\n \"lsfRating\": \"\",\n \"mccaaRating\": \"\",\n \"mccypRating\": \"\",\n \"mcstRating\": \"\",\n \"mdaRating\": \"\",\n \"medietilsynetRating\": \"\",\n \"mekuRating\": \"\",\n \"menaMpaaRating\": \"\",\n \"mibacRating\": \"\",\n \"mocRating\": \"\",\n \"moctwRating\": \"\",\n \"mpaaRating\": \"\",\n \"mpaatRating\": \"\",\n \"mtrcbRating\": \"\",\n \"nbcRating\": \"\",\n \"nbcplRating\": \"\",\n \"nfrcRating\": \"\",\n \"nfvcbRating\": \"\",\n \"nkclvRating\": \"\",\n \"nmcRating\": \"\",\n \"oflcRating\": \"\",\n \"pefilmRating\": \"\",\n \"rcnofRating\": \"\",\n \"resorteviolenciaRating\": \"\",\n \"rtcRating\": \"\",\n \"rteRating\": \"\",\n \"russiaRating\": \"\",\n \"skfilmRating\": \"\",\n \"smaisRating\": \"\",\n \"smsaRating\": \"\",\n \"tvpgRating\": \"\",\n \"ytRating\": \"\"\n },\n \"countryRestriction\": {\n \"allowed\": false,\n \"exception\": []\n },\n \"definition\": \"\",\n \"dimension\": \"\",\n \"duration\": \"\",\n \"hasCustomThumbnail\": false,\n \"licensedContent\": false,\n \"projection\": \"\",\n \"regionRestriction\": {\n \"allowed\": [],\n \"blocked\": []\n }\n },\n \"etag\": \"\",\n \"fileDetails\": {\n \"audioStreams\": [\n {\n \"bitrateBps\": \"\",\n \"channelCount\": 0,\n \"codec\": \"\",\n \"vendor\": \"\"\n }\n ],\n \"bitrateBps\": \"\",\n \"container\": \"\",\n \"creationTime\": \"\",\n \"durationMs\": \"\",\n \"fileName\": \"\",\n \"fileSize\": \"\",\n \"fileType\": \"\",\n \"videoStreams\": [\n {\n \"aspectRatio\": \"\",\n \"bitrateBps\": \"\",\n \"codec\": \"\",\n \"frameRateFps\": \"\",\n \"heightPixels\": 0,\n \"rotation\": \"\",\n \"vendor\": \"\",\n \"widthPixels\": 0\n }\n ]\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"liveStreamingDetails\": {\n \"activeLiveChatId\": \"\",\n \"actualEndTime\": \"\",\n \"actualStartTime\": \"\",\n \"concurrentViewers\": \"\",\n \"scheduledEndTime\": \"\",\n \"scheduledStartTime\": \"\"\n },\n \"localizations\": {},\n \"monetizationDetails\": {\n \"access\": {}\n },\n \"player\": {\n \"embedHeight\": \"\",\n \"embedHtml\": \"\",\n \"embedWidth\": \"\"\n },\n \"processingDetails\": {\n \"editorSuggestionsAvailability\": \"\",\n \"fileDetailsAvailability\": \"\",\n \"processingFailureReason\": \"\",\n \"processingIssuesAvailability\": \"\",\n \"processingProgress\": {\n \"partsProcessed\": \"\",\n \"partsTotal\": \"\",\n \"timeLeftMs\": \"\"\n },\n \"processingStatus\": \"\",\n \"tagSuggestionsAvailability\": \"\",\n \"thumbnailsAvailability\": \"\"\n },\n \"projectDetails\": {},\n \"recordingDetails\": {\n \"location\": {\n \"altitude\": \"\",\n \"latitude\": \"\",\n \"longitude\": \"\"\n },\n \"locationDescription\": \"\",\n \"recordingDate\": \"\"\n },\n \"snippet\": {\n \"categoryId\": \"\",\n \"channelId\": \"\",\n \"channelTitle\": \"\",\n \"defaultAudioLanguage\": \"\",\n \"defaultLanguage\": \"\",\n \"description\": \"\",\n \"liveBroadcastContent\": \"\",\n \"localized\": {\n \"description\": \"\",\n \"title\": \"\"\n },\n \"publishedAt\": \"\",\n \"tags\": [],\n \"thumbnails\": {\n \"high\": {\n \"height\": 0,\n \"url\": \"\",\n \"width\": 0\n },\n \"maxres\": {},\n \"medium\": {},\n \"standard\": {}\n },\n \"title\": \"\"\n },\n \"statistics\": {\n \"commentCount\": \"\",\n \"dislikeCount\": \"\",\n \"favoriteCount\": \"\",\n \"likeCount\": \"\",\n \"viewCount\": \"\"\n },\n \"status\": {\n \"embeddable\": false,\n \"failureReason\": \"\",\n \"license\": \"\",\n \"madeForKids\": false,\n \"privacyStatus\": \"\",\n \"publicStatsViewable\": false,\n \"publishAt\": \"\",\n \"rejectionReason\": \"\",\n \"selfDeclaredMadeForKids\": false,\n \"uploadStatus\": \"\"\n },\n \"suggestions\": {\n \"editorSuggestions\": [],\n \"processingErrors\": [],\n \"processingHints\": [],\n \"processingWarnings\": [],\n \"tagSuggestions\": [\n {\n \"categoryRestricts\": [],\n \"tag\": \"\"\n }\n ]\n },\n \"topicDetails\": {\n \"relevantTopicIds\": [],\n \"topicCategories\": [],\n \"topicIds\": []\n }\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"ageGating\": {\n \"alcoholContent\": false,\n \"restricted\": false,\n \"videoGameRating\": \"\"\n },\n \"contentDetails\": {\n \"caption\": \"\",\n \"contentRating\": {\n \"acbRating\": \"\",\n \"agcomRating\": \"\",\n \"anatelRating\": \"\",\n \"bbfcRating\": \"\",\n \"bfvcRating\": \"\",\n \"bmukkRating\": \"\",\n \"catvRating\": \"\",\n \"catvfrRating\": \"\",\n \"cbfcRating\": \"\",\n \"cccRating\": \"\",\n \"cceRating\": \"\",\n \"chfilmRating\": \"\",\n \"chvrsRating\": \"\",\n \"cicfRating\": \"\",\n \"cnaRating\": \"\",\n \"cncRating\": \"\",\n \"csaRating\": \"\",\n \"cscfRating\": \"\",\n \"czfilmRating\": \"\",\n \"djctqRating\": \"\",\n \"djctqRatingReasons\": [],\n \"ecbmctRating\": \"\",\n \"eefilmRating\": \"\",\n \"egfilmRating\": \"\",\n \"eirinRating\": \"\",\n \"fcbmRating\": \"\",\n \"fcoRating\": \"\",\n \"fmocRating\": \"\",\n \"fpbRating\": \"\",\n \"fpbRatingReasons\": [],\n \"fskRating\": \"\",\n \"grfilmRating\": \"\",\n \"icaaRating\": \"\",\n \"ifcoRating\": \"\",\n \"ilfilmRating\": \"\",\n \"incaaRating\": \"\",\n \"kfcbRating\": \"\",\n \"kijkwijzerRating\": \"\",\n \"kmrbRating\": \"\",\n \"lsfRating\": \"\",\n \"mccaaRating\": \"\",\n \"mccypRating\": \"\",\n \"mcstRating\": \"\",\n \"mdaRating\": \"\",\n \"medietilsynetRating\": \"\",\n \"mekuRating\": \"\",\n \"menaMpaaRating\": \"\",\n \"mibacRating\": \"\",\n \"mocRating\": \"\",\n \"moctwRating\": \"\",\n \"mpaaRating\": \"\",\n \"mpaatRating\": \"\",\n \"mtrcbRating\": \"\",\n \"nbcRating\": \"\",\n \"nbcplRating\": \"\",\n \"nfrcRating\": \"\",\n \"nfvcbRating\": \"\",\n \"nkclvRating\": \"\",\n \"nmcRating\": \"\",\n \"oflcRating\": \"\",\n \"pefilmRating\": \"\",\n \"rcnofRating\": \"\",\n \"resorteviolenciaRating\": \"\",\n \"rtcRating\": \"\",\n \"rteRating\": \"\",\n \"russiaRating\": \"\",\n \"skfilmRating\": \"\",\n \"smaisRating\": \"\",\n \"smsaRating\": \"\",\n \"tvpgRating\": \"\",\n \"ytRating\": \"\"\n },\n \"countryRestriction\": {\n \"allowed\": false,\n \"exception\": []\n },\n \"definition\": \"\",\n \"dimension\": \"\",\n \"duration\": \"\",\n \"hasCustomThumbnail\": false,\n \"licensedContent\": false,\n \"projection\": \"\",\n \"regionRestriction\": {\n \"allowed\": [],\n \"blocked\": []\n }\n },\n \"etag\": \"\",\n \"fileDetails\": {\n \"audioStreams\": [\n {\n \"bitrateBps\": \"\",\n \"channelCount\": 0,\n \"codec\": \"\",\n \"vendor\": \"\"\n }\n ],\n \"bitrateBps\": \"\",\n \"container\": \"\",\n \"creationTime\": \"\",\n \"durationMs\": \"\",\n \"fileName\": \"\",\n \"fileSize\": \"\",\n \"fileType\": \"\",\n \"videoStreams\": [\n {\n \"aspectRatio\": \"\",\n \"bitrateBps\": \"\",\n \"codec\": \"\",\n \"frameRateFps\": \"\",\n \"heightPixels\": 0,\n \"rotation\": \"\",\n \"vendor\": \"\",\n \"widthPixels\": 0\n }\n ]\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"liveStreamingDetails\": {\n \"activeLiveChatId\": \"\",\n \"actualEndTime\": \"\",\n \"actualStartTime\": \"\",\n \"concurrentViewers\": \"\",\n \"scheduledEndTime\": \"\",\n \"scheduledStartTime\": \"\"\n },\n \"localizations\": {},\n \"monetizationDetails\": {\n \"access\": {}\n },\n \"player\": {\n \"embedHeight\": \"\",\n \"embedHtml\": \"\",\n \"embedWidth\": \"\"\n },\n \"processingDetails\": {\n \"editorSuggestionsAvailability\": \"\",\n \"fileDetailsAvailability\": \"\",\n \"processingFailureReason\": \"\",\n \"processingIssuesAvailability\": \"\",\n \"processingProgress\": {\n \"partsProcessed\": \"\",\n \"partsTotal\": \"\",\n \"timeLeftMs\": \"\"\n },\n \"processingStatus\": \"\",\n \"tagSuggestionsAvailability\": \"\",\n \"thumbnailsAvailability\": \"\"\n },\n \"projectDetails\": {},\n \"recordingDetails\": {\n \"location\": {\n \"altitude\": \"\",\n \"latitude\": \"\",\n \"longitude\": \"\"\n },\n \"locationDescription\": \"\",\n \"recordingDate\": \"\"\n },\n \"snippet\": {\n \"categoryId\": \"\",\n \"channelId\": \"\",\n \"channelTitle\": \"\",\n \"defaultAudioLanguage\": \"\",\n \"defaultLanguage\": \"\",\n \"description\": \"\",\n \"liveBroadcastContent\": \"\",\n \"localized\": {\n \"description\": \"\",\n \"title\": \"\"\n },\n \"publishedAt\": \"\",\n \"tags\": [],\n \"thumbnails\": {\n \"high\": {\n \"height\": 0,\n \"url\": \"\",\n \"width\": 0\n },\n \"maxres\": {},\n \"medium\": {},\n \"standard\": {}\n },\n \"title\": \"\"\n },\n \"statistics\": {\n \"commentCount\": \"\",\n \"dislikeCount\": \"\",\n \"favoriteCount\": \"\",\n \"likeCount\": \"\",\n \"viewCount\": \"\"\n },\n \"status\": {\n \"embeddable\": false,\n \"failureReason\": \"\",\n \"license\": \"\",\n \"madeForKids\": false,\n \"privacyStatus\": \"\",\n \"publicStatsViewable\": false,\n \"publishAt\": \"\",\n \"rejectionReason\": \"\",\n \"selfDeclaredMadeForKids\": false,\n \"uploadStatus\": \"\"\n },\n \"suggestions\": {\n \"editorSuggestions\": [],\n \"processingErrors\": [],\n \"processingHints\": [],\n \"processingWarnings\": [],\n \"tagSuggestions\": [\n {\n \"categoryRestricts\": [],\n \"tag\": \"\"\n }\n ]\n },\n \"topicDetails\": {\n \"relevantTopicIds\": [],\n \"topicCategories\": [],\n \"topicIds\": []\n }\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/youtube/v3/videos?part=")
.put(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/youtube/v3/videos?part=")
.header("content-type", "application/json")
.body("{\n \"ageGating\": {\n \"alcoholContent\": false,\n \"restricted\": false,\n \"videoGameRating\": \"\"\n },\n \"contentDetails\": {\n \"caption\": \"\",\n \"contentRating\": {\n \"acbRating\": \"\",\n \"agcomRating\": \"\",\n \"anatelRating\": \"\",\n \"bbfcRating\": \"\",\n \"bfvcRating\": \"\",\n \"bmukkRating\": \"\",\n \"catvRating\": \"\",\n \"catvfrRating\": \"\",\n \"cbfcRating\": \"\",\n \"cccRating\": \"\",\n \"cceRating\": \"\",\n \"chfilmRating\": \"\",\n \"chvrsRating\": \"\",\n \"cicfRating\": \"\",\n \"cnaRating\": \"\",\n \"cncRating\": \"\",\n \"csaRating\": \"\",\n \"cscfRating\": \"\",\n \"czfilmRating\": \"\",\n \"djctqRating\": \"\",\n \"djctqRatingReasons\": [],\n \"ecbmctRating\": \"\",\n \"eefilmRating\": \"\",\n \"egfilmRating\": \"\",\n \"eirinRating\": \"\",\n \"fcbmRating\": \"\",\n \"fcoRating\": \"\",\n \"fmocRating\": \"\",\n \"fpbRating\": \"\",\n \"fpbRatingReasons\": [],\n \"fskRating\": \"\",\n \"grfilmRating\": \"\",\n \"icaaRating\": \"\",\n \"ifcoRating\": \"\",\n \"ilfilmRating\": \"\",\n \"incaaRating\": \"\",\n \"kfcbRating\": \"\",\n \"kijkwijzerRating\": \"\",\n \"kmrbRating\": \"\",\n \"lsfRating\": \"\",\n \"mccaaRating\": \"\",\n \"mccypRating\": \"\",\n \"mcstRating\": \"\",\n \"mdaRating\": \"\",\n \"medietilsynetRating\": \"\",\n \"mekuRating\": \"\",\n \"menaMpaaRating\": \"\",\n \"mibacRating\": \"\",\n \"mocRating\": \"\",\n \"moctwRating\": \"\",\n \"mpaaRating\": \"\",\n \"mpaatRating\": \"\",\n \"mtrcbRating\": \"\",\n \"nbcRating\": \"\",\n \"nbcplRating\": \"\",\n \"nfrcRating\": \"\",\n \"nfvcbRating\": \"\",\n \"nkclvRating\": \"\",\n \"nmcRating\": \"\",\n \"oflcRating\": \"\",\n \"pefilmRating\": \"\",\n \"rcnofRating\": \"\",\n \"resorteviolenciaRating\": \"\",\n \"rtcRating\": \"\",\n \"rteRating\": \"\",\n \"russiaRating\": \"\",\n \"skfilmRating\": \"\",\n \"smaisRating\": \"\",\n \"smsaRating\": \"\",\n \"tvpgRating\": \"\",\n \"ytRating\": \"\"\n },\n \"countryRestriction\": {\n \"allowed\": false,\n \"exception\": []\n },\n \"definition\": \"\",\n \"dimension\": \"\",\n \"duration\": \"\",\n \"hasCustomThumbnail\": false,\n \"licensedContent\": false,\n \"projection\": \"\",\n \"regionRestriction\": {\n \"allowed\": [],\n \"blocked\": []\n }\n },\n \"etag\": \"\",\n \"fileDetails\": {\n \"audioStreams\": [\n {\n \"bitrateBps\": \"\",\n \"channelCount\": 0,\n \"codec\": \"\",\n \"vendor\": \"\"\n }\n ],\n \"bitrateBps\": \"\",\n \"container\": \"\",\n \"creationTime\": \"\",\n \"durationMs\": \"\",\n \"fileName\": \"\",\n \"fileSize\": \"\",\n \"fileType\": \"\",\n \"videoStreams\": [\n {\n \"aspectRatio\": \"\",\n \"bitrateBps\": \"\",\n \"codec\": \"\",\n \"frameRateFps\": \"\",\n \"heightPixels\": 0,\n \"rotation\": \"\",\n \"vendor\": \"\",\n \"widthPixels\": 0\n }\n ]\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"liveStreamingDetails\": {\n \"activeLiveChatId\": \"\",\n \"actualEndTime\": \"\",\n \"actualStartTime\": \"\",\n \"concurrentViewers\": \"\",\n \"scheduledEndTime\": \"\",\n \"scheduledStartTime\": \"\"\n },\n \"localizations\": {},\n \"monetizationDetails\": {\n \"access\": {}\n },\n \"player\": {\n \"embedHeight\": \"\",\n \"embedHtml\": \"\",\n \"embedWidth\": \"\"\n },\n \"processingDetails\": {\n \"editorSuggestionsAvailability\": \"\",\n \"fileDetailsAvailability\": \"\",\n \"processingFailureReason\": \"\",\n \"processingIssuesAvailability\": \"\",\n \"processingProgress\": {\n \"partsProcessed\": \"\",\n \"partsTotal\": \"\",\n \"timeLeftMs\": \"\"\n },\n \"processingStatus\": \"\",\n \"tagSuggestionsAvailability\": \"\",\n \"thumbnailsAvailability\": \"\"\n },\n \"projectDetails\": {},\n \"recordingDetails\": {\n \"location\": {\n \"altitude\": \"\",\n \"latitude\": \"\",\n \"longitude\": \"\"\n },\n \"locationDescription\": \"\",\n \"recordingDate\": \"\"\n },\n \"snippet\": {\n \"categoryId\": \"\",\n \"channelId\": \"\",\n \"channelTitle\": \"\",\n \"defaultAudioLanguage\": \"\",\n \"defaultLanguage\": \"\",\n \"description\": \"\",\n \"liveBroadcastContent\": \"\",\n \"localized\": {\n \"description\": \"\",\n \"title\": \"\"\n },\n \"publishedAt\": \"\",\n \"tags\": [],\n \"thumbnails\": {\n \"high\": {\n \"height\": 0,\n \"url\": \"\",\n \"width\": 0\n },\n \"maxres\": {},\n \"medium\": {},\n \"standard\": {}\n },\n \"title\": \"\"\n },\n \"statistics\": {\n \"commentCount\": \"\",\n \"dislikeCount\": \"\",\n \"favoriteCount\": \"\",\n \"likeCount\": \"\",\n \"viewCount\": \"\"\n },\n \"status\": {\n \"embeddable\": false,\n \"failureReason\": \"\",\n \"license\": \"\",\n \"madeForKids\": false,\n \"privacyStatus\": \"\",\n \"publicStatsViewable\": false,\n \"publishAt\": \"\",\n \"rejectionReason\": \"\",\n \"selfDeclaredMadeForKids\": false,\n \"uploadStatus\": \"\"\n },\n \"suggestions\": {\n \"editorSuggestions\": [],\n \"processingErrors\": [],\n \"processingHints\": [],\n \"processingWarnings\": [],\n \"tagSuggestions\": [\n {\n \"categoryRestricts\": [],\n \"tag\": \"\"\n }\n ]\n },\n \"topicDetails\": {\n \"relevantTopicIds\": [],\n \"topicCategories\": [],\n \"topicIds\": []\n }\n}")
.asString();
const data = JSON.stringify({
ageGating: {
alcoholContent: false,
restricted: false,
videoGameRating: ''
},
contentDetails: {
caption: '',
contentRating: {
acbRating: '',
agcomRating: '',
anatelRating: '',
bbfcRating: '',
bfvcRating: '',
bmukkRating: '',
catvRating: '',
catvfrRating: '',
cbfcRating: '',
cccRating: '',
cceRating: '',
chfilmRating: '',
chvrsRating: '',
cicfRating: '',
cnaRating: '',
cncRating: '',
csaRating: '',
cscfRating: '',
czfilmRating: '',
djctqRating: '',
djctqRatingReasons: [],
ecbmctRating: '',
eefilmRating: '',
egfilmRating: '',
eirinRating: '',
fcbmRating: '',
fcoRating: '',
fmocRating: '',
fpbRating: '',
fpbRatingReasons: [],
fskRating: '',
grfilmRating: '',
icaaRating: '',
ifcoRating: '',
ilfilmRating: '',
incaaRating: '',
kfcbRating: '',
kijkwijzerRating: '',
kmrbRating: '',
lsfRating: '',
mccaaRating: '',
mccypRating: '',
mcstRating: '',
mdaRating: '',
medietilsynetRating: '',
mekuRating: '',
menaMpaaRating: '',
mibacRating: '',
mocRating: '',
moctwRating: '',
mpaaRating: '',
mpaatRating: '',
mtrcbRating: '',
nbcRating: '',
nbcplRating: '',
nfrcRating: '',
nfvcbRating: '',
nkclvRating: '',
nmcRating: '',
oflcRating: '',
pefilmRating: '',
rcnofRating: '',
resorteviolenciaRating: '',
rtcRating: '',
rteRating: '',
russiaRating: '',
skfilmRating: '',
smaisRating: '',
smsaRating: '',
tvpgRating: '',
ytRating: ''
},
countryRestriction: {
allowed: false,
exception: []
},
definition: '',
dimension: '',
duration: '',
hasCustomThumbnail: false,
licensedContent: false,
projection: '',
regionRestriction: {
allowed: [],
blocked: []
}
},
etag: '',
fileDetails: {
audioStreams: [
{
bitrateBps: '',
channelCount: 0,
codec: '',
vendor: ''
}
],
bitrateBps: '',
container: '',
creationTime: '',
durationMs: '',
fileName: '',
fileSize: '',
fileType: '',
videoStreams: [
{
aspectRatio: '',
bitrateBps: '',
codec: '',
frameRateFps: '',
heightPixels: 0,
rotation: '',
vendor: '',
widthPixels: 0
}
]
},
id: '',
kind: '',
liveStreamingDetails: {
activeLiveChatId: '',
actualEndTime: '',
actualStartTime: '',
concurrentViewers: '',
scheduledEndTime: '',
scheduledStartTime: ''
},
localizations: {},
monetizationDetails: {
access: {}
},
player: {
embedHeight: '',
embedHtml: '',
embedWidth: ''
},
processingDetails: {
editorSuggestionsAvailability: '',
fileDetailsAvailability: '',
processingFailureReason: '',
processingIssuesAvailability: '',
processingProgress: {
partsProcessed: '',
partsTotal: '',
timeLeftMs: ''
},
processingStatus: '',
tagSuggestionsAvailability: '',
thumbnailsAvailability: ''
},
projectDetails: {},
recordingDetails: {
location: {
altitude: '',
latitude: '',
longitude: ''
},
locationDescription: '',
recordingDate: ''
},
snippet: {
categoryId: '',
channelId: '',
channelTitle: '',
defaultAudioLanguage: '',
defaultLanguage: '',
description: '',
liveBroadcastContent: '',
localized: {
description: '',
title: ''
},
publishedAt: '',
tags: [],
thumbnails: {
high: {
height: 0,
url: '',
width: 0
},
maxres: {},
medium: {},
standard: {}
},
title: ''
},
statistics: {
commentCount: '',
dislikeCount: '',
favoriteCount: '',
likeCount: '',
viewCount: ''
},
status: {
embeddable: false,
failureReason: '',
license: '',
madeForKids: false,
privacyStatus: '',
publicStatsViewable: false,
publishAt: '',
rejectionReason: '',
selfDeclaredMadeForKids: false,
uploadStatus: ''
},
suggestions: {
editorSuggestions: [],
processingErrors: [],
processingHints: [],
processingWarnings: [],
tagSuggestions: [
{
categoryRestricts: [],
tag: ''
}
]
},
topicDetails: {
relevantTopicIds: [],
topicCategories: [],
topicIds: []
}
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/youtube/v3/videos?part=');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/youtube/v3/videos',
params: {part: ''},
headers: {'content-type': 'application/json'},
data: {
ageGating: {alcoholContent: false, restricted: false, videoGameRating: ''},
contentDetails: {
caption: '',
contentRating: {
acbRating: '',
agcomRating: '',
anatelRating: '',
bbfcRating: '',
bfvcRating: '',
bmukkRating: '',
catvRating: '',
catvfrRating: '',
cbfcRating: '',
cccRating: '',
cceRating: '',
chfilmRating: '',
chvrsRating: '',
cicfRating: '',
cnaRating: '',
cncRating: '',
csaRating: '',
cscfRating: '',
czfilmRating: '',
djctqRating: '',
djctqRatingReasons: [],
ecbmctRating: '',
eefilmRating: '',
egfilmRating: '',
eirinRating: '',
fcbmRating: '',
fcoRating: '',
fmocRating: '',
fpbRating: '',
fpbRatingReasons: [],
fskRating: '',
grfilmRating: '',
icaaRating: '',
ifcoRating: '',
ilfilmRating: '',
incaaRating: '',
kfcbRating: '',
kijkwijzerRating: '',
kmrbRating: '',
lsfRating: '',
mccaaRating: '',
mccypRating: '',
mcstRating: '',
mdaRating: '',
medietilsynetRating: '',
mekuRating: '',
menaMpaaRating: '',
mibacRating: '',
mocRating: '',
moctwRating: '',
mpaaRating: '',
mpaatRating: '',
mtrcbRating: '',
nbcRating: '',
nbcplRating: '',
nfrcRating: '',
nfvcbRating: '',
nkclvRating: '',
nmcRating: '',
oflcRating: '',
pefilmRating: '',
rcnofRating: '',
resorteviolenciaRating: '',
rtcRating: '',
rteRating: '',
russiaRating: '',
skfilmRating: '',
smaisRating: '',
smsaRating: '',
tvpgRating: '',
ytRating: ''
},
countryRestriction: {allowed: false, exception: []},
definition: '',
dimension: '',
duration: '',
hasCustomThumbnail: false,
licensedContent: false,
projection: '',
regionRestriction: {allowed: [], blocked: []}
},
etag: '',
fileDetails: {
audioStreams: [{bitrateBps: '', channelCount: 0, codec: '', vendor: ''}],
bitrateBps: '',
container: '',
creationTime: '',
durationMs: '',
fileName: '',
fileSize: '',
fileType: '',
videoStreams: [
{
aspectRatio: '',
bitrateBps: '',
codec: '',
frameRateFps: '',
heightPixels: 0,
rotation: '',
vendor: '',
widthPixels: 0
}
]
},
id: '',
kind: '',
liveStreamingDetails: {
activeLiveChatId: '',
actualEndTime: '',
actualStartTime: '',
concurrentViewers: '',
scheduledEndTime: '',
scheduledStartTime: ''
},
localizations: {},
monetizationDetails: {access: {}},
player: {embedHeight: '', embedHtml: '', embedWidth: ''},
processingDetails: {
editorSuggestionsAvailability: '',
fileDetailsAvailability: '',
processingFailureReason: '',
processingIssuesAvailability: '',
processingProgress: {partsProcessed: '', partsTotal: '', timeLeftMs: ''},
processingStatus: '',
tagSuggestionsAvailability: '',
thumbnailsAvailability: ''
},
projectDetails: {},
recordingDetails: {
location: {altitude: '', latitude: '', longitude: ''},
locationDescription: '',
recordingDate: ''
},
snippet: {
categoryId: '',
channelId: '',
channelTitle: '',
defaultAudioLanguage: '',
defaultLanguage: '',
description: '',
liveBroadcastContent: '',
localized: {description: '', title: ''},
publishedAt: '',
tags: [],
thumbnails: {high: {height: 0, url: '', width: 0}, maxres: {}, medium: {}, standard: {}},
title: ''
},
statistics: {
commentCount: '',
dislikeCount: '',
favoriteCount: '',
likeCount: '',
viewCount: ''
},
status: {
embeddable: false,
failureReason: '',
license: '',
madeForKids: false,
privacyStatus: '',
publicStatsViewable: false,
publishAt: '',
rejectionReason: '',
selfDeclaredMadeForKids: false,
uploadStatus: ''
},
suggestions: {
editorSuggestions: [],
processingErrors: [],
processingHints: [],
processingWarnings: [],
tagSuggestions: [{categoryRestricts: [], tag: ''}]
},
topicDetails: {relevantTopicIds: [], topicCategories: [], topicIds: []}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/youtube/v3/videos?part=';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"ageGating":{"alcoholContent":false,"restricted":false,"videoGameRating":""},"contentDetails":{"caption":"","contentRating":{"acbRating":"","agcomRating":"","anatelRating":"","bbfcRating":"","bfvcRating":"","bmukkRating":"","catvRating":"","catvfrRating":"","cbfcRating":"","cccRating":"","cceRating":"","chfilmRating":"","chvrsRating":"","cicfRating":"","cnaRating":"","cncRating":"","csaRating":"","cscfRating":"","czfilmRating":"","djctqRating":"","djctqRatingReasons":[],"ecbmctRating":"","eefilmRating":"","egfilmRating":"","eirinRating":"","fcbmRating":"","fcoRating":"","fmocRating":"","fpbRating":"","fpbRatingReasons":[],"fskRating":"","grfilmRating":"","icaaRating":"","ifcoRating":"","ilfilmRating":"","incaaRating":"","kfcbRating":"","kijkwijzerRating":"","kmrbRating":"","lsfRating":"","mccaaRating":"","mccypRating":"","mcstRating":"","mdaRating":"","medietilsynetRating":"","mekuRating":"","menaMpaaRating":"","mibacRating":"","mocRating":"","moctwRating":"","mpaaRating":"","mpaatRating":"","mtrcbRating":"","nbcRating":"","nbcplRating":"","nfrcRating":"","nfvcbRating":"","nkclvRating":"","nmcRating":"","oflcRating":"","pefilmRating":"","rcnofRating":"","resorteviolenciaRating":"","rtcRating":"","rteRating":"","russiaRating":"","skfilmRating":"","smaisRating":"","smsaRating":"","tvpgRating":"","ytRating":""},"countryRestriction":{"allowed":false,"exception":[]},"definition":"","dimension":"","duration":"","hasCustomThumbnail":false,"licensedContent":false,"projection":"","regionRestriction":{"allowed":[],"blocked":[]}},"etag":"","fileDetails":{"audioStreams":[{"bitrateBps":"","channelCount":0,"codec":"","vendor":""}],"bitrateBps":"","container":"","creationTime":"","durationMs":"","fileName":"","fileSize":"","fileType":"","videoStreams":[{"aspectRatio":"","bitrateBps":"","codec":"","frameRateFps":"","heightPixels":0,"rotation":"","vendor":"","widthPixels":0}]},"id":"","kind":"","liveStreamingDetails":{"activeLiveChatId":"","actualEndTime":"","actualStartTime":"","concurrentViewers":"","scheduledEndTime":"","scheduledStartTime":""},"localizations":{},"monetizationDetails":{"access":{}},"player":{"embedHeight":"","embedHtml":"","embedWidth":""},"processingDetails":{"editorSuggestionsAvailability":"","fileDetailsAvailability":"","processingFailureReason":"","processingIssuesAvailability":"","processingProgress":{"partsProcessed":"","partsTotal":"","timeLeftMs":""},"processingStatus":"","tagSuggestionsAvailability":"","thumbnailsAvailability":""},"projectDetails":{},"recordingDetails":{"location":{"altitude":"","latitude":"","longitude":""},"locationDescription":"","recordingDate":""},"snippet":{"categoryId":"","channelId":"","channelTitle":"","defaultAudioLanguage":"","defaultLanguage":"","description":"","liveBroadcastContent":"","localized":{"description":"","title":""},"publishedAt":"","tags":[],"thumbnails":{"high":{"height":0,"url":"","width":0},"maxres":{},"medium":{},"standard":{}},"title":""},"statistics":{"commentCount":"","dislikeCount":"","favoriteCount":"","likeCount":"","viewCount":""},"status":{"embeddable":false,"failureReason":"","license":"","madeForKids":false,"privacyStatus":"","publicStatsViewable":false,"publishAt":"","rejectionReason":"","selfDeclaredMadeForKids":false,"uploadStatus":""},"suggestions":{"editorSuggestions":[],"processingErrors":[],"processingHints":[],"processingWarnings":[],"tagSuggestions":[{"categoryRestricts":[],"tag":""}]},"topicDetails":{"relevantTopicIds":[],"topicCategories":[],"topicIds":[]}}'
};
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}}/youtube/v3/videos?part=',
method: 'PUT',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "ageGating": {\n "alcoholContent": false,\n "restricted": false,\n "videoGameRating": ""\n },\n "contentDetails": {\n "caption": "",\n "contentRating": {\n "acbRating": "",\n "agcomRating": "",\n "anatelRating": "",\n "bbfcRating": "",\n "bfvcRating": "",\n "bmukkRating": "",\n "catvRating": "",\n "catvfrRating": "",\n "cbfcRating": "",\n "cccRating": "",\n "cceRating": "",\n "chfilmRating": "",\n "chvrsRating": "",\n "cicfRating": "",\n "cnaRating": "",\n "cncRating": "",\n "csaRating": "",\n "cscfRating": "",\n "czfilmRating": "",\n "djctqRating": "",\n "djctqRatingReasons": [],\n "ecbmctRating": "",\n "eefilmRating": "",\n "egfilmRating": "",\n "eirinRating": "",\n "fcbmRating": "",\n "fcoRating": "",\n "fmocRating": "",\n "fpbRating": "",\n "fpbRatingReasons": [],\n "fskRating": "",\n "grfilmRating": "",\n "icaaRating": "",\n "ifcoRating": "",\n "ilfilmRating": "",\n "incaaRating": "",\n "kfcbRating": "",\n "kijkwijzerRating": "",\n "kmrbRating": "",\n "lsfRating": "",\n "mccaaRating": "",\n "mccypRating": "",\n "mcstRating": "",\n "mdaRating": "",\n "medietilsynetRating": "",\n "mekuRating": "",\n "menaMpaaRating": "",\n "mibacRating": "",\n "mocRating": "",\n "moctwRating": "",\n "mpaaRating": "",\n "mpaatRating": "",\n "mtrcbRating": "",\n "nbcRating": "",\n "nbcplRating": "",\n "nfrcRating": "",\n "nfvcbRating": "",\n "nkclvRating": "",\n "nmcRating": "",\n "oflcRating": "",\n "pefilmRating": "",\n "rcnofRating": "",\n "resorteviolenciaRating": "",\n "rtcRating": "",\n "rteRating": "",\n "russiaRating": "",\n "skfilmRating": "",\n "smaisRating": "",\n "smsaRating": "",\n "tvpgRating": "",\n "ytRating": ""\n },\n "countryRestriction": {\n "allowed": false,\n "exception": []\n },\n "definition": "",\n "dimension": "",\n "duration": "",\n "hasCustomThumbnail": false,\n "licensedContent": false,\n "projection": "",\n "regionRestriction": {\n "allowed": [],\n "blocked": []\n }\n },\n "etag": "",\n "fileDetails": {\n "audioStreams": [\n {\n "bitrateBps": "",\n "channelCount": 0,\n "codec": "",\n "vendor": ""\n }\n ],\n "bitrateBps": "",\n "container": "",\n "creationTime": "",\n "durationMs": "",\n "fileName": "",\n "fileSize": "",\n "fileType": "",\n "videoStreams": [\n {\n "aspectRatio": "",\n "bitrateBps": "",\n "codec": "",\n "frameRateFps": "",\n "heightPixels": 0,\n "rotation": "",\n "vendor": "",\n "widthPixels": 0\n }\n ]\n },\n "id": "",\n "kind": "",\n "liveStreamingDetails": {\n "activeLiveChatId": "",\n "actualEndTime": "",\n "actualStartTime": "",\n "concurrentViewers": "",\n "scheduledEndTime": "",\n "scheduledStartTime": ""\n },\n "localizations": {},\n "monetizationDetails": {\n "access": {}\n },\n "player": {\n "embedHeight": "",\n "embedHtml": "",\n "embedWidth": ""\n },\n "processingDetails": {\n "editorSuggestionsAvailability": "",\n "fileDetailsAvailability": "",\n "processingFailureReason": "",\n "processingIssuesAvailability": "",\n "processingProgress": {\n "partsProcessed": "",\n "partsTotal": "",\n "timeLeftMs": ""\n },\n "processingStatus": "",\n "tagSuggestionsAvailability": "",\n "thumbnailsAvailability": ""\n },\n "projectDetails": {},\n "recordingDetails": {\n "location": {\n "altitude": "",\n "latitude": "",\n "longitude": ""\n },\n "locationDescription": "",\n "recordingDate": ""\n },\n "snippet": {\n "categoryId": "",\n "channelId": "",\n "channelTitle": "",\n "defaultAudioLanguage": "",\n "defaultLanguage": "",\n "description": "",\n "liveBroadcastContent": "",\n "localized": {\n "description": "",\n "title": ""\n },\n "publishedAt": "",\n "tags": [],\n "thumbnails": {\n "high": {\n "height": 0,\n "url": "",\n "width": 0\n },\n "maxres": {},\n "medium": {},\n "standard": {}\n },\n "title": ""\n },\n "statistics": {\n "commentCount": "",\n "dislikeCount": "",\n "favoriteCount": "",\n "likeCount": "",\n "viewCount": ""\n },\n "status": {\n "embeddable": false,\n "failureReason": "",\n "license": "",\n "madeForKids": false,\n "privacyStatus": "",\n "publicStatsViewable": false,\n "publishAt": "",\n "rejectionReason": "",\n "selfDeclaredMadeForKids": false,\n "uploadStatus": ""\n },\n "suggestions": {\n "editorSuggestions": [],\n "processingErrors": [],\n "processingHints": [],\n "processingWarnings": [],\n "tagSuggestions": [\n {\n "categoryRestricts": [],\n "tag": ""\n }\n ]\n },\n "topicDetails": {\n "relevantTopicIds": [],\n "topicCategories": [],\n "topicIds": []\n }\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"ageGating\": {\n \"alcoholContent\": false,\n \"restricted\": false,\n \"videoGameRating\": \"\"\n },\n \"contentDetails\": {\n \"caption\": \"\",\n \"contentRating\": {\n \"acbRating\": \"\",\n \"agcomRating\": \"\",\n \"anatelRating\": \"\",\n \"bbfcRating\": \"\",\n \"bfvcRating\": \"\",\n \"bmukkRating\": \"\",\n \"catvRating\": \"\",\n \"catvfrRating\": \"\",\n \"cbfcRating\": \"\",\n \"cccRating\": \"\",\n \"cceRating\": \"\",\n \"chfilmRating\": \"\",\n \"chvrsRating\": \"\",\n \"cicfRating\": \"\",\n \"cnaRating\": \"\",\n \"cncRating\": \"\",\n \"csaRating\": \"\",\n \"cscfRating\": \"\",\n \"czfilmRating\": \"\",\n \"djctqRating\": \"\",\n \"djctqRatingReasons\": [],\n \"ecbmctRating\": \"\",\n \"eefilmRating\": \"\",\n \"egfilmRating\": \"\",\n \"eirinRating\": \"\",\n \"fcbmRating\": \"\",\n \"fcoRating\": \"\",\n \"fmocRating\": \"\",\n \"fpbRating\": \"\",\n \"fpbRatingReasons\": [],\n \"fskRating\": \"\",\n \"grfilmRating\": \"\",\n \"icaaRating\": \"\",\n \"ifcoRating\": \"\",\n \"ilfilmRating\": \"\",\n \"incaaRating\": \"\",\n \"kfcbRating\": \"\",\n \"kijkwijzerRating\": \"\",\n \"kmrbRating\": \"\",\n \"lsfRating\": \"\",\n \"mccaaRating\": \"\",\n \"mccypRating\": \"\",\n \"mcstRating\": \"\",\n \"mdaRating\": \"\",\n \"medietilsynetRating\": \"\",\n \"mekuRating\": \"\",\n \"menaMpaaRating\": \"\",\n \"mibacRating\": \"\",\n \"mocRating\": \"\",\n \"moctwRating\": \"\",\n \"mpaaRating\": \"\",\n \"mpaatRating\": \"\",\n \"mtrcbRating\": \"\",\n \"nbcRating\": \"\",\n \"nbcplRating\": \"\",\n \"nfrcRating\": \"\",\n \"nfvcbRating\": \"\",\n \"nkclvRating\": \"\",\n \"nmcRating\": \"\",\n \"oflcRating\": \"\",\n \"pefilmRating\": \"\",\n \"rcnofRating\": \"\",\n \"resorteviolenciaRating\": \"\",\n \"rtcRating\": \"\",\n \"rteRating\": \"\",\n \"russiaRating\": \"\",\n \"skfilmRating\": \"\",\n \"smaisRating\": \"\",\n \"smsaRating\": \"\",\n \"tvpgRating\": \"\",\n \"ytRating\": \"\"\n },\n \"countryRestriction\": {\n \"allowed\": false,\n \"exception\": []\n },\n \"definition\": \"\",\n \"dimension\": \"\",\n \"duration\": \"\",\n \"hasCustomThumbnail\": false,\n \"licensedContent\": false,\n \"projection\": \"\",\n \"regionRestriction\": {\n \"allowed\": [],\n \"blocked\": []\n }\n },\n \"etag\": \"\",\n \"fileDetails\": {\n \"audioStreams\": [\n {\n \"bitrateBps\": \"\",\n \"channelCount\": 0,\n \"codec\": \"\",\n \"vendor\": \"\"\n }\n ],\n \"bitrateBps\": \"\",\n \"container\": \"\",\n \"creationTime\": \"\",\n \"durationMs\": \"\",\n \"fileName\": \"\",\n \"fileSize\": \"\",\n \"fileType\": \"\",\n \"videoStreams\": [\n {\n \"aspectRatio\": \"\",\n \"bitrateBps\": \"\",\n \"codec\": \"\",\n \"frameRateFps\": \"\",\n \"heightPixels\": 0,\n \"rotation\": \"\",\n \"vendor\": \"\",\n \"widthPixels\": 0\n }\n ]\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"liveStreamingDetails\": {\n \"activeLiveChatId\": \"\",\n \"actualEndTime\": \"\",\n \"actualStartTime\": \"\",\n \"concurrentViewers\": \"\",\n \"scheduledEndTime\": \"\",\n \"scheduledStartTime\": \"\"\n },\n \"localizations\": {},\n \"monetizationDetails\": {\n \"access\": {}\n },\n \"player\": {\n \"embedHeight\": \"\",\n \"embedHtml\": \"\",\n \"embedWidth\": \"\"\n },\n \"processingDetails\": {\n \"editorSuggestionsAvailability\": \"\",\n \"fileDetailsAvailability\": \"\",\n \"processingFailureReason\": \"\",\n \"processingIssuesAvailability\": \"\",\n \"processingProgress\": {\n \"partsProcessed\": \"\",\n \"partsTotal\": \"\",\n \"timeLeftMs\": \"\"\n },\n \"processingStatus\": \"\",\n \"tagSuggestionsAvailability\": \"\",\n \"thumbnailsAvailability\": \"\"\n },\n \"projectDetails\": {},\n \"recordingDetails\": {\n \"location\": {\n \"altitude\": \"\",\n \"latitude\": \"\",\n \"longitude\": \"\"\n },\n \"locationDescription\": \"\",\n \"recordingDate\": \"\"\n },\n \"snippet\": {\n \"categoryId\": \"\",\n \"channelId\": \"\",\n \"channelTitle\": \"\",\n \"defaultAudioLanguage\": \"\",\n \"defaultLanguage\": \"\",\n \"description\": \"\",\n \"liveBroadcastContent\": \"\",\n \"localized\": {\n \"description\": \"\",\n \"title\": \"\"\n },\n \"publishedAt\": \"\",\n \"tags\": [],\n \"thumbnails\": {\n \"high\": {\n \"height\": 0,\n \"url\": \"\",\n \"width\": 0\n },\n \"maxres\": {},\n \"medium\": {},\n \"standard\": {}\n },\n \"title\": \"\"\n },\n \"statistics\": {\n \"commentCount\": \"\",\n \"dislikeCount\": \"\",\n \"favoriteCount\": \"\",\n \"likeCount\": \"\",\n \"viewCount\": \"\"\n },\n \"status\": {\n \"embeddable\": false,\n \"failureReason\": \"\",\n \"license\": \"\",\n \"madeForKids\": false,\n \"privacyStatus\": \"\",\n \"publicStatsViewable\": false,\n \"publishAt\": \"\",\n \"rejectionReason\": \"\",\n \"selfDeclaredMadeForKids\": false,\n \"uploadStatus\": \"\"\n },\n \"suggestions\": {\n \"editorSuggestions\": [],\n \"processingErrors\": [],\n \"processingHints\": [],\n \"processingWarnings\": [],\n \"tagSuggestions\": [\n {\n \"categoryRestricts\": [],\n \"tag\": \"\"\n }\n ]\n },\n \"topicDetails\": {\n \"relevantTopicIds\": [],\n \"topicCategories\": [],\n \"topicIds\": []\n }\n}")
val request = Request.Builder()
.url("{{baseUrl}}/youtube/v3/videos?part=")
.put(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PUT',
hostname: 'example.com',
port: null,
path: '/baseUrl/youtube/v3/videos?part=',
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({
ageGating: {alcoholContent: false, restricted: false, videoGameRating: ''},
contentDetails: {
caption: '',
contentRating: {
acbRating: '',
agcomRating: '',
anatelRating: '',
bbfcRating: '',
bfvcRating: '',
bmukkRating: '',
catvRating: '',
catvfrRating: '',
cbfcRating: '',
cccRating: '',
cceRating: '',
chfilmRating: '',
chvrsRating: '',
cicfRating: '',
cnaRating: '',
cncRating: '',
csaRating: '',
cscfRating: '',
czfilmRating: '',
djctqRating: '',
djctqRatingReasons: [],
ecbmctRating: '',
eefilmRating: '',
egfilmRating: '',
eirinRating: '',
fcbmRating: '',
fcoRating: '',
fmocRating: '',
fpbRating: '',
fpbRatingReasons: [],
fskRating: '',
grfilmRating: '',
icaaRating: '',
ifcoRating: '',
ilfilmRating: '',
incaaRating: '',
kfcbRating: '',
kijkwijzerRating: '',
kmrbRating: '',
lsfRating: '',
mccaaRating: '',
mccypRating: '',
mcstRating: '',
mdaRating: '',
medietilsynetRating: '',
mekuRating: '',
menaMpaaRating: '',
mibacRating: '',
mocRating: '',
moctwRating: '',
mpaaRating: '',
mpaatRating: '',
mtrcbRating: '',
nbcRating: '',
nbcplRating: '',
nfrcRating: '',
nfvcbRating: '',
nkclvRating: '',
nmcRating: '',
oflcRating: '',
pefilmRating: '',
rcnofRating: '',
resorteviolenciaRating: '',
rtcRating: '',
rteRating: '',
russiaRating: '',
skfilmRating: '',
smaisRating: '',
smsaRating: '',
tvpgRating: '',
ytRating: ''
},
countryRestriction: {allowed: false, exception: []},
definition: '',
dimension: '',
duration: '',
hasCustomThumbnail: false,
licensedContent: false,
projection: '',
regionRestriction: {allowed: [], blocked: []}
},
etag: '',
fileDetails: {
audioStreams: [{bitrateBps: '', channelCount: 0, codec: '', vendor: ''}],
bitrateBps: '',
container: '',
creationTime: '',
durationMs: '',
fileName: '',
fileSize: '',
fileType: '',
videoStreams: [
{
aspectRatio: '',
bitrateBps: '',
codec: '',
frameRateFps: '',
heightPixels: 0,
rotation: '',
vendor: '',
widthPixels: 0
}
]
},
id: '',
kind: '',
liveStreamingDetails: {
activeLiveChatId: '',
actualEndTime: '',
actualStartTime: '',
concurrentViewers: '',
scheduledEndTime: '',
scheduledStartTime: ''
},
localizations: {},
monetizationDetails: {access: {}},
player: {embedHeight: '', embedHtml: '', embedWidth: ''},
processingDetails: {
editorSuggestionsAvailability: '',
fileDetailsAvailability: '',
processingFailureReason: '',
processingIssuesAvailability: '',
processingProgress: {partsProcessed: '', partsTotal: '', timeLeftMs: ''},
processingStatus: '',
tagSuggestionsAvailability: '',
thumbnailsAvailability: ''
},
projectDetails: {},
recordingDetails: {
location: {altitude: '', latitude: '', longitude: ''},
locationDescription: '',
recordingDate: ''
},
snippet: {
categoryId: '',
channelId: '',
channelTitle: '',
defaultAudioLanguage: '',
defaultLanguage: '',
description: '',
liveBroadcastContent: '',
localized: {description: '', title: ''},
publishedAt: '',
tags: [],
thumbnails: {high: {height: 0, url: '', width: 0}, maxres: {}, medium: {}, standard: {}},
title: ''
},
statistics: {
commentCount: '',
dislikeCount: '',
favoriteCount: '',
likeCount: '',
viewCount: ''
},
status: {
embeddable: false,
failureReason: '',
license: '',
madeForKids: false,
privacyStatus: '',
publicStatsViewable: false,
publishAt: '',
rejectionReason: '',
selfDeclaredMadeForKids: false,
uploadStatus: ''
},
suggestions: {
editorSuggestions: [],
processingErrors: [],
processingHints: [],
processingWarnings: [],
tagSuggestions: [{categoryRestricts: [], tag: ''}]
},
topicDetails: {relevantTopicIds: [], topicCategories: [], topicIds: []}
}));
req.end();
const request = require('request');
const options = {
method: 'PUT',
url: '{{baseUrl}}/youtube/v3/videos',
qs: {part: ''},
headers: {'content-type': 'application/json'},
body: {
ageGating: {alcoholContent: false, restricted: false, videoGameRating: ''},
contentDetails: {
caption: '',
contentRating: {
acbRating: '',
agcomRating: '',
anatelRating: '',
bbfcRating: '',
bfvcRating: '',
bmukkRating: '',
catvRating: '',
catvfrRating: '',
cbfcRating: '',
cccRating: '',
cceRating: '',
chfilmRating: '',
chvrsRating: '',
cicfRating: '',
cnaRating: '',
cncRating: '',
csaRating: '',
cscfRating: '',
czfilmRating: '',
djctqRating: '',
djctqRatingReasons: [],
ecbmctRating: '',
eefilmRating: '',
egfilmRating: '',
eirinRating: '',
fcbmRating: '',
fcoRating: '',
fmocRating: '',
fpbRating: '',
fpbRatingReasons: [],
fskRating: '',
grfilmRating: '',
icaaRating: '',
ifcoRating: '',
ilfilmRating: '',
incaaRating: '',
kfcbRating: '',
kijkwijzerRating: '',
kmrbRating: '',
lsfRating: '',
mccaaRating: '',
mccypRating: '',
mcstRating: '',
mdaRating: '',
medietilsynetRating: '',
mekuRating: '',
menaMpaaRating: '',
mibacRating: '',
mocRating: '',
moctwRating: '',
mpaaRating: '',
mpaatRating: '',
mtrcbRating: '',
nbcRating: '',
nbcplRating: '',
nfrcRating: '',
nfvcbRating: '',
nkclvRating: '',
nmcRating: '',
oflcRating: '',
pefilmRating: '',
rcnofRating: '',
resorteviolenciaRating: '',
rtcRating: '',
rteRating: '',
russiaRating: '',
skfilmRating: '',
smaisRating: '',
smsaRating: '',
tvpgRating: '',
ytRating: ''
},
countryRestriction: {allowed: false, exception: []},
definition: '',
dimension: '',
duration: '',
hasCustomThumbnail: false,
licensedContent: false,
projection: '',
regionRestriction: {allowed: [], blocked: []}
},
etag: '',
fileDetails: {
audioStreams: [{bitrateBps: '', channelCount: 0, codec: '', vendor: ''}],
bitrateBps: '',
container: '',
creationTime: '',
durationMs: '',
fileName: '',
fileSize: '',
fileType: '',
videoStreams: [
{
aspectRatio: '',
bitrateBps: '',
codec: '',
frameRateFps: '',
heightPixels: 0,
rotation: '',
vendor: '',
widthPixels: 0
}
]
},
id: '',
kind: '',
liveStreamingDetails: {
activeLiveChatId: '',
actualEndTime: '',
actualStartTime: '',
concurrentViewers: '',
scheduledEndTime: '',
scheduledStartTime: ''
},
localizations: {},
monetizationDetails: {access: {}},
player: {embedHeight: '', embedHtml: '', embedWidth: ''},
processingDetails: {
editorSuggestionsAvailability: '',
fileDetailsAvailability: '',
processingFailureReason: '',
processingIssuesAvailability: '',
processingProgress: {partsProcessed: '', partsTotal: '', timeLeftMs: ''},
processingStatus: '',
tagSuggestionsAvailability: '',
thumbnailsAvailability: ''
},
projectDetails: {},
recordingDetails: {
location: {altitude: '', latitude: '', longitude: ''},
locationDescription: '',
recordingDate: ''
},
snippet: {
categoryId: '',
channelId: '',
channelTitle: '',
defaultAudioLanguage: '',
defaultLanguage: '',
description: '',
liveBroadcastContent: '',
localized: {description: '', title: ''},
publishedAt: '',
tags: [],
thumbnails: {high: {height: 0, url: '', width: 0}, maxres: {}, medium: {}, standard: {}},
title: ''
},
statistics: {
commentCount: '',
dislikeCount: '',
favoriteCount: '',
likeCount: '',
viewCount: ''
},
status: {
embeddable: false,
failureReason: '',
license: '',
madeForKids: false,
privacyStatus: '',
publicStatsViewable: false,
publishAt: '',
rejectionReason: '',
selfDeclaredMadeForKids: false,
uploadStatus: ''
},
suggestions: {
editorSuggestions: [],
processingErrors: [],
processingHints: [],
processingWarnings: [],
tagSuggestions: [{categoryRestricts: [], tag: ''}]
},
topicDetails: {relevantTopicIds: [], topicCategories: [], topicIds: []}
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PUT', '{{baseUrl}}/youtube/v3/videos');
req.query({
part: ''
});
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
ageGating: {
alcoholContent: false,
restricted: false,
videoGameRating: ''
},
contentDetails: {
caption: '',
contentRating: {
acbRating: '',
agcomRating: '',
anatelRating: '',
bbfcRating: '',
bfvcRating: '',
bmukkRating: '',
catvRating: '',
catvfrRating: '',
cbfcRating: '',
cccRating: '',
cceRating: '',
chfilmRating: '',
chvrsRating: '',
cicfRating: '',
cnaRating: '',
cncRating: '',
csaRating: '',
cscfRating: '',
czfilmRating: '',
djctqRating: '',
djctqRatingReasons: [],
ecbmctRating: '',
eefilmRating: '',
egfilmRating: '',
eirinRating: '',
fcbmRating: '',
fcoRating: '',
fmocRating: '',
fpbRating: '',
fpbRatingReasons: [],
fskRating: '',
grfilmRating: '',
icaaRating: '',
ifcoRating: '',
ilfilmRating: '',
incaaRating: '',
kfcbRating: '',
kijkwijzerRating: '',
kmrbRating: '',
lsfRating: '',
mccaaRating: '',
mccypRating: '',
mcstRating: '',
mdaRating: '',
medietilsynetRating: '',
mekuRating: '',
menaMpaaRating: '',
mibacRating: '',
mocRating: '',
moctwRating: '',
mpaaRating: '',
mpaatRating: '',
mtrcbRating: '',
nbcRating: '',
nbcplRating: '',
nfrcRating: '',
nfvcbRating: '',
nkclvRating: '',
nmcRating: '',
oflcRating: '',
pefilmRating: '',
rcnofRating: '',
resorteviolenciaRating: '',
rtcRating: '',
rteRating: '',
russiaRating: '',
skfilmRating: '',
smaisRating: '',
smsaRating: '',
tvpgRating: '',
ytRating: ''
},
countryRestriction: {
allowed: false,
exception: []
},
definition: '',
dimension: '',
duration: '',
hasCustomThumbnail: false,
licensedContent: false,
projection: '',
regionRestriction: {
allowed: [],
blocked: []
}
},
etag: '',
fileDetails: {
audioStreams: [
{
bitrateBps: '',
channelCount: 0,
codec: '',
vendor: ''
}
],
bitrateBps: '',
container: '',
creationTime: '',
durationMs: '',
fileName: '',
fileSize: '',
fileType: '',
videoStreams: [
{
aspectRatio: '',
bitrateBps: '',
codec: '',
frameRateFps: '',
heightPixels: 0,
rotation: '',
vendor: '',
widthPixels: 0
}
]
},
id: '',
kind: '',
liveStreamingDetails: {
activeLiveChatId: '',
actualEndTime: '',
actualStartTime: '',
concurrentViewers: '',
scheduledEndTime: '',
scheduledStartTime: ''
},
localizations: {},
monetizationDetails: {
access: {}
},
player: {
embedHeight: '',
embedHtml: '',
embedWidth: ''
},
processingDetails: {
editorSuggestionsAvailability: '',
fileDetailsAvailability: '',
processingFailureReason: '',
processingIssuesAvailability: '',
processingProgress: {
partsProcessed: '',
partsTotal: '',
timeLeftMs: ''
},
processingStatus: '',
tagSuggestionsAvailability: '',
thumbnailsAvailability: ''
},
projectDetails: {},
recordingDetails: {
location: {
altitude: '',
latitude: '',
longitude: ''
},
locationDescription: '',
recordingDate: ''
},
snippet: {
categoryId: '',
channelId: '',
channelTitle: '',
defaultAudioLanguage: '',
defaultLanguage: '',
description: '',
liveBroadcastContent: '',
localized: {
description: '',
title: ''
},
publishedAt: '',
tags: [],
thumbnails: {
high: {
height: 0,
url: '',
width: 0
},
maxres: {},
medium: {},
standard: {}
},
title: ''
},
statistics: {
commentCount: '',
dislikeCount: '',
favoriteCount: '',
likeCount: '',
viewCount: ''
},
status: {
embeddable: false,
failureReason: '',
license: '',
madeForKids: false,
privacyStatus: '',
publicStatsViewable: false,
publishAt: '',
rejectionReason: '',
selfDeclaredMadeForKids: false,
uploadStatus: ''
},
suggestions: {
editorSuggestions: [],
processingErrors: [],
processingHints: [],
processingWarnings: [],
tagSuggestions: [
{
categoryRestricts: [],
tag: ''
}
]
},
topicDetails: {
relevantTopicIds: [],
topicCategories: [],
topicIds: []
}
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'PUT',
url: '{{baseUrl}}/youtube/v3/videos',
params: {part: ''},
headers: {'content-type': 'application/json'},
data: {
ageGating: {alcoholContent: false, restricted: false, videoGameRating: ''},
contentDetails: {
caption: '',
contentRating: {
acbRating: '',
agcomRating: '',
anatelRating: '',
bbfcRating: '',
bfvcRating: '',
bmukkRating: '',
catvRating: '',
catvfrRating: '',
cbfcRating: '',
cccRating: '',
cceRating: '',
chfilmRating: '',
chvrsRating: '',
cicfRating: '',
cnaRating: '',
cncRating: '',
csaRating: '',
cscfRating: '',
czfilmRating: '',
djctqRating: '',
djctqRatingReasons: [],
ecbmctRating: '',
eefilmRating: '',
egfilmRating: '',
eirinRating: '',
fcbmRating: '',
fcoRating: '',
fmocRating: '',
fpbRating: '',
fpbRatingReasons: [],
fskRating: '',
grfilmRating: '',
icaaRating: '',
ifcoRating: '',
ilfilmRating: '',
incaaRating: '',
kfcbRating: '',
kijkwijzerRating: '',
kmrbRating: '',
lsfRating: '',
mccaaRating: '',
mccypRating: '',
mcstRating: '',
mdaRating: '',
medietilsynetRating: '',
mekuRating: '',
menaMpaaRating: '',
mibacRating: '',
mocRating: '',
moctwRating: '',
mpaaRating: '',
mpaatRating: '',
mtrcbRating: '',
nbcRating: '',
nbcplRating: '',
nfrcRating: '',
nfvcbRating: '',
nkclvRating: '',
nmcRating: '',
oflcRating: '',
pefilmRating: '',
rcnofRating: '',
resorteviolenciaRating: '',
rtcRating: '',
rteRating: '',
russiaRating: '',
skfilmRating: '',
smaisRating: '',
smsaRating: '',
tvpgRating: '',
ytRating: ''
},
countryRestriction: {allowed: false, exception: []},
definition: '',
dimension: '',
duration: '',
hasCustomThumbnail: false,
licensedContent: false,
projection: '',
regionRestriction: {allowed: [], blocked: []}
},
etag: '',
fileDetails: {
audioStreams: [{bitrateBps: '', channelCount: 0, codec: '', vendor: ''}],
bitrateBps: '',
container: '',
creationTime: '',
durationMs: '',
fileName: '',
fileSize: '',
fileType: '',
videoStreams: [
{
aspectRatio: '',
bitrateBps: '',
codec: '',
frameRateFps: '',
heightPixels: 0,
rotation: '',
vendor: '',
widthPixels: 0
}
]
},
id: '',
kind: '',
liveStreamingDetails: {
activeLiveChatId: '',
actualEndTime: '',
actualStartTime: '',
concurrentViewers: '',
scheduledEndTime: '',
scheduledStartTime: ''
},
localizations: {},
monetizationDetails: {access: {}},
player: {embedHeight: '', embedHtml: '', embedWidth: ''},
processingDetails: {
editorSuggestionsAvailability: '',
fileDetailsAvailability: '',
processingFailureReason: '',
processingIssuesAvailability: '',
processingProgress: {partsProcessed: '', partsTotal: '', timeLeftMs: ''},
processingStatus: '',
tagSuggestionsAvailability: '',
thumbnailsAvailability: ''
},
projectDetails: {},
recordingDetails: {
location: {altitude: '', latitude: '', longitude: ''},
locationDescription: '',
recordingDate: ''
},
snippet: {
categoryId: '',
channelId: '',
channelTitle: '',
defaultAudioLanguage: '',
defaultLanguage: '',
description: '',
liveBroadcastContent: '',
localized: {description: '', title: ''},
publishedAt: '',
tags: [],
thumbnails: {high: {height: 0, url: '', width: 0}, maxres: {}, medium: {}, standard: {}},
title: ''
},
statistics: {
commentCount: '',
dislikeCount: '',
favoriteCount: '',
likeCount: '',
viewCount: ''
},
status: {
embeddable: false,
failureReason: '',
license: '',
madeForKids: false,
privacyStatus: '',
publicStatsViewable: false,
publishAt: '',
rejectionReason: '',
selfDeclaredMadeForKids: false,
uploadStatus: ''
},
suggestions: {
editorSuggestions: [],
processingErrors: [],
processingHints: [],
processingWarnings: [],
tagSuggestions: [{categoryRestricts: [], tag: ''}]
},
topicDetails: {relevantTopicIds: [], topicCategories: [], topicIds: []}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/youtube/v3/videos?part=';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"ageGating":{"alcoholContent":false,"restricted":false,"videoGameRating":""},"contentDetails":{"caption":"","contentRating":{"acbRating":"","agcomRating":"","anatelRating":"","bbfcRating":"","bfvcRating":"","bmukkRating":"","catvRating":"","catvfrRating":"","cbfcRating":"","cccRating":"","cceRating":"","chfilmRating":"","chvrsRating":"","cicfRating":"","cnaRating":"","cncRating":"","csaRating":"","cscfRating":"","czfilmRating":"","djctqRating":"","djctqRatingReasons":[],"ecbmctRating":"","eefilmRating":"","egfilmRating":"","eirinRating":"","fcbmRating":"","fcoRating":"","fmocRating":"","fpbRating":"","fpbRatingReasons":[],"fskRating":"","grfilmRating":"","icaaRating":"","ifcoRating":"","ilfilmRating":"","incaaRating":"","kfcbRating":"","kijkwijzerRating":"","kmrbRating":"","lsfRating":"","mccaaRating":"","mccypRating":"","mcstRating":"","mdaRating":"","medietilsynetRating":"","mekuRating":"","menaMpaaRating":"","mibacRating":"","mocRating":"","moctwRating":"","mpaaRating":"","mpaatRating":"","mtrcbRating":"","nbcRating":"","nbcplRating":"","nfrcRating":"","nfvcbRating":"","nkclvRating":"","nmcRating":"","oflcRating":"","pefilmRating":"","rcnofRating":"","resorteviolenciaRating":"","rtcRating":"","rteRating":"","russiaRating":"","skfilmRating":"","smaisRating":"","smsaRating":"","tvpgRating":"","ytRating":""},"countryRestriction":{"allowed":false,"exception":[]},"definition":"","dimension":"","duration":"","hasCustomThumbnail":false,"licensedContent":false,"projection":"","regionRestriction":{"allowed":[],"blocked":[]}},"etag":"","fileDetails":{"audioStreams":[{"bitrateBps":"","channelCount":0,"codec":"","vendor":""}],"bitrateBps":"","container":"","creationTime":"","durationMs":"","fileName":"","fileSize":"","fileType":"","videoStreams":[{"aspectRatio":"","bitrateBps":"","codec":"","frameRateFps":"","heightPixels":0,"rotation":"","vendor":"","widthPixels":0}]},"id":"","kind":"","liveStreamingDetails":{"activeLiveChatId":"","actualEndTime":"","actualStartTime":"","concurrentViewers":"","scheduledEndTime":"","scheduledStartTime":""},"localizations":{},"monetizationDetails":{"access":{}},"player":{"embedHeight":"","embedHtml":"","embedWidth":""},"processingDetails":{"editorSuggestionsAvailability":"","fileDetailsAvailability":"","processingFailureReason":"","processingIssuesAvailability":"","processingProgress":{"partsProcessed":"","partsTotal":"","timeLeftMs":""},"processingStatus":"","tagSuggestionsAvailability":"","thumbnailsAvailability":""},"projectDetails":{},"recordingDetails":{"location":{"altitude":"","latitude":"","longitude":""},"locationDescription":"","recordingDate":""},"snippet":{"categoryId":"","channelId":"","channelTitle":"","defaultAudioLanguage":"","defaultLanguage":"","description":"","liveBroadcastContent":"","localized":{"description":"","title":""},"publishedAt":"","tags":[],"thumbnails":{"high":{"height":0,"url":"","width":0},"maxres":{},"medium":{},"standard":{}},"title":""},"statistics":{"commentCount":"","dislikeCount":"","favoriteCount":"","likeCount":"","viewCount":""},"status":{"embeddable":false,"failureReason":"","license":"","madeForKids":false,"privacyStatus":"","publicStatsViewable":false,"publishAt":"","rejectionReason":"","selfDeclaredMadeForKids":false,"uploadStatus":""},"suggestions":{"editorSuggestions":[],"processingErrors":[],"processingHints":[],"processingWarnings":[],"tagSuggestions":[{"categoryRestricts":[],"tag":""}]},"topicDetails":{"relevantTopicIds":[],"topicCategories":[],"topicIds":[]}}'
};
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 = @{ @"ageGating": @{ @"alcoholContent": @NO, @"restricted": @NO, @"videoGameRating": @"" },
@"contentDetails": @{ @"caption": @"", @"contentRating": @{ @"acbRating": @"", @"agcomRating": @"", @"anatelRating": @"", @"bbfcRating": @"", @"bfvcRating": @"", @"bmukkRating": @"", @"catvRating": @"", @"catvfrRating": @"", @"cbfcRating": @"", @"cccRating": @"", @"cceRating": @"", @"chfilmRating": @"", @"chvrsRating": @"", @"cicfRating": @"", @"cnaRating": @"", @"cncRating": @"", @"csaRating": @"", @"cscfRating": @"", @"czfilmRating": @"", @"djctqRating": @"", @"djctqRatingReasons": @[ ], @"ecbmctRating": @"", @"eefilmRating": @"", @"egfilmRating": @"", @"eirinRating": @"", @"fcbmRating": @"", @"fcoRating": @"", @"fmocRating": @"", @"fpbRating": @"", @"fpbRatingReasons": @[ ], @"fskRating": @"", @"grfilmRating": @"", @"icaaRating": @"", @"ifcoRating": @"", @"ilfilmRating": @"", @"incaaRating": @"", @"kfcbRating": @"", @"kijkwijzerRating": @"", @"kmrbRating": @"", @"lsfRating": @"", @"mccaaRating": @"", @"mccypRating": @"", @"mcstRating": @"", @"mdaRating": @"", @"medietilsynetRating": @"", @"mekuRating": @"", @"menaMpaaRating": @"", @"mibacRating": @"", @"mocRating": @"", @"moctwRating": @"", @"mpaaRating": @"", @"mpaatRating": @"", @"mtrcbRating": @"", @"nbcRating": @"", @"nbcplRating": @"", @"nfrcRating": @"", @"nfvcbRating": @"", @"nkclvRating": @"", @"nmcRating": @"", @"oflcRating": @"", @"pefilmRating": @"", @"rcnofRating": @"", @"resorteviolenciaRating": @"", @"rtcRating": @"", @"rteRating": @"", @"russiaRating": @"", @"skfilmRating": @"", @"smaisRating": @"", @"smsaRating": @"", @"tvpgRating": @"", @"ytRating": @"" }, @"countryRestriction": @{ @"allowed": @NO, @"exception": @[ ] }, @"definition": @"", @"dimension": @"", @"duration": @"", @"hasCustomThumbnail": @NO, @"licensedContent": @NO, @"projection": @"", @"regionRestriction": @{ @"allowed": @[ ], @"blocked": @[ ] } },
@"etag": @"",
@"fileDetails": @{ @"audioStreams": @[ @{ @"bitrateBps": @"", @"channelCount": @0, @"codec": @"", @"vendor": @"" } ], @"bitrateBps": @"", @"container": @"", @"creationTime": @"", @"durationMs": @"", @"fileName": @"", @"fileSize": @"", @"fileType": @"", @"videoStreams": @[ @{ @"aspectRatio": @"", @"bitrateBps": @"", @"codec": @"", @"frameRateFps": @"", @"heightPixels": @0, @"rotation": @"", @"vendor": @"", @"widthPixels": @0 } ] },
@"id": @"",
@"kind": @"",
@"liveStreamingDetails": @{ @"activeLiveChatId": @"", @"actualEndTime": @"", @"actualStartTime": @"", @"concurrentViewers": @"", @"scheduledEndTime": @"", @"scheduledStartTime": @"" },
@"localizations": @{ },
@"monetizationDetails": @{ @"access": @{ } },
@"player": @{ @"embedHeight": @"", @"embedHtml": @"", @"embedWidth": @"" },
@"processingDetails": @{ @"editorSuggestionsAvailability": @"", @"fileDetailsAvailability": @"", @"processingFailureReason": @"", @"processingIssuesAvailability": @"", @"processingProgress": @{ @"partsProcessed": @"", @"partsTotal": @"", @"timeLeftMs": @"" }, @"processingStatus": @"", @"tagSuggestionsAvailability": @"", @"thumbnailsAvailability": @"" },
@"projectDetails": @{ },
@"recordingDetails": @{ @"location": @{ @"altitude": @"", @"latitude": @"", @"longitude": @"" }, @"locationDescription": @"", @"recordingDate": @"" },
@"snippet": @{ @"categoryId": @"", @"channelId": @"", @"channelTitle": @"", @"defaultAudioLanguage": @"", @"defaultLanguage": @"", @"description": @"", @"liveBroadcastContent": @"", @"localized": @{ @"description": @"", @"title": @"" }, @"publishedAt": @"", @"tags": @[ ], @"thumbnails": @{ @"high": @{ @"height": @0, @"url": @"", @"width": @0 }, @"maxres": @{ }, @"medium": @{ }, @"standard": @{ } }, @"title": @"" },
@"statistics": @{ @"commentCount": @"", @"dislikeCount": @"", @"favoriteCount": @"", @"likeCount": @"", @"viewCount": @"" },
@"status": @{ @"embeddable": @NO, @"failureReason": @"", @"license": @"", @"madeForKids": @NO, @"privacyStatus": @"", @"publicStatsViewable": @NO, @"publishAt": @"", @"rejectionReason": @"", @"selfDeclaredMadeForKids": @NO, @"uploadStatus": @"" },
@"suggestions": @{ @"editorSuggestions": @[ ], @"processingErrors": @[ ], @"processingHints": @[ ], @"processingWarnings": @[ ], @"tagSuggestions": @[ @{ @"categoryRestricts": @[ ], @"tag": @"" } ] },
@"topicDetails": @{ @"relevantTopicIds": @[ ], @"topicCategories": @[ ], @"topicIds": @[ ] } };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/youtube/v3/videos?part="]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PUT"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/youtube/v3/videos?part=" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"ageGating\": {\n \"alcoholContent\": false,\n \"restricted\": false,\n \"videoGameRating\": \"\"\n },\n \"contentDetails\": {\n \"caption\": \"\",\n \"contentRating\": {\n \"acbRating\": \"\",\n \"agcomRating\": \"\",\n \"anatelRating\": \"\",\n \"bbfcRating\": \"\",\n \"bfvcRating\": \"\",\n \"bmukkRating\": \"\",\n \"catvRating\": \"\",\n \"catvfrRating\": \"\",\n \"cbfcRating\": \"\",\n \"cccRating\": \"\",\n \"cceRating\": \"\",\n \"chfilmRating\": \"\",\n \"chvrsRating\": \"\",\n \"cicfRating\": \"\",\n \"cnaRating\": \"\",\n \"cncRating\": \"\",\n \"csaRating\": \"\",\n \"cscfRating\": \"\",\n \"czfilmRating\": \"\",\n \"djctqRating\": \"\",\n \"djctqRatingReasons\": [],\n \"ecbmctRating\": \"\",\n \"eefilmRating\": \"\",\n \"egfilmRating\": \"\",\n \"eirinRating\": \"\",\n \"fcbmRating\": \"\",\n \"fcoRating\": \"\",\n \"fmocRating\": \"\",\n \"fpbRating\": \"\",\n \"fpbRatingReasons\": [],\n \"fskRating\": \"\",\n \"grfilmRating\": \"\",\n \"icaaRating\": \"\",\n \"ifcoRating\": \"\",\n \"ilfilmRating\": \"\",\n \"incaaRating\": \"\",\n \"kfcbRating\": \"\",\n \"kijkwijzerRating\": \"\",\n \"kmrbRating\": \"\",\n \"lsfRating\": \"\",\n \"mccaaRating\": \"\",\n \"mccypRating\": \"\",\n \"mcstRating\": \"\",\n \"mdaRating\": \"\",\n \"medietilsynetRating\": \"\",\n \"mekuRating\": \"\",\n \"menaMpaaRating\": \"\",\n \"mibacRating\": \"\",\n \"mocRating\": \"\",\n \"moctwRating\": \"\",\n \"mpaaRating\": \"\",\n \"mpaatRating\": \"\",\n \"mtrcbRating\": \"\",\n \"nbcRating\": \"\",\n \"nbcplRating\": \"\",\n \"nfrcRating\": \"\",\n \"nfvcbRating\": \"\",\n \"nkclvRating\": \"\",\n \"nmcRating\": \"\",\n \"oflcRating\": \"\",\n \"pefilmRating\": \"\",\n \"rcnofRating\": \"\",\n \"resorteviolenciaRating\": \"\",\n \"rtcRating\": \"\",\n \"rteRating\": \"\",\n \"russiaRating\": \"\",\n \"skfilmRating\": \"\",\n \"smaisRating\": \"\",\n \"smsaRating\": \"\",\n \"tvpgRating\": \"\",\n \"ytRating\": \"\"\n },\n \"countryRestriction\": {\n \"allowed\": false,\n \"exception\": []\n },\n \"definition\": \"\",\n \"dimension\": \"\",\n \"duration\": \"\",\n \"hasCustomThumbnail\": false,\n \"licensedContent\": false,\n \"projection\": \"\",\n \"regionRestriction\": {\n \"allowed\": [],\n \"blocked\": []\n }\n },\n \"etag\": \"\",\n \"fileDetails\": {\n \"audioStreams\": [\n {\n \"bitrateBps\": \"\",\n \"channelCount\": 0,\n \"codec\": \"\",\n \"vendor\": \"\"\n }\n ],\n \"bitrateBps\": \"\",\n \"container\": \"\",\n \"creationTime\": \"\",\n \"durationMs\": \"\",\n \"fileName\": \"\",\n \"fileSize\": \"\",\n \"fileType\": \"\",\n \"videoStreams\": [\n {\n \"aspectRatio\": \"\",\n \"bitrateBps\": \"\",\n \"codec\": \"\",\n \"frameRateFps\": \"\",\n \"heightPixels\": 0,\n \"rotation\": \"\",\n \"vendor\": \"\",\n \"widthPixels\": 0\n }\n ]\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"liveStreamingDetails\": {\n \"activeLiveChatId\": \"\",\n \"actualEndTime\": \"\",\n \"actualStartTime\": \"\",\n \"concurrentViewers\": \"\",\n \"scheduledEndTime\": \"\",\n \"scheduledStartTime\": \"\"\n },\n \"localizations\": {},\n \"monetizationDetails\": {\n \"access\": {}\n },\n \"player\": {\n \"embedHeight\": \"\",\n \"embedHtml\": \"\",\n \"embedWidth\": \"\"\n },\n \"processingDetails\": {\n \"editorSuggestionsAvailability\": \"\",\n \"fileDetailsAvailability\": \"\",\n \"processingFailureReason\": \"\",\n \"processingIssuesAvailability\": \"\",\n \"processingProgress\": {\n \"partsProcessed\": \"\",\n \"partsTotal\": \"\",\n \"timeLeftMs\": \"\"\n },\n \"processingStatus\": \"\",\n \"tagSuggestionsAvailability\": \"\",\n \"thumbnailsAvailability\": \"\"\n },\n \"projectDetails\": {},\n \"recordingDetails\": {\n \"location\": {\n \"altitude\": \"\",\n \"latitude\": \"\",\n \"longitude\": \"\"\n },\n \"locationDescription\": \"\",\n \"recordingDate\": \"\"\n },\n \"snippet\": {\n \"categoryId\": \"\",\n \"channelId\": \"\",\n \"channelTitle\": \"\",\n \"defaultAudioLanguage\": \"\",\n \"defaultLanguage\": \"\",\n \"description\": \"\",\n \"liveBroadcastContent\": \"\",\n \"localized\": {\n \"description\": \"\",\n \"title\": \"\"\n },\n \"publishedAt\": \"\",\n \"tags\": [],\n \"thumbnails\": {\n \"high\": {\n \"height\": 0,\n \"url\": \"\",\n \"width\": 0\n },\n \"maxres\": {},\n \"medium\": {},\n \"standard\": {}\n },\n \"title\": \"\"\n },\n \"statistics\": {\n \"commentCount\": \"\",\n \"dislikeCount\": \"\",\n \"favoriteCount\": \"\",\n \"likeCount\": \"\",\n \"viewCount\": \"\"\n },\n \"status\": {\n \"embeddable\": false,\n \"failureReason\": \"\",\n \"license\": \"\",\n \"madeForKids\": false,\n \"privacyStatus\": \"\",\n \"publicStatsViewable\": false,\n \"publishAt\": \"\",\n \"rejectionReason\": \"\",\n \"selfDeclaredMadeForKids\": false,\n \"uploadStatus\": \"\"\n },\n \"suggestions\": {\n \"editorSuggestions\": [],\n \"processingErrors\": [],\n \"processingHints\": [],\n \"processingWarnings\": [],\n \"tagSuggestions\": [\n {\n \"categoryRestricts\": [],\n \"tag\": \"\"\n }\n ]\n },\n \"topicDetails\": {\n \"relevantTopicIds\": [],\n \"topicCategories\": [],\n \"topicIds\": []\n }\n}" in
Client.call ~headers ~body `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/youtube/v3/videos?part=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'ageGating' => [
'alcoholContent' => null,
'restricted' => null,
'videoGameRating' => ''
],
'contentDetails' => [
'caption' => '',
'contentRating' => [
'acbRating' => '',
'agcomRating' => '',
'anatelRating' => '',
'bbfcRating' => '',
'bfvcRating' => '',
'bmukkRating' => '',
'catvRating' => '',
'catvfrRating' => '',
'cbfcRating' => '',
'cccRating' => '',
'cceRating' => '',
'chfilmRating' => '',
'chvrsRating' => '',
'cicfRating' => '',
'cnaRating' => '',
'cncRating' => '',
'csaRating' => '',
'cscfRating' => '',
'czfilmRating' => '',
'djctqRating' => '',
'djctqRatingReasons' => [
],
'ecbmctRating' => '',
'eefilmRating' => '',
'egfilmRating' => '',
'eirinRating' => '',
'fcbmRating' => '',
'fcoRating' => '',
'fmocRating' => '',
'fpbRating' => '',
'fpbRatingReasons' => [
],
'fskRating' => '',
'grfilmRating' => '',
'icaaRating' => '',
'ifcoRating' => '',
'ilfilmRating' => '',
'incaaRating' => '',
'kfcbRating' => '',
'kijkwijzerRating' => '',
'kmrbRating' => '',
'lsfRating' => '',
'mccaaRating' => '',
'mccypRating' => '',
'mcstRating' => '',
'mdaRating' => '',
'medietilsynetRating' => '',
'mekuRating' => '',
'menaMpaaRating' => '',
'mibacRating' => '',
'mocRating' => '',
'moctwRating' => '',
'mpaaRating' => '',
'mpaatRating' => '',
'mtrcbRating' => '',
'nbcRating' => '',
'nbcplRating' => '',
'nfrcRating' => '',
'nfvcbRating' => '',
'nkclvRating' => '',
'nmcRating' => '',
'oflcRating' => '',
'pefilmRating' => '',
'rcnofRating' => '',
'resorteviolenciaRating' => '',
'rtcRating' => '',
'rteRating' => '',
'russiaRating' => '',
'skfilmRating' => '',
'smaisRating' => '',
'smsaRating' => '',
'tvpgRating' => '',
'ytRating' => ''
],
'countryRestriction' => [
'allowed' => null,
'exception' => [
]
],
'definition' => '',
'dimension' => '',
'duration' => '',
'hasCustomThumbnail' => null,
'licensedContent' => null,
'projection' => '',
'regionRestriction' => [
'allowed' => [
],
'blocked' => [
]
]
],
'etag' => '',
'fileDetails' => [
'audioStreams' => [
[
'bitrateBps' => '',
'channelCount' => 0,
'codec' => '',
'vendor' => ''
]
],
'bitrateBps' => '',
'container' => '',
'creationTime' => '',
'durationMs' => '',
'fileName' => '',
'fileSize' => '',
'fileType' => '',
'videoStreams' => [
[
'aspectRatio' => '',
'bitrateBps' => '',
'codec' => '',
'frameRateFps' => '',
'heightPixels' => 0,
'rotation' => '',
'vendor' => '',
'widthPixels' => 0
]
]
],
'id' => '',
'kind' => '',
'liveStreamingDetails' => [
'activeLiveChatId' => '',
'actualEndTime' => '',
'actualStartTime' => '',
'concurrentViewers' => '',
'scheduledEndTime' => '',
'scheduledStartTime' => ''
],
'localizations' => [
],
'monetizationDetails' => [
'access' => [
]
],
'player' => [
'embedHeight' => '',
'embedHtml' => '',
'embedWidth' => ''
],
'processingDetails' => [
'editorSuggestionsAvailability' => '',
'fileDetailsAvailability' => '',
'processingFailureReason' => '',
'processingIssuesAvailability' => '',
'processingProgress' => [
'partsProcessed' => '',
'partsTotal' => '',
'timeLeftMs' => ''
],
'processingStatus' => '',
'tagSuggestionsAvailability' => '',
'thumbnailsAvailability' => ''
],
'projectDetails' => [
],
'recordingDetails' => [
'location' => [
'altitude' => '',
'latitude' => '',
'longitude' => ''
],
'locationDescription' => '',
'recordingDate' => ''
],
'snippet' => [
'categoryId' => '',
'channelId' => '',
'channelTitle' => '',
'defaultAudioLanguage' => '',
'defaultLanguage' => '',
'description' => '',
'liveBroadcastContent' => '',
'localized' => [
'description' => '',
'title' => ''
],
'publishedAt' => '',
'tags' => [
],
'thumbnails' => [
'high' => [
'height' => 0,
'url' => '',
'width' => 0
],
'maxres' => [
],
'medium' => [
],
'standard' => [
]
],
'title' => ''
],
'statistics' => [
'commentCount' => '',
'dislikeCount' => '',
'favoriteCount' => '',
'likeCount' => '',
'viewCount' => ''
],
'status' => [
'embeddable' => null,
'failureReason' => '',
'license' => '',
'madeForKids' => null,
'privacyStatus' => '',
'publicStatsViewable' => null,
'publishAt' => '',
'rejectionReason' => '',
'selfDeclaredMadeForKids' => null,
'uploadStatus' => ''
],
'suggestions' => [
'editorSuggestions' => [
],
'processingErrors' => [
],
'processingHints' => [
],
'processingWarnings' => [
],
'tagSuggestions' => [
[
'categoryRestricts' => [
],
'tag' => ''
]
]
],
'topicDetails' => [
'relevantTopicIds' => [
],
'topicCategories' => [
],
'topicIds' => [
]
]
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('PUT', '{{baseUrl}}/youtube/v3/videos?part=', [
'body' => '{
"ageGating": {
"alcoholContent": false,
"restricted": false,
"videoGameRating": ""
},
"contentDetails": {
"caption": "",
"contentRating": {
"acbRating": "",
"agcomRating": "",
"anatelRating": "",
"bbfcRating": "",
"bfvcRating": "",
"bmukkRating": "",
"catvRating": "",
"catvfrRating": "",
"cbfcRating": "",
"cccRating": "",
"cceRating": "",
"chfilmRating": "",
"chvrsRating": "",
"cicfRating": "",
"cnaRating": "",
"cncRating": "",
"csaRating": "",
"cscfRating": "",
"czfilmRating": "",
"djctqRating": "",
"djctqRatingReasons": [],
"ecbmctRating": "",
"eefilmRating": "",
"egfilmRating": "",
"eirinRating": "",
"fcbmRating": "",
"fcoRating": "",
"fmocRating": "",
"fpbRating": "",
"fpbRatingReasons": [],
"fskRating": "",
"grfilmRating": "",
"icaaRating": "",
"ifcoRating": "",
"ilfilmRating": "",
"incaaRating": "",
"kfcbRating": "",
"kijkwijzerRating": "",
"kmrbRating": "",
"lsfRating": "",
"mccaaRating": "",
"mccypRating": "",
"mcstRating": "",
"mdaRating": "",
"medietilsynetRating": "",
"mekuRating": "",
"menaMpaaRating": "",
"mibacRating": "",
"mocRating": "",
"moctwRating": "",
"mpaaRating": "",
"mpaatRating": "",
"mtrcbRating": "",
"nbcRating": "",
"nbcplRating": "",
"nfrcRating": "",
"nfvcbRating": "",
"nkclvRating": "",
"nmcRating": "",
"oflcRating": "",
"pefilmRating": "",
"rcnofRating": "",
"resorteviolenciaRating": "",
"rtcRating": "",
"rteRating": "",
"russiaRating": "",
"skfilmRating": "",
"smaisRating": "",
"smsaRating": "",
"tvpgRating": "",
"ytRating": ""
},
"countryRestriction": {
"allowed": false,
"exception": []
},
"definition": "",
"dimension": "",
"duration": "",
"hasCustomThumbnail": false,
"licensedContent": false,
"projection": "",
"regionRestriction": {
"allowed": [],
"blocked": []
}
},
"etag": "",
"fileDetails": {
"audioStreams": [
{
"bitrateBps": "",
"channelCount": 0,
"codec": "",
"vendor": ""
}
],
"bitrateBps": "",
"container": "",
"creationTime": "",
"durationMs": "",
"fileName": "",
"fileSize": "",
"fileType": "",
"videoStreams": [
{
"aspectRatio": "",
"bitrateBps": "",
"codec": "",
"frameRateFps": "",
"heightPixels": 0,
"rotation": "",
"vendor": "",
"widthPixels": 0
}
]
},
"id": "",
"kind": "",
"liveStreamingDetails": {
"activeLiveChatId": "",
"actualEndTime": "",
"actualStartTime": "",
"concurrentViewers": "",
"scheduledEndTime": "",
"scheduledStartTime": ""
},
"localizations": {},
"monetizationDetails": {
"access": {}
},
"player": {
"embedHeight": "",
"embedHtml": "",
"embedWidth": ""
},
"processingDetails": {
"editorSuggestionsAvailability": "",
"fileDetailsAvailability": "",
"processingFailureReason": "",
"processingIssuesAvailability": "",
"processingProgress": {
"partsProcessed": "",
"partsTotal": "",
"timeLeftMs": ""
},
"processingStatus": "",
"tagSuggestionsAvailability": "",
"thumbnailsAvailability": ""
},
"projectDetails": {},
"recordingDetails": {
"location": {
"altitude": "",
"latitude": "",
"longitude": ""
},
"locationDescription": "",
"recordingDate": ""
},
"snippet": {
"categoryId": "",
"channelId": "",
"channelTitle": "",
"defaultAudioLanguage": "",
"defaultLanguage": "",
"description": "",
"liveBroadcastContent": "",
"localized": {
"description": "",
"title": ""
},
"publishedAt": "",
"tags": [],
"thumbnails": {
"high": {
"height": 0,
"url": "",
"width": 0
},
"maxres": {},
"medium": {},
"standard": {}
},
"title": ""
},
"statistics": {
"commentCount": "",
"dislikeCount": "",
"favoriteCount": "",
"likeCount": "",
"viewCount": ""
},
"status": {
"embeddable": false,
"failureReason": "",
"license": "",
"madeForKids": false,
"privacyStatus": "",
"publicStatsViewable": false,
"publishAt": "",
"rejectionReason": "",
"selfDeclaredMadeForKids": false,
"uploadStatus": ""
},
"suggestions": {
"editorSuggestions": [],
"processingErrors": [],
"processingHints": [],
"processingWarnings": [],
"tagSuggestions": [
{
"categoryRestricts": [],
"tag": ""
}
]
},
"topicDetails": {
"relevantTopicIds": [],
"topicCategories": [],
"topicIds": []
}
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/youtube/v3/videos');
$request->setMethod(HTTP_METH_PUT);
$request->setQueryData([
'part' => ''
]);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'ageGating' => [
'alcoholContent' => null,
'restricted' => null,
'videoGameRating' => ''
],
'contentDetails' => [
'caption' => '',
'contentRating' => [
'acbRating' => '',
'agcomRating' => '',
'anatelRating' => '',
'bbfcRating' => '',
'bfvcRating' => '',
'bmukkRating' => '',
'catvRating' => '',
'catvfrRating' => '',
'cbfcRating' => '',
'cccRating' => '',
'cceRating' => '',
'chfilmRating' => '',
'chvrsRating' => '',
'cicfRating' => '',
'cnaRating' => '',
'cncRating' => '',
'csaRating' => '',
'cscfRating' => '',
'czfilmRating' => '',
'djctqRating' => '',
'djctqRatingReasons' => [
],
'ecbmctRating' => '',
'eefilmRating' => '',
'egfilmRating' => '',
'eirinRating' => '',
'fcbmRating' => '',
'fcoRating' => '',
'fmocRating' => '',
'fpbRating' => '',
'fpbRatingReasons' => [
],
'fskRating' => '',
'grfilmRating' => '',
'icaaRating' => '',
'ifcoRating' => '',
'ilfilmRating' => '',
'incaaRating' => '',
'kfcbRating' => '',
'kijkwijzerRating' => '',
'kmrbRating' => '',
'lsfRating' => '',
'mccaaRating' => '',
'mccypRating' => '',
'mcstRating' => '',
'mdaRating' => '',
'medietilsynetRating' => '',
'mekuRating' => '',
'menaMpaaRating' => '',
'mibacRating' => '',
'mocRating' => '',
'moctwRating' => '',
'mpaaRating' => '',
'mpaatRating' => '',
'mtrcbRating' => '',
'nbcRating' => '',
'nbcplRating' => '',
'nfrcRating' => '',
'nfvcbRating' => '',
'nkclvRating' => '',
'nmcRating' => '',
'oflcRating' => '',
'pefilmRating' => '',
'rcnofRating' => '',
'resorteviolenciaRating' => '',
'rtcRating' => '',
'rteRating' => '',
'russiaRating' => '',
'skfilmRating' => '',
'smaisRating' => '',
'smsaRating' => '',
'tvpgRating' => '',
'ytRating' => ''
],
'countryRestriction' => [
'allowed' => null,
'exception' => [
]
],
'definition' => '',
'dimension' => '',
'duration' => '',
'hasCustomThumbnail' => null,
'licensedContent' => null,
'projection' => '',
'regionRestriction' => [
'allowed' => [
],
'blocked' => [
]
]
],
'etag' => '',
'fileDetails' => [
'audioStreams' => [
[
'bitrateBps' => '',
'channelCount' => 0,
'codec' => '',
'vendor' => ''
]
],
'bitrateBps' => '',
'container' => '',
'creationTime' => '',
'durationMs' => '',
'fileName' => '',
'fileSize' => '',
'fileType' => '',
'videoStreams' => [
[
'aspectRatio' => '',
'bitrateBps' => '',
'codec' => '',
'frameRateFps' => '',
'heightPixels' => 0,
'rotation' => '',
'vendor' => '',
'widthPixels' => 0
]
]
],
'id' => '',
'kind' => '',
'liveStreamingDetails' => [
'activeLiveChatId' => '',
'actualEndTime' => '',
'actualStartTime' => '',
'concurrentViewers' => '',
'scheduledEndTime' => '',
'scheduledStartTime' => ''
],
'localizations' => [
],
'monetizationDetails' => [
'access' => [
]
],
'player' => [
'embedHeight' => '',
'embedHtml' => '',
'embedWidth' => ''
],
'processingDetails' => [
'editorSuggestionsAvailability' => '',
'fileDetailsAvailability' => '',
'processingFailureReason' => '',
'processingIssuesAvailability' => '',
'processingProgress' => [
'partsProcessed' => '',
'partsTotal' => '',
'timeLeftMs' => ''
],
'processingStatus' => '',
'tagSuggestionsAvailability' => '',
'thumbnailsAvailability' => ''
],
'projectDetails' => [
],
'recordingDetails' => [
'location' => [
'altitude' => '',
'latitude' => '',
'longitude' => ''
],
'locationDescription' => '',
'recordingDate' => ''
],
'snippet' => [
'categoryId' => '',
'channelId' => '',
'channelTitle' => '',
'defaultAudioLanguage' => '',
'defaultLanguage' => '',
'description' => '',
'liveBroadcastContent' => '',
'localized' => [
'description' => '',
'title' => ''
],
'publishedAt' => '',
'tags' => [
],
'thumbnails' => [
'high' => [
'height' => 0,
'url' => '',
'width' => 0
],
'maxres' => [
],
'medium' => [
],
'standard' => [
]
],
'title' => ''
],
'statistics' => [
'commentCount' => '',
'dislikeCount' => '',
'favoriteCount' => '',
'likeCount' => '',
'viewCount' => ''
],
'status' => [
'embeddable' => null,
'failureReason' => '',
'license' => '',
'madeForKids' => null,
'privacyStatus' => '',
'publicStatsViewable' => null,
'publishAt' => '',
'rejectionReason' => '',
'selfDeclaredMadeForKids' => null,
'uploadStatus' => ''
],
'suggestions' => [
'editorSuggestions' => [
],
'processingErrors' => [
],
'processingHints' => [
],
'processingWarnings' => [
],
'tagSuggestions' => [
[
'categoryRestricts' => [
],
'tag' => ''
]
]
],
'topicDetails' => [
'relevantTopicIds' => [
],
'topicCategories' => [
],
'topicIds' => [
]
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'ageGating' => [
'alcoholContent' => null,
'restricted' => null,
'videoGameRating' => ''
],
'contentDetails' => [
'caption' => '',
'contentRating' => [
'acbRating' => '',
'agcomRating' => '',
'anatelRating' => '',
'bbfcRating' => '',
'bfvcRating' => '',
'bmukkRating' => '',
'catvRating' => '',
'catvfrRating' => '',
'cbfcRating' => '',
'cccRating' => '',
'cceRating' => '',
'chfilmRating' => '',
'chvrsRating' => '',
'cicfRating' => '',
'cnaRating' => '',
'cncRating' => '',
'csaRating' => '',
'cscfRating' => '',
'czfilmRating' => '',
'djctqRating' => '',
'djctqRatingReasons' => [
],
'ecbmctRating' => '',
'eefilmRating' => '',
'egfilmRating' => '',
'eirinRating' => '',
'fcbmRating' => '',
'fcoRating' => '',
'fmocRating' => '',
'fpbRating' => '',
'fpbRatingReasons' => [
],
'fskRating' => '',
'grfilmRating' => '',
'icaaRating' => '',
'ifcoRating' => '',
'ilfilmRating' => '',
'incaaRating' => '',
'kfcbRating' => '',
'kijkwijzerRating' => '',
'kmrbRating' => '',
'lsfRating' => '',
'mccaaRating' => '',
'mccypRating' => '',
'mcstRating' => '',
'mdaRating' => '',
'medietilsynetRating' => '',
'mekuRating' => '',
'menaMpaaRating' => '',
'mibacRating' => '',
'mocRating' => '',
'moctwRating' => '',
'mpaaRating' => '',
'mpaatRating' => '',
'mtrcbRating' => '',
'nbcRating' => '',
'nbcplRating' => '',
'nfrcRating' => '',
'nfvcbRating' => '',
'nkclvRating' => '',
'nmcRating' => '',
'oflcRating' => '',
'pefilmRating' => '',
'rcnofRating' => '',
'resorteviolenciaRating' => '',
'rtcRating' => '',
'rteRating' => '',
'russiaRating' => '',
'skfilmRating' => '',
'smaisRating' => '',
'smsaRating' => '',
'tvpgRating' => '',
'ytRating' => ''
],
'countryRestriction' => [
'allowed' => null,
'exception' => [
]
],
'definition' => '',
'dimension' => '',
'duration' => '',
'hasCustomThumbnail' => null,
'licensedContent' => null,
'projection' => '',
'regionRestriction' => [
'allowed' => [
],
'blocked' => [
]
]
],
'etag' => '',
'fileDetails' => [
'audioStreams' => [
[
'bitrateBps' => '',
'channelCount' => 0,
'codec' => '',
'vendor' => ''
]
],
'bitrateBps' => '',
'container' => '',
'creationTime' => '',
'durationMs' => '',
'fileName' => '',
'fileSize' => '',
'fileType' => '',
'videoStreams' => [
[
'aspectRatio' => '',
'bitrateBps' => '',
'codec' => '',
'frameRateFps' => '',
'heightPixels' => 0,
'rotation' => '',
'vendor' => '',
'widthPixels' => 0
]
]
],
'id' => '',
'kind' => '',
'liveStreamingDetails' => [
'activeLiveChatId' => '',
'actualEndTime' => '',
'actualStartTime' => '',
'concurrentViewers' => '',
'scheduledEndTime' => '',
'scheduledStartTime' => ''
],
'localizations' => [
],
'monetizationDetails' => [
'access' => [
]
],
'player' => [
'embedHeight' => '',
'embedHtml' => '',
'embedWidth' => ''
],
'processingDetails' => [
'editorSuggestionsAvailability' => '',
'fileDetailsAvailability' => '',
'processingFailureReason' => '',
'processingIssuesAvailability' => '',
'processingProgress' => [
'partsProcessed' => '',
'partsTotal' => '',
'timeLeftMs' => ''
],
'processingStatus' => '',
'tagSuggestionsAvailability' => '',
'thumbnailsAvailability' => ''
],
'projectDetails' => [
],
'recordingDetails' => [
'location' => [
'altitude' => '',
'latitude' => '',
'longitude' => ''
],
'locationDescription' => '',
'recordingDate' => ''
],
'snippet' => [
'categoryId' => '',
'channelId' => '',
'channelTitle' => '',
'defaultAudioLanguage' => '',
'defaultLanguage' => '',
'description' => '',
'liveBroadcastContent' => '',
'localized' => [
'description' => '',
'title' => ''
],
'publishedAt' => '',
'tags' => [
],
'thumbnails' => [
'high' => [
'height' => 0,
'url' => '',
'width' => 0
],
'maxres' => [
],
'medium' => [
],
'standard' => [
]
],
'title' => ''
],
'statistics' => [
'commentCount' => '',
'dislikeCount' => '',
'favoriteCount' => '',
'likeCount' => '',
'viewCount' => ''
],
'status' => [
'embeddable' => null,
'failureReason' => '',
'license' => '',
'madeForKids' => null,
'privacyStatus' => '',
'publicStatsViewable' => null,
'publishAt' => '',
'rejectionReason' => '',
'selfDeclaredMadeForKids' => null,
'uploadStatus' => ''
],
'suggestions' => [
'editorSuggestions' => [
],
'processingErrors' => [
],
'processingHints' => [
],
'processingWarnings' => [
],
'tagSuggestions' => [
[
'categoryRestricts' => [
],
'tag' => ''
]
]
],
'topicDetails' => [
'relevantTopicIds' => [
],
'topicCategories' => [
],
'topicIds' => [
]
]
]));
$request->setRequestUrl('{{baseUrl}}/youtube/v3/videos');
$request->setRequestMethod('PUT');
$request->setBody($body);
$request->setQuery(new http\QueryString([
'part' => ''
]));
$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}}/youtube/v3/videos?part=' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"ageGating": {
"alcoholContent": false,
"restricted": false,
"videoGameRating": ""
},
"contentDetails": {
"caption": "",
"contentRating": {
"acbRating": "",
"agcomRating": "",
"anatelRating": "",
"bbfcRating": "",
"bfvcRating": "",
"bmukkRating": "",
"catvRating": "",
"catvfrRating": "",
"cbfcRating": "",
"cccRating": "",
"cceRating": "",
"chfilmRating": "",
"chvrsRating": "",
"cicfRating": "",
"cnaRating": "",
"cncRating": "",
"csaRating": "",
"cscfRating": "",
"czfilmRating": "",
"djctqRating": "",
"djctqRatingReasons": [],
"ecbmctRating": "",
"eefilmRating": "",
"egfilmRating": "",
"eirinRating": "",
"fcbmRating": "",
"fcoRating": "",
"fmocRating": "",
"fpbRating": "",
"fpbRatingReasons": [],
"fskRating": "",
"grfilmRating": "",
"icaaRating": "",
"ifcoRating": "",
"ilfilmRating": "",
"incaaRating": "",
"kfcbRating": "",
"kijkwijzerRating": "",
"kmrbRating": "",
"lsfRating": "",
"mccaaRating": "",
"mccypRating": "",
"mcstRating": "",
"mdaRating": "",
"medietilsynetRating": "",
"mekuRating": "",
"menaMpaaRating": "",
"mibacRating": "",
"mocRating": "",
"moctwRating": "",
"mpaaRating": "",
"mpaatRating": "",
"mtrcbRating": "",
"nbcRating": "",
"nbcplRating": "",
"nfrcRating": "",
"nfvcbRating": "",
"nkclvRating": "",
"nmcRating": "",
"oflcRating": "",
"pefilmRating": "",
"rcnofRating": "",
"resorteviolenciaRating": "",
"rtcRating": "",
"rteRating": "",
"russiaRating": "",
"skfilmRating": "",
"smaisRating": "",
"smsaRating": "",
"tvpgRating": "",
"ytRating": ""
},
"countryRestriction": {
"allowed": false,
"exception": []
},
"definition": "",
"dimension": "",
"duration": "",
"hasCustomThumbnail": false,
"licensedContent": false,
"projection": "",
"regionRestriction": {
"allowed": [],
"blocked": []
}
},
"etag": "",
"fileDetails": {
"audioStreams": [
{
"bitrateBps": "",
"channelCount": 0,
"codec": "",
"vendor": ""
}
],
"bitrateBps": "",
"container": "",
"creationTime": "",
"durationMs": "",
"fileName": "",
"fileSize": "",
"fileType": "",
"videoStreams": [
{
"aspectRatio": "",
"bitrateBps": "",
"codec": "",
"frameRateFps": "",
"heightPixels": 0,
"rotation": "",
"vendor": "",
"widthPixels": 0
}
]
},
"id": "",
"kind": "",
"liveStreamingDetails": {
"activeLiveChatId": "",
"actualEndTime": "",
"actualStartTime": "",
"concurrentViewers": "",
"scheduledEndTime": "",
"scheduledStartTime": ""
},
"localizations": {},
"monetizationDetails": {
"access": {}
},
"player": {
"embedHeight": "",
"embedHtml": "",
"embedWidth": ""
},
"processingDetails": {
"editorSuggestionsAvailability": "",
"fileDetailsAvailability": "",
"processingFailureReason": "",
"processingIssuesAvailability": "",
"processingProgress": {
"partsProcessed": "",
"partsTotal": "",
"timeLeftMs": ""
},
"processingStatus": "",
"tagSuggestionsAvailability": "",
"thumbnailsAvailability": ""
},
"projectDetails": {},
"recordingDetails": {
"location": {
"altitude": "",
"latitude": "",
"longitude": ""
},
"locationDescription": "",
"recordingDate": ""
},
"snippet": {
"categoryId": "",
"channelId": "",
"channelTitle": "",
"defaultAudioLanguage": "",
"defaultLanguage": "",
"description": "",
"liveBroadcastContent": "",
"localized": {
"description": "",
"title": ""
},
"publishedAt": "",
"tags": [],
"thumbnails": {
"high": {
"height": 0,
"url": "",
"width": 0
},
"maxres": {},
"medium": {},
"standard": {}
},
"title": ""
},
"statistics": {
"commentCount": "",
"dislikeCount": "",
"favoriteCount": "",
"likeCount": "",
"viewCount": ""
},
"status": {
"embeddable": false,
"failureReason": "",
"license": "",
"madeForKids": false,
"privacyStatus": "",
"publicStatsViewable": false,
"publishAt": "",
"rejectionReason": "",
"selfDeclaredMadeForKids": false,
"uploadStatus": ""
},
"suggestions": {
"editorSuggestions": [],
"processingErrors": [],
"processingHints": [],
"processingWarnings": [],
"tagSuggestions": [
{
"categoryRestricts": [],
"tag": ""
}
]
},
"topicDetails": {
"relevantTopicIds": [],
"topicCategories": [],
"topicIds": []
}
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/youtube/v3/videos?part=' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"ageGating": {
"alcoholContent": false,
"restricted": false,
"videoGameRating": ""
},
"contentDetails": {
"caption": "",
"contentRating": {
"acbRating": "",
"agcomRating": "",
"anatelRating": "",
"bbfcRating": "",
"bfvcRating": "",
"bmukkRating": "",
"catvRating": "",
"catvfrRating": "",
"cbfcRating": "",
"cccRating": "",
"cceRating": "",
"chfilmRating": "",
"chvrsRating": "",
"cicfRating": "",
"cnaRating": "",
"cncRating": "",
"csaRating": "",
"cscfRating": "",
"czfilmRating": "",
"djctqRating": "",
"djctqRatingReasons": [],
"ecbmctRating": "",
"eefilmRating": "",
"egfilmRating": "",
"eirinRating": "",
"fcbmRating": "",
"fcoRating": "",
"fmocRating": "",
"fpbRating": "",
"fpbRatingReasons": [],
"fskRating": "",
"grfilmRating": "",
"icaaRating": "",
"ifcoRating": "",
"ilfilmRating": "",
"incaaRating": "",
"kfcbRating": "",
"kijkwijzerRating": "",
"kmrbRating": "",
"lsfRating": "",
"mccaaRating": "",
"mccypRating": "",
"mcstRating": "",
"mdaRating": "",
"medietilsynetRating": "",
"mekuRating": "",
"menaMpaaRating": "",
"mibacRating": "",
"mocRating": "",
"moctwRating": "",
"mpaaRating": "",
"mpaatRating": "",
"mtrcbRating": "",
"nbcRating": "",
"nbcplRating": "",
"nfrcRating": "",
"nfvcbRating": "",
"nkclvRating": "",
"nmcRating": "",
"oflcRating": "",
"pefilmRating": "",
"rcnofRating": "",
"resorteviolenciaRating": "",
"rtcRating": "",
"rteRating": "",
"russiaRating": "",
"skfilmRating": "",
"smaisRating": "",
"smsaRating": "",
"tvpgRating": "",
"ytRating": ""
},
"countryRestriction": {
"allowed": false,
"exception": []
},
"definition": "",
"dimension": "",
"duration": "",
"hasCustomThumbnail": false,
"licensedContent": false,
"projection": "",
"regionRestriction": {
"allowed": [],
"blocked": []
}
},
"etag": "",
"fileDetails": {
"audioStreams": [
{
"bitrateBps": "",
"channelCount": 0,
"codec": "",
"vendor": ""
}
],
"bitrateBps": "",
"container": "",
"creationTime": "",
"durationMs": "",
"fileName": "",
"fileSize": "",
"fileType": "",
"videoStreams": [
{
"aspectRatio": "",
"bitrateBps": "",
"codec": "",
"frameRateFps": "",
"heightPixels": 0,
"rotation": "",
"vendor": "",
"widthPixels": 0
}
]
},
"id": "",
"kind": "",
"liveStreamingDetails": {
"activeLiveChatId": "",
"actualEndTime": "",
"actualStartTime": "",
"concurrentViewers": "",
"scheduledEndTime": "",
"scheduledStartTime": ""
},
"localizations": {},
"monetizationDetails": {
"access": {}
},
"player": {
"embedHeight": "",
"embedHtml": "",
"embedWidth": ""
},
"processingDetails": {
"editorSuggestionsAvailability": "",
"fileDetailsAvailability": "",
"processingFailureReason": "",
"processingIssuesAvailability": "",
"processingProgress": {
"partsProcessed": "",
"partsTotal": "",
"timeLeftMs": ""
},
"processingStatus": "",
"tagSuggestionsAvailability": "",
"thumbnailsAvailability": ""
},
"projectDetails": {},
"recordingDetails": {
"location": {
"altitude": "",
"latitude": "",
"longitude": ""
},
"locationDescription": "",
"recordingDate": ""
},
"snippet": {
"categoryId": "",
"channelId": "",
"channelTitle": "",
"defaultAudioLanguage": "",
"defaultLanguage": "",
"description": "",
"liveBroadcastContent": "",
"localized": {
"description": "",
"title": ""
},
"publishedAt": "",
"tags": [],
"thumbnails": {
"high": {
"height": 0,
"url": "",
"width": 0
},
"maxres": {},
"medium": {},
"standard": {}
},
"title": ""
},
"statistics": {
"commentCount": "",
"dislikeCount": "",
"favoriteCount": "",
"likeCount": "",
"viewCount": ""
},
"status": {
"embeddable": false,
"failureReason": "",
"license": "",
"madeForKids": false,
"privacyStatus": "",
"publicStatsViewable": false,
"publishAt": "",
"rejectionReason": "",
"selfDeclaredMadeForKids": false,
"uploadStatus": ""
},
"suggestions": {
"editorSuggestions": [],
"processingErrors": [],
"processingHints": [],
"processingWarnings": [],
"tagSuggestions": [
{
"categoryRestricts": [],
"tag": ""
}
]
},
"topicDetails": {
"relevantTopicIds": [],
"topicCategories": [],
"topicIds": []
}
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"ageGating\": {\n \"alcoholContent\": false,\n \"restricted\": false,\n \"videoGameRating\": \"\"\n },\n \"contentDetails\": {\n \"caption\": \"\",\n \"contentRating\": {\n \"acbRating\": \"\",\n \"agcomRating\": \"\",\n \"anatelRating\": \"\",\n \"bbfcRating\": \"\",\n \"bfvcRating\": \"\",\n \"bmukkRating\": \"\",\n \"catvRating\": \"\",\n \"catvfrRating\": \"\",\n \"cbfcRating\": \"\",\n \"cccRating\": \"\",\n \"cceRating\": \"\",\n \"chfilmRating\": \"\",\n \"chvrsRating\": \"\",\n \"cicfRating\": \"\",\n \"cnaRating\": \"\",\n \"cncRating\": \"\",\n \"csaRating\": \"\",\n \"cscfRating\": \"\",\n \"czfilmRating\": \"\",\n \"djctqRating\": \"\",\n \"djctqRatingReasons\": [],\n \"ecbmctRating\": \"\",\n \"eefilmRating\": \"\",\n \"egfilmRating\": \"\",\n \"eirinRating\": \"\",\n \"fcbmRating\": \"\",\n \"fcoRating\": \"\",\n \"fmocRating\": \"\",\n \"fpbRating\": \"\",\n \"fpbRatingReasons\": [],\n \"fskRating\": \"\",\n \"grfilmRating\": \"\",\n \"icaaRating\": \"\",\n \"ifcoRating\": \"\",\n \"ilfilmRating\": \"\",\n \"incaaRating\": \"\",\n \"kfcbRating\": \"\",\n \"kijkwijzerRating\": \"\",\n \"kmrbRating\": \"\",\n \"lsfRating\": \"\",\n \"mccaaRating\": \"\",\n \"mccypRating\": \"\",\n \"mcstRating\": \"\",\n \"mdaRating\": \"\",\n \"medietilsynetRating\": \"\",\n \"mekuRating\": \"\",\n \"menaMpaaRating\": \"\",\n \"mibacRating\": \"\",\n \"mocRating\": \"\",\n \"moctwRating\": \"\",\n \"mpaaRating\": \"\",\n \"mpaatRating\": \"\",\n \"mtrcbRating\": \"\",\n \"nbcRating\": \"\",\n \"nbcplRating\": \"\",\n \"nfrcRating\": \"\",\n \"nfvcbRating\": \"\",\n \"nkclvRating\": \"\",\n \"nmcRating\": \"\",\n \"oflcRating\": \"\",\n \"pefilmRating\": \"\",\n \"rcnofRating\": \"\",\n \"resorteviolenciaRating\": \"\",\n \"rtcRating\": \"\",\n \"rteRating\": \"\",\n \"russiaRating\": \"\",\n \"skfilmRating\": \"\",\n \"smaisRating\": \"\",\n \"smsaRating\": \"\",\n \"tvpgRating\": \"\",\n \"ytRating\": \"\"\n },\n \"countryRestriction\": {\n \"allowed\": false,\n \"exception\": []\n },\n \"definition\": \"\",\n \"dimension\": \"\",\n \"duration\": \"\",\n \"hasCustomThumbnail\": false,\n \"licensedContent\": false,\n \"projection\": \"\",\n \"regionRestriction\": {\n \"allowed\": [],\n \"blocked\": []\n }\n },\n \"etag\": \"\",\n \"fileDetails\": {\n \"audioStreams\": [\n {\n \"bitrateBps\": \"\",\n \"channelCount\": 0,\n \"codec\": \"\",\n \"vendor\": \"\"\n }\n ],\n \"bitrateBps\": \"\",\n \"container\": \"\",\n \"creationTime\": \"\",\n \"durationMs\": \"\",\n \"fileName\": \"\",\n \"fileSize\": \"\",\n \"fileType\": \"\",\n \"videoStreams\": [\n {\n \"aspectRatio\": \"\",\n \"bitrateBps\": \"\",\n \"codec\": \"\",\n \"frameRateFps\": \"\",\n \"heightPixels\": 0,\n \"rotation\": \"\",\n \"vendor\": \"\",\n \"widthPixels\": 0\n }\n ]\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"liveStreamingDetails\": {\n \"activeLiveChatId\": \"\",\n \"actualEndTime\": \"\",\n \"actualStartTime\": \"\",\n \"concurrentViewers\": \"\",\n \"scheduledEndTime\": \"\",\n \"scheduledStartTime\": \"\"\n },\n \"localizations\": {},\n \"monetizationDetails\": {\n \"access\": {}\n },\n \"player\": {\n \"embedHeight\": \"\",\n \"embedHtml\": \"\",\n \"embedWidth\": \"\"\n },\n \"processingDetails\": {\n \"editorSuggestionsAvailability\": \"\",\n \"fileDetailsAvailability\": \"\",\n \"processingFailureReason\": \"\",\n \"processingIssuesAvailability\": \"\",\n \"processingProgress\": {\n \"partsProcessed\": \"\",\n \"partsTotal\": \"\",\n \"timeLeftMs\": \"\"\n },\n \"processingStatus\": \"\",\n \"tagSuggestionsAvailability\": \"\",\n \"thumbnailsAvailability\": \"\"\n },\n \"projectDetails\": {},\n \"recordingDetails\": {\n \"location\": {\n \"altitude\": \"\",\n \"latitude\": \"\",\n \"longitude\": \"\"\n },\n \"locationDescription\": \"\",\n \"recordingDate\": \"\"\n },\n \"snippet\": {\n \"categoryId\": \"\",\n \"channelId\": \"\",\n \"channelTitle\": \"\",\n \"defaultAudioLanguage\": \"\",\n \"defaultLanguage\": \"\",\n \"description\": \"\",\n \"liveBroadcastContent\": \"\",\n \"localized\": {\n \"description\": \"\",\n \"title\": \"\"\n },\n \"publishedAt\": \"\",\n \"tags\": [],\n \"thumbnails\": {\n \"high\": {\n \"height\": 0,\n \"url\": \"\",\n \"width\": 0\n },\n \"maxres\": {},\n \"medium\": {},\n \"standard\": {}\n },\n \"title\": \"\"\n },\n \"statistics\": {\n \"commentCount\": \"\",\n \"dislikeCount\": \"\",\n \"favoriteCount\": \"\",\n \"likeCount\": \"\",\n \"viewCount\": \"\"\n },\n \"status\": {\n \"embeddable\": false,\n \"failureReason\": \"\",\n \"license\": \"\",\n \"madeForKids\": false,\n \"privacyStatus\": \"\",\n \"publicStatsViewable\": false,\n \"publishAt\": \"\",\n \"rejectionReason\": \"\",\n \"selfDeclaredMadeForKids\": false,\n \"uploadStatus\": \"\"\n },\n \"suggestions\": {\n \"editorSuggestions\": [],\n \"processingErrors\": [],\n \"processingHints\": [],\n \"processingWarnings\": [],\n \"tagSuggestions\": [\n {\n \"categoryRestricts\": [],\n \"tag\": \"\"\n }\n ]\n },\n \"topicDetails\": {\n \"relevantTopicIds\": [],\n \"topicCategories\": [],\n \"topicIds\": []\n }\n}"
headers = { 'content-type': "application/json" }
conn.request("PUT", "/baseUrl/youtube/v3/videos?part=", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/youtube/v3/videos"
querystring = {"part":""}
payload = {
"ageGating": {
"alcoholContent": False,
"restricted": False,
"videoGameRating": ""
},
"contentDetails": {
"caption": "",
"contentRating": {
"acbRating": "",
"agcomRating": "",
"anatelRating": "",
"bbfcRating": "",
"bfvcRating": "",
"bmukkRating": "",
"catvRating": "",
"catvfrRating": "",
"cbfcRating": "",
"cccRating": "",
"cceRating": "",
"chfilmRating": "",
"chvrsRating": "",
"cicfRating": "",
"cnaRating": "",
"cncRating": "",
"csaRating": "",
"cscfRating": "",
"czfilmRating": "",
"djctqRating": "",
"djctqRatingReasons": [],
"ecbmctRating": "",
"eefilmRating": "",
"egfilmRating": "",
"eirinRating": "",
"fcbmRating": "",
"fcoRating": "",
"fmocRating": "",
"fpbRating": "",
"fpbRatingReasons": [],
"fskRating": "",
"grfilmRating": "",
"icaaRating": "",
"ifcoRating": "",
"ilfilmRating": "",
"incaaRating": "",
"kfcbRating": "",
"kijkwijzerRating": "",
"kmrbRating": "",
"lsfRating": "",
"mccaaRating": "",
"mccypRating": "",
"mcstRating": "",
"mdaRating": "",
"medietilsynetRating": "",
"mekuRating": "",
"menaMpaaRating": "",
"mibacRating": "",
"mocRating": "",
"moctwRating": "",
"mpaaRating": "",
"mpaatRating": "",
"mtrcbRating": "",
"nbcRating": "",
"nbcplRating": "",
"nfrcRating": "",
"nfvcbRating": "",
"nkclvRating": "",
"nmcRating": "",
"oflcRating": "",
"pefilmRating": "",
"rcnofRating": "",
"resorteviolenciaRating": "",
"rtcRating": "",
"rteRating": "",
"russiaRating": "",
"skfilmRating": "",
"smaisRating": "",
"smsaRating": "",
"tvpgRating": "",
"ytRating": ""
},
"countryRestriction": {
"allowed": False,
"exception": []
},
"definition": "",
"dimension": "",
"duration": "",
"hasCustomThumbnail": False,
"licensedContent": False,
"projection": "",
"regionRestriction": {
"allowed": [],
"blocked": []
}
},
"etag": "",
"fileDetails": {
"audioStreams": [
{
"bitrateBps": "",
"channelCount": 0,
"codec": "",
"vendor": ""
}
],
"bitrateBps": "",
"container": "",
"creationTime": "",
"durationMs": "",
"fileName": "",
"fileSize": "",
"fileType": "",
"videoStreams": [
{
"aspectRatio": "",
"bitrateBps": "",
"codec": "",
"frameRateFps": "",
"heightPixels": 0,
"rotation": "",
"vendor": "",
"widthPixels": 0
}
]
},
"id": "",
"kind": "",
"liveStreamingDetails": {
"activeLiveChatId": "",
"actualEndTime": "",
"actualStartTime": "",
"concurrentViewers": "",
"scheduledEndTime": "",
"scheduledStartTime": ""
},
"localizations": {},
"monetizationDetails": { "access": {} },
"player": {
"embedHeight": "",
"embedHtml": "",
"embedWidth": ""
},
"processingDetails": {
"editorSuggestionsAvailability": "",
"fileDetailsAvailability": "",
"processingFailureReason": "",
"processingIssuesAvailability": "",
"processingProgress": {
"partsProcessed": "",
"partsTotal": "",
"timeLeftMs": ""
},
"processingStatus": "",
"tagSuggestionsAvailability": "",
"thumbnailsAvailability": ""
},
"projectDetails": {},
"recordingDetails": {
"location": {
"altitude": "",
"latitude": "",
"longitude": ""
},
"locationDescription": "",
"recordingDate": ""
},
"snippet": {
"categoryId": "",
"channelId": "",
"channelTitle": "",
"defaultAudioLanguage": "",
"defaultLanguage": "",
"description": "",
"liveBroadcastContent": "",
"localized": {
"description": "",
"title": ""
},
"publishedAt": "",
"tags": [],
"thumbnails": {
"high": {
"height": 0,
"url": "",
"width": 0
},
"maxres": {},
"medium": {},
"standard": {}
},
"title": ""
},
"statistics": {
"commentCount": "",
"dislikeCount": "",
"favoriteCount": "",
"likeCount": "",
"viewCount": ""
},
"status": {
"embeddable": False,
"failureReason": "",
"license": "",
"madeForKids": False,
"privacyStatus": "",
"publicStatsViewable": False,
"publishAt": "",
"rejectionReason": "",
"selfDeclaredMadeForKids": False,
"uploadStatus": ""
},
"suggestions": {
"editorSuggestions": [],
"processingErrors": [],
"processingHints": [],
"processingWarnings": [],
"tagSuggestions": [
{
"categoryRestricts": [],
"tag": ""
}
]
},
"topicDetails": {
"relevantTopicIds": [],
"topicCategories": [],
"topicIds": []
}
}
headers = {"content-type": "application/json"}
response = requests.put(url, json=payload, headers=headers, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/youtube/v3/videos"
queryString <- list(part = "")
payload <- "{\n \"ageGating\": {\n \"alcoholContent\": false,\n \"restricted\": false,\n \"videoGameRating\": \"\"\n },\n \"contentDetails\": {\n \"caption\": \"\",\n \"contentRating\": {\n \"acbRating\": \"\",\n \"agcomRating\": \"\",\n \"anatelRating\": \"\",\n \"bbfcRating\": \"\",\n \"bfvcRating\": \"\",\n \"bmukkRating\": \"\",\n \"catvRating\": \"\",\n \"catvfrRating\": \"\",\n \"cbfcRating\": \"\",\n \"cccRating\": \"\",\n \"cceRating\": \"\",\n \"chfilmRating\": \"\",\n \"chvrsRating\": \"\",\n \"cicfRating\": \"\",\n \"cnaRating\": \"\",\n \"cncRating\": \"\",\n \"csaRating\": \"\",\n \"cscfRating\": \"\",\n \"czfilmRating\": \"\",\n \"djctqRating\": \"\",\n \"djctqRatingReasons\": [],\n \"ecbmctRating\": \"\",\n \"eefilmRating\": \"\",\n \"egfilmRating\": \"\",\n \"eirinRating\": \"\",\n \"fcbmRating\": \"\",\n \"fcoRating\": \"\",\n \"fmocRating\": \"\",\n \"fpbRating\": \"\",\n \"fpbRatingReasons\": [],\n \"fskRating\": \"\",\n \"grfilmRating\": \"\",\n \"icaaRating\": \"\",\n \"ifcoRating\": \"\",\n \"ilfilmRating\": \"\",\n \"incaaRating\": \"\",\n \"kfcbRating\": \"\",\n \"kijkwijzerRating\": \"\",\n \"kmrbRating\": \"\",\n \"lsfRating\": \"\",\n \"mccaaRating\": \"\",\n \"mccypRating\": \"\",\n \"mcstRating\": \"\",\n \"mdaRating\": \"\",\n \"medietilsynetRating\": \"\",\n \"mekuRating\": \"\",\n \"menaMpaaRating\": \"\",\n \"mibacRating\": \"\",\n \"mocRating\": \"\",\n \"moctwRating\": \"\",\n \"mpaaRating\": \"\",\n \"mpaatRating\": \"\",\n \"mtrcbRating\": \"\",\n \"nbcRating\": \"\",\n \"nbcplRating\": \"\",\n \"nfrcRating\": \"\",\n \"nfvcbRating\": \"\",\n \"nkclvRating\": \"\",\n \"nmcRating\": \"\",\n \"oflcRating\": \"\",\n \"pefilmRating\": \"\",\n \"rcnofRating\": \"\",\n \"resorteviolenciaRating\": \"\",\n \"rtcRating\": \"\",\n \"rteRating\": \"\",\n \"russiaRating\": \"\",\n \"skfilmRating\": \"\",\n \"smaisRating\": \"\",\n \"smsaRating\": \"\",\n \"tvpgRating\": \"\",\n \"ytRating\": \"\"\n },\n \"countryRestriction\": {\n \"allowed\": false,\n \"exception\": []\n },\n \"definition\": \"\",\n \"dimension\": \"\",\n \"duration\": \"\",\n \"hasCustomThumbnail\": false,\n \"licensedContent\": false,\n \"projection\": \"\",\n \"regionRestriction\": {\n \"allowed\": [],\n \"blocked\": []\n }\n },\n \"etag\": \"\",\n \"fileDetails\": {\n \"audioStreams\": [\n {\n \"bitrateBps\": \"\",\n \"channelCount\": 0,\n \"codec\": \"\",\n \"vendor\": \"\"\n }\n ],\n \"bitrateBps\": \"\",\n \"container\": \"\",\n \"creationTime\": \"\",\n \"durationMs\": \"\",\n \"fileName\": \"\",\n \"fileSize\": \"\",\n \"fileType\": \"\",\n \"videoStreams\": [\n {\n \"aspectRatio\": \"\",\n \"bitrateBps\": \"\",\n \"codec\": \"\",\n \"frameRateFps\": \"\",\n \"heightPixels\": 0,\n \"rotation\": \"\",\n \"vendor\": \"\",\n \"widthPixels\": 0\n }\n ]\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"liveStreamingDetails\": {\n \"activeLiveChatId\": \"\",\n \"actualEndTime\": \"\",\n \"actualStartTime\": \"\",\n \"concurrentViewers\": \"\",\n \"scheduledEndTime\": \"\",\n \"scheduledStartTime\": \"\"\n },\n \"localizations\": {},\n \"monetizationDetails\": {\n \"access\": {}\n },\n \"player\": {\n \"embedHeight\": \"\",\n \"embedHtml\": \"\",\n \"embedWidth\": \"\"\n },\n \"processingDetails\": {\n \"editorSuggestionsAvailability\": \"\",\n \"fileDetailsAvailability\": \"\",\n \"processingFailureReason\": \"\",\n \"processingIssuesAvailability\": \"\",\n \"processingProgress\": {\n \"partsProcessed\": \"\",\n \"partsTotal\": \"\",\n \"timeLeftMs\": \"\"\n },\n \"processingStatus\": \"\",\n \"tagSuggestionsAvailability\": \"\",\n \"thumbnailsAvailability\": \"\"\n },\n \"projectDetails\": {},\n \"recordingDetails\": {\n \"location\": {\n \"altitude\": \"\",\n \"latitude\": \"\",\n \"longitude\": \"\"\n },\n \"locationDescription\": \"\",\n \"recordingDate\": \"\"\n },\n \"snippet\": {\n \"categoryId\": \"\",\n \"channelId\": \"\",\n \"channelTitle\": \"\",\n \"defaultAudioLanguage\": \"\",\n \"defaultLanguage\": \"\",\n \"description\": \"\",\n \"liveBroadcastContent\": \"\",\n \"localized\": {\n \"description\": \"\",\n \"title\": \"\"\n },\n \"publishedAt\": \"\",\n \"tags\": [],\n \"thumbnails\": {\n \"high\": {\n \"height\": 0,\n \"url\": \"\",\n \"width\": 0\n },\n \"maxres\": {},\n \"medium\": {},\n \"standard\": {}\n },\n \"title\": \"\"\n },\n \"statistics\": {\n \"commentCount\": \"\",\n \"dislikeCount\": \"\",\n \"favoriteCount\": \"\",\n \"likeCount\": \"\",\n \"viewCount\": \"\"\n },\n \"status\": {\n \"embeddable\": false,\n \"failureReason\": \"\",\n \"license\": \"\",\n \"madeForKids\": false,\n \"privacyStatus\": \"\",\n \"publicStatsViewable\": false,\n \"publishAt\": \"\",\n \"rejectionReason\": \"\",\n \"selfDeclaredMadeForKids\": false,\n \"uploadStatus\": \"\"\n },\n \"suggestions\": {\n \"editorSuggestions\": [],\n \"processingErrors\": [],\n \"processingHints\": [],\n \"processingWarnings\": [],\n \"tagSuggestions\": [\n {\n \"categoryRestricts\": [],\n \"tag\": \"\"\n }\n ]\n },\n \"topicDetails\": {\n \"relevantTopicIds\": [],\n \"topicCategories\": [],\n \"topicIds\": []\n }\n}"
encode <- "json"
response <- VERB("PUT", url, body = payload, query = queryString, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/youtube/v3/videos?part=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"ageGating\": {\n \"alcoholContent\": false,\n \"restricted\": false,\n \"videoGameRating\": \"\"\n },\n \"contentDetails\": {\n \"caption\": \"\",\n \"contentRating\": {\n \"acbRating\": \"\",\n \"agcomRating\": \"\",\n \"anatelRating\": \"\",\n \"bbfcRating\": \"\",\n \"bfvcRating\": \"\",\n \"bmukkRating\": \"\",\n \"catvRating\": \"\",\n \"catvfrRating\": \"\",\n \"cbfcRating\": \"\",\n \"cccRating\": \"\",\n \"cceRating\": \"\",\n \"chfilmRating\": \"\",\n \"chvrsRating\": \"\",\n \"cicfRating\": \"\",\n \"cnaRating\": \"\",\n \"cncRating\": \"\",\n \"csaRating\": \"\",\n \"cscfRating\": \"\",\n \"czfilmRating\": \"\",\n \"djctqRating\": \"\",\n \"djctqRatingReasons\": [],\n \"ecbmctRating\": \"\",\n \"eefilmRating\": \"\",\n \"egfilmRating\": \"\",\n \"eirinRating\": \"\",\n \"fcbmRating\": \"\",\n \"fcoRating\": \"\",\n \"fmocRating\": \"\",\n \"fpbRating\": \"\",\n \"fpbRatingReasons\": [],\n \"fskRating\": \"\",\n \"grfilmRating\": \"\",\n \"icaaRating\": \"\",\n \"ifcoRating\": \"\",\n \"ilfilmRating\": \"\",\n \"incaaRating\": \"\",\n \"kfcbRating\": \"\",\n \"kijkwijzerRating\": \"\",\n \"kmrbRating\": \"\",\n \"lsfRating\": \"\",\n \"mccaaRating\": \"\",\n \"mccypRating\": \"\",\n \"mcstRating\": \"\",\n \"mdaRating\": \"\",\n \"medietilsynetRating\": \"\",\n \"mekuRating\": \"\",\n \"menaMpaaRating\": \"\",\n \"mibacRating\": \"\",\n \"mocRating\": \"\",\n \"moctwRating\": \"\",\n \"mpaaRating\": \"\",\n \"mpaatRating\": \"\",\n \"mtrcbRating\": \"\",\n \"nbcRating\": \"\",\n \"nbcplRating\": \"\",\n \"nfrcRating\": \"\",\n \"nfvcbRating\": \"\",\n \"nkclvRating\": \"\",\n \"nmcRating\": \"\",\n \"oflcRating\": \"\",\n \"pefilmRating\": \"\",\n \"rcnofRating\": \"\",\n \"resorteviolenciaRating\": \"\",\n \"rtcRating\": \"\",\n \"rteRating\": \"\",\n \"russiaRating\": \"\",\n \"skfilmRating\": \"\",\n \"smaisRating\": \"\",\n \"smsaRating\": \"\",\n \"tvpgRating\": \"\",\n \"ytRating\": \"\"\n },\n \"countryRestriction\": {\n \"allowed\": false,\n \"exception\": []\n },\n \"definition\": \"\",\n \"dimension\": \"\",\n \"duration\": \"\",\n \"hasCustomThumbnail\": false,\n \"licensedContent\": false,\n \"projection\": \"\",\n \"regionRestriction\": {\n \"allowed\": [],\n \"blocked\": []\n }\n },\n \"etag\": \"\",\n \"fileDetails\": {\n \"audioStreams\": [\n {\n \"bitrateBps\": \"\",\n \"channelCount\": 0,\n \"codec\": \"\",\n \"vendor\": \"\"\n }\n ],\n \"bitrateBps\": \"\",\n \"container\": \"\",\n \"creationTime\": \"\",\n \"durationMs\": \"\",\n \"fileName\": \"\",\n \"fileSize\": \"\",\n \"fileType\": \"\",\n \"videoStreams\": [\n {\n \"aspectRatio\": \"\",\n \"bitrateBps\": \"\",\n \"codec\": \"\",\n \"frameRateFps\": \"\",\n \"heightPixels\": 0,\n \"rotation\": \"\",\n \"vendor\": \"\",\n \"widthPixels\": 0\n }\n ]\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"liveStreamingDetails\": {\n \"activeLiveChatId\": \"\",\n \"actualEndTime\": \"\",\n \"actualStartTime\": \"\",\n \"concurrentViewers\": \"\",\n \"scheduledEndTime\": \"\",\n \"scheduledStartTime\": \"\"\n },\n \"localizations\": {},\n \"monetizationDetails\": {\n \"access\": {}\n },\n \"player\": {\n \"embedHeight\": \"\",\n \"embedHtml\": \"\",\n \"embedWidth\": \"\"\n },\n \"processingDetails\": {\n \"editorSuggestionsAvailability\": \"\",\n \"fileDetailsAvailability\": \"\",\n \"processingFailureReason\": \"\",\n \"processingIssuesAvailability\": \"\",\n \"processingProgress\": {\n \"partsProcessed\": \"\",\n \"partsTotal\": \"\",\n \"timeLeftMs\": \"\"\n },\n \"processingStatus\": \"\",\n \"tagSuggestionsAvailability\": \"\",\n \"thumbnailsAvailability\": \"\"\n },\n \"projectDetails\": {},\n \"recordingDetails\": {\n \"location\": {\n \"altitude\": \"\",\n \"latitude\": \"\",\n \"longitude\": \"\"\n },\n \"locationDescription\": \"\",\n \"recordingDate\": \"\"\n },\n \"snippet\": {\n \"categoryId\": \"\",\n \"channelId\": \"\",\n \"channelTitle\": \"\",\n \"defaultAudioLanguage\": \"\",\n \"defaultLanguage\": \"\",\n \"description\": \"\",\n \"liveBroadcastContent\": \"\",\n \"localized\": {\n \"description\": \"\",\n \"title\": \"\"\n },\n \"publishedAt\": \"\",\n \"tags\": [],\n \"thumbnails\": {\n \"high\": {\n \"height\": 0,\n \"url\": \"\",\n \"width\": 0\n },\n \"maxres\": {},\n \"medium\": {},\n \"standard\": {}\n },\n \"title\": \"\"\n },\n \"statistics\": {\n \"commentCount\": \"\",\n \"dislikeCount\": \"\",\n \"favoriteCount\": \"\",\n \"likeCount\": \"\",\n \"viewCount\": \"\"\n },\n \"status\": {\n \"embeddable\": false,\n \"failureReason\": \"\",\n \"license\": \"\",\n \"madeForKids\": false,\n \"privacyStatus\": \"\",\n \"publicStatsViewable\": false,\n \"publishAt\": \"\",\n \"rejectionReason\": \"\",\n \"selfDeclaredMadeForKids\": false,\n \"uploadStatus\": \"\"\n },\n \"suggestions\": {\n \"editorSuggestions\": [],\n \"processingErrors\": [],\n \"processingHints\": [],\n \"processingWarnings\": [],\n \"tagSuggestions\": [\n {\n \"categoryRestricts\": [],\n \"tag\": \"\"\n }\n ]\n },\n \"topicDetails\": {\n \"relevantTopicIds\": [],\n \"topicCategories\": [],\n \"topicIds\": []\n }\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.put('/baseUrl/youtube/v3/videos') do |req|
req.params['part'] = ''
req.body = "{\n \"ageGating\": {\n \"alcoholContent\": false,\n \"restricted\": false,\n \"videoGameRating\": \"\"\n },\n \"contentDetails\": {\n \"caption\": \"\",\n \"contentRating\": {\n \"acbRating\": \"\",\n \"agcomRating\": \"\",\n \"anatelRating\": \"\",\n \"bbfcRating\": \"\",\n \"bfvcRating\": \"\",\n \"bmukkRating\": \"\",\n \"catvRating\": \"\",\n \"catvfrRating\": \"\",\n \"cbfcRating\": \"\",\n \"cccRating\": \"\",\n \"cceRating\": \"\",\n \"chfilmRating\": \"\",\n \"chvrsRating\": \"\",\n \"cicfRating\": \"\",\n \"cnaRating\": \"\",\n \"cncRating\": \"\",\n \"csaRating\": \"\",\n \"cscfRating\": \"\",\n \"czfilmRating\": \"\",\n \"djctqRating\": \"\",\n \"djctqRatingReasons\": [],\n \"ecbmctRating\": \"\",\n \"eefilmRating\": \"\",\n \"egfilmRating\": \"\",\n \"eirinRating\": \"\",\n \"fcbmRating\": \"\",\n \"fcoRating\": \"\",\n \"fmocRating\": \"\",\n \"fpbRating\": \"\",\n \"fpbRatingReasons\": [],\n \"fskRating\": \"\",\n \"grfilmRating\": \"\",\n \"icaaRating\": \"\",\n \"ifcoRating\": \"\",\n \"ilfilmRating\": \"\",\n \"incaaRating\": \"\",\n \"kfcbRating\": \"\",\n \"kijkwijzerRating\": \"\",\n \"kmrbRating\": \"\",\n \"lsfRating\": \"\",\n \"mccaaRating\": \"\",\n \"mccypRating\": \"\",\n \"mcstRating\": \"\",\n \"mdaRating\": \"\",\n \"medietilsynetRating\": \"\",\n \"mekuRating\": \"\",\n \"menaMpaaRating\": \"\",\n \"mibacRating\": \"\",\n \"mocRating\": \"\",\n \"moctwRating\": \"\",\n \"mpaaRating\": \"\",\n \"mpaatRating\": \"\",\n \"mtrcbRating\": \"\",\n \"nbcRating\": \"\",\n \"nbcplRating\": \"\",\n \"nfrcRating\": \"\",\n \"nfvcbRating\": \"\",\n \"nkclvRating\": \"\",\n \"nmcRating\": \"\",\n \"oflcRating\": \"\",\n \"pefilmRating\": \"\",\n \"rcnofRating\": \"\",\n \"resorteviolenciaRating\": \"\",\n \"rtcRating\": \"\",\n \"rteRating\": \"\",\n \"russiaRating\": \"\",\n \"skfilmRating\": \"\",\n \"smaisRating\": \"\",\n \"smsaRating\": \"\",\n \"tvpgRating\": \"\",\n \"ytRating\": \"\"\n },\n \"countryRestriction\": {\n \"allowed\": false,\n \"exception\": []\n },\n \"definition\": \"\",\n \"dimension\": \"\",\n \"duration\": \"\",\n \"hasCustomThumbnail\": false,\n \"licensedContent\": false,\n \"projection\": \"\",\n \"regionRestriction\": {\n \"allowed\": [],\n \"blocked\": []\n }\n },\n \"etag\": \"\",\n \"fileDetails\": {\n \"audioStreams\": [\n {\n \"bitrateBps\": \"\",\n \"channelCount\": 0,\n \"codec\": \"\",\n \"vendor\": \"\"\n }\n ],\n \"bitrateBps\": \"\",\n \"container\": \"\",\n \"creationTime\": \"\",\n \"durationMs\": \"\",\n \"fileName\": \"\",\n \"fileSize\": \"\",\n \"fileType\": \"\",\n \"videoStreams\": [\n {\n \"aspectRatio\": \"\",\n \"bitrateBps\": \"\",\n \"codec\": \"\",\n \"frameRateFps\": \"\",\n \"heightPixels\": 0,\n \"rotation\": \"\",\n \"vendor\": \"\",\n \"widthPixels\": 0\n }\n ]\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"liveStreamingDetails\": {\n \"activeLiveChatId\": \"\",\n \"actualEndTime\": \"\",\n \"actualStartTime\": \"\",\n \"concurrentViewers\": \"\",\n \"scheduledEndTime\": \"\",\n \"scheduledStartTime\": \"\"\n },\n \"localizations\": {},\n \"monetizationDetails\": {\n \"access\": {}\n },\n \"player\": {\n \"embedHeight\": \"\",\n \"embedHtml\": \"\",\n \"embedWidth\": \"\"\n },\n \"processingDetails\": {\n \"editorSuggestionsAvailability\": \"\",\n \"fileDetailsAvailability\": \"\",\n \"processingFailureReason\": \"\",\n \"processingIssuesAvailability\": \"\",\n \"processingProgress\": {\n \"partsProcessed\": \"\",\n \"partsTotal\": \"\",\n \"timeLeftMs\": \"\"\n },\n \"processingStatus\": \"\",\n \"tagSuggestionsAvailability\": \"\",\n \"thumbnailsAvailability\": \"\"\n },\n \"projectDetails\": {},\n \"recordingDetails\": {\n \"location\": {\n \"altitude\": \"\",\n \"latitude\": \"\",\n \"longitude\": \"\"\n },\n \"locationDescription\": \"\",\n \"recordingDate\": \"\"\n },\n \"snippet\": {\n \"categoryId\": \"\",\n \"channelId\": \"\",\n \"channelTitle\": \"\",\n \"defaultAudioLanguage\": \"\",\n \"defaultLanguage\": \"\",\n \"description\": \"\",\n \"liveBroadcastContent\": \"\",\n \"localized\": {\n \"description\": \"\",\n \"title\": \"\"\n },\n \"publishedAt\": \"\",\n \"tags\": [],\n \"thumbnails\": {\n \"high\": {\n \"height\": 0,\n \"url\": \"\",\n \"width\": 0\n },\n \"maxres\": {},\n \"medium\": {},\n \"standard\": {}\n },\n \"title\": \"\"\n },\n \"statistics\": {\n \"commentCount\": \"\",\n \"dislikeCount\": \"\",\n \"favoriteCount\": \"\",\n \"likeCount\": \"\",\n \"viewCount\": \"\"\n },\n \"status\": {\n \"embeddable\": false,\n \"failureReason\": \"\",\n \"license\": \"\",\n \"madeForKids\": false,\n \"privacyStatus\": \"\",\n \"publicStatsViewable\": false,\n \"publishAt\": \"\",\n \"rejectionReason\": \"\",\n \"selfDeclaredMadeForKids\": false,\n \"uploadStatus\": \"\"\n },\n \"suggestions\": {\n \"editorSuggestions\": [],\n \"processingErrors\": [],\n \"processingHints\": [],\n \"processingWarnings\": [],\n \"tagSuggestions\": [\n {\n \"categoryRestricts\": [],\n \"tag\": \"\"\n }\n ]\n },\n \"topicDetails\": {\n \"relevantTopicIds\": [],\n \"topicCategories\": [],\n \"topicIds\": []\n }\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}}/youtube/v3/videos";
let querystring = [
("part", ""),
];
let payload = json!({
"ageGating": json!({
"alcoholContent": false,
"restricted": false,
"videoGameRating": ""
}),
"contentDetails": json!({
"caption": "",
"contentRating": json!({
"acbRating": "",
"agcomRating": "",
"anatelRating": "",
"bbfcRating": "",
"bfvcRating": "",
"bmukkRating": "",
"catvRating": "",
"catvfrRating": "",
"cbfcRating": "",
"cccRating": "",
"cceRating": "",
"chfilmRating": "",
"chvrsRating": "",
"cicfRating": "",
"cnaRating": "",
"cncRating": "",
"csaRating": "",
"cscfRating": "",
"czfilmRating": "",
"djctqRating": "",
"djctqRatingReasons": (),
"ecbmctRating": "",
"eefilmRating": "",
"egfilmRating": "",
"eirinRating": "",
"fcbmRating": "",
"fcoRating": "",
"fmocRating": "",
"fpbRating": "",
"fpbRatingReasons": (),
"fskRating": "",
"grfilmRating": "",
"icaaRating": "",
"ifcoRating": "",
"ilfilmRating": "",
"incaaRating": "",
"kfcbRating": "",
"kijkwijzerRating": "",
"kmrbRating": "",
"lsfRating": "",
"mccaaRating": "",
"mccypRating": "",
"mcstRating": "",
"mdaRating": "",
"medietilsynetRating": "",
"mekuRating": "",
"menaMpaaRating": "",
"mibacRating": "",
"mocRating": "",
"moctwRating": "",
"mpaaRating": "",
"mpaatRating": "",
"mtrcbRating": "",
"nbcRating": "",
"nbcplRating": "",
"nfrcRating": "",
"nfvcbRating": "",
"nkclvRating": "",
"nmcRating": "",
"oflcRating": "",
"pefilmRating": "",
"rcnofRating": "",
"resorteviolenciaRating": "",
"rtcRating": "",
"rteRating": "",
"russiaRating": "",
"skfilmRating": "",
"smaisRating": "",
"smsaRating": "",
"tvpgRating": "",
"ytRating": ""
}),
"countryRestriction": json!({
"allowed": false,
"exception": ()
}),
"definition": "",
"dimension": "",
"duration": "",
"hasCustomThumbnail": false,
"licensedContent": false,
"projection": "",
"regionRestriction": json!({
"allowed": (),
"blocked": ()
})
}),
"etag": "",
"fileDetails": json!({
"audioStreams": (
json!({
"bitrateBps": "",
"channelCount": 0,
"codec": "",
"vendor": ""
})
),
"bitrateBps": "",
"container": "",
"creationTime": "",
"durationMs": "",
"fileName": "",
"fileSize": "",
"fileType": "",
"videoStreams": (
json!({
"aspectRatio": "",
"bitrateBps": "",
"codec": "",
"frameRateFps": "",
"heightPixels": 0,
"rotation": "",
"vendor": "",
"widthPixels": 0
})
)
}),
"id": "",
"kind": "",
"liveStreamingDetails": json!({
"activeLiveChatId": "",
"actualEndTime": "",
"actualStartTime": "",
"concurrentViewers": "",
"scheduledEndTime": "",
"scheduledStartTime": ""
}),
"localizations": json!({}),
"monetizationDetails": json!({"access": json!({})}),
"player": json!({
"embedHeight": "",
"embedHtml": "",
"embedWidth": ""
}),
"processingDetails": json!({
"editorSuggestionsAvailability": "",
"fileDetailsAvailability": "",
"processingFailureReason": "",
"processingIssuesAvailability": "",
"processingProgress": json!({
"partsProcessed": "",
"partsTotal": "",
"timeLeftMs": ""
}),
"processingStatus": "",
"tagSuggestionsAvailability": "",
"thumbnailsAvailability": ""
}),
"projectDetails": json!({}),
"recordingDetails": json!({
"location": json!({
"altitude": "",
"latitude": "",
"longitude": ""
}),
"locationDescription": "",
"recordingDate": ""
}),
"snippet": json!({
"categoryId": "",
"channelId": "",
"channelTitle": "",
"defaultAudioLanguage": "",
"defaultLanguage": "",
"description": "",
"liveBroadcastContent": "",
"localized": json!({
"description": "",
"title": ""
}),
"publishedAt": "",
"tags": (),
"thumbnails": json!({
"high": json!({
"height": 0,
"url": "",
"width": 0
}),
"maxres": json!({}),
"medium": json!({}),
"standard": json!({})
}),
"title": ""
}),
"statistics": json!({
"commentCount": "",
"dislikeCount": "",
"favoriteCount": "",
"likeCount": "",
"viewCount": ""
}),
"status": json!({
"embeddable": false,
"failureReason": "",
"license": "",
"madeForKids": false,
"privacyStatus": "",
"publicStatsViewable": false,
"publishAt": "",
"rejectionReason": "",
"selfDeclaredMadeForKids": false,
"uploadStatus": ""
}),
"suggestions": json!({
"editorSuggestions": (),
"processingErrors": (),
"processingHints": (),
"processingWarnings": (),
"tagSuggestions": (
json!({
"categoryRestricts": (),
"tag": ""
})
)
}),
"topicDetails": json!({
"relevantTopicIds": (),
"topicCategories": (),
"topicIds": ()
})
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PUT").unwrap(), url)
.query(&querystring)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PUT \
--url '{{baseUrl}}/youtube/v3/videos?part=' \
--header 'content-type: application/json' \
--data '{
"ageGating": {
"alcoholContent": false,
"restricted": false,
"videoGameRating": ""
},
"contentDetails": {
"caption": "",
"contentRating": {
"acbRating": "",
"agcomRating": "",
"anatelRating": "",
"bbfcRating": "",
"bfvcRating": "",
"bmukkRating": "",
"catvRating": "",
"catvfrRating": "",
"cbfcRating": "",
"cccRating": "",
"cceRating": "",
"chfilmRating": "",
"chvrsRating": "",
"cicfRating": "",
"cnaRating": "",
"cncRating": "",
"csaRating": "",
"cscfRating": "",
"czfilmRating": "",
"djctqRating": "",
"djctqRatingReasons": [],
"ecbmctRating": "",
"eefilmRating": "",
"egfilmRating": "",
"eirinRating": "",
"fcbmRating": "",
"fcoRating": "",
"fmocRating": "",
"fpbRating": "",
"fpbRatingReasons": [],
"fskRating": "",
"grfilmRating": "",
"icaaRating": "",
"ifcoRating": "",
"ilfilmRating": "",
"incaaRating": "",
"kfcbRating": "",
"kijkwijzerRating": "",
"kmrbRating": "",
"lsfRating": "",
"mccaaRating": "",
"mccypRating": "",
"mcstRating": "",
"mdaRating": "",
"medietilsynetRating": "",
"mekuRating": "",
"menaMpaaRating": "",
"mibacRating": "",
"mocRating": "",
"moctwRating": "",
"mpaaRating": "",
"mpaatRating": "",
"mtrcbRating": "",
"nbcRating": "",
"nbcplRating": "",
"nfrcRating": "",
"nfvcbRating": "",
"nkclvRating": "",
"nmcRating": "",
"oflcRating": "",
"pefilmRating": "",
"rcnofRating": "",
"resorteviolenciaRating": "",
"rtcRating": "",
"rteRating": "",
"russiaRating": "",
"skfilmRating": "",
"smaisRating": "",
"smsaRating": "",
"tvpgRating": "",
"ytRating": ""
},
"countryRestriction": {
"allowed": false,
"exception": []
},
"definition": "",
"dimension": "",
"duration": "",
"hasCustomThumbnail": false,
"licensedContent": false,
"projection": "",
"regionRestriction": {
"allowed": [],
"blocked": []
}
},
"etag": "",
"fileDetails": {
"audioStreams": [
{
"bitrateBps": "",
"channelCount": 0,
"codec": "",
"vendor": ""
}
],
"bitrateBps": "",
"container": "",
"creationTime": "",
"durationMs": "",
"fileName": "",
"fileSize": "",
"fileType": "",
"videoStreams": [
{
"aspectRatio": "",
"bitrateBps": "",
"codec": "",
"frameRateFps": "",
"heightPixels": 0,
"rotation": "",
"vendor": "",
"widthPixels": 0
}
]
},
"id": "",
"kind": "",
"liveStreamingDetails": {
"activeLiveChatId": "",
"actualEndTime": "",
"actualStartTime": "",
"concurrentViewers": "",
"scheduledEndTime": "",
"scheduledStartTime": ""
},
"localizations": {},
"monetizationDetails": {
"access": {}
},
"player": {
"embedHeight": "",
"embedHtml": "",
"embedWidth": ""
},
"processingDetails": {
"editorSuggestionsAvailability": "",
"fileDetailsAvailability": "",
"processingFailureReason": "",
"processingIssuesAvailability": "",
"processingProgress": {
"partsProcessed": "",
"partsTotal": "",
"timeLeftMs": ""
},
"processingStatus": "",
"tagSuggestionsAvailability": "",
"thumbnailsAvailability": ""
},
"projectDetails": {},
"recordingDetails": {
"location": {
"altitude": "",
"latitude": "",
"longitude": ""
},
"locationDescription": "",
"recordingDate": ""
},
"snippet": {
"categoryId": "",
"channelId": "",
"channelTitle": "",
"defaultAudioLanguage": "",
"defaultLanguage": "",
"description": "",
"liveBroadcastContent": "",
"localized": {
"description": "",
"title": ""
},
"publishedAt": "",
"tags": [],
"thumbnails": {
"high": {
"height": 0,
"url": "",
"width": 0
},
"maxres": {},
"medium": {},
"standard": {}
},
"title": ""
},
"statistics": {
"commentCount": "",
"dislikeCount": "",
"favoriteCount": "",
"likeCount": "",
"viewCount": ""
},
"status": {
"embeddable": false,
"failureReason": "",
"license": "",
"madeForKids": false,
"privacyStatus": "",
"publicStatsViewable": false,
"publishAt": "",
"rejectionReason": "",
"selfDeclaredMadeForKids": false,
"uploadStatus": ""
},
"suggestions": {
"editorSuggestions": [],
"processingErrors": [],
"processingHints": [],
"processingWarnings": [],
"tagSuggestions": [
{
"categoryRestricts": [],
"tag": ""
}
]
},
"topicDetails": {
"relevantTopicIds": [],
"topicCategories": [],
"topicIds": []
}
}'
echo '{
"ageGating": {
"alcoholContent": false,
"restricted": false,
"videoGameRating": ""
},
"contentDetails": {
"caption": "",
"contentRating": {
"acbRating": "",
"agcomRating": "",
"anatelRating": "",
"bbfcRating": "",
"bfvcRating": "",
"bmukkRating": "",
"catvRating": "",
"catvfrRating": "",
"cbfcRating": "",
"cccRating": "",
"cceRating": "",
"chfilmRating": "",
"chvrsRating": "",
"cicfRating": "",
"cnaRating": "",
"cncRating": "",
"csaRating": "",
"cscfRating": "",
"czfilmRating": "",
"djctqRating": "",
"djctqRatingReasons": [],
"ecbmctRating": "",
"eefilmRating": "",
"egfilmRating": "",
"eirinRating": "",
"fcbmRating": "",
"fcoRating": "",
"fmocRating": "",
"fpbRating": "",
"fpbRatingReasons": [],
"fskRating": "",
"grfilmRating": "",
"icaaRating": "",
"ifcoRating": "",
"ilfilmRating": "",
"incaaRating": "",
"kfcbRating": "",
"kijkwijzerRating": "",
"kmrbRating": "",
"lsfRating": "",
"mccaaRating": "",
"mccypRating": "",
"mcstRating": "",
"mdaRating": "",
"medietilsynetRating": "",
"mekuRating": "",
"menaMpaaRating": "",
"mibacRating": "",
"mocRating": "",
"moctwRating": "",
"mpaaRating": "",
"mpaatRating": "",
"mtrcbRating": "",
"nbcRating": "",
"nbcplRating": "",
"nfrcRating": "",
"nfvcbRating": "",
"nkclvRating": "",
"nmcRating": "",
"oflcRating": "",
"pefilmRating": "",
"rcnofRating": "",
"resorteviolenciaRating": "",
"rtcRating": "",
"rteRating": "",
"russiaRating": "",
"skfilmRating": "",
"smaisRating": "",
"smsaRating": "",
"tvpgRating": "",
"ytRating": ""
},
"countryRestriction": {
"allowed": false,
"exception": []
},
"definition": "",
"dimension": "",
"duration": "",
"hasCustomThumbnail": false,
"licensedContent": false,
"projection": "",
"regionRestriction": {
"allowed": [],
"blocked": []
}
},
"etag": "",
"fileDetails": {
"audioStreams": [
{
"bitrateBps": "",
"channelCount": 0,
"codec": "",
"vendor": ""
}
],
"bitrateBps": "",
"container": "",
"creationTime": "",
"durationMs": "",
"fileName": "",
"fileSize": "",
"fileType": "",
"videoStreams": [
{
"aspectRatio": "",
"bitrateBps": "",
"codec": "",
"frameRateFps": "",
"heightPixels": 0,
"rotation": "",
"vendor": "",
"widthPixels": 0
}
]
},
"id": "",
"kind": "",
"liveStreamingDetails": {
"activeLiveChatId": "",
"actualEndTime": "",
"actualStartTime": "",
"concurrentViewers": "",
"scheduledEndTime": "",
"scheduledStartTime": ""
},
"localizations": {},
"monetizationDetails": {
"access": {}
},
"player": {
"embedHeight": "",
"embedHtml": "",
"embedWidth": ""
},
"processingDetails": {
"editorSuggestionsAvailability": "",
"fileDetailsAvailability": "",
"processingFailureReason": "",
"processingIssuesAvailability": "",
"processingProgress": {
"partsProcessed": "",
"partsTotal": "",
"timeLeftMs": ""
},
"processingStatus": "",
"tagSuggestionsAvailability": "",
"thumbnailsAvailability": ""
},
"projectDetails": {},
"recordingDetails": {
"location": {
"altitude": "",
"latitude": "",
"longitude": ""
},
"locationDescription": "",
"recordingDate": ""
},
"snippet": {
"categoryId": "",
"channelId": "",
"channelTitle": "",
"defaultAudioLanguage": "",
"defaultLanguage": "",
"description": "",
"liveBroadcastContent": "",
"localized": {
"description": "",
"title": ""
},
"publishedAt": "",
"tags": [],
"thumbnails": {
"high": {
"height": 0,
"url": "",
"width": 0
},
"maxres": {},
"medium": {},
"standard": {}
},
"title": ""
},
"statistics": {
"commentCount": "",
"dislikeCount": "",
"favoriteCount": "",
"likeCount": "",
"viewCount": ""
},
"status": {
"embeddable": false,
"failureReason": "",
"license": "",
"madeForKids": false,
"privacyStatus": "",
"publicStatsViewable": false,
"publishAt": "",
"rejectionReason": "",
"selfDeclaredMadeForKids": false,
"uploadStatus": ""
},
"suggestions": {
"editorSuggestions": [],
"processingErrors": [],
"processingHints": [],
"processingWarnings": [],
"tagSuggestions": [
{
"categoryRestricts": [],
"tag": ""
}
]
},
"topicDetails": {
"relevantTopicIds": [],
"topicCategories": [],
"topicIds": []
}
}' | \
http PUT '{{baseUrl}}/youtube/v3/videos?part=' \
content-type:application/json
wget --quiet \
--method PUT \
--header 'content-type: application/json' \
--body-data '{\n "ageGating": {\n "alcoholContent": false,\n "restricted": false,\n "videoGameRating": ""\n },\n "contentDetails": {\n "caption": "",\n "contentRating": {\n "acbRating": "",\n "agcomRating": "",\n "anatelRating": "",\n "bbfcRating": "",\n "bfvcRating": "",\n "bmukkRating": "",\n "catvRating": "",\n "catvfrRating": "",\n "cbfcRating": "",\n "cccRating": "",\n "cceRating": "",\n "chfilmRating": "",\n "chvrsRating": "",\n "cicfRating": "",\n "cnaRating": "",\n "cncRating": "",\n "csaRating": "",\n "cscfRating": "",\n "czfilmRating": "",\n "djctqRating": "",\n "djctqRatingReasons": [],\n "ecbmctRating": "",\n "eefilmRating": "",\n "egfilmRating": "",\n "eirinRating": "",\n "fcbmRating": "",\n "fcoRating": "",\n "fmocRating": "",\n "fpbRating": "",\n "fpbRatingReasons": [],\n "fskRating": "",\n "grfilmRating": "",\n "icaaRating": "",\n "ifcoRating": "",\n "ilfilmRating": "",\n "incaaRating": "",\n "kfcbRating": "",\n "kijkwijzerRating": "",\n "kmrbRating": "",\n "lsfRating": "",\n "mccaaRating": "",\n "mccypRating": "",\n "mcstRating": "",\n "mdaRating": "",\n "medietilsynetRating": "",\n "mekuRating": "",\n "menaMpaaRating": "",\n "mibacRating": "",\n "mocRating": "",\n "moctwRating": "",\n "mpaaRating": "",\n "mpaatRating": "",\n "mtrcbRating": "",\n "nbcRating": "",\n "nbcplRating": "",\n "nfrcRating": "",\n "nfvcbRating": "",\n "nkclvRating": "",\n "nmcRating": "",\n "oflcRating": "",\n "pefilmRating": "",\n "rcnofRating": "",\n "resorteviolenciaRating": "",\n "rtcRating": "",\n "rteRating": "",\n "russiaRating": "",\n "skfilmRating": "",\n "smaisRating": "",\n "smsaRating": "",\n "tvpgRating": "",\n "ytRating": ""\n },\n "countryRestriction": {\n "allowed": false,\n "exception": []\n },\n "definition": "",\n "dimension": "",\n "duration": "",\n "hasCustomThumbnail": false,\n "licensedContent": false,\n "projection": "",\n "regionRestriction": {\n "allowed": [],\n "blocked": []\n }\n },\n "etag": "",\n "fileDetails": {\n "audioStreams": [\n {\n "bitrateBps": "",\n "channelCount": 0,\n "codec": "",\n "vendor": ""\n }\n ],\n "bitrateBps": "",\n "container": "",\n "creationTime": "",\n "durationMs": "",\n "fileName": "",\n "fileSize": "",\n "fileType": "",\n "videoStreams": [\n {\n "aspectRatio": "",\n "bitrateBps": "",\n "codec": "",\n "frameRateFps": "",\n "heightPixels": 0,\n "rotation": "",\n "vendor": "",\n "widthPixels": 0\n }\n ]\n },\n "id": "",\n "kind": "",\n "liveStreamingDetails": {\n "activeLiveChatId": "",\n "actualEndTime": "",\n "actualStartTime": "",\n "concurrentViewers": "",\n "scheduledEndTime": "",\n "scheduledStartTime": ""\n },\n "localizations": {},\n "monetizationDetails": {\n "access": {}\n },\n "player": {\n "embedHeight": "",\n "embedHtml": "",\n "embedWidth": ""\n },\n "processingDetails": {\n "editorSuggestionsAvailability": "",\n "fileDetailsAvailability": "",\n "processingFailureReason": "",\n "processingIssuesAvailability": "",\n "processingProgress": {\n "partsProcessed": "",\n "partsTotal": "",\n "timeLeftMs": ""\n },\n "processingStatus": "",\n "tagSuggestionsAvailability": "",\n "thumbnailsAvailability": ""\n },\n "projectDetails": {},\n "recordingDetails": {\n "location": {\n "altitude": "",\n "latitude": "",\n "longitude": ""\n },\n "locationDescription": "",\n "recordingDate": ""\n },\n "snippet": {\n "categoryId": "",\n "channelId": "",\n "channelTitle": "",\n "defaultAudioLanguage": "",\n "defaultLanguage": "",\n "description": "",\n "liveBroadcastContent": "",\n "localized": {\n "description": "",\n "title": ""\n },\n "publishedAt": "",\n "tags": [],\n "thumbnails": {\n "high": {\n "height": 0,\n "url": "",\n "width": 0\n },\n "maxres": {},\n "medium": {},\n "standard": {}\n },\n "title": ""\n },\n "statistics": {\n "commentCount": "",\n "dislikeCount": "",\n "favoriteCount": "",\n "likeCount": "",\n "viewCount": ""\n },\n "status": {\n "embeddable": false,\n "failureReason": "",\n "license": "",\n "madeForKids": false,\n "privacyStatus": "",\n "publicStatsViewable": false,\n "publishAt": "",\n "rejectionReason": "",\n "selfDeclaredMadeForKids": false,\n "uploadStatus": ""\n },\n "suggestions": {\n "editorSuggestions": [],\n "processingErrors": [],\n "processingHints": [],\n "processingWarnings": [],\n "tagSuggestions": [\n {\n "categoryRestricts": [],\n "tag": ""\n }\n ]\n },\n "topicDetails": {\n "relevantTopicIds": [],\n "topicCategories": [],\n "topicIds": []\n }\n}' \
--output-document \
- '{{baseUrl}}/youtube/v3/videos?part='
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"ageGating": [
"alcoholContent": false,
"restricted": false,
"videoGameRating": ""
],
"contentDetails": [
"caption": "",
"contentRating": [
"acbRating": "",
"agcomRating": "",
"anatelRating": "",
"bbfcRating": "",
"bfvcRating": "",
"bmukkRating": "",
"catvRating": "",
"catvfrRating": "",
"cbfcRating": "",
"cccRating": "",
"cceRating": "",
"chfilmRating": "",
"chvrsRating": "",
"cicfRating": "",
"cnaRating": "",
"cncRating": "",
"csaRating": "",
"cscfRating": "",
"czfilmRating": "",
"djctqRating": "",
"djctqRatingReasons": [],
"ecbmctRating": "",
"eefilmRating": "",
"egfilmRating": "",
"eirinRating": "",
"fcbmRating": "",
"fcoRating": "",
"fmocRating": "",
"fpbRating": "",
"fpbRatingReasons": [],
"fskRating": "",
"grfilmRating": "",
"icaaRating": "",
"ifcoRating": "",
"ilfilmRating": "",
"incaaRating": "",
"kfcbRating": "",
"kijkwijzerRating": "",
"kmrbRating": "",
"lsfRating": "",
"mccaaRating": "",
"mccypRating": "",
"mcstRating": "",
"mdaRating": "",
"medietilsynetRating": "",
"mekuRating": "",
"menaMpaaRating": "",
"mibacRating": "",
"mocRating": "",
"moctwRating": "",
"mpaaRating": "",
"mpaatRating": "",
"mtrcbRating": "",
"nbcRating": "",
"nbcplRating": "",
"nfrcRating": "",
"nfvcbRating": "",
"nkclvRating": "",
"nmcRating": "",
"oflcRating": "",
"pefilmRating": "",
"rcnofRating": "",
"resorteviolenciaRating": "",
"rtcRating": "",
"rteRating": "",
"russiaRating": "",
"skfilmRating": "",
"smaisRating": "",
"smsaRating": "",
"tvpgRating": "",
"ytRating": ""
],
"countryRestriction": [
"allowed": false,
"exception": []
],
"definition": "",
"dimension": "",
"duration": "",
"hasCustomThumbnail": false,
"licensedContent": false,
"projection": "",
"regionRestriction": [
"allowed": [],
"blocked": []
]
],
"etag": "",
"fileDetails": [
"audioStreams": [
[
"bitrateBps": "",
"channelCount": 0,
"codec": "",
"vendor": ""
]
],
"bitrateBps": "",
"container": "",
"creationTime": "",
"durationMs": "",
"fileName": "",
"fileSize": "",
"fileType": "",
"videoStreams": [
[
"aspectRatio": "",
"bitrateBps": "",
"codec": "",
"frameRateFps": "",
"heightPixels": 0,
"rotation": "",
"vendor": "",
"widthPixels": 0
]
]
],
"id": "",
"kind": "",
"liveStreamingDetails": [
"activeLiveChatId": "",
"actualEndTime": "",
"actualStartTime": "",
"concurrentViewers": "",
"scheduledEndTime": "",
"scheduledStartTime": ""
],
"localizations": [],
"monetizationDetails": ["access": []],
"player": [
"embedHeight": "",
"embedHtml": "",
"embedWidth": ""
],
"processingDetails": [
"editorSuggestionsAvailability": "",
"fileDetailsAvailability": "",
"processingFailureReason": "",
"processingIssuesAvailability": "",
"processingProgress": [
"partsProcessed": "",
"partsTotal": "",
"timeLeftMs": ""
],
"processingStatus": "",
"tagSuggestionsAvailability": "",
"thumbnailsAvailability": ""
],
"projectDetails": [],
"recordingDetails": [
"location": [
"altitude": "",
"latitude": "",
"longitude": ""
],
"locationDescription": "",
"recordingDate": ""
],
"snippet": [
"categoryId": "",
"channelId": "",
"channelTitle": "",
"defaultAudioLanguage": "",
"defaultLanguage": "",
"description": "",
"liveBroadcastContent": "",
"localized": [
"description": "",
"title": ""
],
"publishedAt": "",
"tags": [],
"thumbnails": [
"high": [
"height": 0,
"url": "",
"width": 0
],
"maxres": [],
"medium": [],
"standard": []
],
"title": ""
],
"statistics": [
"commentCount": "",
"dislikeCount": "",
"favoriteCount": "",
"likeCount": "",
"viewCount": ""
],
"status": [
"embeddable": false,
"failureReason": "",
"license": "",
"madeForKids": false,
"privacyStatus": "",
"publicStatsViewable": false,
"publishAt": "",
"rejectionReason": "",
"selfDeclaredMadeForKids": false,
"uploadStatus": ""
],
"suggestions": [
"editorSuggestions": [],
"processingErrors": [],
"processingHints": [],
"processingWarnings": [],
"tagSuggestions": [
[
"categoryRestricts": [],
"tag": ""
]
]
],
"topicDetails": [
"relevantTopicIds": [],
"topicCategories": [],
"topicIds": []
]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/youtube/v3/videos?part=")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
youtube.watermarks.set
{{baseUrl}}/youtube/v3/watermarks/set
QUERY PARAMS
channelId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/youtube/v3/watermarks/set?channelId=");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/youtube/v3/watermarks/set" {:query-params {:channelId ""}})
require "http/client"
url = "{{baseUrl}}/youtube/v3/watermarks/set?channelId="
response = HTTP::Client.post url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/youtube/v3/watermarks/set?channelId="),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/youtube/v3/watermarks/set?channelId=");
var request = new RestRequest("", Method.Post);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/youtube/v3/watermarks/set?channelId="
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/youtube/v3/watermarks/set?channelId= HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/youtube/v3/watermarks/set?channelId=")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/youtube/v3/watermarks/set?channelId="))
.method("POST", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/youtube/v3/watermarks/set?channelId=")
.post(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/youtube/v3/watermarks/set?channelId=")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/youtube/v3/watermarks/set?channelId=');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/youtube/v3/watermarks/set',
params: {channelId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/youtube/v3/watermarks/set?channelId=';
const options = {method: 'POST'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/youtube/v3/watermarks/set?channelId=',
method: 'POST',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/youtube/v3/watermarks/set?channelId=")
.post(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/youtube/v3/watermarks/set?channelId=',
headers: {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/youtube/v3/watermarks/set',
qs: {channelId: ''}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/youtube/v3/watermarks/set');
req.query({
channelId: ''
});
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}}/youtube/v3/watermarks/set',
params: {channelId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/youtube/v3/watermarks/set?channelId=';
const options = {method: 'POST'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/youtube/v3/watermarks/set?channelId="]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/youtube/v3/watermarks/set?channelId=" in
Client.call `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/youtube/v3/watermarks/set?channelId=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/youtube/v3/watermarks/set?channelId=');
echo $response->getBody();
setUrl('{{baseUrl}}/youtube/v3/watermarks/set');
$request->setMethod(HTTP_METH_POST);
$request->setQueryData([
'channelId' => ''
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/youtube/v3/watermarks/set');
$request->setRequestMethod('POST');
$request->setQuery(new http\QueryString([
'channelId' => ''
]));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/youtube/v3/watermarks/set?channelId=' -Method POST
$response = Invoke-RestMethod -Uri '{{baseUrl}}/youtube/v3/watermarks/set?channelId=' -Method POST
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("POST", "/baseUrl/youtube/v3/watermarks/set?channelId=")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/youtube/v3/watermarks/set"
querystring = {"channelId":""}
response = requests.post(url, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/youtube/v3/watermarks/set"
queryString <- list(channelId = "")
response <- VERB("POST", url, query = queryString, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/youtube/v3/watermarks/set?channelId=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.post('/baseUrl/youtube/v3/watermarks/set') do |req|
req.params['channelId'] = ''
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/youtube/v3/watermarks/set";
let querystring = [
("channelId", ""),
];
let client = reqwest::Client::new();
let response = client.post(url)
.query(&querystring)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/youtube/v3/watermarks/set?channelId='
http POST '{{baseUrl}}/youtube/v3/watermarks/set?channelId='
wget --quiet \
--method POST \
--output-document \
- '{{baseUrl}}/youtube/v3/watermarks/set?channelId='
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/youtube/v3/watermarks/set?channelId=")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
youtube.watermarks.unset
{{baseUrl}}/youtube/v3/watermarks/unset
QUERY PARAMS
channelId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/youtube/v3/watermarks/unset?channelId=");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/youtube/v3/watermarks/unset" {:query-params {:channelId ""}})
require "http/client"
url = "{{baseUrl}}/youtube/v3/watermarks/unset?channelId="
response = HTTP::Client.post url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/youtube/v3/watermarks/unset?channelId="),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/youtube/v3/watermarks/unset?channelId=");
var request = new RestRequest("", Method.Post);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/youtube/v3/watermarks/unset?channelId="
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/youtube/v3/watermarks/unset?channelId= HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/youtube/v3/watermarks/unset?channelId=")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/youtube/v3/watermarks/unset?channelId="))
.method("POST", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/youtube/v3/watermarks/unset?channelId=")
.post(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/youtube/v3/watermarks/unset?channelId=")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/youtube/v3/watermarks/unset?channelId=');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/youtube/v3/watermarks/unset',
params: {channelId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/youtube/v3/watermarks/unset?channelId=';
const options = {method: 'POST'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/youtube/v3/watermarks/unset?channelId=',
method: 'POST',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/youtube/v3/watermarks/unset?channelId=")
.post(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/youtube/v3/watermarks/unset?channelId=',
headers: {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/youtube/v3/watermarks/unset',
qs: {channelId: ''}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/youtube/v3/watermarks/unset');
req.query({
channelId: ''
});
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}}/youtube/v3/watermarks/unset',
params: {channelId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/youtube/v3/watermarks/unset?channelId=';
const options = {method: 'POST'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/youtube/v3/watermarks/unset?channelId="]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/youtube/v3/watermarks/unset?channelId=" in
Client.call `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/youtube/v3/watermarks/unset?channelId=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/youtube/v3/watermarks/unset?channelId=');
echo $response->getBody();
setUrl('{{baseUrl}}/youtube/v3/watermarks/unset');
$request->setMethod(HTTP_METH_POST);
$request->setQueryData([
'channelId' => ''
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/youtube/v3/watermarks/unset');
$request->setRequestMethod('POST');
$request->setQuery(new http\QueryString([
'channelId' => ''
]));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/youtube/v3/watermarks/unset?channelId=' -Method POST
$response = Invoke-RestMethod -Uri '{{baseUrl}}/youtube/v3/watermarks/unset?channelId=' -Method POST
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("POST", "/baseUrl/youtube/v3/watermarks/unset?channelId=")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/youtube/v3/watermarks/unset"
querystring = {"channelId":""}
response = requests.post(url, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/youtube/v3/watermarks/unset"
queryString <- list(channelId = "")
response <- VERB("POST", url, query = queryString, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/youtube/v3/watermarks/unset?channelId=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.post('/baseUrl/youtube/v3/watermarks/unset') do |req|
req.params['channelId'] = ''
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/youtube/v3/watermarks/unset";
let querystring = [
("channelId", ""),
];
let client = reqwest::Client::new();
let response = client.post(url)
.query(&querystring)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/youtube/v3/watermarks/unset?channelId='
http POST '{{baseUrl}}/youtube/v3/watermarks/unset?channelId='
wget --quiet \
--method POST \
--output-document \
- '{{baseUrl}}/youtube/v3/watermarks/unset?channelId='
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/youtube/v3/watermarks/unset?channelId=")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
PUT
youtube.youtube.v3.updateCommentThreads
{{baseUrl}}/youtube/v3/commentThreads
BODY json
{
"etag": "",
"id": "",
"kind": "",
"replies": {
"comments": [
{
"etag": "",
"id": "",
"kind": "",
"snippet": {
"authorChannelId": {
"value": ""
},
"authorChannelUrl": "",
"authorDisplayName": "",
"authorProfileImageUrl": "",
"canRate": false,
"channelId": "",
"likeCount": 0,
"moderationStatus": "",
"parentId": "",
"publishedAt": "",
"textDisplay": "",
"textOriginal": "",
"updatedAt": "",
"videoId": "",
"viewerRating": ""
}
}
]
},
"snippet": {
"canReply": false,
"channelId": "",
"isPublic": false,
"topLevelComment": {},
"totalReplyCount": 0,
"videoId": ""
}
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/youtube/v3/commentThreads");
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 \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"replies\": {\n \"comments\": [\n {\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"authorChannelId\": {\n \"value\": \"\"\n },\n \"authorChannelUrl\": \"\",\n \"authorDisplayName\": \"\",\n \"authorProfileImageUrl\": \"\",\n \"canRate\": false,\n \"channelId\": \"\",\n \"likeCount\": 0,\n \"moderationStatus\": \"\",\n \"parentId\": \"\",\n \"publishedAt\": \"\",\n \"textDisplay\": \"\",\n \"textOriginal\": \"\",\n \"updatedAt\": \"\",\n \"videoId\": \"\",\n \"viewerRating\": \"\"\n }\n }\n ]\n },\n \"snippet\": {\n \"canReply\": false,\n \"channelId\": \"\",\n \"isPublic\": false,\n \"topLevelComment\": {},\n \"totalReplyCount\": 0,\n \"videoId\": \"\"\n }\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/youtube/v3/commentThreads" {:content-type :json
:form-params {:etag ""
:id ""
:kind ""
:replies {:comments [{:etag ""
:id ""
:kind ""
:snippet {:authorChannelId {:value ""}
:authorChannelUrl ""
:authorDisplayName ""
:authorProfileImageUrl ""
:canRate false
:channelId ""
:likeCount 0
:moderationStatus ""
:parentId ""
:publishedAt ""
:textDisplay ""
:textOriginal ""
:updatedAt ""
:videoId ""
:viewerRating ""}}]}
:snippet {:canReply false
:channelId ""
:isPublic false
:topLevelComment {}
:totalReplyCount 0
:videoId ""}}})
require "http/client"
url = "{{baseUrl}}/youtube/v3/commentThreads"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"replies\": {\n \"comments\": [\n {\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"authorChannelId\": {\n \"value\": \"\"\n },\n \"authorChannelUrl\": \"\",\n \"authorDisplayName\": \"\",\n \"authorProfileImageUrl\": \"\",\n \"canRate\": false,\n \"channelId\": \"\",\n \"likeCount\": 0,\n \"moderationStatus\": \"\",\n \"parentId\": \"\",\n \"publishedAt\": \"\",\n \"textDisplay\": \"\",\n \"textOriginal\": \"\",\n \"updatedAt\": \"\",\n \"videoId\": \"\",\n \"viewerRating\": \"\"\n }\n }\n ]\n },\n \"snippet\": {\n \"canReply\": false,\n \"channelId\": \"\",\n \"isPublic\": false,\n \"topLevelComment\": {},\n \"totalReplyCount\": 0,\n \"videoId\": \"\"\n }\n}"
response = HTTP::Client.put url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Put,
RequestUri = new Uri("{{baseUrl}}/youtube/v3/commentThreads"),
Content = new StringContent("{\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"replies\": {\n \"comments\": [\n {\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"authorChannelId\": {\n \"value\": \"\"\n },\n \"authorChannelUrl\": \"\",\n \"authorDisplayName\": \"\",\n \"authorProfileImageUrl\": \"\",\n \"canRate\": false,\n \"channelId\": \"\",\n \"likeCount\": 0,\n \"moderationStatus\": \"\",\n \"parentId\": \"\",\n \"publishedAt\": \"\",\n \"textDisplay\": \"\",\n \"textOriginal\": \"\",\n \"updatedAt\": \"\",\n \"videoId\": \"\",\n \"viewerRating\": \"\"\n }\n }\n ]\n },\n \"snippet\": {\n \"canReply\": false,\n \"channelId\": \"\",\n \"isPublic\": false,\n \"topLevelComment\": {},\n \"totalReplyCount\": 0,\n \"videoId\": \"\"\n }\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/youtube/v3/commentThreads");
var request = new RestRequest("", Method.Put);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"replies\": {\n \"comments\": [\n {\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"authorChannelId\": {\n \"value\": \"\"\n },\n \"authorChannelUrl\": \"\",\n \"authorDisplayName\": \"\",\n \"authorProfileImageUrl\": \"\",\n \"canRate\": false,\n \"channelId\": \"\",\n \"likeCount\": 0,\n \"moderationStatus\": \"\",\n \"parentId\": \"\",\n \"publishedAt\": \"\",\n \"textDisplay\": \"\",\n \"textOriginal\": \"\",\n \"updatedAt\": \"\",\n \"videoId\": \"\",\n \"viewerRating\": \"\"\n }\n }\n ]\n },\n \"snippet\": {\n \"canReply\": false,\n \"channelId\": \"\",\n \"isPublic\": false,\n \"topLevelComment\": {},\n \"totalReplyCount\": 0,\n \"videoId\": \"\"\n }\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/youtube/v3/commentThreads"
payload := strings.NewReader("{\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"replies\": {\n \"comments\": [\n {\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"authorChannelId\": {\n \"value\": \"\"\n },\n \"authorChannelUrl\": \"\",\n \"authorDisplayName\": \"\",\n \"authorProfileImageUrl\": \"\",\n \"canRate\": false,\n \"channelId\": \"\",\n \"likeCount\": 0,\n \"moderationStatus\": \"\",\n \"parentId\": \"\",\n \"publishedAt\": \"\",\n \"textDisplay\": \"\",\n \"textOriginal\": \"\",\n \"updatedAt\": \"\",\n \"videoId\": \"\",\n \"viewerRating\": \"\"\n }\n }\n ]\n },\n \"snippet\": {\n \"canReply\": false,\n \"channelId\": \"\",\n \"isPublic\": false,\n \"topLevelComment\": {},\n \"totalReplyCount\": 0,\n \"videoId\": \"\"\n }\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PUT /baseUrl/youtube/v3/commentThreads HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 835
{
"etag": "",
"id": "",
"kind": "",
"replies": {
"comments": [
{
"etag": "",
"id": "",
"kind": "",
"snippet": {
"authorChannelId": {
"value": ""
},
"authorChannelUrl": "",
"authorDisplayName": "",
"authorProfileImageUrl": "",
"canRate": false,
"channelId": "",
"likeCount": 0,
"moderationStatus": "",
"parentId": "",
"publishedAt": "",
"textDisplay": "",
"textOriginal": "",
"updatedAt": "",
"videoId": "",
"viewerRating": ""
}
}
]
},
"snippet": {
"canReply": false,
"channelId": "",
"isPublic": false,
"topLevelComment": {},
"totalReplyCount": 0,
"videoId": ""
}
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/youtube/v3/commentThreads")
.setHeader("content-type", "application/json")
.setBody("{\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"replies\": {\n \"comments\": [\n {\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"authorChannelId\": {\n \"value\": \"\"\n },\n \"authorChannelUrl\": \"\",\n \"authorDisplayName\": \"\",\n \"authorProfileImageUrl\": \"\",\n \"canRate\": false,\n \"channelId\": \"\",\n \"likeCount\": 0,\n \"moderationStatus\": \"\",\n \"parentId\": \"\",\n \"publishedAt\": \"\",\n \"textDisplay\": \"\",\n \"textOriginal\": \"\",\n \"updatedAt\": \"\",\n \"videoId\": \"\",\n \"viewerRating\": \"\"\n }\n }\n ]\n },\n \"snippet\": {\n \"canReply\": false,\n \"channelId\": \"\",\n \"isPublic\": false,\n \"topLevelComment\": {},\n \"totalReplyCount\": 0,\n \"videoId\": \"\"\n }\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/youtube/v3/commentThreads"))
.header("content-type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString("{\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"replies\": {\n \"comments\": [\n {\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"authorChannelId\": {\n \"value\": \"\"\n },\n \"authorChannelUrl\": \"\",\n \"authorDisplayName\": \"\",\n \"authorProfileImageUrl\": \"\",\n \"canRate\": false,\n \"channelId\": \"\",\n \"likeCount\": 0,\n \"moderationStatus\": \"\",\n \"parentId\": \"\",\n \"publishedAt\": \"\",\n \"textDisplay\": \"\",\n \"textOriginal\": \"\",\n \"updatedAt\": \"\",\n \"videoId\": \"\",\n \"viewerRating\": \"\"\n }\n }\n ]\n },\n \"snippet\": {\n \"canReply\": false,\n \"channelId\": \"\",\n \"isPublic\": false,\n \"topLevelComment\": {},\n \"totalReplyCount\": 0,\n \"videoId\": \"\"\n }\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"replies\": {\n \"comments\": [\n {\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"authorChannelId\": {\n \"value\": \"\"\n },\n \"authorChannelUrl\": \"\",\n \"authorDisplayName\": \"\",\n \"authorProfileImageUrl\": \"\",\n \"canRate\": false,\n \"channelId\": \"\",\n \"likeCount\": 0,\n \"moderationStatus\": \"\",\n \"parentId\": \"\",\n \"publishedAt\": \"\",\n \"textDisplay\": \"\",\n \"textOriginal\": \"\",\n \"updatedAt\": \"\",\n \"videoId\": \"\",\n \"viewerRating\": \"\"\n }\n }\n ]\n },\n \"snippet\": {\n \"canReply\": false,\n \"channelId\": \"\",\n \"isPublic\": false,\n \"topLevelComment\": {},\n \"totalReplyCount\": 0,\n \"videoId\": \"\"\n }\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/youtube/v3/commentThreads")
.put(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/youtube/v3/commentThreads")
.header("content-type", "application/json")
.body("{\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"replies\": {\n \"comments\": [\n {\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"authorChannelId\": {\n \"value\": \"\"\n },\n \"authorChannelUrl\": \"\",\n \"authorDisplayName\": \"\",\n \"authorProfileImageUrl\": \"\",\n \"canRate\": false,\n \"channelId\": \"\",\n \"likeCount\": 0,\n \"moderationStatus\": \"\",\n \"parentId\": \"\",\n \"publishedAt\": \"\",\n \"textDisplay\": \"\",\n \"textOriginal\": \"\",\n \"updatedAt\": \"\",\n \"videoId\": \"\",\n \"viewerRating\": \"\"\n }\n }\n ]\n },\n \"snippet\": {\n \"canReply\": false,\n \"channelId\": \"\",\n \"isPublic\": false,\n \"topLevelComment\": {},\n \"totalReplyCount\": 0,\n \"videoId\": \"\"\n }\n}")
.asString();
const data = JSON.stringify({
etag: '',
id: '',
kind: '',
replies: {
comments: [
{
etag: '',
id: '',
kind: '',
snippet: {
authorChannelId: {
value: ''
},
authorChannelUrl: '',
authorDisplayName: '',
authorProfileImageUrl: '',
canRate: false,
channelId: '',
likeCount: 0,
moderationStatus: '',
parentId: '',
publishedAt: '',
textDisplay: '',
textOriginal: '',
updatedAt: '',
videoId: '',
viewerRating: ''
}
}
]
},
snippet: {
canReply: false,
channelId: '',
isPublic: false,
topLevelComment: {},
totalReplyCount: 0,
videoId: ''
}
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/youtube/v3/commentThreads');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/youtube/v3/commentThreads',
headers: {'content-type': 'application/json'},
data: {
etag: '',
id: '',
kind: '',
replies: {
comments: [
{
etag: '',
id: '',
kind: '',
snippet: {
authorChannelId: {value: ''},
authorChannelUrl: '',
authorDisplayName: '',
authorProfileImageUrl: '',
canRate: false,
channelId: '',
likeCount: 0,
moderationStatus: '',
parentId: '',
publishedAt: '',
textDisplay: '',
textOriginal: '',
updatedAt: '',
videoId: '',
viewerRating: ''
}
}
]
},
snippet: {
canReply: false,
channelId: '',
isPublic: false,
topLevelComment: {},
totalReplyCount: 0,
videoId: ''
}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/youtube/v3/commentThreads';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"etag":"","id":"","kind":"","replies":{"comments":[{"etag":"","id":"","kind":"","snippet":{"authorChannelId":{"value":""},"authorChannelUrl":"","authorDisplayName":"","authorProfileImageUrl":"","canRate":false,"channelId":"","likeCount":0,"moderationStatus":"","parentId":"","publishedAt":"","textDisplay":"","textOriginal":"","updatedAt":"","videoId":"","viewerRating":""}}]},"snippet":{"canReply":false,"channelId":"","isPublic":false,"topLevelComment":{},"totalReplyCount":0,"videoId":""}}'
};
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}}/youtube/v3/commentThreads',
method: 'PUT',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "etag": "",\n "id": "",\n "kind": "",\n "replies": {\n "comments": [\n {\n "etag": "",\n "id": "",\n "kind": "",\n "snippet": {\n "authorChannelId": {\n "value": ""\n },\n "authorChannelUrl": "",\n "authorDisplayName": "",\n "authorProfileImageUrl": "",\n "canRate": false,\n "channelId": "",\n "likeCount": 0,\n "moderationStatus": "",\n "parentId": "",\n "publishedAt": "",\n "textDisplay": "",\n "textOriginal": "",\n "updatedAt": "",\n "videoId": "",\n "viewerRating": ""\n }\n }\n ]\n },\n "snippet": {\n "canReply": false,\n "channelId": "",\n "isPublic": false,\n "topLevelComment": {},\n "totalReplyCount": 0,\n "videoId": ""\n }\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"replies\": {\n \"comments\": [\n {\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"authorChannelId\": {\n \"value\": \"\"\n },\n \"authorChannelUrl\": \"\",\n \"authorDisplayName\": \"\",\n \"authorProfileImageUrl\": \"\",\n \"canRate\": false,\n \"channelId\": \"\",\n \"likeCount\": 0,\n \"moderationStatus\": \"\",\n \"parentId\": \"\",\n \"publishedAt\": \"\",\n \"textDisplay\": \"\",\n \"textOriginal\": \"\",\n \"updatedAt\": \"\",\n \"videoId\": \"\",\n \"viewerRating\": \"\"\n }\n }\n ]\n },\n \"snippet\": {\n \"canReply\": false,\n \"channelId\": \"\",\n \"isPublic\": false,\n \"topLevelComment\": {},\n \"totalReplyCount\": 0,\n \"videoId\": \"\"\n }\n}")
val request = Request.Builder()
.url("{{baseUrl}}/youtube/v3/commentThreads")
.put(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PUT',
hostname: 'example.com',
port: null,
path: '/baseUrl/youtube/v3/commentThreads',
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({
etag: '',
id: '',
kind: '',
replies: {
comments: [
{
etag: '',
id: '',
kind: '',
snippet: {
authorChannelId: {value: ''},
authorChannelUrl: '',
authorDisplayName: '',
authorProfileImageUrl: '',
canRate: false,
channelId: '',
likeCount: 0,
moderationStatus: '',
parentId: '',
publishedAt: '',
textDisplay: '',
textOriginal: '',
updatedAt: '',
videoId: '',
viewerRating: ''
}
}
]
},
snippet: {
canReply: false,
channelId: '',
isPublic: false,
topLevelComment: {},
totalReplyCount: 0,
videoId: ''
}
}));
req.end();
const request = require('request');
const options = {
method: 'PUT',
url: '{{baseUrl}}/youtube/v3/commentThreads',
headers: {'content-type': 'application/json'},
body: {
etag: '',
id: '',
kind: '',
replies: {
comments: [
{
etag: '',
id: '',
kind: '',
snippet: {
authorChannelId: {value: ''},
authorChannelUrl: '',
authorDisplayName: '',
authorProfileImageUrl: '',
canRate: false,
channelId: '',
likeCount: 0,
moderationStatus: '',
parentId: '',
publishedAt: '',
textDisplay: '',
textOriginal: '',
updatedAt: '',
videoId: '',
viewerRating: ''
}
}
]
},
snippet: {
canReply: false,
channelId: '',
isPublic: false,
topLevelComment: {},
totalReplyCount: 0,
videoId: ''
}
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PUT', '{{baseUrl}}/youtube/v3/commentThreads');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
etag: '',
id: '',
kind: '',
replies: {
comments: [
{
etag: '',
id: '',
kind: '',
snippet: {
authorChannelId: {
value: ''
},
authorChannelUrl: '',
authorDisplayName: '',
authorProfileImageUrl: '',
canRate: false,
channelId: '',
likeCount: 0,
moderationStatus: '',
parentId: '',
publishedAt: '',
textDisplay: '',
textOriginal: '',
updatedAt: '',
videoId: '',
viewerRating: ''
}
}
]
},
snippet: {
canReply: false,
channelId: '',
isPublic: false,
topLevelComment: {},
totalReplyCount: 0,
videoId: ''
}
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'PUT',
url: '{{baseUrl}}/youtube/v3/commentThreads',
headers: {'content-type': 'application/json'},
data: {
etag: '',
id: '',
kind: '',
replies: {
comments: [
{
etag: '',
id: '',
kind: '',
snippet: {
authorChannelId: {value: ''},
authorChannelUrl: '',
authorDisplayName: '',
authorProfileImageUrl: '',
canRate: false,
channelId: '',
likeCount: 0,
moderationStatus: '',
parentId: '',
publishedAt: '',
textDisplay: '',
textOriginal: '',
updatedAt: '',
videoId: '',
viewerRating: ''
}
}
]
},
snippet: {
canReply: false,
channelId: '',
isPublic: false,
topLevelComment: {},
totalReplyCount: 0,
videoId: ''
}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/youtube/v3/commentThreads';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"etag":"","id":"","kind":"","replies":{"comments":[{"etag":"","id":"","kind":"","snippet":{"authorChannelId":{"value":""},"authorChannelUrl":"","authorDisplayName":"","authorProfileImageUrl":"","canRate":false,"channelId":"","likeCount":0,"moderationStatus":"","parentId":"","publishedAt":"","textDisplay":"","textOriginal":"","updatedAt":"","videoId":"","viewerRating":""}}]},"snippet":{"canReply":false,"channelId":"","isPublic":false,"topLevelComment":{},"totalReplyCount":0,"videoId":""}}'
};
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 = @{ @"etag": @"",
@"id": @"",
@"kind": @"",
@"replies": @{ @"comments": @[ @{ @"etag": @"", @"id": @"", @"kind": @"", @"snippet": @{ @"authorChannelId": @{ @"value": @"" }, @"authorChannelUrl": @"", @"authorDisplayName": @"", @"authorProfileImageUrl": @"", @"canRate": @NO, @"channelId": @"", @"likeCount": @0, @"moderationStatus": @"", @"parentId": @"", @"publishedAt": @"", @"textDisplay": @"", @"textOriginal": @"", @"updatedAt": @"", @"videoId": @"", @"viewerRating": @"" } } ] },
@"snippet": @{ @"canReply": @NO, @"channelId": @"", @"isPublic": @NO, @"topLevelComment": @{ }, @"totalReplyCount": @0, @"videoId": @"" } };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/youtube/v3/commentThreads"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PUT"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/youtube/v3/commentThreads" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"replies\": {\n \"comments\": [\n {\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"authorChannelId\": {\n \"value\": \"\"\n },\n \"authorChannelUrl\": \"\",\n \"authorDisplayName\": \"\",\n \"authorProfileImageUrl\": \"\",\n \"canRate\": false,\n \"channelId\": \"\",\n \"likeCount\": 0,\n \"moderationStatus\": \"\",\n \"parentId\": \"\",\n \"publishedAt\": \"\",\n \"textDisplay\": \"\",\n \"textOriginal\": \"\",\n \"updatedAt\": \"\",\n \"videoId\": \"\",\n \"viewerRating\": \"\"\n }\n }\n ]\n },\n \"snippet\": {\n \"canReply\": false,\n \"channelId\": \"\",\n \"isPublic\": false,\n \"topLevelComment\": {},\n \"totalReplyCount\": 0,\n \"videoId\": \"\"\n }\n}" in
Client.call ~headers ~body `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/youtube/v3/commentThreads",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'etag' => '',
'id' => '',
'kind' => '',
'replies' => [
'comments' => [
[
'etag' => '',
'id' => '',
'kind' => '',
'snippet' => [
'authorChannelId' => [
'value' => ''
],
'authorChannelUrl' => '',
'authorDisplayName' => '',
'authorProfileImageUrl' => '',
'canRate' => null,
'channelId' => '',
'likeCount' => 0,
'moderationStatus' => '',
'parentId' => '',
'publishedAt' => '',
'textDisplay' => '',
'textOriginal' => '',
'updatedAt' => '',
'videoId' => '',
'viewerRating' => ''
]
]
]
],
'snippet' => [
'canReply' => null,
'channelId' => '',
'isPublic' => null,
'topLevelComment' => [
],
'totalReplyCount' => 0,
'videoId' => ''
]
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('PUT', '{{baseUrl}}/youtube/v3/commentThreads', [
'body' => '{
"etag": "",
"id": "",
"kind": "",
"replies": {
"comments": [
{
"etag": "",
"id": "",
"kind": "",
"snippet": {
"authorChannelId": {
"value": ""
},
"authorChannelUrl": "",
"authorDisplayName": "",
"authorProfileImageUrl": "",
"canRate": false,
"channelId": "",
"likeCount": 0,
"moderationStatus": "",
"parentId": "",
"publishedAt": "",
"textDisplay": "",
"textOriginal": "",
"updatedAt": "",
"videoId": "",
"viewerRating": ""
}
}
]
},
"snippet": {
"canReply": false,
"channelId": "",
"isPublic": false,
"topLevelComment": {},
"totalReplyCount": 0,
"videoId": ""
}
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/youtube/v3/commentThreads');
$request->setMethod(HTTP_METH_PUT);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'etag' => '',
'id' => '',
'kind' => '',
'replies' => [
'comments' => [
[
'etag' => '',
'id' => '',
'kind' => '',
'snippet' => [
'authorChannelId' => [
'value' => ''
],
'authorChannelUrl' => '',
'authorDisplayName' => '',
'authorProfileImageUrl' => '',
'canRate' => null,
'channelId' => '',
'likeCount' => 0,
'moderationStatus' => '',
'parentId' => '',
'publishedAt' => '',
'textDisplay' => '',
'textOriginal' => '',
'updatedAt' => '',
'videoId' => '',
'viewerRating' => ''
]
]
]
],
'snippet' => [
'canReply' => null,
'channelId' => '',
'isPublic' => null,
'topLevelComment' => [
],
'totalReplyCount' => 0,
'videoId' => ''
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'etag' => '',
'id' => '',
'kind' => '',
'replies' => [
'comments' => [
[
'etag' => '',
'id' => '',
'kind' => '',
'snippet' => [
'authorChannelId' => [
'value' => ''
],
'authorChannelUrl' => '',
'authorDisplayName' => '',
'authorProfileImageUrl' => '',
'canRate' => null,
'channelId' => '',
'likeCount' => 0,
'moderationStatus' => '',
'parentId' => '',
'publishedAt' => '',
'textDisplay' => '',
'textOriginal' => '',
'updatedAt' => '',
'videoId' => '',
'viewerRating' => ''
]
]
]
],
'snippet' => [
'canReply' => null,
'channelId' => '',
'isPublic' => null,
'topLevelComment' => [
],
'totalReplyCount' => 0,
'videoId' => ''
]
]));
$request->setRequestUrl('{{baseUrl}}/youtube/v3/commentThreads');
$request->setRequestMethod('PUT');
$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}}/youtube/v3/commentThreads' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"etag": "",
"id": "",
"kind": "",
"replies": {
"comments": [
{
"etag": "",
"id": "",
"kind": "",
"snippet": {
"authorChannelId": {
"value": ""
},
"authorChannelUrl": "",
"authorDisplayName": "",
"authorProfileImageUrl": "",
"canRate": false,
"channelId": "",
"likeCount": 0,
"moderationStatus": "",
"parentId": "",
"publishedAt": "",
"textDisplay": "",
"textOriginal": "",
"updatedAt": "",
"videoId": "",
"viewerRating": ""
}
}
]
},
"snippet": {
"canReply": false,
"channelId": "",
"isPublic": false,
"topLevelComment": {},
"totalReplyCount": 0,
"videoId": ""
}
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/youtube/v3/commentThreads' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"etag": "",
"id": "",
"kind": "",
"replies": {
"comments": [
{
"etag": "",
"id": "",
"kind": "",
"snippet": {
"authorChannelId": {
"value": ""
},
"authorChannelUrl": "",
"authorDisplayName": "",
"authorProfileImageUrl": "",
"canRate": false,
"channelId": "",
"likeCount": 0,
"moderationStatus": "",
"parentId": "",
"publishedAt": "",
"textDisplay": "",
"textOriginal": "",
"updatedAt": "",
"videoId": "",
"viewerRating": ""
}
}
]
},
"snippet": {
"canReply": false,
"channelId": "",
"isPublic": false,
"topLevelComment": {},
"totalReplyCount": 0,
"videoId": ""
}
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"replies\": {\n \"comments\": [\n {\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"authorChannelId\": {\n \"value\": \"\"\n },\n \"authorChannelUrl\": \"\",\n \"authorDisplayName\": \"\",\n \"authorProfileImageUrl\": \"\",\n \"canRate\": false,\n \"channelId\": \"\",\n \"likeCount\": 0,\n \"moderationStatus\": \"\",\n \"parentId\": \"\",\n \"publishedAt\": \"\",\n \"textDisplay\": \"\",\n \"textOriginal\": \"\",\n \"updatedAt\": \"\",\n \"videoId\": \"\",\n \"viewerRating\": \"\"\n }\n }\n ]\n },\n \"snippet\": {\n \"canReply\": false,\n \"channelId\": \"\",\n \"isPublic\": false,\n \"topLevelComment\": {},\n \"totalReplyCount\": 0,\n \"videoId\": \"\"\n }\n}"
headers = { 'content-type': "application/json" }
conn.request("PUT", "/baseUrl/youtube/v3/commentThreads", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/youtube/v3/commentThreads"
payload = {
"etag": "",
"id": "",
"kind": "",
"replies": { "comments": [
{
"etag": "",
"id": "",
"kind": "",
"snippet": {
"authorChannelId": { "value": "" },
"authorChannelUrl": "",
"authorDisplayName": "",
"authorProfileImageUrl": "",
"canRate": False,
"channelId": "",
"likeCount": 0,
"moderationStatus": "",
"parentId": "",
"publishedAt": "",
"textDisplay": "",
"textOriginal": "",
"updatedAt": "",
"videoId": "",
"viewerRating": ""
}
}
] },
"snippet": {
"canReply": False,
"channelId": "",
"isPublic": False,
"topLevelComment": {},
"totalReplyCount": 0,
"videoId": ""
}
}
headers = {"content-type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/youtube/v3/commentThreads"
payload <- "{\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"replies\": {\n \"comments\": [\n {\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"authorChannelId\": {\n \"value\": \"\"\n },\n \"authorChannelUrl\": \"\",\n \"authorDisplayName\": \"\",\n \"authorProfileImageUrl\": \"\",\n \"canRate\": false,\n \"channelId\": \"\",\n \"likeCount\": 0,\n \"moderationStatus\": \"\",\n \"parentId\": \"\",\n \"publishedAt\": \"\",\n \"textDisplay\": \"\",\n \"textOriginal\": \"\",\n \"updatedAt\": \"\",\n \"videoId\": \"\",\n \"viewerRating\": \"\"\n }\n }\n ]\n },\n \"snippet\": {\n \"canReply\": false,\n \"channelId\": \"\",\n \"isPublic\": false,\n \"topLevelComment\": {},\n \"totalReplyCount\": 0,\n \"videoId\": \"\"\n }\n}"
encode <- "json"
response <- VERB("PUT", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/youtube/v3/commentThreads")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"replies\": {\n \"comments\": [\n {\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"authorChannelId\": {\n \"value\": \"\"\n },\n \"authorChannelUrl\": \"\",\n \"authorDisplayName\": \"\",\n \"authorProfileImageUrl\": \"\",\n \"canRate\": false,\n \"channelId\": \"\",\n \"likeCount\": 0,\n \"moderationStatus\": \"\",\n \"parentId\": \"\",\n \"publishedAt\": \"\",\n \"textDisplay\": \"\",\n \"textOriginal\": \"\",\n \"updatedAt\": \"\",\n \"videoId\": \"\",\n \"viewerRating\": \"\"\n }\n }\n ]\n },\n \"snippet\": {\n \"canReply\": false,\n \"channelId\": \"\",\n \"isPublic\": false,\n \"topLevelComment\": {},\n \"totalReplyCount\": 0,\n \"videoId\": \"\"\n }\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.put('/baseUrl/youtube/v3/commentThreads') do |req|
req.body = "{\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"replies\": {\n \"comments\": [\n {\n \"etag\": \"\",\n \"id\": \"\",\n \"kind\": \"\",\n \"snippet\": {\n \"authorChannelId\": {\n \"value\": \"\"\n },\n \"authorChannelUrl\": \"\",\n \"authorDisplayName\": \"\",\n \"authorProfileImageUrl\": \"\",\n \"canRate\": false,\n \"channelId\": \"\",\n \"likeCount\": 0,\n \"moderationStatus\": \"\",\n \"parentId\": \"\",\n \"publishedAt\": \"\",\n \"textDisplay\": \"\",\n \"textOriginal\": \"\",\n \"updatedAt\": \"\",\n \"videoId\": \"\",\n \"viewerRating\": \"\"\n }\n }\n ]\n },\n \"snippet\": {\n \"canReply\": false,\n \"channelId\": \"\",\n \"isPublic\": false,\n \"topLevelComment\": {},\n \"totalReplyCount\": 0,\n \"videoId\": \"\"\n }\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}}/youtube/v3/commentThreads";
let payload = json!({
"etag": "",
"id": "",
"kind": "",
"replies": json!({"comments": (
json!({
"etag": "",
"id": "",
"kind": "",
"snippet": json!({
"authorChannelId": json!({"value": ""}),
"authorChannelUrl": "",
"authorDisplayName": "",
"authorProfileImageUrl": "",
"canRate": false,
"channelId": "",
"likeCount": 0,
"moderationStatus": "",
"parentId": "",
"publishedAt": "",
"textDisplay": "",
"textOriginal": "",
"updatedAt": "",
"videoId": "",
"viewerRating": ""
})
})
)}),
"snippet": json!({
"canReply": false,
"channelId": "",
"isPublic": false,
"topLevelComment": json!({}),
"totalReplyCount": 0,
"videoId": ""
})
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PUT").unwrap(), url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PUT \
--url {{baseUrl}}/youtube/v3/commentThreads \
--header 'content-type: application/json' \
--data '{
"etag": "",
"id": "",
"kind": "",
"replies": {
"comments": [
{
"etag": "",
"id": "",
"kind": "",
"snippet": {
"authorChannelId": {
"value": ""
},
"authorChannelUrl": "",
"authorDisplayName": "",
"authorProfileImageUrl": "",
"canRate": false,
"channelId": "",
"likeCount": 0,
"moderationStatus": "",
"parentId": "",
"publishedAt": "",
"textDisplay": "",
"textOriginal": "",
"updatedAt": "",
"videoId": "",
"viewerRating": ""
}
}
]
},
"snippet": {
"canReply": false,
"channelId": "",
"isPublic": false,
"topLevelComment": {},
"totalReplyCount": 0,
"videoId": ""
}
}'
echo '{
"etag": "",
"id": "",
"kind": "",
"replies": {
"comments": [
{
"etag": "",
"id": "",
"kind": "",
"snippet": {
"authorChannelId": {
"value": ""
},
"authorChannelUrl": "",
"authorDisplayName": "",
"authorProfileImageUrl": "",
"canRate": false,
"channelId": "",
"likeCount": 0,
"moderationStatus": "",
"parentId": "",
"publishedAt": "",
"textDisplay": "",
"textOriginal": "",
"updatedAt": "",
"videoId": "",
"viewerRating": ""
}
}
]
},
"snippet": {
"canReply": false,
"channelId": "",
"isPublic": false,
"topLevelComment": {},
"totalReplyCount": 0,
"videoId": ""
}
}' | \
http PUT {{baseUrl}}/youtube/v3/commentThreads \
content-type:application/json
wget --quiet \
--method PUT \
--header 'content-type: application/json' \
--body-data '{\n "etag": "",\n "id": "",\n "kind": "",\n "replies": {\n "comments": [\n {\n "etag": "",\n "id": "",\n "kind": "",\n "snippet": {\n "authorChannelId": {\n "value": ""\n },\n "authorChannelUrl": "",\n "authorDisplayName": "",\n "authorProfileImageUrl": "",\n "canRate": false,\n "channelId": "",\n "likeCount": 0,\n "moderationStatus": "",\n "parentId": "",\n "publishedAt": "",\n "textDisplay": "",\n "textOriginal": "",\n "updatedAt": "",\n "videoId": "",\n "viewerRating": ""\n }\n }\n ]\n },\n "snippet": {\n "canReply": false,\n "channelId": "",\n "isPublic": false,\n "topLevelComment": {},\n "totalReplyCount": 0,\n "videoId": ""\n }\n}' \
--output-document \
- {{baseUrl}}/youtube/v3/commentThreads
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"etag": "",
"id": "",
"kind": "",
"replies": ["comments": [
[
"etag": "",
"id": "",
"kind": "",
"snippet": [
"authorChannelId": ["value": ""],
"authorChannelUrl": "",
"authorDisplayName": "",
"authorProfileImageUrl": "",
"canRate": false,
"channelId": "",
"likeCount": 0,
"moderationStatus": "",
"parentId": "",
"publishedAt": "",
"textDisplay": "",
"textOriginal": "",
"updatedAt": "",
"videoId": "",
"viewerRating": ""
]
]
]],
"snippet": [
"canReply": false,
"channelId": "",
"isPublic": false,
"topLevelComment": [],
"totalReplyCount": 0,
"videoId": ""
]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/youtube/v3/commentThreads")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()