Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
has anyone succedd with a POST/PUT towards NPrinting API with a request body?
I can start tasks and do other stuff that doesn't require a request body, but f.ex. PUT /users/{id}/groups does not work.
I have all other stuff working (im quite sure at least) like Origin, X-HTTP-Method-Override, Cookie but I receive a 400 - "Malformed parameters in body" when i try the following in the request body field in QvRestConnector;
{
"groupIds": "guid-of-a-group"
}
Have tried both directly in Rest Connector setup, with a "with connection" including a replace(vBodyString,'"',chr(34) & chr(34)) and postman.
Am i doing something wrong or is the API just not working as expected?
Running Feb-18 release btw.
Br Johan
Solved!
It worked with the following request body;
["my_group_guid"]
Used Chrome Dev Tools and investigated how WC did it.
probably need to replace ':' aswell. I usually just URL encode everything.
I get the same error code when using postman
ah sorry missed that bit.
Have you tried using the example provided by the devs?
Im trying the POST example for update of a user in the guide in the following thread How to use Qlik NPrinting APIs inside a Qlik Sense load script
Well the example to update a user works fine so its should just be a matter on how to "format" the request body for the https://help.qlik.com/en-US/nprinting/April2018/APIs/NP+API/index.html#usersIdGroupsPut endpoint.
It just states a required request body of "groupIds".
I have, in POSTMAN, tried the following;
{
"groupIds": "an_existing_group_GUID"
}
without any luck
so u are sure the group ID exists and the user u put in also exists?
ifso I have no clue why this wouldn't work. Sofar I only use the API for checking publish tasks and running them.(I fire my NPrinting reporting within Sense to make sure the app reload was finished correctly)
yes, im sure. I've checked them both with the API and in Web Console.
Thanks for your effort - guess I have to start a case at Qlik Support...
No problem, goodluck getting this to work.
Solved!
It worked with the following request body;
["my_group_guid"]
Used Chrome Dev Tools and investigated how WC did it.