Skip to content

Instantly share code, notes, and snippets.

@blafrance
Created March 17, 2015 16:24
Show Gist options
  • Save blafrance/d354127c81e943011739 to your computer and use it in GitHub Desktop.
Save blafrance/d354127c81e943011739 to your computer and use it in GitHub Desktop.
AuthorityLabs Interface API PHP Connection Example
<?php
$url = 'URL_OF_RESOURCE'; //url for resource you are trying to retrieve - see http://docs.authoritylabs.apiary.io/ for a list of URLs
$api_key = 'YOUR_API_KEY_HERE'; //your AuthorityLabs interface API key
$ch = curl_init();
curl_setopt($ch,CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_HTTPHEADER, array("Content-Type: application/json", "Accept: vnd.authoritylabs+json; version=1", "X-API-KEY: $api_key"));
$response = curl_exec($ch);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment