Announcement
Collapse
No announcement yet.
Posting JSON with MVT:CALL
Collapse
X
-
Thank You! Method as RAW, and wrapping the fields as a string did it. Removing my token from this post, also a good idea!
-
You probably need to set your method to 'RAW' and fields should be a comma separated list of variables, but you are passing it a data value directly. Meaning you should be doing fields="'g.add_email'" I believe. Also I recommend editing your post and removing your authorization token, anyone could potentially use that token and impersonate your or read your data.
Leave a comment:
-
Posting JSON with MVT:CALL
I'm trying to post some simple JSON (to the Mailchimp API), but I get back and error that says what I'm sending is NULL. Here's the code:
Code:<mvt:assign name="g.list_id" value="'d579b341b9'" /> <mvt:assign name="g.tag_url" value="'https://us2.api.mailchimp.com/3.0/lists/'$ g.list_id $'/segments/21/members'" /> <mvt:assign name="g.add_email" value="'{ \"email_address\": \"[email protected]\"}'" /> <mvt:assign name="g.headers" value="'Authorization: Basic xxxxxxxxxxxxxxxxxx' $ asciichar( 13 ) $ asciichar( 10 )" /> <mvt:call action="g.tag_url" method="'POST'" fields="g.add_email" content-type="'application/json'" headers="g.headers" > <mvt:eval expr="s.callvalue" /> Yields the error: "errors":[{"field":"","message":"Schema describes object, NULL found instead"}] </mvt:call>
Any help greatly appreciated.
Best,
PaulLast edited by paul.oreilly; 06-15-19, 04:55 AM.Tags: None
Leave a comment: