Sorry new question, hopefully be the last
I have been asked if mozapi can be integrated into a php page which know it can be done but I have never done any work before involving api so not sure how to go about it
the page it needs to go on has the domains in the database and the mozapi info needs to display in correct columns, the client needs the domain authority, trust flow and citation flow if possible to be pulled in from mozapi
just need pointing in the right direction or a rough start to what the code would look like, I guess I would need to include the db info and query above the api script?
I found the following coding on Google
Code:
//MOZ API INFO
$accessID = "API ID HERE"; // * Add unique Access ID
$secretKey = "SECRET KEY HERE"; // * Add unique Secret Key
//Set Expires time in future here 5 minutes.
$expires = time() + 300;
// A new linefeed is necessary between your AccessID and Expires.
$stringToSign = $accessID."\n".$expires;
// Get the "raw" or binary output of the hmac hash.
$binarySignature = hash_hmac('sha1', $stringToSign, $secretKey, true);
// We need to base64-encode it and then url-encode that.
$urlSafeSignature = urlencode(base64_encode($binarySignature));
// This is the URL that we want link metrics for.
$objectURL = $_POST['url'];
// Add up all the bit flags you want returned.
// Learn more here: https://moz.com/help/guides/moz-api/mozscape/api-reference/url-metrics
$cols = "103079215104";
// Now put your entire request together.
// This example uses the Mozscape URL Metrics API.
$requestUrl = "http://lsapi.seomoz.com/linkscape/url-metrics/".urlencode($objectURL)."?Cols=".$cols."&AccessID=".$accessID."&Expires=".$expires."&Signature=".$urlSafeSignature;
// We can easily use Curl to send off our request.
$options = array(
CURLOPT_RETURNTRANSFER => true
);
$ch = curl_init($requestUrl);
curl_setopt_array($ch, $options);
$content = curl_exec($ch);
curl_close($ch);
// * Store URL metrics in array
$json_a = json_decode($content);
// * Assign URL metrics to separate variables
$MozRank = $json_a->umrp;
$theUrl = $json_a->uu;
$title = $json_a->ut;
Just unsure how to get that displaying in the correct columns and if the coding is correct
Thank you in advance
Bookmarks