1

I keep getting the following error for this REST API --> https://mcmqczd118jdz8xqdfsbxdwh96f0.rest.marketingcloudapis.com/hub/v1/dataeventsasync/key:GAT_FUEL_triggered_DE_Test/rowset/

{
"message": "JSON Deserialization Exception: Line: 1, Position: 72, JSON Path: [0].keys.get_Fuel_Array",
"errorcode": 10004,
"documentation": ""

}

This is my original JSON body I am sending in request -

"keys":

    {
        "EmailAddress": "[email protected]",
        "get_Fuel_Array": {

            "Introduction": "Greg,<br/>Start hydrated with stored carbs,<br/>then add additional carbs.",
            "QuizLink": "https://www.gatorade.com/fuelplan/recommendations?id=c6e6dbee-9561-4f90-a9ca-225a1ff6413a",
            "Mosaic": {
                "Image": "https://www.gatorade.com/images/fuel-plan/recommendations/mosaic.png",
                "AdditionalProductCount": 12
            },
            "Goals": [{
                "Icon": "https://www.gatorade.com/images/fuel-plan/recommendations/rec-battery.svg",
                "Name": "Get energy for your workout",
                "BenefitText": "Start by replenishing your energy stores with carbs or protein to make sure you have enough fuel to keep going."
            }, {
                "Icon": "https://www.gatorade.com/images/fuel-plan/recommendations/rec-drop.svg",
                "Name": "Focus on your hydration",
                "BenefitText": "Drink fluid with sodium to help you stay hydrated during your workout. Add carbs on days when your workout goes longer."
            }, {
                "Icon": "https://www.gatorade.com/images/fuel-plan/recommendations/rec-jar.svg",
                "Name": "Increase your strength",
                "BenefitText": "Get a boost from your workout by consuming the right nutrition to support strength training, like an increase in muscle size."
            }, {
                "Icon": "https://www.gatorade.com/images/fuel-plan/recommendations/rec-jar.svg",
                "Name": "Gain Muscle",
                "BenefitText": "Appropriate nutrition can support the adaptations to strength training, especially the increases in muscle size."
            }],
            "PreGuidance": "Get energy for your workout.Drink about <span style=\"color:#0061B4;\">12oz of fluid</span> and consume about <span style=\"color:#FF4179;\">154g of carbs</span>.",
            "PreProductRecommendations": [{
                "ProductName": "Gatorade Thirst Quencher",
                "ConsumptionNotes": "Consume 30 minutes before your workout",
                "Image": "https://www.gatorade.com/images/fuel-plan/recommendations/product-image-1.png",
                "Gtin": "001654984",
                "CarbAmount": "75-90g",
                "FluidAmount": "10oz",
                "CaffeineAmount": ""
            }, {
                "ProductName": "Propel Electrolyte Water Beverage",
                "ConsumptionNotes": "Consume 15 minutes before your workout",
                "Image": "https://www.gatorade.com/images/fuel-plan/recommendations/product-image-2.png",
                "Gtin": "001654984",
                "CarbAmount": "",
                "FluidAmount": "15oz",
                "CaffeineAmount": ""
            }, {
                "ProductName": "Oatmeal Bowl",
                "ConsumptionNotes": "Consume 15 minutes before your workout",
                "Image": "https://www.gatorade.com/images/fuel-plan/recommendations/product-image-3.png",
                "Gtin": "001654984",
                "CarbAmount": "40g",
                "FluidAmount": "",
                "CaffeineAmount": ""
            }],
            "WorkoutGuidance": "Replace what’s lost when you sweat. Consume <span style=\"color:#0061B4;\">45-60g carbs</span> to help maintain energy levels and drink <span style=\"color:#FF4179;\">fluid to preference</span>.",
            "WorkoutProductRecommendations": [{
                "ProductName": "Gatorade Endurance Energy Gel",
                "ConsumptionNotes": "Consume 1 serving during your workout",
                "Image": "https://www.gatorade.com/images/fuel-plan/recommendations/work-out-2.png",
                "Gtin": "0001234567",
                "CarbAmount": "75-90g",
                "SodiumAmount": "10oz"
            }, {
                "ProductName": "Cytosport Fast Twitch",
                "ConsumptionNotes": "",
                "Image": "https://www.gatorade.com/images/fuel-plan/recommendations/work-out-4.png",
                "Gtin": "0001234567",
                "CarbAmount": "",
                "SodiumAmount": "40mg"
            }],
            "RecoverGuidance": "Replace what’s lost when you sweat. Consume <span style=\"color:#0061B4;\">45-60g carbs</span> to help maintain energy levels and drink <span style=\"color:#FF4179;\">fluid to preference</span>.",
            "RecoverProductRecommendations": [{
                "ProductName": "Muscle Milk Pro Sleeping Giant Protein",
                "ConsumptionNotes": "Consume 2 scoops within 1 hour of your workout",
                "Image": "https://www.gatorade.com/images/fuel-plan/recommendations/recover-2.png",
                "Gtin": "00013561654",
                "ProteinAmount": "10g",
                "FluidAmount": "22oz"
            }, {
                "ProductName": "Evolve Plant-Based Protein Powder",
                "ConsumptionNotes": "Consume 2 scoops within 1 hour of your workout",
                "Image": "https://www.gatorade.com/images/fuel-plan/recommendations/recover-3.png",
                "Gtin": "00013561654",
                "ProteinAmount": "2g",
                "FluidAmount": ""
            }, {
                "ProductName": "Granola Bar",
                "ConsumptionNotes": "",
                "Image": "https://www.gatorade.com/images/fuel-plan/recommendations/recover-4.png",
                "Gtin": "00013561654",
                "ProteinAmount": "20g",
                "FluidAmount": "20oz"
            }]
        },
        "SourceID": "US_GT_NUORBITMEDIA_GATORADEFUEL_20220901",
        "Timestamp": "2022-09-06 10:11:06 PM"
    }

}]

I updated it to the following seeing this conversation --> Converted deserialized JSON to Serialized JSON Array, but I still get the same error, and not able to resolve it.

[{
  "keys":
    {
        "EmailAddress": "[email protected]",
        "get_Fuel_Array": {
            "SourceID": "US_GT_NUORBITMEDIA_GATORADEFUEL_20220901",
            "Timestamp": "2022-09-06 10:11:06 PM",
            "Introduction": "Greg Start hydrated with stored carbs then add additional carbs.",
            "QuizLink": "test1",
            
            "Mosaic": {
                "Image": "test2",
                "AdditionalProductCount": "12"
            },
            "Goals": "[{\"Icon\":\"test3\",\"Name\":\"Get energy for your workout\", \"BenefitText\":\"Start by replenishing your energy stores with carbs or protein to make sure you have enough fuel to keep going.\"},{\"Icon\":\"test4\",\"Name\":\"Focus on your hydration\", \"BenefitText\":\"Drink fluid with sodium to help you stay hydrated during your workout. Add carbs on days when your workout goes longer.\"}]",
            "PreGuidance": "Get energy for your workout.Drink about 12oz of fluid and consume about 154g of carbs.",
            "PreProductRecommendations": "[{\"ProductName\":\"Gatorade Thirst Quencher\",\"ConsumptionNotes\": \"Consume 30 minutes before your workout\",\"Image\":\"test6\",\"Gtin\": \"001654984\",\"CarbAmount\": \"75-90g\",\"FluidAmount\": \"10oz\", \"CaffeineAmount\": \"\"},{\"ProductName\":\"Propel Electrolyte Water Beverage\",\"ConsumptionNotes\": \"Consume 15 minutes before your workout\",\"Image\":\"test7\",\"Gtin\": \"001654984\",\"CarbAmount\": \"\",\"FluidAmount\": \"15oz\", \"CaffeineAmount\": \"\"}]",
            "WorkoutGuidance": "Replace whats lost when you sweat. Consume45-60g carbs to help maintain energy levels and drink fluid to preference.",
            "WorkoutProductRecommendations": "[{\"ProductName\": \"Gatorade Endurance Energy Gel\",\"ConsumptionNotes\": \"Consume 1 serving during your workout\",\"Image\": \"test8\",\"Gtin\": \"0001234567\",\"CarbAmount\": \"75-90g\",\"SodiumAmount\": \"10oz\"},{\"ProductName\": \"Cytosport Fast Twitch\",\"ConsumptionNotes\": \"\",\"Image\": \"test9\",\"Gtin\": \"0001234567\",\"CarbAmount\": \"\",\"SodiumAmount\": \"40mg\"}]",
            "RecoverGuidance": "Replace whats lost when you sweat. Consume45-60g carbs to help maintain energy levels and drink fluid to preference.",
            "RecoverProductRecommendations":"[{\"ProductName\": \"Muscle Milk Pro Sleeping Giant Protein\",\"ConsumptionNotes\":\"Consume 2 scoops within 1 hour of your workout\",\"Image\": \"test10\",\"Gtin\":\"00013561654\",\"ProteinAmount\": \"10g\",\"FluidAmount\": \"22oz\"},{\"ProductName\": \"Evolve Plant-Based Protein Powder\",\"ConsumptionNotes\":\"Consume 2 scoops within 1 hour of your workout\",\"Image\": \"test11\",\"Gtin\":\"00013561654\",\"ProteinAmount\": \"2g\",\"FluidAmount\": \"\"}]"
        }
    }
}]

Any suggestion or help is highly appreciated. Thank you in advance.

1
  • 1
    Have you tried making sure it's not in an array? (ie an object {} as the parent) Commented Sep 8, 2022 at 5:19

0

You must log in to answer this question.