1

I'm using php-upwork-oauth2 package with symfony to get my upwork profile informations .

Based on this repository : https://github.com/upwork/php-upwork-oauth2/blob/master/example/example.php i added my clientId and my clientSecret :

    $config = new \Upwork\API\Config([
        'clientId'          => '...', // SETUP YOUR CONSUMER KEY
        'clientSecret'      => '...', // SETUP KEY SECRET
        'redirectUri'       => 'https://localhost:8000/upwork',
        'accessToken'       => $session->get('access_token'),
        'accessSecret'      => $session->get('access_secret'),
        //'expiresIn'         => 'xxxxxxxxxx', // WARNING: keep this up-to-date!
        'debug'             => true, // enables debug mode
        //'authType'          => 'MyOAuthPHPLib' // your own authentication type, see AuthTypes directory
    ]);

    $client = new \Upwork\API\Client($config);

    $auth = new \Upwork\API\Routers\Auth($client);

    $info = $auth->getUserInfo();

    dd($info);

How can i get accessToken and accessSecret ?

I'm currently getting this error :

Call to a member function getBody() on string

1 Answer 1

-1

What is $session->get('access_token'), in your code? Is it set to something? I'd recommend:

  1. comment out accessToken and accessSecret lines
  2. follow the authentication and authorization process
  3. grep received access token/secret
  4. add the token pair to the config
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.