Closed dellax closed 5 months ago
thanks for reporting this issue. image_asset
is a breakdown and we will need to find a way to figure out how to assign the return type for the breakdowns.
@stcheng Can you please let us know any possible ETA around the fix?
Noticed not only image_asset
but even body_asset
also comes as json, however breakdowns like age
come as string.
Is there any way we can figure out which breakdowns are string and which are json?
Currently checking with hitting the API manually, would like to verify the same with some documentation and https://developers.facebook.com/docs/marketing-api/insights/breakdowns does not have sample responses for all types of breakdowns.
this has been addressed in our latest release v19.0.1 with the introduction of multiple AdAsset* types support in Java.
Which SDK version are you using?
18.0.4
What's the issue?
Exception while parsing image_asset field. Graph api returns object
{hash: "", url: "", name: "", id: ""}
instead of string (sdk)https://github.com/facebook/facebook-java-business-sdk/blob/87c547911dc2d68334022c23235f30f1482b0631/src/main/java/com/facebook/ads/sdk/AdsInsights.java#L344
Steps/Sample code to reproduce the issue
Observed Results:
IllegalStateException: Expected a string but was BEGIN_OBJECT at line 1 column 597 path $.image_asset
field image_asset is object instead of string
"image_asset":{"hash":"fe849a1241400bda20f49343871e35cf","url":"https:\/\/www.facebook.com\/ads\/image\/?d=AQI9AeCIYzup6CWY5SqPOpa8yUTN5Vgy89wpRtkWQ59XzTcCiaE4SQl3XXpa-_9Hn0nywG9KAE0auQQbZu4537HzGGeBaBea5ZNSOtVkAA8WgvgThIxmnbMb9GimMR6C2lvbSTogNZaz_O8mKlf_gKqq","name":"DA_EN_Static_Experimental_V134AH_Facebook_1080x1080_Static.jpg","id":"6490685440776"}}
Expected Results:
correctly parse JSON response