Convert working curl command into Node-Red flow

I have a working curl command I'm trying to integrate into Node-Red. I have a Change node in front of a HTTP request node, but I'm stuck trying to figure out the correct formatting required.

Here's the curl command -

curl  -X POST -H "" -H "accept:application/json" -H "content-type:application/json" -H "accept-encoding:gzip" -H "user-agent:okhttp/3.12.0" -d '{"api_key":"XXXYYYZZZ", "email":"", "password":"AAABBBCCC"}' ""



Perfect! Thank-you.

The curl command returns the data I need in Node-Red now. Unfortunately it appears to crop the token I'm attempting to grab. The following screen-shot shows the full token I'm expecting (about 1700 characters), and the next block is the token returned in Node-Red.

The Node-Red data has about 2/3rds of the characters of the correct token and ends with ..."

Is there a limit on characters in a given JSON field?

I need to flow the IDToken to an MQTT node for another process. Any suggestions?

Screen-shot of IDToken clipping

are you saying it is clipped because it doesn't show in the debug log? If so, the debug log clips the output IN THE LOG based on a setting in settings.js however the value in the msg should be still there

If you are saying mqtt is clipping the data when you publish it, this link might shed some light on the issue:

1 Like

It's just clipping in the debug log. That's reassuring that the value should be there because I haven't worked out how to forward the token to an MQTT node yet (call me a complete noob....).

When I 'copy Path' for the relevant token in the debug log, I see -


You can use a change node to move payload.userPoolOAuth.IdToken to payload

Thanks @zenofmud . All working well now.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.