3

I am trying to create a facebook Adaccount with Facebook Business SDK. But when I use method createAdAccount it gives me an error. please see the image attached below. Here is the documentation about adacount creation

enter image description here

I am using createAdAccount like this.

public function createAdAccount() {
        //$params['name'] = "My test Partner";
        $params = ['name' => 'My test Partner',
            'currency' => 'USD', 
            'timezone_id' => 1, 
            'end_advertiser'=> 'NONE',
            'media_agency' => 'UNFOUND',
            'partner' => 'UNFOUND'
        ];
        $buisness = new Business('<buisness account id>');
        $adacount = $buisness->createAdAccount(['name'], $params);

        echo "<pre>"; print_r($adacount);
    }

Update : I also added my app id in my business account here. enter image description here Any help would be appreciated. Thanks in advance.

Manoj Dhiman
  • 5,096
  • 6
  • 29
  • 68

1 Answers1

4

I got the reason behind this. This is due to the error because I haven't added the app into my business manager account. I added the app and it worked. Please refer to the screenshot if you get the same issue. You need to go into your business manager setting and add the app. enter image description here

Hope this will help the needed person.

Community
  • 1
  • 1
Manoj Dhiman
  • 5,096
  • 6
  • 29
  • 68