Hello,
I am using API for 1.7.x and adding media to layout without problem.
But in 1.8 API adding media system completely change. You are using playlist now.
Campaing have Layout
Layout have Regions
Regions have (multiple) playlists
There is a method for adding media to playlist, (/playlist/library/assign/{playlistId})) it works if you know playlist id. But the problem is how to now playlist id?
If you get Layout list it will list all layouts but wont say which playlist and regions the layout connected to.
How get correct playlistid from Layout name?
THE SOLUTION:
If you use with parameter, it will give you all connected playlist and regions:
/api/layout?layout=&embed=regions,playlists
{
"layoutId": 12,
"ownerId": 2,
"campaignId": 13,
"backgroundImageId": null,
"schemaVersion": 3,
"layout": "16 AĞUSTOS DHU",
"description": null,
"backgroundColor": "#000",
"createdDt": "2017-08-16 10:59:48",
"modifiedDt": "2018-01-24 16:45:56",
"status": 1,
"retired": 0,
"backgroundzIndex": 0,
"width": 1920,
"height": 1080,
"displayOrder": null,
"duration": 2045,
"statusMessage": null,
"regions": [
{
"regionId": 21,
"layoutId": 12,
"ownerId": 2,
"name": "fds-1",
"width": "1853.0000",
"height": "1070.0000",
"top": "12.0000",
"left": "96.0000",
"zIndex": 0,
"playlists": [
{
"playlistId": 21,
"ownerId": 2,
"name": "fds-1",
"tags": [],
"widgets": [],
"permissions": [],
"displayOrder": "1"
}
],
"regionOptions": [
{
"regionId": 21,
"option": "loop",
"value": "0"
},
{
"regionId": 21,
"option": "transitionDirection",
"value": "N"
},
{
"regionId": 21,
"option": "transitionDuration",
"value": null
},
{
"regionId": 21,
"option": "transitionType",
"value": null
}
],
"permissions": [
{
"permissionId": "329",
"entityId": "7",
"groupId": "2",
"objectId": 21,
"isUser": null,
"entity": "Xibo\\Entity\\Region",
"objectIdString": null,
"group": null,
"view": "1",
"edit": "0",
"delete": "0",
"modifyPermissions": null
}
],
"displayOrder": null,
"duration": "2045",
"tempId": null
}
],
"tags": null,
"permissions": [],
"campaigns": [],
"owner": "dogus",
"groupsWithPermissions": "Everyone"
},
Thanks
Michael