How to Set Up a Cronjob to Automatically Refresh Access Token
The INS Shopping Slider module for PrestaShop makes it easy to integrate your Instagram content into your online store. To keep your integration running smoothly, it's essential to ensure that your Instagram access token is always up to date. This guide will show you how to set up a cronjob to automatically refresh your access token, so you can maintain seamless functionality without manual intervention.
Understanding access token validity
Instagram's long-lived access tokens are valid for 60 days and can be refreshed as long as they are at least 24 hours old but have not yet expired. Setting up a cronjob will help automate this process and ensure your website operates smoothly without any interruptions due to token expiration.
Setting up a Cronjob for automatic token renewal
Step 1: Access the module configuration page
- Navigate to the configuration page of the INS Shopping Slider module in your PrestaShop back office.
Step 2: Navigate to the cronjob settings
- Click on "Settings" in the module's main menu.
- Click on the "Cronjob" tab and read the instructions carefully.
Step 3: Set up a cronjob
To automate the process of refreshing the access token, you need to set up a cronjob on your server. The method for setting up a cronjob varies depending on your server environment. If you're unsure how to set up a cronjob, your hosting provider can provide support and guidance.
Set up the command provided by our module on your server to run at the desired frequency. For example:
* * * * * /usr/bin/php /yourdomain.com/modules/ybc_instagram/cronjob.php secure=LThz90jps4
Manual execution
You also can execute the cronjob manually by clicking the "Execute Cronjob Manually" button on the module's configuration page.
Note:
- It is recommended to set the cronjob frequency to once a week to ensure the token is refreshed in a timely manner.
- Private Instagram accounts cannot retrieve an access token, so ensure your account is public to use this feature.
By following these steps, you can automate the renewal of your Instagram access token, ensuring that your PrestaShop store remains integrated with your Instagram account. This will help enhance your store's visual appeal and engage visitors with captivating Instagram content.