Question

Issue in JSON data while receiving it in Action


Hi All,

         Below is the Json getting from webhook..

 

{"Number":"CONSIG-Zap005",

"Date":"2021-06-22", 

"CustomerCode":"{{CustomerCode}}",

"SenderName":"TransVirtualTest",

"SenderAddress":"Level 2",

"SenderAddress2":"15 Hunter Street",

"SenderSuburb":"NEWCASTLE",

"SenderState":"NSW",

"SenderPostcode":"2300",

"SenderReference":"TEST12345685",

"ConsignmentSenderContact":"Michael",

"ConsignmentSenderPhone":"02 4900 0000",

"SenderEmail":"sender@email.test",

"ConsignmentPickupSpecialInstructions":"Stair Access Only",

"ConsignmentSenderIsResidential":"n",

"ReceiverName":"Rapidteks",

"ReceiverAddress":"Level 1",

"ReceiverAddress2":"10 Yilen Close",

"ReceiverSuburb":"BERESFIELD",

"ReceiverState":"NSW",

"ReceiverPostcode":"2321",

"ConsignmentReceiverContact":"Andrew",

"ConsignmentReceiverPhone":"02 4908 4000",

"ReceiverEmail":"receiver@email.test",

"PickupRequest":"y",

"ConsignmentReceiverIsResidential":"y",

"ReturnPdfLabels": "n",

"ReturnPdfConsignment": "n",

"SpecialInstructions":"Hand Unload Required",

"ConsignmentOtherReferences":"CBA32456",

"ConsignmentOtherReferences2":"DBA35478",

"ConsignmentPickupBookingTime":"2022-04-11T03:00+10:00",

"ConsignmentPickupBookingTimeTo":"2022-04-11T03:00+11:00",

"ConsignmentBookingDateTime":"2022-05-02T03:00+07:30",

"ConsignmentBookingDateTimeTo":"2022-05-02T03:00+11:30",

"ConsignmentPickupCloseTime":"17:00",

"Rows":[

    {"Reference":"Ref1",

    "Qty":4, 

    "Description" : "Carton",

    "ItemContentsDescription":"Car Parts",

    "Weight":"10",

    "Width":"0.2",

    "Length":"0.2",

    "Height":"0.3",

    "DangerousGoodsUNNumber":"UN0004",

    "DangerousGoodsClass":"1.1D",

    "DangerousGoodsSubRisk":"SubRisk1",

    "DangerousGoodsPackagingGroup":"15",

    "Items":[

        {"Barcode":"TEST123456001"},

        {"Barcode":"TEST123456002"},

        {"Barcode":"TEST123456003"},

        {"Barcode":"TEST123456014"}

    ]

    },

    {"Reference":"Ref2",

    "Qty":2, 

    "Description" : "Pallets",

    "ItemContentsDescription":"Car Parts",

    "Weight":"600",

    "Width":"1.2",

    "Length":"1.2",

    "Height":"1.3",

    "DangerousGoodsUNNumber":"UN0004",

    "DangerousGoodsClass":"1.1D",

    "DangerousGoodsSubRisk":"SubRisk1",

    "DangerousGoodsPackagingGroup":"15",

    "Items":[

        {"Barcode":"TEST123456005"},

        {"Barcode":"TEST123456006"}

    ]

    }

]}

                

while getting it, the Items objects are clubbed together and we are unable to identify like whether it is belongs to Ref1 Or Ref2.

After the Action mapping while we receive it in API the json data looks like below,

 

{
    "Number": "CONSIG-Zap005",
    "Date": "2021-06-22",
    "CustomerCode": "TEST01",
    "SenderName": "TransVirtualTest",
    "SenderAddress": "Level 2",
    "SenderAddress2": "15 Hunter Street",
    "SenderSuburb": "NEWCASTLE",
    "SenderState": "NSW",
    "SenderPostcode": "2300",
    "SenderReference": "TEST12345685",
    "ConsignmentSenderContact": "Michael",
    "ConsignmentSenderPhone": "02 4900 0000",
    "SenderEmail": "sender@email.test",
    "ConsignmentPickupSpecialInstructions": "Stair Access Only",
    "ConsignmentSenderIsResidential": "n",
    "ReceiverName": "Rapidteks",
    "ReceiverAddress": "Level 1",
    "ReceiverAddress2": "ReceiverAddress2",
    "ReceiverSuburb": "BERESFIELD",
    "ReceiverState": "NSW",
    "ReceiverPostcode": "2321",
    "ConsignmentReceiverContact": "Andrew",
    "ConsignmentReceiverPhone": "02 4908 4000",
    "ReceiverEmail": "receiver@email.test",
    "PickupRequest": "y",
    "ConsignmentReceiverIsResidential": "y",
    "ReturnPdfLabels": "n",
    "ReturnPdfConsignment": "n",
    "SpecialInstructions": "Hand Unload Required",
    "ConsignmentOtherReferences": "CBA32456",
    "ConsignmentOtherReferences2": "DBA35478",
    "ConsignmentPickupBookingTime": "2022-04-11T03:00+10:00",
    "ConsignmentPickupBookingTimeTo": "2022-04-11T03:00+11:00",
    "ConsignmentBookingDateTime": "2022-05-02T03:00+07:30",
    "ConsignmentBookingDateTimeTo": "2022-05-02T03:00+11:30",
    "ConsignmentPickupCloseTime": "17:00",
    "Rows": [
        {
            "Reference": "Ref1",
            "Qty": "4",
            "Description": "Carton",
            "ItemContentsDescription": "Car Parts",
            "Weight": "10",
            "Width": "0.2",
            "Length": "0.2",
            "Height": "0.3",
            "DangerousGoodsUNNumber": "UN0004",
            "DangerousGoodsClass": "1.1D",
            "DangerousGoodsSubRisk": "SubRisk1",
            "DangerousGoodsPackagingGroup": "15",
            "Barcode": [
                {
                    "Barcode": "TEST123456001"
                },
                {
                    "Barcode": "TEST123456002"
                },
                {
                    "Barcode": "TEST123456003"
                },
                {
                    "Barcode": "TEST123456014"
                },
                {
                    "Barcode": "TEST123456005"
                },
                {
                    "Barcode": "TEST123456006"
                }
            ]
        },
        {
            "Reference": "Ref2",
            "Qty": "2",
            "Description": "Pallets",
            "ItemContentsDescription": "Car Parts",
            "Weight": "600",
            "Width": "1.2",
            "Length": "1.2",
            "Height": "1.3",
            "DangerousGoodsUNNumber": "UN0004",
            "DangerousGoodsClass": "1.1D",
            "DangerousGoodsSubRisk": "SubRisk1",
            "DangerousGoodsPackagingGroup": "15",
            "Barcode": [
                {
                    "Barcode": "TEST123456001"
                },
                {
                    "Barcode": "TEST123456002"
                },
                {
                    "Barcode": "TEST123456003"
                },
                {
                    "Barcode": "TEST123456014"
                },
                {
                    "Barcode": "TEST123456005"
                },
                {
                    "Barcode": "TEST123456006"
                }
            ]
        }
    ]
}

 

Here all barcodes mixed up and we are unable to identify whether it belong to Ref1 Or Ref2….

How to achieve this.?


0 replies

Be the first to reply!

Reply