• 0
Sign in to follow this  
SINA3285248

Error access_token.invalid SDK php

Question

Hola estoy intentando subir un producto con la SKD php de MeLi y cuando subo el producto de test me da esta respuesta:

Array
(
    [body] => stdClass Object
        (
            [message] => access_token.invalid
            [error] => Invalid OAuth access token.
            [status] => 403
            [cause] => Array
                (
                )

        )

    [httpCode] => 403
)

Aclaro, el codigo esta tal y como lo descargue, los unicos cambios que hice fueron el secret key y el app ID.

Share this post


Link to post
Share on other sites

1 answer to this question

Recommended Posts

  • 0
Posted (edited)

Hola tuve el mismo problema y  comente el siguiente codigo en el bloque del boton buscar y eso me funciono:

Cualquier duda si puedo ayudar aqui estoy.

// $user = $meli->authorize($_GET['code'], $redirectURI);
 
// // Now we create the sessions with the authenticated user
// $_SESSION['access_token'] = $user['body']->access_token;
// $_SESSION['expires_in'] = $user['body']->expires_in;
// $_SESSION['refresh_token'] = $user['body']->refresh_token;
 
// // We can check if the access token in invalid checking the time
// if($_SESSION['expires_in'] + time() + 1 < time()) {
// try {
// print_r($meli->refreshAccessToken());
// } catch (Exception $e) {
// echo "Exception: ", $e->getMessage(), "\n";
// }
// }
Edited by Marcos Robles

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this