zoho / zsign-php-sdk

This SDK provides wrapper functions for Zoho Sign v1 API's Document Management and Template Management.
4 stars 7 forks source link

Authorization Missing(Access Token/ Refresh Token) #5

Open suadikhasen opened 1 year ago

suadikhasen commented 1 year ago

i have get this error

Authorization Missing(Access Token/ Refresh Token) 

my code is this

$user = new OAuth( array(
            OAuth::CLIENT_ID => "",
            OAuth::CLIENT_SECRET=> "",
            OAuth::DC => "COM",
            OAuth::REFRESH_TOKEN=> "",
        ) );

        ZohoSign::setCurrentUser( $user );
        $response = $user->generateAccessTokenUsingRefreshToken();

        Log::info('token information'.$user->getRefreshToken());

        $access_token = $user->getAccessToken(); // get and store access token so to avoid unnecessary regeneration.
        Log::info('Token information'.$access_token);
        /*********
        STEP 2 : Draft a request using SDK functions
         **********/

        $reqObj = new RequestObject();
        $reqObj->setRequestName     ( 'Partnership Agreement' );

        $partner = new Actions();
        $partner->setRecipientName  ( "Will S" );
        $partner->setRecipientEmail ( "will.s@zylker.com" );
        $partner->setActionType     ( Actions::SIGNER );
        $partner->setisEmbedded     ( true );

        $reqObj->addAction  ( $partner );
        $file1 = $_SERVER['DOCUMENT_ROOT']."/Documents/TextTagsAPI.pdf";
        $files = [
            new CURLfile( $file1 )
        ];

        $draftJSON  = ZohoSign::draftRequest( $reqObj,  $files);

        /*********
        STEP 3 : Submit for signature
         **********/
        $sfs_resp   = ZohoSign::submitForSignature( $draftJSON );

the error is happened at this line of code.

$draftJSON  = ZohoSign::draftRequest( $reqObj,  $files);
alexyunes commented 6 months ago

same happening to me. suadikhasen, did you find the solution?