Bug in php-sdk

Bug in php-sdk

When the oAuth token is created, the expiry time is managed in Milliseconds


But, the response object is saying 'expires_in=3600' to it, which is only 3.6 seconds, instead of one hour.

This needs to be multiplied by 1000 before using it in setExpiryTime()

For helping people google this problem, you'll see this trigger {"error":"access_denied"} randomly, or with the exception "Exception while fetching access token from refresh token"

The fix is to change that line (Line 119) to this in vendor/zohocrm/php-sdk/src/oauth/ZohoOAuthClient.php

        $oAuthTokens->setExpiryTime($oAuthTokens->getCurrentTimeInMillis() + ( $expiresIn * 1000 ));



      Zoho Developer Community









                                Zoho Desk Resources

                                • Desk Community Learning Series


                                • Digest


                                • Functions


                                • Meetups


                                • Kbase


                                • Resources


                                • Glossary


                                • Desk Marketplace


                                • MVP Corner


                                • Word of the Day



                                    Zoho Marketing Automation


                                            Manage your brands on social media



                                                  Zoho TeamInbox Resources

                                                    Zoho DataPrep Resources



                                                      Zoho CRM Plus Resources

                                                        Zoho Books Resources


                                                          Zoho Subscriptions Resources

                                                            Zoho Projects Resources


                                                              Zoho Sprints Resources


                                                                Qntrl Resources


                                                                  Zoho Creator Resources



                                                                    Zoho WorkDrive Resources



                                                                      Zoho Campaigns Resources


                                                                        Zoho CRM Resources

                                                                        • CRM Community Learning Series

                                                                          CRM Community Learning Series


                                                                        • Tips

                                                                          Tips

                                                                        • Functions

                                                                          Functions

                                                                        • Meetups

                                                                          Meetups

                                                                        • Kbase

                                                                          Kbase

                                                                        • Resources

                                                                          Resources

                                                                        • Digest

                                                                          Digest

                                                                        • CRM Marketplace

                                                                          CRM Marketplace

                                                                        • MVP Corner

                                                                          MVP Corner





                                                                            Design. Discuss. Deliver.

                                                                            Create visually engaging stories with Zoho Show.

                                                                            Get Started Now