Hi, you could let FileMaker create the data sorted alphabetically? Then create you JSON from that.
Yeah, I thought of that, but at that point I might as well just use the authorize.net xml api.
It seems like you would need a loop using JSONListKeys () on your data to reorder them. Could I see a sample of the data?
Is there any way to force JSONSetElement to create the keys in a specific order?
Trying to integrate with authorize.net json api, and they require the keys in a specific order.
Really? JSON is supposed to not care about the order of the keys at all; that's part of the beauty of it. None of the JSON parsing is positional.
Do they have that documented somewhere?
Yeah, I know JSON isn't supposed to care about the order of keys.
Here's the thread I started on the authorize.net developer forum. An admin posted saying the order of the keys in the json matters to their api.
3 of 3 people found this helpful
Ugly; at least they are aware that they are breaking JSON rules.
How about using prefixes for the keys as you add them in order "01-MyKey", "02-SecondKey",... to build your JSON and then you do one substitute on the string to get all the prefixes out just before you send it? That substitute is just a text operator and wouldn't change the order of the JSON.