Creates a new share to a given target

v1
post
/1/vod/channel/{channel}/share

Creates a share, returns a share having id in order to build this url : https://api.vod2.infomaniak.com/res/embed/{{ ID }}.html

Path parameters

channel
requiredstring
Examples:example

Body Parameters

application/json
targetstring

uuid of media or playlist

Examples:1jhvl2uqacxj5
playerstring

uuid of player

Examples:1jhvl2uqacxj5
encodingstring

uuid of encoding

Examples:1jhvl2uqacxj5

Response Body

application/json
resultstring
Examples:success
idstring
Examples:1jhvl2uqa5v8a
target_typestring
Examples:maria
target_idstring
Examples:maria
commentstring
Examples:maria
timestampstring
Examples:maria
validitynumber

In seconds

Examples:42
created_atdatetime
Examples:2021-09-15T14:23:41+00:00
updated_atdatetime
Examples:2021-09-15T14:23:41+00:00
deleted_atdatetime
Examples:2021-09-15T14:23:41+00:00
linksarrayof[object Object]

Example request

                <?php
use GuzzleHttp\Client;

$client = new Client();
$headers = [
	'Authorization' => 'Bearer YOUR-TOKEN-HERE',
	'Content-Type' => 'application/json'
];

$body = '{
    "target": "1jhvl2uqacxj5",
    "player": "1jhvl2uqacxj5",
    "encoding": "1jhvl2uqacxj5"
}';

$request = new Request('POST', 'https://api.infomaniak.com/1/vod/channel/{channel}/share', $headers, $body);
$res = $client->sendAsync($request)->wait();
echo $res->getBody();
            

Example response

application/json
                
                    
{
"result":"success",
"id":"1jhvl2uqa5v8a",
"target_type":"maria",
"target_id":"maria",
"comment":"maria",
"timestamp":"maria",
"validity":42,
"created_at":"2021-09-15T14:23:41+00:00",
"updated_at":"2021-09-15T14:23:41+00:00",
"deleted_at":"2021-09-15T14:23:41+00:00",
"links":[
{
"description":"Link",
"type":"object",
"properties":{
"url":{
"format":"string",
"type":"string",
"example":"https://infomaniak.com"
},
"mimetype":{
"format":"string",
"type":"string",
"example":"maria"
},
"size":{
"format":"int32",
"type":"number",
"example":42
},
"size_human_readable":{
"format":"string",
"type":"string",
"example":"maria"
}
}
}
]
}