TV API
GET
Asset Collection
{{baseUrl}}/asset
HEADERS
apikey
{{apiKey}}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/asset");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "apikey: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/asset" {:headers {:apikey "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/asset"
headers = HTTP::Headers{
"apikey" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/asset"),
Headers =
{
{ "apikey", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/asset");
var request = new RestRequest("", Method.Get);
request.AddHeader("apikey", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/asset"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("apikey", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/asset HTTP/1.1
Apikey: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/asset")
.setHeader("apikey", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/asset"))
.header("apikey", "{{apiKey}}")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/asset")
.get()
.addHeader("apikey", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/asset")
.header("apikey", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/asset');
xhr.setRequestHeader('apikey', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/asset',
headers: {apikey: '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/asset';
const options = {method: 'GET', headers: {apikey: '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/asset',
method: 'GET',
headers: {
apikey: '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/asset")
.get()
.addHeader("apikey", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/asset',
headers: {
apikey: '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/asset',
headers: {apikey: '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/asset');
req.headers({
apikey: '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/asset',
headers: {apikey: '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/asset';
const options = {method: 'GET', headers: {apikey: '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"apikey": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/asset"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/asset" in
let headers = Header.add (Header.init ()) "apikey" "{{apiKey}}" in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/asset",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"apikey: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/asset', [
'headers' => [
'apikey' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/asset');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders([
'apikey' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/asset');
$request->setRequestMethod('GET');
$request->setHeaders([
'apikey' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("apikey", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/asset' -Method GET -Headers $headers
$headers=@{}
$headers.Add("apikey", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/asset' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'apikey': "{{apiKey}}" }
conn.request("GET", "/baseUrl/asset", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/asset"
headers = {"apikey": "{{apiKey}}"}
response = requests.get(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/asset"
response <- VERB("GET", url, add_headers('apikey' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/asset")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["apikey"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/asset') do |req|
req.headers['apikey'] = '{{apiKey}}'
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/asset";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("apikey", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/asset \
--header 'apikey: {{apiKey}}'
http GET {{baseUrl}}/asset \
apikey:'{{apiKey}}'
wget --quiet \
--method GET \
--header 'apikey: {{apiKey}}' \
--output-document \
- {{baseUrl}}/asset
import Foundation
let headers = ["apikey": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/asset")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"hasNext": true,
"limit": 2,
"item": [{
"id": "5ad4cc44-3f18-52c5-8a3b-b65e791a25cf",
"type": "movie",
"title": "Hello Ladies: The Movie",
"runtime": 85,
"productionYear": 2014,
"certification": {
"bbfc": "12"
},
"meta": {},
"category": [{
"code": "movie-drama",
"name": "Movie/Drama"
},
{
"code": "movie-drama:comedy",
"name": "Comedy",
"dvb": "1400"
}
],
"attribute": [
"tv-movie"
],
"summary": {
"long": "Stuart's ex calls him from Britain to tell him she and her husband are visiting Los Angeles, so he sets out to impress them by recruiting a Russian model to pose as his girlfriend. However, the plan soon starts to unravel when she cancels, leaving Stuart to try to persuade his flatmate Jessica to take over. Feature-length special of the comedy, starring Stephen Merchant and Christine Woods, with a cameo appearance by Nicole Kidman",
"medium": "Stuart tries to impress his visiting ex and her husband by recruiting a Russian model to pose as his girlfriend. Feature-length special of the comedy, starring Stephen Merchant",
"short": "Feature-length special of the comedy, starring Stephen Merchant"
},
"media": [{
"kind": "image:asset",
"copyright": "© HBO",
"expiry": "2019-01-01T00:00:00.000Z",
"rendition": {
"default": {
"href": "https://tv.assets.pressassociation.io/aa8e0f8e-6650-50dc-8196-919e7caeba2c.jpg"
}
}
}],
"related": [{
"type": "series",
"id": "476baf58-6cbf-54c9-9d69-00be74be6c34",
"title": "Hello Ladies",
"media": []
}],
"subject": [{
"code": "programme:patv:2091892",
"profile": "asset"
}],
"link": [{
"rel": "contributor",
"href": "https://tv.api.pressassociation.io/v2/asset/5ad4cc44-3f18-52c5-8a3b-b65e791a25cf/contributor"
}],
"createdAt": "2018-07-21T18:07:00.425Z",
"updatedAt": "2018-09-13T11:32:41.140Z"
},
{
"id": "4f83438e-7e0b-50e3-b491-0fbdb758fde9",
"type": "episode",
"number": 3,
"certification": {},
"meta": {
"episode": "3"
},
"category": [],
"attribute": [],
"summary": {
"medium": "The sheer power that online platforms have to bring about the downfall of anyone in a matter of hours",
"short": "The power that online platforms to bring people down"
},
"media": [],
"related": [{
"type": "season",
"id": "9f8c14fd-e1bb-5acf-bea7-18d2f87ba940",
"title": "Vogue Season 2",
"number": 2,
"media": []
},
{
"type": "series",
"id": "7bb984f4-85d6-5d70-9b95-967c56009cdf",
"title": "Vogue",
"media": []
}
],
"subject": [{
"code": "programme:patv:3082393",
"profile": "asset"
}],
"link": [],
"createdAt": "2018-09-13T12:08:41.188Z",
"updatedAt": "2018-09-13T12:08:41.188Z"
}
]
}
GET
Asset Contributors
{{baseUrl}}/asset/:assetId/contributor
HEADERS
apikey
{{apiKey}}
QUERY PARAMS
assetId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/asset/:assetId/contributor");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "apikey: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/asset/:assetId/contributor" {:headers {:apikey "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/asset/:assetId/contributor"
headers = HTTP::Headers{
"apikey" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/asset/:assetId/contributor"),
Headers =
{
{ "apikey", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/asset/:assetId/contributor");
var request = new RestRequest("", Method.Get);
request.AddHeader("apikey", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/asset/:assetId/contributor"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("apikey", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/asset/:assetId/contributor HTTP/1.1
Apikey: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/asset/:assetId/contributor")
.setHeader("apikey", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/asset/:assetId/contributor"))
.header("apikey", "{{apiKey}}")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/asset/:assetId/contributor")
.get()
.addHeader("apikey", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/asset/:assetId/contributor")
.header("apikey", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/asset/:assetId/contributor');
xhr.setRequestHeader('apikey', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/asset/:assetId/contributor',
headers: {apikey: '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/asset/:assetId/contributor';
const options = {method: 'GET', headers: {apikey: '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/asset/:assetId/contributor',
method: 'GET',
headers: {
apikey: '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/asset/:assetId/contributor")
.get()
.addHeader("apikey", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/asset/:assetId/contributor',
headers: {
apikey: '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/asset/:assetId/contributor',
headers: {apikey: '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/asset/:assetId/contributor');
req.headers({
apikey: '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/asset/:assetId/contributor',
headers: {apikey: '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/asset/:assetId/contributor';
const options = {method: 'GET', headers: {apikey: '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"apikey": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/asset/:assetId/contributor"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/asset/:assetId/contributor" in
let headers = Header.add (Header.init ()) "apikey" "{{apiKey}}" in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/asset/:assetId/contributor",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"apikey: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/asset/:assetId/contributor', [
'headers' => [
'apikey' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/asset/:assetId/contributor');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders([
'apikey' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/asset/:assetId/contributor');
$request->setRequestMethod('GET');
$request->setHeaders([
'apikey' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("apikey", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/asset/:assetId/contributor' -Method GET -Headers $headers
$headers=@{}
$headers.Add("apikey", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/asset/:assetId/contributor' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'apikey': "{{apiKey}}" }
conn.request("GET", "/baseUrl/asset/:assetId/contributor", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/asset/:assetId/contributor"
headers = {"apikey": "{{apiKey}}"}
response = requests.get(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/asset/:assetId/contributor"
response <- VERB("GET", url, add_headers('apikey' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/asset/:assetId/contributor")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["apikey"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/asset/:assetId/contributor') do |req|
req.headers['apikey'] = '{{apiKey}}'
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/asset/:assetId/contributor";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("apikey", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/asset/:assetId/contributor \
--header 'apikey: {{apiKey}}'
http GET {{baseUrl}}/asset/:assetId/contributor \
apikey:'{{apiKey}}'
wget --quiet \
--method GET \
--header 'apikey: {{apiKey}}' \
--output-document \
- {{baseUrl}}/asset/:assetId/contributor
import Foundation
let headers = ["apikey": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/asset/:assetId/contributor")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"hasNext": false,
"total": 12,
"item": [{
"id": "e315bafc-c277-5e83-a496-050920771a32",
"name": "Stephen Merchant",
"dob": "1974-11-24",
"from": "Bristol",
"gender": "male",
"meta": {
"best-known-for": "Being Ricky Gervais' best friend, and sending Karl Pilkington around the world.",
"early-life": "Merchant was born in Bristol and attended Hanham High School. He graduated from University of Warwick with a first-class degree in Film and Literature.",
"career": "Before Merchant met Gervais, he was performing stand-up comedy. The pair worked together at London radio station XFM. Later, Merchant worked on a production course at the BBC, in which he enlisted Gervais' help for a short film called 'Seedy Boss' - which is when the idea of The Office arose, with both writing and directing the series. While The Office then enjoyed success Stateside, Gervais and Merchant also concentrated on BBC sitcom Extras. Then came Merchant's radio show for BBC 6 Music, The Steve Show. The comic is in the midst of nationwide tour of the UK, with a stop in New York, and continues to show up in movies and TV shows, including vehicles like An Idiot Abroad and Life's Too Short. ",
"quote": "\"Ricky's quite happy to provoke opinion, to blur the line between his acting and his stand-up persona. He likes to be a little bit provocative. He takes pleasure from that and he's good at it, and to him it feels challenging. It feels important. That doesn't concern me.\" ",
"trivia": ""
},
"media": [],
"subject": [{
"code": "person:patv:44703",
"profile": "contributor"
}],
"createdAt": "2018-07-18T16:20:19.008Z",
"updatedAt": "2018-07-18T16:20:19.008Z",
"character": [{
"type": "actor",
"name": "Stuart"
}],
"role": [
"actor",
"director"
]
},
{
"id": "4e8e4d70-73bd-5ddc-a3f6-b641dd74a1c5",
"name": "Christine Woods",
"meta": {},
"media": [],
"subject": [{
"code": "person:patv:116603",
"profile": "contributor"
}],
"createdAt": "2018-07-18T17:20:13.612Z",
"updatedAt": "2018-07-18T17:20:13.612Z",
"character": [{
"type": "actor",
"name": "Jessica"
}],
"role": [
"actor"
]
},
{
"id": "32a484a4-2db7-595e-aa1a-d3da8a627ceb",
"name": "Nate Torrence",
"meta": {},
"media": [],
"subject": [{
"code": "person:patv:108549",
"profile": "contributor"
}],
"createdAt": "2018-07-18T17:11:30.159Z",
"updatedAt": "2018-07-18T17:11:30.159Z",
"character": [{
"type": "actor",
"name": "Wade"
}],
"role": [
"actor"
]
},
{
"id": "3935f2eb-6750-5382-ab7b-3efaf2278ff8",
"name": "Kevin Weisman",
"meta": {},
"media": [],
"subject": [{
"code": "person:patv:70416",
"profile": "contributor"
}],
"createdAt": "2018-07-18T16:38:08.180Z",
"updatedAt": "2018-07-18T16:38:08.180Z",
"character": [{
"type": "actor",
"name": "Kives"
}],
"role": [
"actor"
]
},
{
"id": "96b213f4-6b60-539e-8bc8-9bea41498f72",
"name": "Kyle Mooney",
"meta": {},
"media": [],
"subject": [{
"code": "person:patv:187866",
"profile": "contributor"
}],
"createdAt": "2018-07-18T18:23:43.446Z",
"updatedAt": "2018-07-18T18:23:43.446Z",
"character": [{
"type": "actor",
"name": "Rory"
}],
"role": [
"actor"
]
},
{
"id": "f4da7be8-0ee9-501e-80a7-34f1d2882ee9",
"name": "Adam Campbell",
"meta": {},
"media": [],
"subject": [{
"code": "person:patv:85937",
"profile": "contributor"
}],
"createdAt": "2018-07-18T16:53:34.535Z",
"updatedAt": "2018-07-18T16:53:34.535Z",
"character": [{
"type": "actor",
"name": "Mike"
}],
"role": [
"actor"
]
},
{
"id": "6a1808ee-0576-59d2-ae04-2387f4c51baf",
"name": "Carly Craig",
"meta": {},
"media": [],
"subject": [{
"code": "person:patv:187867",
"profile": "contributor"
}],
"createdAt": "2018-07-18T18:23:43.349Z",
"updatedAt": "2018-07-18T18:23:43.349Z",
"character": [{
"type": "actor",
"name": "Carrie"
}],
"role": [
"actor"
]
},
{
"id": "4c0b74e6-73e7-51b5-9cdb-d9c1b8ee4b65",
"name": "Crista Flanagan",
"meta": {},
"media": [],
"subject": [{
"code": "person:patv:112273",
"profile": "contributor"
}],
"createdAt": "2018-07-18T17:16:10.228Z",
"updatedAt": "2018-07-18T17:16:10.228Z",
"character": [{
"type": "actor",
"name": "Marion"
}],
"role": [
"actor"
]
},
{
"id": "92b14527-1e9a-5b07-995a-dcc28777d635",
"name": "Stephanie Corneliussen",
"meta": {},
"media": [],
"subject": [{
"code": "person:patv:187868",
"profile": "contributor"
}],
"createdAt": "2018-07-18T18:23:43.342Z",
"updatedAt": "2018-07-18T18:23:43.342Z",
"character": [{
"type": "actor",
"name": "Tatiana"
}],
"role": [
"actor"
]
},
{
"id": "de803291-8e80-5cca-ab09-417ac9a4a314",
"name": "Stephen Tobolowsky",
"meta": {},
"media": [],
"subject": [{
"code": "person:patv:13712",
"profile": "contributor"
}],
"createdAt": "2018-07-18T15:54:00.330Z",
"updatedAt": "2018-07-18T15:54:00.330Z",
"character": [{
"type": "actor",
"name": "Alan"
}],
"role": [
"actor"
]
},
{
"id": "2fbf8395-44e9-5127-8e3a-d27eb9afab9c",
"name": "Allison Tolman",
"meta": {},
"media": [],
"subject": [{
"code": "person:patv:178796",
"profile": "contributor"
}],
"createdAt": "2018-07-18T18:16:38.032Z",
"updatedAt": "2018-07-18T18:16:38.032Z",
"character": [{
"type": "actor",
"name": "Kate"
}],
"role": [
"actor"
]
},
{
"id": "93cb60a6-4cc3-5644-89c0-a45928a8498b",
"name": "Nicole Kidman",
"dob": "1967-06-20",
"from": "Honolulu, Hawaii",
"gender": "female",
"meta": {
"best-known-for": "A string of Hollywood movies.",
"early-life": "Nicole Mary Kidman was born in Honolulu, Hawaii, on June 20, 1967, but spent three years in Washington DC before her parents moved to their native Sydney, Australia. Her father was a biochemist and clinical psychologist, her mother a nursing instructor. Her younger sister, Antonia, is a TV presenter in Australia. Nicole took ballet lessons, but eventually turned to acting, and received a letter of praise and encouragement from Jane Campion, who saw her in a play and later directed her in The Portrait of a Lady in 1996.",
"career": "At 16, Kidman made her TV and film debuts in Young Talent Time and BMX Bandits respectively. Roles in Bush Christmas and A Country Practice followed. In 1989, Dead Calm and miniseries Bangkok Hilton brought her international acclaim, and launched her career in America. Future husband Tom Cruise cast her in Days of Thunder, while To Die For proved she was more than just a pretty face. Since then, she's appeared in a number of Hollywood movies, including Eyes Wide Shut, Moulin Rouge!, The Others and The Hours (for which she won an Oscar). More recent films include Rabbit Hole, The Paperboy, The Railway Man, Grace of Monaco, Before I Go to Sleep and Paddington.",
"quote": "\"I believe that as much as you take, you have to give back. It's important not to focus on yourself too much.\"",
"trivia": "In 1994, Kidman was appointed a goodwill ambassador for Unicef."
},
"media": [],
"subject": [{
"code": "person:patv:2030",
"profile": "contributor"
}],
"createdAt": "2018-07-18T15:51:34.948Z",
"updatedAt": "2018-07-18T15:51:34.948Z",
"character": [{
"type": "actor",
"name": "Herself"
}],
"role": [
"actor"
]
}
]
}
GET
Asset Detail
{{baseUrl}}/asset/:assetId
HEADERS
apikey
{{apiKey}}
QUERY PARAMS
assetId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/asset/:assetId");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "apikey: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/asset/:assetId" {:headers {:apikey "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/asset/:assetId"
headers = HTTP::Headers{
"apikey" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/asset/:assetId"),
Headers =
{
{ "apikey", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/asset/:assetId");
var request = new RestRequest("", Method.Get);
request.AddHeader("apikey", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/asset/:assetId"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("apikey", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/asset/:assetId HTTP/1.1
Apikey: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/asset/:assetId")
.setHeader("apikey", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/asset/:assetId"))
.header("apikey", "{{apiKey}}")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/asset/:assetId")
.get()
.addHeader("apikey", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/asset/:assetId")
.header("apikey", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/asset/:assetId');
xhr.setRequestHeader('apikey', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/asset/:assetId',
headers: {apikey: '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/asset/:assetId';
const options = {method: 'GET', headers: {apikey: '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/asset/:assetId',
method: 'GET',
headers: {
apikey: '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/asset/:assetId")
.get()
.addHeader("apikey", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/asset/:assetId',
headers: {
apikey: '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/asset/:assetId',
headers: {apikey: '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/asset/:assetId');
req.headers({
apikey: '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/asset/:assetId',
headers: {apikey: '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/asset/:assetId';
const options = {method: 'GET', headers: {apikey: '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"apikey": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/asset/:assetId"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/asset/:assetId" in
let headers = Header.add (Header.init ()) "apikey" "{{apiKey}}" in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/asset/:assetId",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"apikey: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/asset/:assetId', [
'headers' => [
'apikey' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/asset/:assetId');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders([
'apikey' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/asset/:assetId');
$request->setRequestMethod('GET');
$request->setHeaders([
'apikey' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("apikey", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/asset/:assetId' -Method GET -Headers $headers
$headers=@{}
$headers.Add("apikey", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/asset/:assetId' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'apikey': "{{apiKey}}" }
conn.request("GET", "/baseUrl/asset/:assetId", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/asset/:assetId"
headers = {"apikey": "{{apiKey}}"}
response = requests.get(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/asset/:assetId"
response <- VERB("GET", url, add_headers('apikey' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/asset/:assetId")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["apikey"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/asset/:assetId') do |req|
req.headers['apikey'] = '{{apiKey}}'
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/asset/:assetId";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("apikey", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/asset/:assetId \
--header 'apikey: {{apiKey}}'
http GET {{baseUrl}}/asset/:assetId \
apikey:'{{apiKey}}'
wget --quiet \
--method GET \
--header 'apikey: {{apiKey}}' \
--output-document \
- {{baseUrl}}/asset/:assetId
import Foundation
let headers = ["apikey": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/asset/:assetId")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"id": "5ad4cc44-3f18-52c5-8a3b-b65e791a25cf",
"type": "movie",
"title": "Hello Ladies: The Movie",
"runtime": 85,
"productionYear": 2014,
"certification": {
"bbfc": "12"
},
"meta": {},
"category": [{
"code": "movie-drama",
"name": "Movie/Drama"
},
{
"code": "movie-drama:comedy",
"name": "Comedy",
"dvb": "1400"
}
],
"attribute": [
"tv-movie"
],
"summary": {
"long": "Stuart's ex calls him from Britain to tell him she and her husband are visiting Los Angeles, so he sets out to impress them by recruiting a Russian model to pose as his girlfriend. However, the plan soon starts to unravel when she cancels, leaving Stuart to try to persuade his flatmate Jessica to take over. Feature-length special of the comedy, starring Stephen Merchant and Christine Woods, with a cameo appearance by Nicole Kidman",
"medium": "Stuart tries to impress his visiting ex and her husband by recruiting a Russian model to pose as his girlfriend. Feature-length special of the comedy, starring Stephen Merchant",
"short": "Feature-length special of the comedy, starring Stephen Merchant"
},
"media": [{
"kind": "image:asset",
"copyright": "© HBO",
"expiry": "2019-01-01T00:00:00.000Z",
"rendition": {
"default": {
"href": "https://tv.assets.pressassociation.io/aa8e0f8e-6650-50dc-8196-919e7caeba2c.jpg"
}
}
}],
"related": [{
"type": "series",
"id": "476baf58-6cbf-54c9-9d69-00be74be6c34",
"title": "Hello Ladies",
"subject": [{
"code": "series:patv:171382",
"profile": "asset"
}],
"media": []
}],
"subject": [{
"code": "programme:patv:2091892",
"profile": "asset"
}],
"link": [{
"rel": "contributor",
"href": "https://tv.api.pressassociation.io/v2/asset/5ad4cc44-3f18-52c5-8a3b-b65e791a25cf/contributor"
}],
"createdAt": "2018-07-21T18:07:00.425Z",
"updatedAt": "2018-09-13T12:32:41.140Z"
}
GET
Catalogue Asset Collection
{{baseUrl}}/catalogue/:catalogueId/asset
HEADERS
apikey
{{apiKey}}
QUERY PARAMS
catalogueId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/catalogue/:catalogueId/asset");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "apikey: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/catalogue/:catalogueId/asset" {:headers {:apikey "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/catalogue/:catalogueId/asset"
headers = HTTP::Headers{
"apikey" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/catalogue/:catalogueId/asset"),
Headers =
{
{ "apikey", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/catalogue/:catalogueId/asset");
var request = new RestRequest("", Method.Get);
request.AddHeader("apikey", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/catalogue/:catalogueId/asset"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("apikey", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/catalogue/:catalogueId/asset HTTP/1.1
Apikey: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/catalogue/:catalogueId/asset")
.setHeader("apikey", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/catalogue/:catalogueId/asset"))
.header("apikey", "{{apiKey}}")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/catalogue/:catalogueId/asset")
.get()
.addHeader("apikey", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/catalogue/:catalogueId/asset")
.header("apikey", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/catalogue/:catalogueId/asset');
xhr.setRequestHeader('apikey', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/catalogue/:catalogueId/asset',
headers: {apikey: '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/catalogue/:catalogueId/asset';
const options = {method: 'GET', headers: {apikey: '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/catalogue/:catalogueId/asset',
method: 'GET',
headers: {
apikey: '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/catalogue/:catalogueId/asset")
.get()
.addHeader("apikey", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/catalogue/:catalogueId/asset',
headers: {
apikey: '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/catalogue/:catalogueId/asset',
headers: {apikey: '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/catalogue/:catalogueId/asset');
req.headers({
apikey: '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/catalogue/:catalogueId/asset',
headers: {apikey: '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/catalogue/:catalogueId/asset';
const options = {method: 'GET', headers: {apikey: '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"apikey": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/catalogue/:catalogueId/asset"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/catalogue/:catalogueId/asset" in
let headers = Header.add (Header.init ()) "apikey" "{{apiKey}}" in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/catalogue/:catalogueId/asset",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"apikey: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/catalogue/:catalogueId/asset', [
'headers' => [
'apikey' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/catalogue/:catalogueId/asset');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders([
'apikey' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/catalogue/:catalogueId/asset');
$request->setRequestMethod('GET');
$request->setHeaders([
'apikey' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("apikey", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/catalogue/:catalogueId/asset' -Method GET -Headers $headers
$headers=@{}
$headers.Add("apikey", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/catalogue/:catalogueId/asset' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'apikey': "{{apiKey}}" }
conn.request("GET", "/baseUrl/catalogue/:catalogueId/asset", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/catalogue/:catalogueId/asset"
headers = {"apikey": "{{apiKey}}"}
response = requests.get(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/catalogue/:catalogueId/asset"
response <- VERB("GET", url, add_headers('apikey' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/catalogue/:catalogueId/asset")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["apikey"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/catalogue/:catalogueId/asset') do |req|
req.headers['apikey'] = '{{apiKey}}'
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/catalogue/:catalogueId/asset";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("apikey", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/catalogue/:catalogueId/asset \
--header 'apikey: {{apiKey}}'
http GET {{baseUrl}}/catalogue/:catalogueId/asset \
apikey:'{{apiKey}}'
wget --quiet \
--method GET \
--header 'apikey: {{apiKey}}' \
--output-document \
- {{baseUrl}}/catalogue/:catalogueId/asset
import Foundation
let headers = ["apikey": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/catalogue/:catalogueId/asset")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"hasNext": false,
"total": 93,
"item": [
{
"id": "f55530eb-d12f-40aa-8b20-e2fa4361cc24",
"title": "The Hole",
"availibility": {
"start": "2020-12-22T14:15:00Z",
"end": "2021-03-22T14:15:00Z"
},
"link": [
{
"rel": "bbc-iplayer-playback",
"href": "https://www.live.bbctvapps.co.uk/tap/iplayer/tv/playback/b0872vmq"
},
{
"rel": "bbc-iplayer",
"href": "https://www.live.bbctvapps.co.uk/tap/iplayer"
},
{
"rel": "bbc-iplayer-ait",
"href": "https://www.live.bbctvapps.co.uk/tap/iplayer/ait/launch/iplayer.aitx"
}
],
"asset": {
"id": "04ae6b98-6e5f-5f76-a879-16b04d8ade0b",
"type": "movie",
"title": "The Hole",
"runtime": 91,
"productionYear": 2009,
"certification": {
"bbfc": "12"
},
"meta": {},
"category": [
{
"code": "movie-drama",
"name": "Movie/Drama",
"dvb": "1000"
},
{
"code": "movie-drama:horror",
"name": "Horror",
"dvb": "1F03"
}
],
"attribute": [],
"summary": {
"short": "Horror, starring Chris Massoglia",
"medium": "Three kids discover a mysterious hole in a basement that leads to a strange world where they must face their worst fears. Horror, starring Chris Massoglia and Haley Bennett",
"long": "Two brothers left alone in their new house discover a mysterious hole in the basement. Aided by a girl living next door, they explore the dark depths in search of treasure, only to end up in a strange world where they must each face their own worst fears. Joe Dante's horror, starring Chris Massoglia, Haley Bennett, Nathan Gamble, Teri Polo and Bruce Dern"
},
"contributor": [
{
"id": "a740ab1c-69b5-5e46-ae6c-ea2894940bec",
"name": "Chris Massoglia",
"meta": {},
"media": [],
"character": [
{
"type": "actor",
"name": "Dane"
}
],
"role": [
"actor"
]
},
{
"id": "e8c1460b-7348-5620-8641-40172762d925",
"name": "Haley Bennett",
"meta": {},
"media": [],
"character": [
{
"type": "actor",
"name": "Julie"
}
],
"role": [
"actor"
]
},
{
"id": "d8abeab7-efc3-57cf-b3f1-c7b4f0347c4a",
"name": "Nathan Gamble",
"meta": {},
"media": [],
"character": [
{
"type": "actor",
"name": "Lucas"
}
],
"role": [
"actor"
]
},
{
"id": "070c70d5-af59-5a3e-8715-943281b72c96",
"name": "Teri Polo",
"meta": {},
"media": [],
"character": [
{
"type": "actor",
"name": "Susan"
}
],
"role": [
"actor"
]
},
{
"id": "e325fc7a-a985-5bbe-8d89-99003960bfbc",
"name": "Bruce Dern",
"meta": {},
"media": [],
"character": [
{
"type": "actor",
"name": "Creepy Carl"
}
],
"role": [
"actor"
]
},
{
"id": "418fe6d6-7df1-5012-a367-56abdc3e3c44",
"name": "Quinn Lord",
"meta": {},
"media": [],
"character": [
{
"type": "actor",
"name": "Annie Smith"
}
],
"role": [
"actor"
]
},
{
"id": "bf1dc78e-73bf-58c7-aa17-e820e20d32ed",
"name": "Mark Pawson",
"meta": {},
"media": [],
"character": [
{
"type": "actor",
"name": "Travis"
}
],
"role": [
"actor"
]
},
{
"id": "d8221daf-c1c5-54ff-b7a3-b2b696edf6e1",
"name": "Merritt Patterson",
"meta": {},
"media": [],
"character": [
{
"type": "actor",
"name": "Jessica"
}
],
"role": [
"actor"
]
},
{
"id": "477fe6b3-35b9-5127-aa4e-125285010eb7",
"name": "Joe Dante",
"meta": {},
"media": [],
"character": [],
"role": [
"director"
]
}
],
"media": [
{
"kind": "image:asset",
"copyright": "© 2009 Ed Araquel/Bold FIlms/sky",
"rendition": {
"default": {
"href": "https://tv.assets.pressassociation.io/6caf8bc9-2bb9-53f6-b145-8fe056fa7395.jpg"
}
}
}
],
"related": [],
"link": [
{
"rel": "contributor",
"href": "https://tv.api.pressassociation.io/v2/asset/04ae6b98-6e5f-5f76-a879-16b04d8ade0b/contributor"
}
]
}
}
]
}
GET
Catalogue Asset Detail
{{baseUrl}}/catalogue/:catalogueId/asset/:assetId
HEADERS
apikey
{{apiKey}}
QUERY PARAMS
catalogueId
assetId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/catalogue/:catalogueId/asset/:assetId");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "apikey: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/catalogue/:catalogueId/asset/:assetId" {:headers {:apikey "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/catalogue/:catalogueId/asset/:assetId"
headers = HTTP::Headers{
"apikey" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/catalogue/:catalogueId/asset/:assetId"),
Headers =
{
{ "apikey", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/catalogue/:catalogueId/asset/:assetId");
var request = new RestRequest("", Method.Get);
request.AddHeader("apikey", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/catalogue/:catalogueId/asset/:assetId"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("apikey", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/catalogue/:catalogueId/asset/:assetId HTTP/1.1
Apikey: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/catalogue/:catalogueId/asset/:assetId")
.setHeader("apikey", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/catalogue/:catalogueId/asset/:assetId"))
.header("apikey", "{{apiKey}}")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/catalogue/:catalogueId/asset/:assetId")
.get()
.addHeader("apikey", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/catalogue/:catalogueId/asset/:assetId")
.header("apikey", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/catalogue/:catalogueId/asset/:assetId');
xhr.setRequestHeader('apikey', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/catalogue/:catalogueId/asset/:assetId',
headers: {apikey: '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/catalogue/:catalogueId/asset/:assetId';
const options = {method: 'GET', headers: {apikey: '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/catalogue/:catalogueId/asset/:assetId',
method: 'GET',
headers: {
apikey: '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/catalogue/:catalogueId/asset/:assetId")
.get()
.addHeader("apikey", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/catalogue/:catalogueId/asset/:assetId',
headers: {
apikey: '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/catalogue/:catalogueId/asset/:assetId',
headers: {apikey: '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/catalogue/:catalogueId/asset/:assetId');
req.headers({
apikey: '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/catalogue/:catalogueId/asset/:assetId',
headers: {apikey: '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/catalogue/:catalogueId/asset/:assetId';
const options = {method: 'GET', headers: {apikey: '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"apikey": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/catalogue/:catalogueId/asset/:assetId"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/catalogue/:catalogueId/asset/:assetId" in
let headers = Header.add (Header.init ()) "apikey" "{{apiKey}}" in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/catalogue/:catalogueId/asset/:assetId",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"apikey: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/catalogue/:catalogueId/asset/:assetId', [
'headers' => [
'apikey' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/catalogue/:catalogueId/asset/:assetId');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders([
'apikey' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/catalogue/:catalogueId/asset/:assetId');
$request->setRequestMethod('GET');
$request->setHeaders([
'apikey' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("apikey", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/catalogue/:catalogueId/asset/:assetId' -Method GET -Headers $headers
$headers=@{}
$headers.Add("apikey", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/catalogue/:catalogueId/asset/:assetId' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'apikey': "{{apiKey}}" }
conn.request("GET", "/baseUrl/catalogue/:catalogueId/asset/:assetId", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/catalogue/:catalogueId/asset/:assetId"
headers = {"apikey": "{{apiKey}}"}
response = requests.get(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/catalogue/:catalogueId/asset/:assetId"
response <- VERB("GET", url, add_headers('apikey' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/catalogue/:catalogueId/asset/:assetId")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["apikey"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/catalogue/:catalogueId/asset/:assetId') do |req|
req.headers['apikey'] = '{{apiKey}}'
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/catalogue/:catalogueId/asset/:assetId";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("apikey", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/catalogue/:catalogueId/asset/:assetId \
--header 'apikey: {{apiKey}}'
http GET {{baseUrl}}/catalogue/:catalogueId/asset/:assetId \
apikey:'{{apiKey}}'
wget --quiet \
--method GET \
--header 'apikey: {{apiKey}}' \
--output-document \
- {{baseUrl}}/catalogue/:catalogueId/asset/:assetId
import Foundation
let headers = ["apikey": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/catalogue/:catalogueId/asset/:assetId")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"id": "44cc7da6-6a71-5d4c-a943-c8f457945aa0",
"title": "House Guest",
"number": 2,
"season": 3,
"certification": {
"netflix": "U"
},
"meta": {
"cast": "Jasmine St. Clair,Allegra Clark,Rosamund Marks,Faye Mata,Kira Buckland,David Roach,Brad Venable",
"directors": "Andrew Tan,Stephen Murray",
"genres": "Kids' Music,Kids' TV,TV Cartoons",
"episode": 2,
"season": 3
},
"attribute": [],
"media": [],
"summary": {
"long": "When Dr. Alvah and her gruff friends move into the Friendship House, the girls must find a new spot to hang out."
},
"link": [
{
"rel": "asset",
"href": "https://tv.api.pressassociation.io/v2/asset/031fa01e-7acf-58d9-95e2-8df67afa860c"
}
],
"availability": {
"start": "2022-07-17T00:00:00.000Z",
"region": "UK"
},
"deeplink": [
{
"rel": "url",
"href": "https://www.netflix.com/browse?jbv=81279856"
}
]
}
GET
Catalogue Collection
{{baseUrl}}/catalogue
HEADERS
apikey
{{apiKey}}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/catalogue");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "apikey: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/catalogue" {:headers {:apikey "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/catalogue"
headers = HTTP::Headers{
"apikey" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/catalogue"),
Headers =
{
{ "apikey", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/catalogue");
var request = new RestRequest("", Method.Get);
request.AddHeader("apikey", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/catalogue"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("apikey", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/catalogue HTTP/1.1
Apikey: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/catalogue")
.setHeader("apikey", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/catalogue"))
.header("apikey", "{{apiKey}}")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/catalogue")
.get()
.addHeader("apikey", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/catalogue")
.header("apikey", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/catalogue');
xhr.setRequestHeader('apikey', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/catalogue',
headers: {apikey: '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/catalogue';
const options = {method: 'GET', headers: {apikey: '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/catalogue',
method: 'GET',
headers: {
apikey: '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/catalogue")
.get()
.addHeader("apikey", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/catalogue',
headers: {
apikey: '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/catalogue',
headers: {apikey: '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/catalogue');
req.headers({
apikey: '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/catalogue',
headers: {apikey: '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/catalogue';
const options = {method: 'GET', headers: {apikey: '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"apikey": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/catalogue"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/catalogue" in
let headers = Header.add (Header.init ()) "apikey" "{{apiKey}}" in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/catalogue",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"apikey: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/catalogue', [
'headers' => [
'apikey' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/catalogue');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders([
'apikey' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/catalogue');
$request->setRequestMethod('GET');
$request->setHeaders([
'apikey' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("apikey", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/catalogue' -Method GET -Headers $headers
$headers=@{}
$headers.Add("apikey", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/catalogue' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'apikey': "{{apiKey}}" }
conn.request("GET", "/baseUrl/catalogue", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/catalogue"
headers = {"apikey": "{{apiKey}}"}
response = requests.get(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/catalogue"
response <- VERB("GET", url, add_headers('apikey' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/catalogue")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["apikey"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/catalogue') do |req|
req.headers['apikey'] = '{{apiKey}}'
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/catalogue";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("apikey", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/catalogue \
--header 'apikey: {{apiKey}}'
http GET {{baseUrl}}/catalogue \
apikey:'{{apiKey}}'
wget --quiet \
--method GET \
--header 'apikey: {{apiKey}}' \
--output-document \
- {{baseUrl}}/catalogue
import Foundation
let headers = ["apikey": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/catalogue")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"hasNext": false,
"total": 3,
"items": [{
"id": "f55530eb-d12f-40aa-8b20-e2fa4361cc24",
"name": "Amazon Prime",
"namespace": "catalogue:amazon-prime"
}, {
"id": "a2815ecc-dae1-521d-930a-43333e266c86",
"name": "BBC iPlayer",
"namespace": "catalogue:iplayer"
}, {
"id": "3e8bf6a5-5910-56f1-8070-ecea9143e89e",
"name": "Netflix",
"namespace": "catalogue:netflix"
}]
}
GET
Catalogue Detail
{{baseUrl}}/catalogue/:catalogueId
HEADERS
apikey
{{apiKey}}
QUERY PARAMS
catalogueId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/catalogue/:catalogueId");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "apikey: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/catalogue/:catalogueId" {:headers {:apikey "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/catalogue/:catalogueId"
headers = HTTP::Headers{
"apikey" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/catalogue/:catalogueId"),
Headers =
{
{ "apikey", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/catalogue/:catalogueId");
var request = new RestRequest("", Method.Get);
request.AddHeader("apikey", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/catalogue/:catalogueId"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("apikey", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/catalogue/:catalogueId HTTP/1.1
Apikey: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/catalogue/:catalogueId")
.setHeader("apikey", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/catalogue/:catalogueId"))
.header("apikey", "{{apiKey}}")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/catalogue/:catalogueId")
.get()
.addHeader("apikey", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/catalogue/:catalogueId")
.header("apikey", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/catalogue/:catalogueId');
xhr.setRequestHeader('apikey', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/catalogue/:catalogueId',
headers: {apikey: '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/catalogue/:catalogueId';
const options = {method: 'GET', headers: {apikey: '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/catalogue/:catalogueId',
method: 'GET',
headers: {
apikey: '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/catalogue/:catalogueId")
.get()
.addHeader("apikey", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/catalogue/:catalogueId',
headers: {
apikey: '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/catalogue/:catalogueId',
headers: {apikey: '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/catalogue/:catalogueId');
req.headers({
apikey: '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/catalogue/:catalogueId',
headers: {apikey: '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/catalogue/:catalogueId';
const options = {method: 'GET', headers: {apikey: '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"apikey": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/catalogue/:catalogueId"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/catalogue/:catalogueId" in
let headers = Header.add (Header.init ()) "apikey" "{{apiKey}}" in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/catalogue/:catalogueId",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"apikey: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/catalogue/:catalogueId', [
'headers' => [
'apikey' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/catalogue/:catalogueId');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders([
'apikey' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/catalogue/:catalogueId');
$request->setRequestMethod('GET');
$request->setHeaders([
'apikey' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("apikey", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/catalogue/:catalogueId' -Method GET -Headers $headers
$headers=@{}
$headers.Add("apikey", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/catalogue/:catalogueId' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'apikey': "{{apiKey}}" }
conn.request("GET", "/baseUrl/catalogue/:catalogueId", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/catalogue/:catalogueId"
headers = {"apikey": "{{apiKey}}"}
response = requests.get(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/catalogue/:catalogueId"
response <- VERB("GET", url, add_headers('apikey' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/catalogue/:catalogueId")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["apikey"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/catalogue/:catalogueId') do |req|
req.headers['apikey'] = '{{apiKey}}'
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/catalogue/:catalogueId";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("apikey", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/catalogue/:catalogueId \
--header 'apikey: {{apiKey}}'
http GET {{baseUrl}}/catalogue/:catalogueId \
apikey:'{{apiKey}}'
wget --quiet \
--method GET \
--header 'apikey: {{apiKey}}' \
--output-document \
- {{baseUrl}}/catalogue/:catalogueId
import Foundation
let headers = ["apikey": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/catalogue/:catalogueId")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"id": "f55530eb-d12f-40aa-8b20-e2fa4361cc24",
"name": "Amazon Prime",
"namespace": "catalogue:amazon-prime"
}
GET
Channel Collection
{{baseUrl}}/channel
HEADERS
apikey
{{apiKey}}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/channel");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "apikey: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/channel" {:headers {:apikey "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/channel"
headers = HTTP::Headers{
"apikey" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/channel"),
Headers =
{
{ "apikey", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/channel");
var request = new RestRequest("", Method.Get);
request.AddHeader("apikey", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/channel"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("apikey", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/channel HTTP/1.1
Apikey: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/channel")
.setHeader("apikey", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/channel"))
.header("apikey", "{{apiKey}}")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/channel")
.get()
.addHeader("apikey", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/channel")
.header("apikey", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/channel');
xhr.setRequestHeader('apikey', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/channel',
headers: {apikey: '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/channel';
const options = {method: 'GET', headers: {apikey: '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/channel',
method: 'GET',
headers: {
apikey: '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/channel")
.get()
.addHeader("apikey", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/channel',
headers: {
apikey: '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/channel',
headers: {apikey: '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/channel');
req.headers({
apikey: '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/channel',
headers: {apikey: '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/channel';
const options = {method: 'GET', headers: {apikey: '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"apikey": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/channel"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/channel" in
let headers = Header.add (Header.init ()) "apikey" "{{apiKey}}" in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/channel",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"apikey: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/channel', [
'headers' => [
'apikey' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/channel');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders([
'apikey' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/channel');
$request->setRequestMethod('GET');
$request->setHeaders([
'apikey' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("apikey", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/channel' -Method GET -Headers $headers
$headers=@{}
$headers.Add("apikey", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/channel' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'apikey': "{{apiKey}}" }
conn.request("GET", "/baseUrl/channel", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/channel"
headers = {"apikey": "{{apiKey}}"}
response = requests.get(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/channel"
response <- VERB("GET", url, add_headers('apikey' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/channel")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["apikey"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/channel') do |req|
req.headers['apikey'] = '{{apiKey}}'
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/channel";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("apikey", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/channel \
--header 'apikey: {{apiKey}}'
http GET {{baseUrl}}/channel \
apikey:'{{apiKey}}'
wget --quiet \
--method GET \
--header 'apikey: {{apiKey}}' \
--output-document \
- {{baseUrl}}/channel
import Foundation
let headers = ["apikey": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/channel")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"hasNext": false,
"total": 4,
"item": [{
"id": "39a2da9d-dfff-5c6c-8117-43f7d97c992a",
"title": "Sky Arts HD",
"epg": "122",
"attribute": [
"hd"
],
"meta": {},
"category": [{
"code": "entertainment",
"name": "Entertainment"
}],
"media": [{
"kind": "image:logo",
"rendition": {
"default": {
"href": "https://tv.assets.pressassociation.io/703fd0ae-9879-5931-aabd-e28d924881b2.png"
}
}
}],
"subject": [{
"code": "channel:patv:1356",
"profile": "channel"
}]
},
{
"id": "5c56dba8-10dd-5b7e-aa9d-0317867ec2c9",
"title": "Sky Atlantic",
"epg": "808",
"attribute": [],
"meta": {},
"category": [{
"code": "entertainment",
"name": "Entertainment"
}],
"media": [{
"kind": "image:logo",
"rendition": {
"default": {
"href": "https://tv.assets.pressassociation.io/9815ca87-c213-5c76-8ccc-244f698b391b.png"
}
}
}],
"subject": [{
"code": "channel:patv:1628",
"profile": "channel"
}]
},
{
"id": "a09789e9-1ed1-5dc9-9bb0-843240810372",
"title": "Sky Atlantic +1",
"epg": "208",
"attribute": [],
"meta": {},
"category": [{
"code": "entertainment",
"name": "Entertainment"
}],
"media": [{
"kind": "image:logo",
"rendition": {
"default": {
"href": "https://tv.assets.pressassociation.io/9b7e7ce9-a080-5f64-b22a-e09bb62b5c92.png"
}
}
}],
"subject": [{
"code": "channel:patv:1757",
"profile": "channel"
}]
},
{
"id": "17430b79-ac54-55a9-8530-1b62247e9d9f",
"title": "Sky Atlantic HD",
"epg": "108",
"attribute": [
"hd"
],
"meta": {},
"category": [{
"code": "entertainment",
"name": "Entertainment"
}],
"media": [{
"kind": "image:logo",
"rendition": {
"default": {
"href": "https://tv.assets.pressassociation.io/9f1a0be2-570d-56cf-a0ed-07f8efcec6b1.png"
}
}
}],
"subject": [{
"code": "channel:patv:1629",
"profile": "channel"
}]
}
]
}
GET
Channel Detail
{{baseUrl}}/channel/:channelId
HEADERS
apikey
{{apiKey}}
QUERY PARAMS
channelId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/channel/:channelId");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "apikey: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/channel/:channelId" {:headers {:apikey "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/channel/:channelId"
headers = HTTP::Headers{
"apikey" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/channel/:channelId"),
Headers =
{
{ "apikey", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/channel/:channelId");
var request = new RestRequest("", Method.Get);
request.AddHeader("apikey", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/channel/:channelId"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("apikey", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/channel/:channelId HTTP/1.1
Apikey: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/channel/:channelId")
.setHeader("apikey", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/channel/:channelId"))
.header("apikey", "{{apiKey}}")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/channel/:channelId")
.get()
.addHeader("apikey", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/channel/:channelId")
.header("apikey", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/channel/:channelId');
xhr.setRequestHeader('apikey', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/channel/:channelId',
headers: {apikey: '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/channel/:channelId';
const options = {method: 'GET', headers: {apikey: '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/channel/:channelId',
method: 'GET',
headers: {
apikey: '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/channel/:channelId")
.get()
.addHeader("apikey", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/channel/:channelId',
headers: {
apikey: '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/channel/:channelId',
headers: {apikey: '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/channel/:channelId');
req.headers({
apikey: '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/channel/:channelId',
headers: {apikey: '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/channel/:channelId';
const options = {method: 'GET', headers: {apikey: '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"apikey": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/channel/:channelId"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/channel/:channelId" in
let headers = Header.add (Header.init ()) "apikey" "{{apiKey}}" in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/channel/:channelId",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"apikey: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/channel/:channelId', [
'headers' => [
'apikey' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/channel/:channelId');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders([
'apikey' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/channel/:channelId');
$request->setRequestMethod('GET');
$request->setHeaders([
'apikey' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("apikey", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/channel/:channelId' -Method GET -Headers $headers
$headers=@{}
$headers.Add("apikey", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/channel/:channelId' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'apikey': "{{apiKey}}" }
conn.request("GET", "/baseUrl/channel/:channelId", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/channel/:channelId"
headers = {"apikey": "{{apiKey}}"}
response = requests.get(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/channel/:channelId"
response <- VERB("GET", url, add_headers('apikey' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/channel/:channelId")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["apikey"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/channel/:channelId') do |req|
req.headers['apikey'] = '{{apiKey}}'
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/channel/:channelId";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("apikey", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/channel/:channelId \
--header 'apikey: {{apiKey}}'
http GET {{baseUrl}}/channel/:channelId \
apikey:'{{apiKey}}'
wget --quiet \
--method GET \
--header 'apikey: {{apiKey}}' \
--output-document \
- {{baseUrl}}/channel/:channelId
import Foundation
let headers = ["apikey": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/channel/:channelId")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"id": "04498b90-567b-56f0-a4ee-793c4d5d1f40",
"title": "BBC One HD",
"attribute": [
"hd"
],
"meta": {
"live-stream": "https://www.bbc.co.uk/tv/bbcone/live"
},
"category": [{
"code": "entertainment",
"name": "Entertainment"
}],
"media": [{
"kind": "image:logo",
"rendition": {
"default": {
"href": "https://tv.assets.pressassociation.io/ea24a3e3-bd81-53fe-9d30-b0cbcea05abf.png"
}
}
}],
"subject": [{
"code": "channel:patv:1609",
"profile": "channel"
},
{
"code": "channel:youview:1182",
"profile": "channel"
}
]
}
GET
Contributor Collection
{{baseUrl}}/contributor
HEADERS
apikey
{{apiKey}}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/contributor");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "apikey: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/contributor" {:headers {:apikey "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/contributor"
headers = HTTP::Headers{
"apikey" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/contributor"),
Headers =
{
{ "apikey", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/contributor");
var request = new RestRequest("", Method.Get);
request.AddHeader("apikey", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/contributor"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("apikey", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/contributor HTTP/1.1
Apikey: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/contributor")
.setHeader("apikey", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/contributor"))
.header("apikey", "{{apiKey}}")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/contributor")
.get()
.addHeader("apikey", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/contributor")
.header("apikey", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/contributor');
xhr.setRequestHeader('apikey', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/contributor',
headers: {apikey: '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/contributor';
const options = {method: 'GET', headers: {apikey: '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/contributor',
method: 'GET',
headers: {
apikey: '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/contributor")
.get()
.addHeader("apikey", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/contributor',
headers: {
apikey: '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/contributor',
headers: {apikey: '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/contributor');
req.headers({
apikey: '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/contributor',
headers: {apikey: '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/contributor';
const options = {method: 'GET', headers: {apikey: '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"apikey": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/contributor"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/contributor" in
let headers = Header.add (Header.init ()) "apikey" "{{apiKey}}" in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/contributor",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"apikey: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/contributor', [
'headers' => [
'apikey' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/contributor');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders([
'apikey' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/contributor');
$request->setRequestMethod('GET');
$request->setHeaders([
'apikey' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("apikey", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/contributor' -Method GET -Headers $headers
$headers=@{}
$headers.Add("apikey", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/contributor' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'apikey': "{{apiKey}}" }
conn.request("GET", "/baseUrl/contributor", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/contributor"
headers = {"apikey": "{{apiKey}}"}
response = requests.get(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/contributor"
response <- VERB("GET", url, add_headers('apikey' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/contributor")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["apikey"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/contributor') do |req|
req.headers['apikey'] = '{{apiKey}}'
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/contributor";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("apikey", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/contributor \
--header 'apikey: {{apiKey}}'
http GET {{baseUrl}}/contributor \
apikey:'{{apiKey}}'
wget --quiet \
--method GET \
--header 'apikey: {{apiKey}}' \
--output-document \
- {{baseUrl}}/contributor
import Foundation
let headers = ["apikey": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/contributor")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"hasNext": true,
"limit": 10,
"item": [{
"id": "3190b65d-a5f4-52a3-ab81-7e4c74d4b669",
"name": "Ned Michaels",
"meta": {},
"media": [],
"subject": [{
"code": "person:patv:219728",
"profile": "contributor"
}],
"createdAt": "2018-09-13T14:07:01.210Z",
"updatedAt": "2018-09-13T10:07:01.210Z"
},
{
"id": "ddae2b39-8eb6-5b42-a7dc-401a45342b60",
"name": "Adriano Falivene",
"meta": {},
"media": [],
"subject": [{
"code": "person:patv:219727",
"profile": "contributor"
}],
"createdAt": "2018-09-13T11:51:00.811Z",
"updatedAt": "2018-09-13T11:51:00.811Z"
},
{
"id": "e2f80721-76d7-5a88-81c0-c7ee595faa7d",
"name": "Luca Tanganelli",
"meta": {},
"media": [],
"subject": [{
"code": "person:patv:219726",
"profile": "contributor"
}],
"createdAt": "2018-09-13T11:50:40.808Z",
"updatedAt": "2018-09-13T12:50:40.808Z"
},
{
"id": "43cad8e3-3bd1-58fe-8fd5-f896bc2830d9",
"name": "Vincenzo De Michele",
"meta": {},
"media": [],
"subject": [{
"code": "person:patv:219725",
"profile": "contributor"
}],
"createdAt": "2018-09-13T11:50:20.778Z",
"updatedAt": "2018-09-13T13:50:20.778Z"
},
{
"id": "884b1aa4-c432-5d25-9fb1-5628a16f6006",
"name": "Giovanni Calcagno",
"meta": {},
"media": [],
"subject": [{
"code": "person:patv:219724",
"profile": "contributor"
}],
"createdAt": "2018-09-13T11:50:00.900Z",
"updatedAt": "2018-09-13T14:50:00.900Z"
},
{
"id": "823328c0-c60f-5d6c-9ced-9faa9ff7d93e",
"name": "Franco Salamon",
"meta": {},
"media": [],
"subject": [{
"code": "person:patv:219723",
"profile": "contributor"
}],
"createdAt": "2018-09-13T11:49:40.809Z",
"updatedAt": "2018-09-13T15:49:40.809Z"
},
{
"id": "a1476b32-e459-57a5-987e-431abaa7d4f7",
"name": "Giulio Beranek",
"meta": {},
"media": [],
"subject": [{
"code": "person:patv:219722",
"profile": "contributor"
}],
"createdAt": "2018-09-13T11:49:20.942Z",
"updatedAt": "2018-09-13T16:49:20.942Z"
},
{
"id": "eca6748f-7a64-5e91-b51c-e7faffeafda8",
"name": "Massimiliano Frateschi",
"meta": {},
"media": [],
"subject": [{
"code": "person:patv:219721",
"profile": "contributor"
}],
"createdAt": "2018-09-13T11:49:20.940Z",
"updatedAt": "2018-09-13T17:49:20.940Z"
},
{
"id": "f860d05f-49c5-5021-8ad1-6051d3dcb7cd",
"name": "Luca Marinelli",
"meta": {},
"media": [],
"subject": [{
"code": "person:patv:219720",
"profile": "contributor"
}],
"createdAt": "2018-09-13T11:48:20.978Z",
"updatedAt": "2018-09-13T18:48:20.978Z"
},
{
"id": "27ba4011-9bc8-5236-9161-d87737a28f44",
"name": "Ruben Alba",
"meta": {},
"media": [],
"subject": [{
"code": "person:patv:219719",
"profile": "contributor"
}],
"createdAt": "2018-09-13T10:00:40.717Z",
"updatedAt": "2018-09-13T19:00:40.717Z"
}
]
}
GET
Contributor Detail
{{baseUrl}}/contributor/:contributorId
HEADERS
apikey
{{apiKey}}
QUERY PARAMS
contributorId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/contributor/:contributorId");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "apikey: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/contributor/:contributorId" {:headers {:apikey "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/contributor/:contributorId"
headers = HTTP::Headers{
"apikey" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/contributor/:contributorId"),
Headers =
{
{ "apikey", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/contributor/:contributorId");
var request = new RestRequest("", Method.Get);
request.AddHeader("apikey", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/contributor/:contributorId"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("apikey", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/contributor/:contributorId HTTP/1.1
Apikey: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/contributor/:contributorId")
.setHeader("apikey", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/contributor/:contributorId"))
.header("apikey", "{{apiKey}}")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/contributor/:contributorId")
.get()
.addHeader("apikey", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/contributor/:contributorId")
.header("apikey", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/contributor/:contributorId');
xhr.setRequestHeader('apikey', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/contributor/:contributorId',
headers: {apikey: '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/contributor/:contributorId';
const options = {method: 'GET', headers: {apikey: '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/contributor/:contributorId',
method: 'GET',
headers: {
apikey: '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/contributor/:contributorId")
.get()
.addHeader("apikey", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/contributor/:contributorId',
headers: {
apikey: '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/contributor/:contributorId',
headers: {apikey: '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/contributor/:contributorId');
req.headers({
apikey: '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/contributor/:contributorId',
headers: {apikey: '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/contributor/:contributorId';
const options = {method: 'GET', headers: {apikey: '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"apikey": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/contributor/:contributorId"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/contributor/:contributorId" in
let headers = Header.add (Header.init ()) "apikey" "{{apiKey}}" in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/contributor/:contributorId",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"apikey: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/contributor/:contributorId', [
'headers' => [
'apikey' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/contributor/:contributorId');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders([
'apikey' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/contributor/:contributorId');
$request->setRequestMethod('GET');
$request->setHeaders([
'apikey' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("apikey", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/contributor/:contributorId' -Method GET -Headers $headers
$headers=@{}
$headers.Add("apikey", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/contributor/:contributorId' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'apikey': "{{apiKey}}" }
conn.request("GET", "/baseUrl/contributor/:contributorId", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/contributor/:contributorId"
headers = {"apikey": "{{apiKey}}"}
response = requests.get(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/contributor/:contributorId"
response <- VERB("GET", url, add_headers('apikey' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/contributor/:contributorId")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["apikey"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/contributor/:contributorId') do |req|
req.headers['apikey'] = '{{apiKey}}'
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/contributor/:contributorId";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("apikey", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/contributor/:contributorId \
--header 'apikey: {{apiKey}}'
http GET {{baseUrl}}/contributor/:contributorId \
apikey:'{{apiKey}}'
wget --quiet \
--method GET \
--header 'apikey: {{apiKey}}' \
--output-document \
- {{baseUrl}}/contributor/:contributorId
import Foundation
let headers = ["apikey": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/contributor/:contributorId")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"id": "e315bafc-c277-5e83-a496-050920771a32",
"name": "Stephen Merchant",
"dob": "1974-11-24",
"from": "Bristol",
"gender": "male",
"meta": {
"best-known-for": "Being Ricky Gervais' best friend, and sending Karl Pilkington around the world.",
"early-life": "Merchant was born in Bristol and attended Hanham High School. He graduated from University of Warwick with a first-class degree in Film and Literature.",
"career": "Before Merchant met Gervais, he was performing stand-up comedy. The pair worked together at London radio station XFM. Later, Merchant worked on a production course at the BBC, in which he enlisted Gervais' help for a short film called 'Seedy Boss' - which is when the idea of The Office arose, with both writing and directing the series. While The Office then enjoyed success Stateside, Gervais and Merchant also concentrated on BBC sitcom Extras. Then came Merchant's radio show for BBC 6 Music, The Steve Show. The comic is in the midst of nationwide tour of the UK, with a stop in New York, and continues to show up in movies and TV shows, including vehicles like An Idiot Abroad and Life's Too Short. ",
"quote": "\"Ricky's quite happy to provoke opinion, to blur the line between his acting and his stand-up persona. He likes to be a little bit provocative. He takes pleasure from that and he's good at it, and to him it feels challenging. It feels important. That doesn't concern me.\" ",
"trivia": ""
},
"media": [],
"subject": [{
"code": "person:patv:44703",
"profile": "contributor"
}],
"createdAt": "2018-07-18T16:20:19.008Z",
"updatedAt": "2018-07-18T16:20:19.008Z"
}
GET
Feature Collection
{{baseUrl}}/feature
HEADERS
apikey
{{apiKey}}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/feature");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "apikey: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/feature" {:headers {:apikey "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/feature"
headers = HTTP::Headers{
"apikey" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/feature"),
Headers =
{
{ "apikey", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/feature");
var request = new RestRequest("", Method.Get);
request.AddHeader("apikey", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/feature"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("apikey", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/feature HTTP/1.1
Apikey: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/feature")
.setHeader("apikey", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/feature"))
.header("apikey", "{{apiKey}}")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/feature")
.get()
.addHeader("apikey", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/feature")
.header("apikey", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/feature');
xhr.setRequestHeader('apikey', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/feature',
headers: {apikey: '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/feature';
const options = {method: 'GET', headers: {apikey: '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/feature',
method: 'GET',
headers: {
apikey: '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/feature")
.get()
.addHeader("apikey", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/feature',
headers: {
apikey: '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/feature',
headers: {apikey: '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/feature');
req.headers({
apikey: '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/feature',
headers: {apikey: '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/feature';
const options = {method: 'GET', headers: {apikey: '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"apikey": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/feature"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/feature" in
let headers = Header.add (Header.init ()) "apikey" "{{apiKey}}" in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/feature",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"apikey: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/feature', [
'headers' => [
'apikey' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/feature');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders([
'apikey' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/feature');
$request->setRequestMethod('GET');
$request->setHeaders([
'apikey' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("apikey", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/feature' -Method GET -Headers $headers
$headers=@{}
$headers.Add("apikey", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/feature' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'apikey': "{{apiKey}}" }
conn.request("GET", "/baseUrl/feature", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/feature"
headers = {"apikey": "{{apiKey}}"}
response = requests.get(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/feature"
response <- VERB("GET", url, add_headers('apikey' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/feature")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["apikey"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/feature') do |req|
req.headers['apikey'] = '{{apiKey}}'
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/feature";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("apikey", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/feature \
--header 'apikey: {{apiKey}}'
http GET {{baseUrl}}/feature \
apikey:'{{apiKey}}'
wget --quiet \
--method GET \
--header 'apikey: {{apiKey}}' \
--output-document \
- {{baseUrl}}/feature
import Foundation
let headers = ["apikey": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/feature")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"id": "98bfb7dc-2531-56b7-acb0-fdbe1b8c1e48",
"start": "2018-08-31T23:00:00.000Z",
"end": "2018-09-30T22:59:59.999Z",
"type": "monthly-all4",
"selection": [{
"available": "2018-09-08T00:00:00.000Z",
"summary": {
"long": "(Available now) Remember an Icelandic crime series called Case, which was available early in 2017? The Court is its prequel, set in the offices of a Reykjavik law firm. Lawyers Brynhildur and Hordur offer support to their colleague, Logi Traustason, when he becomes increasingly obsessed with solving a bizarre incident from his youth that led him to his incarceration for manslaughter. The Court, or Rettur as it's known in its native country, is Iceland's most acclaimed crime series ever, and after watching the first episode, you'll realise why."
},
"attribute": [],
"asset": {
"id": "b171d710-cfce-5cf0-835d-f5d99d7f3b49",
"type": "episode",
"certification": {},
"meta": {},
"category": [{
"code": "movie-drama",
"name": "Movie/Drama"
},
{
"code": "movie-drama:detective-thriller",
"name": "Detective/Thriller",
"dvb": "1100"
}
],
"attribute": [],
"summary": {
"short": "Icelandic crime drama, starring Magnús Jónsson"
},
"media": [],
"contributor": [],
"related": [{
"type": "series",
"id": "5c6f9b04-ed1f-5c64-b4da-44527804f319",
"title": "The Court",
"subject": [{
"code": "series:patv:266353",
"profile": "asset"
}],
"media": []
}],
"subject": [{
"code": "programme:patv:3071733",
"profile": "asset"
}],
"link": []
}
},
{
"available": "2018-09-08T00:00:00.000Z",
"summary": {
"long": "(From Friday) After Friday, when the internationally renowned VICE channel makes 900 hours of its award-winning programmes available via All 4, viewers really won't be able to say they can't find anything to watch anymore. Among the highlights we can expect Jamali Maddix's documentary series Hate Thy Neighbour, the Emmy-nominated travel series Gaycation, Black Market, which is a personal project for The Wire and Boardwalk Empire star Michael K Williams, and Needles and Pins, an in-depth look at the tattoo scene."
},
"attribute": [],
"asset": {
"id": "ef8805aa-ee59-5985-aa15-86b755c63e83",
"type": "episode",
"certification": {},
"meta": {},
"category": [{
"code": "social-political-issues-economics",
"name": "Social/Political Issues/Economics"
},
{
"code": "social-political-issues-economics:general",
"name": "General",
"dvb": "8000"
}
],
"attribute": [],
"summary": {
"short": "All4 on demand platform"
},
"contributor": [],
"media": [],
"related": [{
"type": "series",
"id": "5b1ff7e7-5cbc-5e80-a9b3-1b065d384ac9",
"title": "Vice",
"subject": [{
"code": "series:patv:266357",
"profile": "asset"
}],
"media": []
}],
"subject": [{
"code": "programme:patv:3071756",
"profile": "asset"
}],
"link": []
}
},
{
"available": "2018-09-01T00:00:00.000Z",
"summary": {},
"attribute": [],
"asset": {
"id": "bc0324e2-14d3-51fc-aff4-012ba9871ffb",
"type": "episode",
"title": "Box Set",
"certification": {},
"meta": {},
"category": [],
"attribute": [],
"summary": {
"short": "Drama following a group of young people in Chester",
"medium": "Drama following the lives and loves of young people in Chester",
"long": "Drama following the lives and loves of a group of teenagers and young adults in Chester"
},
"contributor": [],
"media": [],
"related": [{
"type": "series",
"id": "895826b7-cce2-52fb-91bd-46419c793880",
"title": "Hollyoaks",
"subject": [{
"code": "series:patv:798",
"profile": "asset"
}],
"media": []
}],
"subject": [{
"code": "programme:patv:3049329",
"profile": "asset"
}],
"link": []
}
}
]
}
GET
Feature Detail
{{baseUrl}}/feature/:featureId
HEADERS
apikey
{{apiKey}}
QUERY PARAMS
featureId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/feature/:featureId");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "apikey: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/feature/:featureId" {:headers {:apikey "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/feature/:featureId"
headers = HTTP::Headers{
"apikey" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/feature/:featureId"),
Headers =
{
{ "apikey", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/feature/:featureId");
var request = new RestRequest("", Method.Get);
request.AddHeader("apikey", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/feature/:featureId"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("apikey", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/feature/:featureId HTTP/1.1
Apikey: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/feature/:featureId")
.setHeader("apikey", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/feature/:featureId"))
.header("apikey", "{{apiKey}}")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/feature/:featureId")
.get()
.addHeader("apikey", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/feature/:featureId")
.header("apikey", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/feature/:featureId');
xhr.setRequestHeader('apikey', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/feature/:featureId',
headers: {apikey: '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/feature/:featureId';
const options = {method: 'GET', headers: {apikey: '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/feature/:featureId',
method: 'GET',
headers: {
apikey: '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/feature/:featureId")
.get()
.addHeader("apikey", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/feature/:featureId',
headers: {
apikey: '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/feature/:featureId',
headers: {apikey: '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/feature/:featureId');
req.headers({
apikey: '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/feature/:featureId',
headers: {apikey: '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/feature/:featureId';
const options = {method: 'GET', headers: {apikey: '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"apikey": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/feature/:featureId"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/feature/:featureId" in
let headers = Header.add (Header.init ()) "apikey" "{{apiKey}}" in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/feature/:featureId",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"apikey: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/feature/:featureId', [
'headers' => [
'apikey' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/feature/:featureId');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders([
'apikey' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/feature/:featureId');
$request->setRequestMethod('GET');
$request->setHeaders([
'apikey' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("apikey", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/feature/:featureId' -Method GET -Headers $headers
$headers=@{}
$headers.Add("apikey", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/feature/:featureId' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'apikey': "{{apiKey}}" }
conn.request("GET", "/baseUrl/feature/:featureId", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/feature/:featureId"
headers = {"apikey": "{{apiKey}}"}
response = requests.get(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/feature/:featureId"
response <- VERB("GET", url, add_headers('apikey' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/feature/:featureId")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["apikey"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/feature/:featureId') do |req|
req.headers['apikey'] = '{{apiKey}}'
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/feature/:featureId";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("apikey", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/feature/:featureId \
--header 'apikey: {{apiKey}}'
http GET {{baseUrl}}/feature/:featureId \
apikey:'{{apiKey}}'
wget --quiet \
--method GET \
--header 'apikey: {{apiKey}}' \
--output-document \
- {{baseUrl}}/feature/:featureId
import Foundation
let headers = ["apikey": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/feature/:featureId")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"id": "98bfb7dc-2531-56b7-acb0-fdbe1b8c1e48",
"start": "2018-08-31T23:00:00.000Z",
"end": "2018-09-30T22:59:59.999Z",
"type": "monthly-all4",
"selection": [{
"available": "2018-09-08T00:00:00.000Z",
"summary": {
"long": "(Available now) Remember an Icelandic crime series called Case, which was available early in 2017? The Court is its prequel, set in the offices of a Reykjavik law firm. Lawyers Brynhildur and Hordur offer support to their colleague, Logi Traustason, when he becomes increasingly obsessed with solving a bizarre incident from his youth that led him to his incarceration for manslaughter. The Court, or Rettur as it's known in its native country, is Iceland's most acclaimed crime series ever, and after watching the first episode, you'll realise why."
},
"attribute": [],
"asset": {
"id": "b171d710-cfce-5cf0-835d-f5d99d7f3b49",
"type": "episode",
"certification": {},
"meta": {},
"category": [{
"code": "movie-drama",
"name": "Movie/Drama"
},
{
"code": "movie-drama:detective-thriller",
"name": "Detective/Thriller",
"dvb": "1100"
}
],
"attribute": [],
"summary": {
"short": "Icelandic crime drama, starring Magnús Jónsson"
},
"contributor": [],
"media": [],
"related": [{
"type": "series",
"id": "5c6f9b04-ed1f-5c64-b4da-44527804f319",
"title": "The Court",
"subject": [{
"code": "series:patv:266353",
"profile": "asset"
}],
"media": []
}],
"subject": [{
"code": "programme:patv:3071733",
"profile": "asset"
}],
"link": []
}
},
{
"available": "2018-09-08T00:00:00.000Z",
"summary": {
"long": "(From Friday) After Friday, when the internationally renowned VICE channel makes 900 hours of its award-winning programmes available via All 4, viewers really won't be able to say they can't find anything to watch anymore. Among the highlights we can expect Jamali Maddix's documentary series Hate Thy Neighbour, the Emmy-nominated travel series Gaycation, Black Market, which is a personal project for The Wire and Boardwalk Empire star Michael K Williams, and Needles and Pins, an in-depth look at the tattoo scene."
},
"attribute": [],
"asset": {
"id": "ef8805aa-ee59-5985-aa15-86b755c63e83",
"type": "episode",
"certification": {},
"meta": {},
"category": [{
"code": "social-political-issues-economics",
"name": "Social/Political Issues/Economics"
},
{
"code": "social-political-issues-economics:general",
"name": "General",
"dvb": "8000"
}
],
"attribute": [],
"summary": {
"short": "All4 on demand platform"
},
"media": [],
"contributor": [],
"related": [{
"type": "series",
"id": "5b1ff7e7-5cbc-5e80-a9b3-1b065d384ac9",
"title": "Vice",
"subject": [{
"code": "series:patv:266357",
"profile": "asset"
}],
"media": []
}],
"subject": [{
"code": "programme:patv:3071756",
"profile": "asset"
}],
"link": []
}
},
{
"available": "2018-09-01T00:00:00.000Z",
"summary": {},
"attribute": [],
"asset": {
"id": "bc0324e2-14d3-51fc-aff4-012ba9871ffb",
"type": "episode",
"title": "Box Set",
"certification": {},
"meta": {},
"category": [],
"attribute": [],
"summary": {
"short": "Drama following a group of young people in Chester",
"medium": "Drama following the lives and loves of young people in Chester",
"long": "Drama following the lives and loves of a group of teenagers and young adults in Chester"
},
"media": [],
"contributor": [],
"related": [{
"type": "series",
"id": "895826b7-cce2-52fb-91bd-46419c793880",
"title": "Hollyoaks",
"subject": [{
"code": "series:patv:798",
"profile": "asset"
}],
"media": []
}],
"subject": [{
"code": "programme:patv:3049329",
"profile": "asset"
}],
"link": []
}
}
]
}
GET
Feature Type Collection
{{baseUrl}}/feature-type
HEADERS
apikey
{{apiKey}}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/feature-type");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "apikey: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/feature-type" {:headers {:apikey "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/feature-type"
headers = HTTP::Headers{
"apikey" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/feature-type"),
Headers =
{
{ "apikey", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/feature-type");
var request = new RestRequest("", Method.Get);
request.AddHeader("apikey", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/feature-type"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("apikey", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/feature-type HTTP/1.1
Apikey: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/feature-type")
.setHeader("apikey", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/feature-type"))
.header("apikey", "{{apiKey}}")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/feature-type")
.get()
.addHeader("apikey", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/feature-type")
.header("apikey", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/feature-type');
xhr.setRequestHeader('apikey', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/feature-type',
headers: {apikey: '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/feature-type';
const options = {method: 'GET', headers: {apikey: '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/feature-type',
method: 'GET',
headers: {
apikey: '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/feature-type")
.get()
.addHeader("apikey", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/feature-type',
headers: {
apikey: '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/feature-type',
headers: {apikey: '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/feature-type');
req.headers({
apikey: '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/feature-type',
headers: {apikey: '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/feature-type';
const options = {method: 'GET', headers: {apikey: '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"apikey": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/feature-type"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/feature-type" in
let headers = Header.add (Header.init ()) "apikey" "{{apiKey}}" in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/feature-type",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"apikey: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/feature-type', [
'headers' => [
'apikey' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/feature-type');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders([
'apikey' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/feature-type');
$request->setRequestMethod('GET');
$request->setHeaders([
'apikey' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("apikey", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/feature-type' -Method GET -Headers $headers
$headers=@{}
$headers.Add("apikey", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/feature-type' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'apikey': "{{apiKey}}" }
conn.request("GET", "/baseUrl/feature-type", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/feature-type"
headers = {"apikey": "{{apiKey}}"}
response = requests.get(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/feature-type"
response <- VERB("GET", url, add_headers('apikey' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/feature-type")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["apikey"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/feature-type') do |req|
req.headers['apikey'] = '{{apiKey}}'
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/feature-type";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("apikey", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/feature-type \
--header 'apikey: {{apiKey}}'
http GET {{baseUrl}}/feature-type \
apikey:'{{apiKey}}'
wget --quiet \
--method GET \
--header 'apikey: {{apiKey}}' \
--output-document \
- {{baseUrl}}/feature-type
import Foundation
let headers = ["apikey": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/feature-type")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"hasNext": false,
"total": 3,
"item": [{
"id": "15426f44-eabc-52f0-b208-8e19cbb1ab58",
"name": "Monthly Now TV Entertainment",
"namespace": "monthly-now-tv-entertainment"
},
{
"id": "1def4c60-ce2b-59cd-a6b1-885168370456",
"name": "Monthly Amazon Prime",
"namespace": "monthly-amazon-prime"
},
{
"id": "8a6ee958-efdb-5111-ac5c-f42afc5b5ec6",
"name": "Monthly All4",
"namespace": "monthly-all4"
}
]
}
GET
Platform Collection
{{baseUrl}}/platform
HEADERS
apikey
{{apiKey}}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/platform");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "apikey: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/platform" {:headers {:apikey "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/platform"
headers = HTTP::Headers{
"apikey" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/platform"),
Headers =
{
{ "apikey", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/platform");
var request = new RestRequest("", Method.Get);
request.AddHeader("apikey", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/platform"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("apikey", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/platform HTTP/1.1
Apikey: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/platform")
.setHeader("apikey", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/platform"))
.header("apikey", "{{apiKey}}")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/platform")
.get()
.addHeader("apikey", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/platform")
.header("apikey", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/platform');
xhr.setRequestHeader('apikey', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/platform',
headers: {apikey: '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/platform';
const options = {method: 'GET', headers: {apikey: '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/platform',
method: 'GET',
headers: {
apikey: '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/platform")
.get()
.addHeader("apikey", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/platform',
headers: {
apikey: '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/platform',
headers: {apikey: '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/platform');
req.headers({
apikey: '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/platform',
headers: {apikey: '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/platform';
const options = {method: 'GET', headers: {apikey: '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"apikey": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/platform"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/platform" in
let headers = Header.add (Header.init ()) "apikey" "{{apiKey}}" in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/platform",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"apikey: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/platform', [
'headers' => [
'apikey' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/platform');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders([
'apikey' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/platform');
$request->setRequestMethod('GET');
$request->setHeaders([
'apikey' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("apikey", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/platform' -Method GET -Headers $headers
$headers=@{}
$headers.Add("apikey", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/platform' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'apikey': "{{apiKey}}" }
conn.request("GET", "/baseUrl/platform", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/platform"
headers = {"apikey": "{{apiKey}}"}
response = requests.get(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/platform"
response <- VERB("GET", url, add_headers('apikey' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/platform")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["apikey"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/platform') do |req|
req.headers['apikey'] = '{{apiKey}}'
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/platform";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("apikey", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/platform \
--header 'apikey: {{apiKey}}'
http GET {{baseUrl}}/platform \
apikey:'{{apiKey}}'
wget --quiet \
--method GET \
--header 'apikey: {{apiKey}}' \
--output-document \
- {{baseUrl}}/platform
import Foundation
let headers = ["apikey": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/platform")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"hasNext": false,
"total": 13,
"item": [{
"id": "f55acb3b-a288-5ff7-962b-0da29811d046",
"title": "BT TV",
"subject": [{
"code": "platform:patv:11",
"profile": "platform"
}]
},
{
"id": "4f44db8b-c50b-5505-8f26-96d6893d5f68",
"title": "Freesat",
"subject": [{
"code": "platform:patv:4",
"profile": "platform"
}]
},
{
"id": "f00688ce-618e-52bd-ac1b-6829e20fc236",
"title": "Freeview",
"subject": [{
"code": "platform:patv:3",
"profile": "platform"
}]
},
{
"id": "33139c53-38e4-5e58-bb11-ecce4985b1fb",
"title": "International",
"subject": [{
"code": "platform:patv:14",
"profile": "platform"
}]
},
{
"id": "1a8b9f29-ac88-54d1-814c-4d51fbbc3986",
"title": "Irish Radio",
"subject": [{
"code": "platform:patv:13",
"profile": "platform"
}]
},
{
"id": "afff7fdb-4da4-5c49-8e06-94be28be1ffc",
"title": "Saorsat",
"subject": [{
"code": "platform:patv:9",
"profile": "platform"
}]
},
{
"id": "01c13cf5-d37a-5158-a614-592c37514ebc",
"title": "Saorview",
"subject": [{
"code": "platform:patv:8",
"profile": "platform"
}]
},
{
"id": "d3b26caa-8c7d-5f97-9eff-40fcf1a6f8d3",
"title": "Sky HD",
"subject": [{
"code": "platform:patv:1",
"profile": "platform"
}]
},
{
"id": "663c1c3c-e306-59fc-a51b-53faa97640fa",
"title": "Sky SD",
"subject": [{
"code": "platform:patv:2",
"profile": "platform"
}]
},
{
"id": "04330045-d657-56a4-92ca-3c3df585ccf5",
"title": "TalkTalk YouView",
"subject": [{
"code": "platform:patv:12",
"profile": "platform"
}]
},
{
"id": "972ff074-8146-554a-b0b9-9b20238f1553",
"title": "Virgin",
"subject": [{
"code": "platform:patv:5",
"profile": "platform"
}]
},
{
"id": "77167797-7f2e-5076-9eaf-8be13fc65ff3",
"title": "Virgin Media Ireland",
"subject": [{
"code": "platform:patv:7",
"profile": "platform"
}]
},
{
"id": "752f9903-b233-58f9-9b38-65f16f09a65b",
"title": "YouView",
"subject": [{
"code": "platform:patv:10",
"profile": "platform"
}]
}
]
}
GET
Platform Detail
{{baseUrl}}/platform/:platformId
HEADERS
apikey
{{apiKey}}
QUERY PARAMS
platformId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/platform/:platformId");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "apikey: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/platform/:platformId" {:headers {:apikey "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/platform/:platformId"
headers = HTTP::Headers{
"apikey" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/platform/:platformId"),
Headers =
{
{ "apikey", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/platform/:platformId");
var request = new RestRequest("", Method.Get);
request.AddHeader("apikey", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/platform/:platformId"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("apikey", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/platform/:platformId HTTP/1.1
Apikey: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/platform/:platformId")
.setHeader("apikey", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/platform/:platformId"))
.header("apikey", "{{apiKey}}")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/platform/:platformId")
.get()
.addHeader("apikey", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/platform/:platformId")
.header("apikey", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/platform/:platformId');
xhr.setRequestHeader('apikey', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/platform/:platformId',
headers: {apikey: '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/platform/:platformId';
const options = {method: 'GET', headers: {apikey: '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/platform/:platformId',
method: 'GET',
headers: {
apikey: '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/platform/:platformId")
.get()
.addHeader("apikey", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/platform/:platformId',
headers: {
apikey: '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/platform/:platformId',
headers: {apikey: '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/platform/:platformId');
req.headers({
apikey: '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/platform/:platformId',
headers: {apikey: '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/platform/:platformId';
const options = {method: 'GET', headers: {apikey: '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"apikey": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/platform/:platformId"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/platform/:platformId" in
let headers = Header.add (Header.init ()) "apikey" "{{apiKey}}" in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/platform/:platformId",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"apikey: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/platform/:platformId', [
'headers' => [
'apikey' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/platform/:platformId');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders([
'apikey' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/platform/:platformId');
$request->setRequestMethod('GET');
$request->setHeaders([
'apikey' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("apikey", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/platform/:platformId' -Method GET -Headers $headers
$headers=@{}
$headers.Add("apikey", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/platform/:platformId' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'apikey': "{{apiKey}}" }
conn.request("GET", "/baseUrl/platform/:platformId", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/platform/:platformId"
headers = {"apikey": "{{apiKey}}"}
response = requests.get(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/platform/:platformId"
response <- VERB("GET", url, add_headers('apikey' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/platform/:platformId")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["apikey"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/platform/:platformId') do |req|
req.headers['apikey'] = '{{apiKey}}'
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/platform/:platformId";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("apikey", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/platform/:platformId \
--header 'apikey: {{apiKey}}'
http GET {{baseUrl}}/platform/:platformId \
apikey:'{{apiKey}}'
wget --quiet \
--method GET \
--header 'apikey: {{apiKey}}' \
--output-document \
- {{baseUrl}}/platform/:platformId
import Foundation
let headers = ["apikey": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/platform/:platformId")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"id": "d3b26caa-8c7d-5f97-9eff-40fcf1a6f8d3",
"title": "Sky HD",
"subject": [{
"code": "platform:patv:1",
"profile": "platform"
}]
}
GET
Platform Region Collection
{{baseUrl}}/platform/:platformId/region
HEADERS
apikey
{{apiKey}}
QUERY PARAMS
platformId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/platform/:platformId/region");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "apikey: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/platform/:platformId/region" {:headers {:apikey "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/platform/:platformId/region"
headers = HTTP::Headers{
"apikey" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/platform/:platformId/region"),
Headers =
{
{ "apikey", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/platform/:platformId/region");
var request = new RestRequest("", Method.Get);
request.AddHeader("apikey", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/platform/:platformId/region"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("apikey", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/platform/:platformId/region HTTP/1.1
Apikey: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/platform/:platformId/region")
.setHeader("apikey", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/platform/:platformId/region"))
.header("apikey", "{{apiKey}}")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/platform/:platformId/region")
.get()
.addHeader("apikey", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/platform/:platformId/region")
.header("apikey", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/platform/:platformId/region');
xhr.setRequestHeader('apikey', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/platform/:platformId/region',
headers: {apikey: '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/platform/:platformId/region';
const options = {method: 'GET', headers: {apikey: '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/platform/:platformId/region',
method: 'GET',
headers: {
apikey: '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/platform/:platformId/region")
.get()
.addHeader("apikey", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/platform/:platformId/region',
headers: {
apikey: '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/platform/:platformId/region',
headers: {apikey: '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/platform/:platformId/region');
req.headers({
apikey: '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/platform/:platformId/region',
headers: {apikey: '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/platform/:platformId/region';
const options = {method: 'GET', headers: {apikey: '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"apikey": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/platform/:platformId/region"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/platform/:platformId/region" in
let headers = Header.add (Header.init ()) "apikey" "{{apiKey}}" in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/platform/:platformId/region",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"apikey: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/platform/:platformId/region', [
'headers' => [
'apikey' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/platform/:platformId/region');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders([
'apikey' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/platform/:platformId/region');
$request->setRequestMethod('GET');
$request->setHeaders([
'apikey' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("apikey", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/platform/:platformId/region' -Method GET -Headers $headers
$headers=@{}
$headers.Add("apikey", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/platform/:platformId/region' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'apikey': "{{apiKey}}" }
conn.request("GET", "/baseUrl/platform/:platformId/region", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/platform/:platformId/region"
headers = {"apikey": "{{apiKey}}"}
response = requests.get(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/platform/:platformId/region"
response <- VERB("GET", url, add_headers('apikey' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/platform/:platformId/region")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["apikey"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/platform/:platformId/region') do |req|
req.headers['apikey'] = '{{apiKey}}'
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/platform/:platformId/region";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("apikey", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/platform/:platformId/region \
--header 'apikey: {{apiKey}}'
http GET {{baseUrl}}/platform/:platformId/region \
apikey:'{{apiKey}}'
wget --quiet \
--method GET \
--header 'apikey: {{apiKey}}' \
--output-document \
- {{baseUrl}}/platform/:platformId/region
import Foundation
let headers = ["apikey": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/platform/:platformId/region")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"hasNext": false,
"total": 3,
"item": [{
"id": "b7ca55cd-8528-5422-bb04-5c14491a3274",
"title": "Anglia",
"subject": [{
"code": "region:patv:1",
"profile": "region"
}]
},
{
"id": "de884ff9-8ab7-5edc-a16a-7f4ad9dbf166",
"title": "Cambridgeshire",
"subject": [{
"code": "region:patv:2",
"profile": "region"
}]
},
{
"id": "b21a3fcd-36cd-5d12-8536-52cdc9ef63b4",
"title": "Channel Islands",
"subject": [{
"code": "region:patv:3",
"profile": "region"
}]
}
]
}
GET
Schedule Collection
{{baseUrl}}/schedule
HEADERS
apikey
{{apiKey}}
QUERY PARAMS
channelId
start
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/schedule?channelId=&start=");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "apikey: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/schedule" {:headers {:apikey "{{apiKey}}"}
:query-params {:channelId ""
:start ""}})
require "http/client"
url = "{{baseUrl}}/schedule?channelId=&start="
headers = HTTP::Headers{
"apikey" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/schedule?channelId=&start="),
Headers =
{
{ "apikey", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/schedule?channelId=&start=");
var request = new RestRequest("", Method.Get);
request.AddHeader("apikey", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/schedule?channelId=&start="
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("apikey", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/schedule?channelId=&start= HTTP/1.1
Apikey: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/schedule?channelId=&start=")
.setHeader("apikey", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/schedule?channelId=&start="))
.header("apikey", "{{apiKey}}")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/schedule?channelId=&start=")
.get()
.addHeader("apikey", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/schedule?channelId=&start=")
.header("apikey", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/schedule?channelId=&start=');
xhr.setRequestHeader('apikey', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/schedule',
params: {channelId: '', start: ''},
headers: {apikey: '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/schedule?channelId=&start=';
const options = {method: 'GET', headers: {apikey: '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/schedule?channelId=&start=',
method: 'GET',
headers: {
apikey: '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/schedule?channelId=&start=")
.get()
.addHeader("apikey", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/schedule?channelId=&start=',
headers: {
apikey: '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/schedule',
qs: {channelId: '', start: ''},
headers: {apikey: '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/schedule');
req.query({
channelId: '',
start: ''
});
req.headers({
apikey: '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/schedule',
params: {channelId: '', start: ''},
headers: {apikey: '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/schedule?channelId=&start=';
const options = {method: 'GET', headers: {apikey: '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"apikey": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/schedule?channelId=&start="]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/schedule?channelId=&start=" in
let headers = Header.add (Header.init ()) "apikey" "{{apiKey}}" in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/schedule?channelId=&start=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"apikey: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/schedule?channelId=&start=', [
'headers' => [
'apikey' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/schedule');
$request->setMethod(HTTP_METH_GET);
$request->setQueryData([
'channelId' => '',
'start' => ''
]);
$request->setHeaders([
'apikey' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/schedule');
$request->setRequestMethod('GET');
$request->setQuery(new http\QueryString([
'channelId' => '',
'start' => ''
]));
$request->setHeaders([
'apikey' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("apikey", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/schedule?channelId=&start=' -Method GET -Headers $headers
$headers=@{}
$headers.Add("apikey", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/schedule?channelId=&start=' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'apikey': "{{apiKey}}" }
conn.request("GET", "/baseUrl/schedule?channelId=&start=", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/schedule"
querystring = {"channelId":"","start":""}
headers = {"apikey": "{{apiKey}}"}
response = requests.get(url, headers=headers, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/schedule"
queryString <- list(
channelId = "",
start = ""
)
response <- VERB("GET", url, query = queryString, add_headers('apikey' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/schedule?channelId=&start=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["apikey"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/schedule') do |req|
req.headers['apikey'] = '{{apiKey}}'
req.params['channelId'] = ''
req.params['start'] = ''
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/schedule";
let querystring = [
("channelId", ""),
("start", ""),
];
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("apikey", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.query(&querystring)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url '{{baseUrl}}/schedule?channelId=&start=' \
--header 'apikey: {{apiKey}}'
http GET '{{baseUrl}}/schedule?channelId=&start=' \
apikey:'{{apiKey}}'
wget --quiet \
--method GET \
--header 'apikey: {{apiKey}}' \
--output-document \
- '{{baseUrl}}/schedule?channelId=&start='
import Foundation
let headers = ["apikey": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/schedule?channelId=&start=")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"hasNext": false,
"total": 3,
"item": [{
"id": "8d37623a-a2c5-429a-ab1b-a2fd32a99830",
"title": "Weather for the Week Ahead",
"dateTime": "2018-09-11T00:25:00.000Z",
"duration": 5,
"certification": {},
"meta": {},
"attribute": [
"subtitles",
"16x9",
"hd"
],
"summary": {},
"asset": {
"id": "fcb7f5ac-8745-5644-a4a8-854eecf9ed7f",
"type": "episode",
"certification": {},
"meta": {},
"category": [{
"code": "news-current-affairs",
"name": "News/Current Affairs"
},
{
"code": "news-current-affairs:weather",
"name": "Weather",
"dvb": "2F03"
}
],
"attribute": [],
"summary": {},
"media": [],
"related": [{
"type": "series",
"id": "6953ebec-f877-5881-8dae-33329dc7dab2",
"title": "Weather for the Week Ahead",
"subject": [{
"code": "series:patv:12838",
"profile": "asset"
}],
"media": [{
"kind": "image:asset",
"copyright": "BBC iPlayer",
"rendition": {
"default": {
"href": "https://tv.assets.pressassociation.io/f6edde30-7a58-57f7-a186-1c96bea11b9d.jpg"
}
},
"expiry": "2018-09-18T00:00:00.000Z"
}]
}],
"subject": [{
"code": "programme:patv:3070067",
"profile": "asset"
}],
"link": []
}
},
{
"id": "5b3249e1-766d-4e6e-ad82-043f993630b7",
"title": "BBC News",
"dateTime": "2018-09-11T00:30:00.000Z",
"duration": 270,
"certification": {},
"meta": {},
"attribute": [
"subtitles",
"16x9",
"hd"
],
"summary": {},
"asset": {
"id": "89e90a81-01bd-5837-8166-8d850963e430",
"type": "episode",
"title": "10/09/2018",
"certification": {},
"meta": {},
"category": [],
"attribute": [],
"summary": {},
"contributor": [],
"media": [],
"related": [{
"type": "series",
"id": "6725dbee-4db4-50c6-b3cc-d5162ca8a231",
"title": "BBC News",
"subject": [{
"code": "series:patv:212735",
"profile": "asset"
}],
"media": [{
"kind": "image:asset",
"copyright": "BBC",
"rendition": {
"default": {
"href": "https://tv.assets.pressassociation.io/36e7ad3d-6ab6-5ae6-b911-5e2c333e1478.jpg"
}
},
"expiry": "2018-09-18T00:00:00.000Z"
}]
}],
"subject": [{
"code": "programme:patv:3074741",
"profile": "asset"
}],
"link": []
}
},
{
"id": "c30669b1-056b-4bf5-a8a2-3fe75355b038",
"title": "Breakfast",
"dateTime": "2018-09-11T05:00:00.000Z",
"duration": 195,
"certification": {},
"meta": {},
"attribute": [
"subtitles",
"16x9",
"interactive-content",
"hd"
],
"summary": {
"short": "Presented by Dan Walker and Naga Munchetty",
"medium": "A round-up of national and international news, plus current affairs, arts and entertainment, and weather. Presented by Dan Walker and Naga Munchetty"
},
"asset": {
"id": "62ab7c29-311e-56ef-8584-06a5fb134a47",
"type": "episode",
"title": "11/09/2018",
"certification": {},
"meta": {},
"category": [],
"attribute": [],
"summary": {
"short": "Presented by Dan Walker and Naga Munchetty",
"medium": "A round-up of national and international news, plus current affairs, arts and entertainment, and weather. Presented by Dan Walker and Naga Munchetty"
},
"contributor": [],
"media": [],
"related": [{
"type": "series",
"id": "0cb4dfe4-9fb4-5ccc-85fc-f7794b5267dd",
"title": "Breakfast",
"subject": [{
"code": "series:patv:15041",
"profile": "asset"
}],
"media": [{
"kind": "image:asset",
"copyright": "BBC",
"rendition": {
"default": {
"href": "https://tv.assets.pressassociation.io/b9bc4659-ce07-55ac-894d-66e2bfe95c9a.jpg"
}
},
"expiry": "2018-09-18T00:00:00.000Z"
}]
}],
"subject": [{
"code": "programme:patv:3069479",
"profile": "asset"
}],
"link": []
}
}
]
}