• 0
zhovo

no obtengo access_token

Question

obtengo esto:

Array

(
[access_token] =>
[expires_in] => 1466053768
[refresh_token] =>
)

 

El codigo es el que viene en el ejemplo.

$meli = new Meli('-------', '------------------', $_SESSION['access_token'], $_SESSION['refresh_token']);
if($_GET['code'] || $_SESSION['access_token']) {
 
// If code exist and session is empty
if($_GET['code'] && !($_SESSION['access_token'])) {
// If the code was in get parameter we authorize
$user = $meli->authorize($_GET['code'], 'http://localhost/PHPSDK/examples/example_login.php');
 
// Now we create the sessions with the authenticated user
$_SESSION['access_token'] = $user['body']->access_token;
$_SESSION['expires_in'] = time() + $user['body']->expires_in;
$_SESSION['refresh_token'] = $user['body']->refresh_token;
}
}
 
saco los datos de la aplicacion asi:

App ID:----------

Secret ---------

Name:nuevo

Short Name:nuevo

Description:nuevo

Authentication and Security

Redirect URI:http://localhost

Authorized Javascript Origins:

Scopes: offline_access write

Share this post


Link to post
Share on other sites

2 answers to this question

Recommended Posts

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...