Hi,
I am able to connect xibo api with oauth 1.0. I can use LayoutList method to take layoutlist or use any method without problem if I use querystring (url parameters) working examplehttp://localhost:81/xibo/services.php?service=rest&response=xml&method=LayoutList.
but I need to use LayoutRegionLibraryAdd method which can take array of mediaIds with MediaList parameter. working example:http://localhost:81/xibo/services.php?service=rest&method=LayoutRegionLibraryAdd&layoutId=461®ionId=550d2cf750528&mediaList=776&response=xml
but both working examples work with querstring url parameters, there is nothing in body. If you need to send more than one mediaList you should use MediaList[0]=776&MediaList[1]=777&MediaList[n]=xxx
As I see sending all parameters in querystring has some limitations, so need to send data with body, but I cannot.
I use Chrome Postman App to test api, I tried raw, text, json, raw part
{
“service”:“rest”,
“method”:“LayoutRegionLibraryAdd”,
“layoutId”:“459”,
“response”:“json”,
“regionId”:“550a087f6e988”,
“mediaList”:“777”
}
**but the api service returns a xmds response (200), whatever you write in raw (body part) ** This response is same as http://localhost:81/xibo/services.php (the url without url parameters).
My question is does api accept data in body part of just querystring? And if it accepts what did I wrong? Is there a working sample of .net application to connect and send data to xibo api ?
Dear Alex,
Thank you for your quick and clear answer.
I find the pyton code before, and understand that is the part but cannot find how to do in .net.
What string we should have before urlencode, is this correct?: and what should we do multiple mediaIds?
That would depend on the functionality in .net (which I don’t use I’m afraid).
In Python, the urlencode function takes the dictionary we pass it (ie key: value) and converts it to that string. So presumably there’s an equivalent .net function, otherwise you’d have to build the string to send as the body yourself.
Ok, I see. If you can help me, it would be great.
Lets forget about .net and simulate this from Postman app (which is chrome extension, and test api calls)
I am not sure which format should I use.
This screen shot shows; if you write all parameters to querystring it works.I can use querysting but as you know it has character limit, so I have lots of media to add so querystring is not usable if you send lots of data.
But if you use body, as screen shot, it always return “XMDS” (same as you write the services.php url without any parameter, it never reads paramater from body)