Qlik Community

Ask a Question

Qlik NPrinting Discussions

Discussion Board for collaboration on Qlik NPrinting.

Announcements
QlikWorld starts MONDAY! last chance to register is now ! REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
blaise
Partner
Partner

NPrinting API - POST/PUT with request body not working

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

1 Solution

Accepted Solutions
blaise
Partner
Partner
Author

Solved!

It worked with the following request body;

["my_group_guid"]

Used Chrome Dev Tools and investigated how WC did it.

View solution in original post

11 Replies
bramkn
Partner
Partner

probably need to replace ':' aswell. I usually just URL encode everything.

blaise
Partner
Partner
Author

I get the same error code when using postman

bramkn
Partner
Partner

ah sorry missed that bit.

Have you tried using the example provided by the devs?

blaise
Partner
Partner
Author

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

blaise
Partner
Partner
Author

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

bramkn
Partner
Partner

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)

blaise
Partner
Partner
Author

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...

bramkn
Partner
Partner

No problem, goodluck getting this to work.

blaise
Partner
Partner
Author

Solved!

It worked with the following request body;

["my_group_guid"]

Used Chrome Dev Tools and investigated how WC did it.

View solution in original post