You are viewing limited content. For full access, please sign in.

Question

Question

Constructing JSON for Web Request Rule

asked on May 20, 2024

This is the Web Request I'm trying to make

{
    %(Name: ShipToName; Type: Text),
    %(Name: ShipToAddress; Type: Text),
    %(Name: ShipToCity; Type: Text),
    %(Name: ShipToState; Type: Text),
    %(Name: ShipToZip; Type: Text),
    %(Name: OrderDate; Type: Text),
    "Items"[
        {%(Name: Items; Type: Text)}
    ]
}

I need to include an array of items at the bottom, but I'm not sure how to make those comma separated. Any ideas?

 

0 0

Replies

replied on May 20, 2024

Assuming "Name: Items" is a multi-value token, you can use the "Apply Index" functionality of the Token Editor to join the values together with a comma (select "All values separated by:"  and select "Comma").

0 0
replied on May 21, 2024

It also looks like your JSON payload is missing the keys for 6 properties 

0 0
replied on May 22, 2024

What do you mean by Keys?

0 0
replied on May 22, 2024 Show version history

JSON is constructed of key-value pairs (and arrays) like this:

{
    "key": "value",
    "key": "value",
    "key": {
         "key": "value",
         "key": "value"
    },
    "key": ["value1", "value2"]
}

Your JSON above seems to be missing the keys, except for "Items".  I guessed your token values were just formatted with them or that you were just posting the general idea (e.g., your tokens aren't named in a standard way), but Zac is saying if what you posted is your actual JSON, it's not valid and will be rejected by the server.

 

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.