We are trying to create dev environment for fetching ads insights in development mode.
We are able to achieve below items except ad creative & ad creation
- Sandbox Ad Account test user
- Access token with required permissions for ad insights.
- Using Access token we are able to create adset, campaign, upload image.
- We are getting below response when we try to create ad creative
Response: { "error": { "message": "Invalid parameter", "type": "OAuthException", "code": 100, "error_subcode": 1885183, "is_transient": false, "error_user_title": "Ads creative post was created by an app that is in development mode", "error_user_msg": "Ads creative post was created by an app that is in development mode. It must be in public to create this ad.", "fbtrace_id": "DtL9CQLDa1T" } }
& Access token become invalid, if we put app in public mode.
Request :
curl -X POST \
'https://graph.facebook.com/v3.0/act_1966727743624778/adcreatives?access_token=<Token>' \
-H 'Cache-Control: no-cache' \
-H 'Postman-Token: bf7aeed1-0391-441c-be78-a62528ecdaac' \
-H 'content-type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW' \
-F 'name=blabla creative' \
-F 'object_story_spec={ "link_data": { "image_hash": "10c7a77ac2d0d19ba36a246d6f9ea0dd", "link": "https://app.google.com", "message": "try it out" }, "page_id": "<pageid>"}'