Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi, I happen to have created an NPrinting API connection, so far I've been able to GET to filters, apps,connections, etc without any problems. But when I do GET user I get the error "HTTP protocol error 500. An unhandled exception occurred."
This happens to me when I try with a limit of 15 (in total I have 248 users)
For example this link if it takes me →http://nprinting.server.domain:4993/api/v1/users?limit=15
But the following longer throws me the error → http://nprinting.server.domain:4993/api/v1/users?limit=16
Please I need help on this.
Hi,
1. Update label on the post so it reflects version of NPrinting you are using - answer will depend on the version.
2. Is user used to communicate via API full Admin in NPrinting (does it have Administrator Role?) - when using API the same restrictions apply as via UI
3. How do you execute your API?
thanks
Lech
Hi, Lech.
The user I use to connect to the api has full admin permissions.
I connect from the qliksense script, I make the queries with this format:
SQL SELECT
"__KEY_data",
(SELECT
"id",
"name",
"description",
"created",
"lastUpdate",
"__FK_items"
FROM "items" FK "__FK_items")
FROM JSON (wrap off) "data" PK "__KEY_data"
WITH CONNECTION(
URL "$(vURL)",
HTTPHEADER "cookie" "$(vCookie)"
);
For example, it doesn't throw me an error when it assigned the variable vURL → http://nprinting.server.domain:4993/api/v1/apps?limit=1000
I only have the problem when I do the GET for "user".
Thanks.
Hi @davila - understand, now back to my 1st point - what is the version of NPrinting you are using? And update label on the post please...
I have also checked on my end using my NPrinting.qvs file which I provided you link to and it works as expected loading all users data.
My code is as simple as:
Hi
I just tested all limits between 1 and 20 in a Qlik NPrinting May 2023 SR1 installation and all worked correctly. I don't know which version you are using and I don't remember a solved bug on this.
HTTP error 500 is related to permissions so check the role and related rights of the user you are logged in.
You could also check the Qlik NPrinting Log files.
Best Regards,
Ruggero
Hi, this is my version NPrinting:
The user I use to connect to the api has full admin permissions.
Here I show you the message that it throws when I do limit 16
But with limit 15 it works.
Thanks for your help.
Hi @davila
Where did you get your script from?
Your version of NPrinting does not have all the fields you have in your statements in the API documentation https://help.qlik.com/en-US/nprinting/April2020/APIs/NP+API/index.html?page=54.
Fields in documentation for GET Users call support following structure:
{
"data" : {
"totalItems" : 0,
"offset" : 6,
"limit" : 1,
"items" : [ {
"domainAccount" : "aeiou",
"subFolder" : "aeiou",
"created" : "2000-01-23T04:56:07.000+00:00",
"timezone" : "aeiou",
"alternateEmail1" : "aeiou",
"userName" : "aeiou",
"locale" : "de",
"enabled" : true,
"folder" : "aeiou",
"alternateEmail3" : "aeiou",
"lastUpdate" : "2000-01-23T04:56:07.000+00:00",
"alternateEmail2" : "aeiou",
"id" : "00000000-0000-0000-0000-000000000000",
"email" : "aeiou"
} ]
}
}
It is hard to test anything on such old version as it is not supported for more than a year so I suggest to upgrade to currently supported version and for API call you may need to alter your SQL Select statement.
cheers
Hi @Lech_Miszkiewicz
Thank you very much for your help, I think I'll talk to my provider to update the NPrinting platform.
However, I still find it strange that I only take users with a limit less than 15.
I generated the script considering the documentation of the API on this website:
https://help.qlik.com/en-US/nprinting/May2023/APIs/NP+API/index.html?page=0
Cheers.
Well. You are generating script for version May 2023 based on the link you gave us. April 2020 is much older and is different. I specifically asked you about version for that very reason. I gave you link reference to that api version so try again using it or simply create a connection to the “get users” end point and use Qlik to generate script for you while browsing table. Your syntax looks bit odd so i think it may be a reason why its not working properly.