Hello, I have set up an application on YDN and have the secret, key, and application ID. I have trying unsuccessfully using different OAuth libraries for PHP to get a request_token. Most of the code from common.php is below:
require_once "OAuth.php"; //oauth library require_once "common.php"; //common functions and variables
//initialize consumer $consumer = new OAuthConsumer($key, $secret, NULL);
//prepare to get request token $sig_method = new OAuthSignatureMethod_HMAC_SHA1(); $parsed = parse_url($request_token_endpoint); $params = array('oauth_callback' => $base_url);
//sign request and get request token $req_req = OAuthRequest::from_consumer_and_token($consumer, NULL, "GET", $request_token_endpoint, $params); $req_req->sign_request($sig_method, $consumer, NULL); $req_token = run_curl($req_req->to_url(), 'GET');
I have tried to echoed $req_token and the value is empty/NULL. I have tested the URL in the address bar and it comes back with a 404 error message. If additional code is needed, please let me know and I will provide.
I have reviewed the OAuth library code and other examples on the Web but for whatever reason, I cannot get past the first step of getting the token, so if someone could help me to understand what I am doing wrong it would be very much appreciated as I am new to using YDN.