Skip to main content
Announcements
Defect acknowledgement with Nprinting Engine May 2022 SR2, please READ HERE
cancel
Showing results for 
Search instead for 
Did you mean: 
blaise
Partner - Specialist
Partner - Specialist

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 - Specialist
Partner - Specialist
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 - Specialist
Partner - Specialist

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

blaise
Partner - Specialist
Partner - Specialist
Author

I get the same error code when using postman

bramkn
Partner - Specialist
Partner - Specialist

ah sorry missed that bit.

Have you tried using the example provided by the devs?

blaise
Partner - Specialist
Partner - Specialist
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 - Specialist
Partner - Specialist
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 - Specialist
Partner - Specialist

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 - Specialist
Partner - Specialist
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 - Specialist
Partner - Specialist

No problem, goodluck getting this to work.

blaise
Partner - Specialist
Partner - Specialist
Author

Solved!

It worked with the following request body;

["my_group_guid"]

Used Chrome Dev Tools and investigated how WC did it.