cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

JSON Payload issues

shawnharv
New Contributor

Iโ€™ve come across an issue where the REST post works using a JSON generator, but when we receive the JSON from the pipeline and post it, the call fails. The JSON payload is exactly the same between the JSON generator and what we receive, yet we cannot get the POST call to fire successfully.

JSON Payloads is as follows:
[
{
โ€œkindโ€: โ€œdoubleclicksearch#conversionListโ€,
โ€œconversionโ€ : [{
โ€œclickIdโ€ : โ€œXXXXXXXXXXXXXXXXXXMYaAunkEALw_wcBโ€,
โ€œconversionIdโ€ : โ€œXXXXXXXXXXXzhXE5AAMโ€,
โ€œconversionTimestampโ€ : โ€œ1623361621000โ€,
โ€œsegmentationTypeโ€ : โ€œFLOODLIGHTโ€,
โ€œsegmentationNameโ€ : โ€œSFDC_Winsโ€,
โ€œtypeโ€: โ€œACTIONโ€
},
{
โ€œclickIdโ€ : โ€œXXXXXXXXXXXXd69532af3081b22f4โ€,
โ€œconversionIdโ€ : โ€œXXXXXXXXXXXXXzhW2pAAEโ€,
โ€œconversionTimestampโ€ : โ€œ1623352858000โ€,
โ€œsegmentationTypeโ€ : โ€œFLOODLIGHTโ€,
โ€œsegmentationNameโ€ : โ€œSFDC_Winsโ€,
โ€œtypeโ€: โ€œACTIONโ€
}
]
}
]

4 REPLIES 4

bojanvelevski
Valued Contributor

Hi @shawnharv,

Try and wrap the payload into one object, and pass that object into the Entity field in the REST Post snap.

Something like this:

[
{
โ€œpayloadโ€: {
โ€œkindโ€: โ€œdoubleclicksearch#conversionListโ€,
โ€œconversionโ€: [
{
โ€œclickIdโ€: โ€œXXXXXXXXXXXXXXXXXXMYaAunkEALw_wcBโ€,
โ€œconversionIdโ€: โ€œXXXXXXXXXXXzhXE5AAMโ€,
โ€œconversionTimestampโ€: โ€œ1623361621000โ€,
โ€œsegmentationTypeโ€: โ€œFLOODLIGHTโ€,
โ€œsegmentationNameโ€: โ€œSFDC_Winsโ€,
โ€œtypeโ€: โ€œACTIONโ€
},
{
โ€œclickIdโ€: โ€œXXXXXXXXXXXXd69532af3081b22f4โ€,
โ€œconversionIdโ€: โ€œXXXXXXXXXXXXXzhW2pAAEโ€,
โ€œconversionTimestampโ€: โ€œ1623352858000โ€,
โ€œsegmentationTypeโ€: โ€œFLOODLIGHTโ€,
โ€œsegmentationNameโ€: โ€œSFDC_Winsโ€,
โ€œtypeโ€: โ€œACTIONโ€
}
]
}
}
]

image

Donโ€™t forget the Content-Type Header:

image

Thanks [bojanvelevski] for the quick response.

I tried wrapping this in the payload object like you suggested, but still no success. The doubleclick search API responds with โ€œThe request was not valid. Details: [Empty batch encountered]โ€.

Its very strange how the payload works when its coming from a JSON generator snap, but the same JSON payload coming from a file fails. The two are literally the same haha.

Thanks,
Shawn

Please review and post a screenshot of the Pipeline Execution Statistics of each version of the pipeline โ€“ the one with the JSON Generator and the one without. This will give us more information about exactly how many input documents are being received by the REST Post.

I think we found a solution to this. All ill say is camelCase lol.

Thank you all for your quick responses and suggestions.

Regards,
Shawn