Search code examples
facebookfacebook-graph-apisslhttpscover

How to get a securl cover URL?


I'm tryng to get the cover url of a FBpage using:

$fql_query_url = "https://graph.facebook.com"
    ."/$fb_id[id]?fields=cover"
."";
try {
    $fql_query_result = @file_get_contents($fql_query_url);
    $fql_query_obj = json_decode($fql_query_result, true);
} catch(Exception $o){   }
$cover = $fql_query_obj[cover][source];

I get an http://... url and not the https://... url

any tips?


Solution

  • As @CBroe pointed out, you need to specify you need a secure URL by setting the return_ssl_resources argument to 1: https://graph.facebook.com/wtf.no.username/picture?return_ssl_resources=1.

    Edit: Please note that this isn't FQL (Facebook Query Language), this is just a standard API call.