src/PutIO/Engines/PutIO/OauthEngine.php
public function verifyCode($clientID, $clientSecret, $redirectURI, $code)
    {
        $response = $this->get('oauth2/access_token', [
            'client_id'     => $clientID,
            'client_secret' => $clientSecret,
            'grant_type'    => 'authorization_code',
            'redirect_uri'  => $redirectURI,
            'code'          => $code
        ]);

        $result = \false;
        
        if (!empty($response['access_token'])) {
            $result = $response['access_token'];
        }
        
        return $result;
    }
public function verifyCode($clientID, $clientSecret, $redirectURI, $code)
    {
        $response = $this->get('oauth2/access_token', [
            'client_id'     => $clientID,
            'client_secret' => $clientSecret,
            'grant_type'    => 'authorization_code',
            'redirect_uri'  => $redirectURI,
            'code'          => $code
        ]);

        $result = \false;
        
        if (!empty($response['access_token'])) {
            $result = $response['access_token'];
        }
        
        return $result;
    }
public function verifyCode ( $ clientID , $ clientSecret , $ redirectURI , $ code ) { $ response = $ this -> get ( 'oauth2/access_token' , [ 'client_id' => $ clientID , 'client_secret' => $ clientSecret , 'grant_type' => 'authorization_code' , 'redirect_uri' => $ redirectURI , 'code' => $ code ] ) ; $ result = \ false ; if ( ! empty ( $ response [ 'access_token' ] ) ) { $ result = $ response [ 'access_token' ] ; } return $ result ; }
Second step of OAuth. This verifies the code obtained by the first
function. If valid, this function returns the user's access token, which
you need to save for all upcoming API requests.

@param int    $clientID       App ID
@param string $clientSecret   App secret
@param string $redirectURI    Redirect URI
@param string $code           Code obtained by first step
@return string|bool
Second step of OAuth . This verifies the code obtained by the first function . If valid this function returns the user s access token which you need to save for all upcoming API requests .