Idempotently update up to 100 ratings or title interactions
curl --request POST \
--url https://punchplay.tv/api/platform/v1/sync/ratings \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"items": [
{
"tmdb_id": 2,
"client_item_id": "<string>",
"season": 1,
"episode": 1,
"rating": 5,
"is_favourite": true,
"want_to_watch": true
}
]
}
'import requests
url = "https://punchplay.tv/api/platform/v1/sync/ratings"
payload = { "items": [
{
"tmdb_id": 2,
"client_item_id": "<string>",
"season": 1,
"episode": 1,
"rating": 5,
"is_favourite": True,
"want_to_watch": True
}
] }
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
items: [
{
tmdb_id: 2,
client_item_id: '<string>',
season: 1,
episode: 1,
rating: 5,
is_favourite: true,
want_to_watch: true
}
]
})
};
fetch('https://punchplay.tv/api/platform/v1/sync/ratings', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://punchplay.tv/api/platform/v1/sync/ratings",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'items' => [
[
'tmdb_id' => 2,
'client_item_id' => '<string>',
'season' => 1,
'episode' => 1,
'rating' => 5,
'is_favourite' => true,
'want_to_watch' => true
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Idempotency-Key: <idempotency-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://punchplay.tv/api/platform/v1/sync/ratings"
payload := strings.NewReader("{\n \"items\": [\n {\n \"tmdb_id\": 2,\n \"client_item_id\": \"<string>\",\n \"season\": 1,\n \"episode\": 1,\n \"rating\": 5,\n \"is_favourite\": true,\n \"want_to_watch\": true\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://punchplay.tv/api/platform/v1/sync/ratings")
.header("Idempotency-Key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"items\": [\n {\n \"tmdb_id\": 2,\n \"client_item_id\": \"<string>\",\n \"season\": 1,\n \"episode\": 1,\n \"rating\": 5,\n \"is_favourite\": true,\n \"want_to_watch\": true\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://punchplay.tv/api/platform/v1/sync/ratings")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"items\": [\n {\n \"tmdb_id\": 2,\n \"client_item_id\": \"<string>\",\n \"season\": 1,\n \"episode\": 1,\n \"rating\": 5,\n \"is_favourite\": true,\n \"want_to_watch\": true\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"results": [
{
"client_item_id": "<string>",
"index": 1,
"id": 2,
"error": "<string>"
}
],
"inserted": 1,
"updated": 1,
"removed": 1,
"skipped": 1,
"invalid": 1,
"idempotency_replayed": true
}{
"error": "<string>",
"message": "<string>",
"request_id": "<string>",
"required_scope": "<string>"
}{
"error": "<string>",
"message": "<string>",
"request_id": "<string>",
"required_scope": "<string>"
}{
"error": "<string>",
"message": "<string>",
"request_id": "<string>",
"required_scope": "<string>"
}{
"error": "<string>",
"message": "<string>",
"request_id": "<string>",
"required_scope": "<string>"
}{
"error": "<string>",
"message": "<string>",
"request_id": "<string>",
"required_scope": "<string>"
}{
"error": "<string>",
"message": "<string>",
"request_id": "<string>",
"required_scope": "<string>"
}{
"error": "<string>",
"message": "<string>",
"request_id": "<string>",
"required_scope": "<string>"
}Sync
Idempotently update up to 100 ratings or title interactions
POST
/
api
/
platform
/
v1
/
sync
/
ratings
Idempotently update up to 100 ratings or title interactions
curl --request POST \
--url https://punchplay.tv/api/platform/v1/sync/ratings \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"items": [
{
"tmdb_id": 2,
"client_item_id": "<string>",
"season": 1,
"episode": 1,
"rating": 5,
"is_favourite": true,
"want_to_watch": true
}
]
}
'import requests
url = "https://punchplay.tv/api/platform/v1/sync/ratings"
payload = { "items": [
{
"tmdb_id": 2,
"client_item_id": "<string>",
"season": 1,
"episode": 1,
"rating": 5,
"is_favourite": True,
"want_to_watch": True
}
] }
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
items: [
{
tmdb_id: 2,
client_item_id: '<string>',
season: 1,
episode: 1,
rating: 5,
is_favourite: true,
want_to_watch: true
}
]
})
};
fetch('https://punchplay.tv/api/platform/v1/sync/ratings', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://punchplay.tv/api/platform/v1/sync/ratings",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'items' => [
[
'tmdb_id' => 2,
'client_item_id' => '<string>',
'season' => 1,
'episode' => 1,
'rating' => 5,
'is_favourite' => true,
'want_to_watch' => true
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Idempotency-Key: <idempotency-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://punchplay.tv/api/platform/v1/sync/ratings"
payload := strings.NewReader("{\n \"items\": [\n {\n \"tmdb_id\": 2,\n \"client_item_id\": \"<string>\",\n \"season\": 1,\n \"episode\": 1,\n \"rating\": 5,\n \"is_favourite\": true,\n \"want_to_watch\": true\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://punchplay.tv/api/platform/v1/sync/ratings")
.header("Idempotency-Key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"items\": [\n {\n \"tmdb_id\": 2,\n \"client_item_id\": \"<string>\",\n \"season\": 1,\n \"episode\": 1,\n \"rating\": 5,\n \"is_favourite\": true,\n \"want_to_watch\": true\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://punchplay.tv/api/platform/v1/sync/ratings")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"items\": [\n {\n \"tmdb_id\": 2,\n \"client_item_id\": \"<string>\",\n \"season\": 1,\n \"episode\": 1,\n \"rating\": 5,\n \"is_favourite\": true,\n \"want_to_watch\": true\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"results": [
{
"client_item_id": "<string>",
"index": 1,
"id": 2,
"error": "<string>"
}
],
"inserted": 1,
"updated": 1,
"removed": 1,
"skipped": 1,
"invalid": 1,
"idempotency_replayed": true
}{
"error": "<string>",
"message": "<string>",
"request_id": "<string>",
"required_scope": "<string>"
}{
"error": "<string>",
"message": "<string>",
"request_id": "<string>",
"required_scope": "<string>"
}{
"error": "<string>",
"message": "<string>",
"request_id": "<string>",
"required_scope": "<string>"
}{
"error": "<string>",
"message": "<string>",
"request_id": "<string>",
"required_scope": "<string>"
}{
"error": "<string>",
"message": "<string>",
"request_id": "<string>",
"required_scope": "<string>"
}{
"error": "<string>",
"message": "<string>",
"request_id": "<string>",
"required_scope": "<string>"
}{
"error": "<string>",
"message": "<string>",
"request_id": "<string>",
"required_scope": "<string>"
}Authorizations
The access token received from the authorization server in the OAuth 2.0 flow.
Headers
Required string length:
8 - 200Body
application/json
Required array length:
1 - 100 elementsShow child attributes
Show child attributes
Idempotently insert up to 100 history items
Previous
Idempotently add or remove up to 100 watchlist items
Next
⌘I