Creating a Facebook Application
This procedure requires Google Chrome, Mozilla Firefox, or Microsoft Internet Explorer 8.
If you do not have a Facebook account, create one. The name of this account appears as the developer of the application you create.
- On the web page http://developers.facebook.com/apps, click the Create New App button, enter a name and click Continue. Enter the Security Check text and click Continue.
- On the resulting page,
- Make a note of the Application ID and Application Secret.
- Fill in other attributes, then click Save Changes.
- Go to https://developers.facebook.com/apps and register as a developer if you have not already done so. Click Create a New App.
- In the Create a New App window, enter the appropriate information, then click Create App, then click Save Changes.
- In the resulting Settings window, Basic tab,
- Make a note of the App ID and App Secret.
- Enter an e-mail addess in the Contact Email field, then click Save Changes.
- On the Advanced tab, for "Native or desktop app?", select YES, then click Save Changes.
- On the Migrations tab: Genesys recommends that you turn on all current Facebook migrations, unless the Facebook Driver or Social Messaging Server Release Note explicitly says to leave some of them off.
- Click App Details in the left-hand navigation frame. In the resulting window, enter a Short Description and a Long Description, then click Save Changes.
- In the Contact Info area, fill in the Private Policy URL field, then click Save Changes.
- Click Status & Review in the left-hand navigation frame. Select YES for "Do you want to make this app and all its live features available to the general public?", then click Save Changes.
To get your user short-lived access token, enter the following URL into a browser
https://www.facebook.com/dialog/oauth? client_id=APPLICATION_ID &redirect_uri=https://www.facebook.com/connect/login_success.html &scope=PERMISSIONS &response_type=token
making the following substitutions:
- For APPLICATION_ID, substitute the Application ID from Step 3.
- For PERMISSIONS, substitute a comma-separated list of the permissions listed below.
On the resulting page, click Go to App.
On the permissions page, click Allow. The resulting page displays the single word 'success'.
Make note of the long alphanumeric string following access_code= in the URL (excluding &expires=<number> at the end of the string)—this is your user access token.
The access token may not stay visible in the browsers's address field for very long. If it disappears, you can retrieve it from the browser history (click Control-H).
To check when the user access token expires, go to https://developers.facebook.com/tools/debug and enter in the access token from the previous step.
- If your user access token is short lived, you can extend it by entering the following URL in a browser, substituting the Application Id for APPLICATION_ID, the Application Secret for APPLICATION_SECRET, and the token from step 7 for TOKEN:
https://graph.facebook.com/oauth/access_token? grant_type=fb_exchange_token &client_id=APPLICATION_ID &client_secret=APPLICATION_SECRET &fb_exchange_token=TOKEN
- This produces a screen with a single line of text consisting of access_token= followed by a long alphanumeric string. Make a note of this string. It is the value of the Social Messaging Server configuration option x-access-token.
Important&expires=<number> at the end of the string must not be included in the value of x-facebook-access-token.
At any point, you can generate a new long-lived token by obtaining a new short-lived token and repeating Steps 4–7. According to Facebook, "In some cases, this newer long-lived token might be identical to the previous one, but we can't guarantee it and your app shouldn't depend upon it."
For the permission codes to be used in the URL given in Step 3, Genesys recommends the following minimum list:
For further details on permissions in the Facebook API v2.0, see https://developers.facebook.com/docs/facebook-login/permissions/v2.0#overview.