When you register your App with Rediff Apps, you have created an entry in our database for your App. However, this App is not yet serviceable. As the developer of an App, you need to verify that you are the owner or that you can access and have permissions to develop on the callback URL you specified during the registration process. You can do this by making a call to the Rediff Apps server as per the PHP example given below.
NOTE: While the example is coded in PHP, you can use any language as per your preference, but you need to ensure that you translate the steps in the sample code perfectly.
ALSO NOTE: This code needs to be run just the once when you first register and verify your app. You do not need to verify your app again, unless you change your callback URL.
For all calls that you make to Rediff API, you have to set the HTTP Header field, “Referer”, to the callback URL of your App.
To verify your callback URL using PHP:
<?php // Your app's AuthKey $authkey = '12695948244bac7ac8e2b8021881'; // Your app's AppKey $appkey = '126265r2ewe333e33e33'; // Your app's name $appName = 'App1'; // Your app's Callback URL $appCallbackURL = "http://www.YOUR-REDIFF-APP-CALLBACK-URL.com"; // The XML to send for authentication $postForApps = '<?xml version="1.0"?><request><appinfo><authkey>'.$authkey.'</authkey><appkey>'.$appkey.'</appkey><appname>'.$appName.'</appname></appinfo> <requestdetails> <action>authenticate</action><callback>'.$appCallbackURL.'</callback></requestdetails></request>'; // Set the Parameters for the call, and execute it $curl = curl_init(); $post_data = array("xml"=>trim($postForApps)); $tmp_arr_httpheader = array("Content-type: application/x-www-form-urlencoded","Connection: Close"); curl_setopt($curl, CURLOPT_URL, "http://playgully.rediff.com/authenticator"); curl_setopt($curl, CURLOPT_HEADER, 0); curl_setopt($curl, CURLOPT_REFERER, $appCallbackURL); curl_setopt($curl, CURLOPT_VERBOSE, 1); curl_setopt($curl, CURLOPT_FOLLOWLOCATION, false); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); curl_setopt($curl, CURLOPT_POST,1); curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data); $result = curl_exec($curl); // View the response of the authentication request echo $result; ?>
CLICK HERE to return to the main Table of Contents.