Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Connect 2026 Agenda Now Available: Explore Sessions
cancel
Showing results for 
Search instead for 
Did you mean: 
xdoomcore
Contributor
Contributor

Issue with JSON Payload in User Creation via NPrinting REST API from Qlik Sense

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!

Qlik NPrinting 

Labels (2)
1 Reply
Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

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

cheers Lech, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful to the problem.