2016-09-17 16 views
0

我有發佈要約頁面(我是管理員)通過Facebook API的問題。這是工作,當我張貼飼料到這個頁面,但不是提供。這總是返回給我帶有消息的FacebookSDKException:無效的參數。我使用PHP(Laravel框架),但我認爲這對我使用的語言無關緊要。我使用此代碼:無效的參數在發佈要約facebook api

try { 
     $response = $fb->post('/' . $page_id . '/offers' , $offerData, (string) $request->access_token 
       ); 
    } catch (\Facebook\Exceptions\FacebookSDKException $e) { 
     return response()->json(['error'=>$e->getMessage(), 
      ], 200); 
    } 

其中我的「$ request-> access_token」是頁面訪問令牌。在我的「$ offerData」我有這個字段:

$offerData =[ 
     'claim_limit'=>8, 
     'expiration_time'=>\Carbon\Carbon::now()->addDays(10)->toDateTimeString(), 
     'message'=>"bbb", 
     'title'=>"ascvc", 
     'coupon_required'=>false, 
     'image_url'=>'...', 
     'published'=>true, 
     'reminder_time'=>\Carbon\Carbon::now()->addDays(5)->toDateTimeString(), 
     // 'scheduled_publish_time'=>5 
    ]; 

我也試圖通過捲曲(不是第一碼),並捲曲返回類似的錯誤信息做到這一點。

"{"error":{"message":"Invalid parameter","type":"OAuthException","code":100,"error_subcode":1528104,"is_transient":false,"error_user_title":"Check Your Admin Permission Level","error_user_msg":"Only some admins of your Page are able to create and edit offers. Talk to the person responsible for your Page about your admin permission level.","fbtrace_id":"..."}}" 

它看起來有問題,權限,但在登錄Facebook的我設置權限:

['manage_pages', 'pages_show_list', 'email', 
     'user_hometown', 'publish_actions', 'user_photos', 'publish_pages'] 

我不知道在哪裏的問題。我必須告訴你,同一頁面上的提要工作正常,但不提供。你能幫我嗎?

+0

這是不是你從用戶要求授予您的應用程序的權限,但什麼樣的水平管理員權限的人在頁面設置已經分配。 – CBroe

回答