Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello everyone,
I'm integrating Qlik Sense with the NPrinting REST API to automatically create users and assign them dynamic email report delivery.
My goal is to create users through the endpoint /api/v1/users, using the POST method and a JSON payload with name, email, and roles. However, I encounter the following error:
"Connector reply error: Unknown substring, string, or value at (X,YY): '.xxxx@yyyy.zzz'"
(where the error points to part of the email address I send in the email field)
-What I've tried:
I've built the JSON payload ensuring all entries are in a single line, quotes are correctly escaped, and the roles array is well-formed.
Example of how I construct the payload in Qlik:
"
LET vClient = 'Jose pipo pip giga chad (sample name)';
LET vEmail = 'pepe.chad@gigachad.giga.com';
LET vRoles = chr(34) & 'User' & chr(34); // ["User"]
LET vUserPayload =
chr(123) &
chr(34) & 'name' & chr(34) & ':' & chr(34) & '$(vClient)' & chr(34) & ',' &
chr(34) & 'email' & chr(34) & ':' & chr(34) & '$(vEmail)' & chr(34) & ',' &
chr(34) & 'roles' & chr(34) & ':[' & '$(vRoles)' & ']' &
chr(125);
TRACE 'JSON Payload: ' & '$(vUserPayload)';
In the log, the string appears perfectly formatted, e.g.:
{"name":"Jose pipo pip giga chad (sample name)","email":"pepe.chad@gigachad.giga.com","roles": ["User"]}
The API call:
WITH CONNECTION (
URL "$(vNPrintingServer)/api/v1/users",
HTTPHEADER "Cookie" "$(vCookie)",
HTTPHEADER "Content-Type" "application/json",
BODY "$(vUserPayload)",
METHOD "POST"
);
What I’ve validated:
-Payload has no line breaks or invisible characters (verified with TRACE).
-The roles array is correct: ["User"].
-Content-Type header is set properly.
-Cookie and URL are working for other endpoints.
The error received:
Despite the correct JSON, the server responds:
"Connector reply error: Unknown substring, string, or value at (8,56): '.chad@gigachad.giga.com'"
It seems to cut parts of the email address, even though in logs it looks okay.
Has anyone faced similar issues?
Is there something else to review in the payload or how the REST call is made?
Thanks in advance for your help!
Hi,
have you tried using my subroutines?
https://nprintingadventures.com/2020/03/27/nprinting-api-qlik-rest-subroutines-v1-2/
nprinting.qvs has this implemented and it worked well last time i checked
cheers