Skip to content

Instantly share code, notes, and snippets.

@helisoncruz
Created November 30, 2017 12:37
Show Gist options
  • Save helisoncruz/044a793119163a6bec1fbd856b74593e to your computer and use it in GitHub Desktop.
Save helisoncruz/044a793119163a6bec1fbd856b74593e to your computer and use it in GitHub Desktop.
CURL Post PHP Liberação de domínios para Facebook / Whitelisted Domains Facebook
<?php
$url = 'https://graph.facebook.com/v2.6/me/messenger_profile?access_token=<seu_access_token>';
$ch = curl_init( $url );
$payload = '{"whitelisted_domains":["https://xml_set_unparsed_entity_decl_handler(parser, handler).com.br"]}';
curl_setopt( $ch, CURLOPT_POSTFIELDS, $payload );
curl_setopt( $ch, CURLOPT_HTTPHEADER, array('Content-Type:application/json'));
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true );
$result = curl_exec($ch);
curl_close($ch);
echo "<pre>$result</pre>";
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment