admin管理员组

文章数量:1432384

I'm using again the Facebook Marketing API. I successfully managed to create Facebook ads with my Node.js app, now I want to create ad for Instagram.

To create an AdCreative, my call is as follows:

 fb.api('/act_' + rows[0].ad_act + '/adcreatives', 'post', {
   "name": "Test Instagram",
   "object_story_spec": {
     "page_id": "XXXXX",
     "instagram_actor_id": "YYYYY",
     "link_data": {
       "call_to_action": {
         "type": "LEARN_MORE",
         "value": {
           "link": ""
         }
       },
       "image_hash": imgHash,
       "link": "",
       "message": "Message test",
       "caption": "caption text",
     },
   }
 });

But the API always return the same message:

{ message: '(#100) Param  must be a valid Instagram account id',
  type: 'OAuthException',
  code: 100,
  fbtrace_id: 'Dr1XrUANRGr' }

rows[0].ad_act is the right account ID.

XXXX is a valid page id for that ad account.

YYYY is a valid instagram ID that is set as the instagram ads account for the page (setting into FB).

I tried different Instagram accounts as well as pages.

I'm using again the Facebook Marketing API. I successfully managed to create Facebook ads with my Node.js app, now I want to create ad for Instagram.

To create an AdCreative, my call is as follows:

 fb.api('/act_' + rows[0].ad_act + '/adcreatives', 'post', {
   "name": "Test Instagram",
   "object_story_spec": {
     "page_id": "XXXXX",
     "instagram_actor_id": "YYYYY",
     "link_data": {
       "call_to_action": {
         "type": "LEARN_MORE",
         "value": {
           "link": "http://example."
         }
       },
       "image_hash": imgHash,
       "link": "http://url.",
       "message": "Message test",
       "caption": "caption text",
     },
   }
 });

But the API always return the same message:

{ message: '(#100) Param  must be a valid Instagram account id',
  type: 'OAuthException',
  code: 100,
  fbtrace_id: 'Dr1XrUANRGr' }

rows[0].ad_act is the right account ID.

XXXX is a valid page id for that ad account.

YYYY is a valid instagram ID that is set as the instagram ads account for the page (setting into FB).

I tried different Instagram accounts as well as pages.

Share Improve this question edited Feb 15, 2017 at 21:43 Maria Ines Parnisari 17.5k10 gold badges93 silver badges138 bronze badges asked Oct 14, 2016 at 14:59 direxitdirexit 4054 silver badges19 bronze badges 4
  • i'm having the same issue. did you found any solution ? – Vijayant Katyal Commented Feb 15, 2017 at 15:33
  • FYI, the call won't work if you specify a Facebook account ID as an Instagram account ID. I've had no trouble using a real Instagram account ID. – Maria Ines Parnisari Commented Feb 15, 2017 at 21:45
  • Actually you must not use the instagram id BUT – direxit Commented Mar 2, 2017 at 1:23
  • you had to get the instagram_actor_id which is NOT the instagram_account_id. Graph API : /someFbPageID/instagram_accounts will return attached instagram account as a graphEdge then get the id from that object, its the instagram_actor_id – direxit Commented Mar 2, 2017 at 1:30
Add a ment  | 

2 Answers 2

Reset to default 3

This is the answer :

had to get the instagram_actor_id which is NOT the instagram_account_id.

Graph API : /someFbPageID/instagram_accounts will return instagram account as a graphEdge then get the id of that object, its the instagram_actor_id

"YYYY is a valid instagram ID that is set as the instagram ads account for the page (setting into FB)."

There is not a concept of "Instagram ads account". This YYYY needs to be a valid Instagram account (aka profile) ID. By "valid", I mean:

  1. It cannot be private. It has to be visible to the public. (default is not private.)
  2. It needs to be linked to a Facebook Page or business. https://developers.facebook./docs/marketing-api/guides/instagramads/v2.9
  3. If YYYY is linked to a Page, the Page needs to be XXXX.

As you mentioned that "I tried different Instagram accounts as well as pages.", I felt that you are not using a pair of IG and FB accounts. Randomly coupling them won't work.

BTW, the YYYY needs to be a number, which you can find on UI or by calling API in the doc I mentioned above. It cannot be an Instagram handle like "cooldude".

本文标签: javascriptFacebook marketing APIParam must be a valid Instagram account idStack Overflow