Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion OAuth Authentication Failure: Token retrieval returns "Invalid API Version".
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Subangkit Ramadiputra  
View profile  
 More options Jul 16 2012, 5:12 am
From: Subangkit Ramadiputra <subangkit.ramadipu...@kiranatama.com>
Date: Mon, 16 Jul 2012 02:12:34 -0700 (PDT)
Local: Mon, Jul 16 2012 5:12 am
Subject: Re: OAuth Authentication Failure: Token retrieval returns "Invalid API Version".

I've same problem to get access_token

$oauth2token_url = 'https://disqus.com/api/oauth/2.0/access_token/';
$redirect_uri =
'http://community.git.local/sites/all/libraries/disqus-php/oauth.php';
$clienttoken_post = array(
    "grant_type" => 'authorization_code',
    "client_id" => $public_key,
    "client_secret" => $secret_key,
    "redirect_uri" => $redirect_uri,
    "code" => $code
);

$curl = curl_init($oauth2token_url);

curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, $clienttoken_post);
curl_setopt($curl, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);

$json_response = curl_exec($curl);
curl_close($curl);

But didn't work and give me error message

invalid parameter: code

On Saturday, November 19, 2011 2:25:31 AM UTC+7, djangok wrote:

> I am able to retrieve the temporary code with /api/oauth/2.0/
> authorize/

> When I try to retrieve the Access Code from /api/oauth/2.0/
> access_token/, I receive HTTP 400: Invalid API Version.

> I've checked to make sure the format was correct.  I tried it with
> curl on the command line, and with the python code supplied by Disqus.
> (https://github.com/disqus/disqus-api-demos/tree/master/comments)
> Both return the same response.

> So, some questions:
> 1. How long does the temporary code last?  10 secs, 10 mins?  Does it
> time out while I format the request by hand?  (I'm just testing right
> now.)
> 2. Is there a problem with the server code at Disqus that is
> generating this request?
> 3. How long are the access tokens good for?  I would really like to
> allow the Users to authorize my app forever.  I can't make them
> authorize the app every time they log in.

> Kevin


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.