Hi all partners,
To help you in setting up the Social Auto Sharing feature, today I will show you how to create an application on Facebook, then get the ID key and the secret key of this application.
NOTE: This tutorial assumes that you don't have your Facebook application yet. If you have created an application before, you can skip through steps 1 to step 8, and start from step 9 to get the application's ID and secret key.
Step 1: Go to https://developers.facebook.com/, click My Apps then select Add New App.
Step 2: When an popup display, you need to enter the name of application (for example, PES Social Auto Sharing), then enter your email address. After that, click Create App ID.
Step 3: Enter the captcha key then click Submit.
Step 4: In the Select a Scenario screen, select Get Started with the Pages API, then click Confirm.
Step 5: Now you will be redirected to Basic Settings screen of Application Dashboard. To make your application live, you have to provide some info for your application, as the guide below:
- The Namespace field, you can enter anything you want, but it should be like your application name, ie: social-auto-posting
- The App Domains field, you enter: pes.social
- The Terms of Serive URL field, you can use this one: https://pes.social/pages/terms-of-use.html
- The Category field, you can select any categories you want.
- The Business Use field, you select Provide services to other businesses
Step 6: scroll to the bottom of page, click to Add Platform button.
Step 7: a Select Platform popup will display, you select Website.
Step 8: In the Site URL field, you enter this address: https://pes.social then click Save Changes.
Step 9: to get App ID, still on this page, you scroll up to the top. Then you can easy finding the App ID at the top left of section.
Step 10: to get App Secret, you have to click to Show button at the right of App Secret field, then provide the password of your Facebook account, click Submit.
Step 11: Go to Facebook Graph API Explorer tool: https://developers.facebook.com/tools/explorer/?classic=1
Step 12: On this screen, click the Application dropdown menu at the top right then select this application.
Step 13: click to the Get Token button then select Get User Access Token.
Step 14: when Select Permissions window displayed, you have to make sure that the manage_pages and publish_pages permissions are checked, then click Get Access Token button.
Step 15: click Continue as [your name]
Step 16: Select the page that you want to post to there.
Step 17: make sure you checked the Manage your Pages and Publish as Pages you manage checkboxes, then click Done and OK.
Step 18: you will be redirect to Graph API Explorer page again. Now you have to click Get Token button again, but at this time select your application.
Step 19: copy the access token in the Access Token field.
Step 20: open a new browser tab then paste this URL to address box: https://graph.facebook.com/oauth/access_token?grant_type=fb_exchange_token&client_id=appid&client_secret=appsecret&fb_exchange_token=accesstoken
- appid: Your Application ID that you found at step 9.
- appsecret: You Application Secret key that you found at step 10.
- accesstoken: The Facebook Page Access Token that you just found at step 19.
Step 21: Now you have the Non-Expire Facebook Page Access Token.
If you have any question, feel free to leave a comment at below, we will reply as soon as posible.
Thanks for reading.