Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Async Insights - Exception while parsing image_asset field #449

Closed
dellax opened this issue Jan 23, 2024 · 3 comments
Closed

Async Insights - Exception while parsing image_asset field #449

dellax opened this issue Jan 23, 2024 · 3 comments

Comments

@dellax
Copy link

dellax commented Jan 23, 2024

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)

Steps/Sample code to reproduce the issue

========Start of API Call========
Post: https://graph.facebook.com/v18.0/act_xxxxxxxxxxxx/insights
Content-Disposition: form-data; name="access_token"


omitted


Content-Disposition: form-data; name="time_range"


{"since":"2024-01-10","until":"2024-01-10"}


Content-Disposition: form-data; name="level"


ad


Content-Disposition: form-data; name="breakdowns"


image_asset


Content-Disposition: form-data; name="limit"


25


Content-Disposition: form-data; name="appsecret_proof"


omitted


Content-Disposition: form-data; name="fields"


account_id,actions,ad_id,ad_name,adset_id,adset_name,campaign_id,campaign_name,spend,unique_actions,account_name,impressions,reach,clicks,unique_clicks


Content-Disposition: form-data; name="filtering"


[{field: 'action_type',operator:'IN', value: ['app_install', 'mobile_app_install', 'omni_tutorial_completion', 'omni_level_achieved', 'omni_spend_credits', 'omni_purchase', 'omni_achievement_unlocked']}]


----------------------------689313569058869891--

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
@stcheng
Copy link
Contributor

stcheng commented Jan 23, 2024

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.

@adithya-1
Copy link

adithya-1 commented Feb 12, 2024

@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.

@stcheng
Copy link
Contributor

stcheng commented Mar 14, 2024

this has been addressed in our latest release v19.0.1 with the introduction of multiple AdAsset* types support in Java.

@stcheng stcheng closed this as completed Mar 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants