Legacy Dev Forum Posts

 View Only

Sign Up

Can someone help me build the contract and response for this please?

  • 1.  Can someone help me build the contract and response for this please?

    Posted 06-05-2025 18:41

    VaunMcCarthy | 2020-08-13 05:40:55 UTC | #1

    Response I get from this webservice:

    { "FlyerAccount": { "success": true, "accountNumber": "123456, "accoutName": "John Smith", "accountBalance": { "dollars": 0, "cents": 0 }, "seatNumber": "1", "classCode": "ABC" } }

    Basically I need to get out each of the items in the FlyerAccount array into it's own item/variable, including the accountBalance sub-array.


    Jason_Mathison | 2020-08-13 13:09:40 UTC | #2

    Hi Vaun,

    I am a bit confused by the "FlyerAccount array" part of your question as I don't see any arrays in the example response, do you maybe mean object and sub-object?

    Also, the example isn't valid JSON. The account number has a " before the number, but not after.

    Would you mind trying to make the output contract with the UI to look like your example response object? It doesn't look like you should really need a translation map or custom success template to work with this response.

    --Jason


    VaunMcCarthy | 2020-08-13 18:43:56 UTC | #3

    Thanks Jason. Moment of confusion there. The missing " was from removing actual customer info.

    So for this would FlyerAccount be the top level object in the output contract followed by separate items(string and Boolean) for the others? Then just add another object item for accountBalance to get that subobject?

    What if I also wanted to capture that seatNumber item?


    Jason_Mathison | 2020-08-13 18:48:25 UTC | #4

    So the root level of the output contract would be an object, it doesn't really have a name.

    Inside of that root level object you would have a FlyerAccount object with stuff in it. seatNumber would be a string at the same level asFlyerAccount.

    If you get stuck feel free to export your action and post it to this thread.


    Jason_Mathison | 2020-08-20 16:00:37 UTC | #7

    I saw you posted something and then deleted it. Were you able to get this to work?


    system | 2020-09-20 16:05:38 UTC | #8

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


    This post was migrated from the old Developer Forum.

    ref: 8566