创建新的页面位置FACEBOOK API

时间:2017-05-08 17:45:52

标签: facebook-graph-api

我正在尝试使用带有标准权限的APP为现有页面创建新位置,但它显示错误“只有列入白名单的APP可以使用此端点创建新页面/ {page_id} / locations”。

  • Facebook SDK PHP
  • Facebook Graph API v2.9
  • 我的代码:

    $fb = new Facebook(['app_id' => app_idp,'app_secret' => app_secret,]);
    $fb->setDefaultAccessToken(master_page_access_token);
    $new_location['hours'] = array("mon_1_open"=> "10:00",
            "mon_1_close"=>"19:00",
            "tue_1_open"=> "10:00",
            "tue_1_close"=> "19:00",
            "wed_1_open"=>"10:00",
            "wed_1_close"=> "19:00",
            "thu_1_open"=> "10:00",
            "thu_1_close"=> "19:00",
            "fri_1_open"=> "10:00",
            "fri_1_close"=> "19:00",
            "sat_1_open"=>"10:00",
            "sat_1_close"=>"19:00"
    );
    $location =  array(
            'hours'=>$new_location['hours'],
            'location'=> array(
            'street'=>$full_address,
            'latitude' => $latitude,
            'longitude'=> $longitude,
            'city_id'=> $city_id,
            'zip'=> $zip),
            'phone' => $phone ,
            'place_topics'=>array('210979565595898',
                    '199512783398620',
                    '108472109230615'),
            'price_range' => '$$',
            'store_location_descriptor' => $store_location_descriptor,
            'store_name'=> $store_name,
            'store_number'=> $store_id,
    );
    try {
            $new_pages =  $fb->post('/{page_id}/locations',$location,master_page_access_token); 
    } 
    catch (Exceptions\FacebookResponseException $exc) {
            echo $exc->getMessage();
    }
    
  • 错误 enter image description here

0 个答案:

没有答案