API : Assigning layouts to campaign


#1

Hey,

I’m trying to assign a layout to a campaign using the API

I’ve made it in postman and it worked :


But now I want to make that same call but in PHP, (NOT WITH POSTMAN), but I can’t find the correct syntax.
Same for unsassign, there is no parameters to enter the array of layouts to unassign:image


Anyone knows the syntax to assign / unassign in PHP ? (the one in the picture above didn’t work)


#2

Which branch of the oauth2 do you have please? It looks to me like master ie release 1.1 with 1.8 CMS?

We made severe changes to the oauth2 php api library for 2.0 - which technically is a beta release from develop branch and that’s what version 2 cms uses as well.

Regarding the call you’ve mentioned, there are also major changes there, that’s how it looks like in the updated version:
https://github.com/xibosignage/oauth2-xibo-cms/blob/develop/src/Entity/XiboCampaign.php#L157

Due to the fact that the oauth league client and php requirement also had to be updated, as well as number of changes needed in the core CMS (mostly of phpunit tests) those changes were not included in the php library release for 1.8 CMS series.


#3

I’m in 1.8.
I used that link : https://github.com/xibosignage/oauth2-xibo-cms and clicked download.
We are planning on upgrading our API to 2.0 as soon as possible…

Im the mean time, I’m sorry for being insistent, but I really need to know how to do this : API - Troubles trying to get the ID of a playlist, region, and widget


#4

It would be best to use v2 CMS and oauth

There are differences in what we receive from API in those versions, hence why it’s best to use both CMS and php api library in the same series.

That’s also answer to your other topic really, I will reply to you there as well.


#5

Okay great, thanks for the fast replies