简体   繁体   中英

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. 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:

    $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.

The facebook access tokens have a lifetime of about two hours. For longer lived web apps, especially server side, need to generate long lived tokens. Long lived tokens generally lasts about 60 days.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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