facebook / facebook-php-business-sdk

PHP SDK for Meta Marketing API
https://developers.facebook.com/docs/business-sdk
Other
833 stars 516 forks source link

Creating Lookalike Audience returns Empty Response in SDK but error via Curl #477

Closed felixlehmann closed 6 years ago

felixlehmann commented 6 years ago

Seems to be similar like https://github.com/facebook/facebook-php-business-sdk/issues/158.

Situation: creation of a lookalike audience for an existing country and lookalike ratio combination fails.

The SDK returns error code 0, empty response.

But Curl (logger activated in SDK) returns error 2654

{"error":{"message":"(#2654) Can\u2019t Create a Duplicate Lookalike: You've already created a lookalike audience with the same source, country and size. Please try using a different source or different specifications.","type":"OAuthException","code":2654,"error_subcode":1713007,"fbtrace_id":"EoNPC9bPpuK"}}

Call: curl \

-F 'name=XXX Lookalike (XXX)' \ -F 'subtype=LOOKALIKE' \ -F 'origin_audience_id={REMOVED}' \ -F 'lookalike_spec={"type":"custom_ratio","ratio":"0.01","country":"DE"}' \ -F 'access_token={REMOVED}' \ -F 'appsecretproof={REMOVED}' \ https://graph.facebook.com/v3.1/act{REMOVED}/customaudiences

I would actually expect that the SDK returns the same original error code and message.

jingping2015 commented 6 years ago

This should be fixed.

felixlehmann commented 6 years ago

Just for my interest: as there was no commit here, has it been fixed on api side? (I didn't test it yet)

jingping2015 commented 6 years ago

yes.