Tuesday, 30 May 2017

StaticMap error on Facebook Messenger Send API

This is what I get in my log : (#2022) Your message couldn't be sent because it includes content that other people on Facebook have reported as abusive. OAuthException 2022 undefined Av1v6nxLbVt

I tried to send (it worked fine yesterday) a static map :

$limage = "https://maps.googleapis.com/maps/api/staticmap?center=".$lat2.",".$lng2."&zoom=17&scale=false&size=600x300&maptype=roadmap&format=png&visual_refresh=true&markers=size:mid%7Ccolor:0xff0000%7Clabel:1%7C".$lat2.",".$lng2;

In Messenger with this :

$response = [
 "attachment" => array(
     "type" => "template",
     "payload" => array(
         "template_type" => "generic",
         "elements" => [
             "title" => $nom,
             "image_url" => $limage,
             "subtitle" => "📍 ".$adresse."\nℹ️ ".$is_open,
             "default_action" => array(
                 "type" => "web_url",
                 "url" => $url
             ),
             "buttons" => [ array(
                 "type"=>"web_url",
                 "url"=> $url,
                 "title"=> "📍 Google Map",
                 "webview_height_ratio"=> "tall"
             ),
             array(
                 "type"=>"web_url",
                 "url"=> "https://www.google.fr?id=".$place_id,
                 "title"=> "ℹ️ à proximité",
                 "webview_height_ratio"=> "tall"
             )
            ]
        ]

))];

But image_url like "https://maps.googleapis.com/maps/api/staticmap..." are blocked today ! With another URL it works fine.
Why static map are blocked ?? How can I change that ? Thank you



via Pablo DelaNoche

No comments:

Post a Comment