简体   繁体   English

使用UE API向Facebook发送消息,返回403错误

[英]Sending message to facebook using UE API returning 403 error

I am using PHP SDK for using UE API UE in my PHP laravel project. 我在PHP laravel项目中使用PHP SDK来使用UE API UE I have createduser and connection successfully and getting right json.But When I am trying to send message using below code I get 403 forbidden error: 我已经成功创建了用户和连接并获得了正确的json。但是当我尝试使用以下代码发送消息时,出现403禁止错误:

    $options = array(
        "receivers" => array(
            array(
                "name"=> "Me"
            )
        ),
        "message"=>array(
            "subject"=>"test",
            "body"=> "ABC",
            "image"=>"http://politibits.blogs.tuscaloosanews.com/files/2010/07/sanford_big_dummy_navy_shirt.jpg",
            "link"=>array(
                "uri"=> "http://google.com",
                "description"=> "link desc",
                "title"=>"link title"
            )
        )
    );

    //Send the message and get their uris
    $uris = $connection->send_message($options); 

Please suggest some solution. 请提出一些解决方案。

The access token might have expired. 访问令牌可能已过期。 Please reconnect the facebook connection again or refresh the connection. 请再次重新连接Facebook连接或刷新连接。

The facebook access tokens have a lifetime of about two hours. Facebook访问令牌的寿命大约为两个小时。 For longer lived web apps, especially server side, need to generate long lived tokens. 对于寿命较长的Web应用程序,尤其是服务器端,需要生成寿命较长的令牌。 Long lived tokens generally lasts about 60 days. 寿命长的令牌通常持续约60天。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM