Skip to content

Commit b462c58

Browse files
committed
update readme file
1 parent f9f2654 commit b462c58

File tree

1 file changed

+28
-27
lines changed

1 file changed

+28
-27
lines changed

README.md

Lines changed: 28 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -29,33 +29,6 @@ Configure `.env` file
2929
FACEBOOK_PAGE_ID=
3030
FACEBOOK_ACCESS_TOKEN=
3131
```
32-
### How to generate access token?
33-
1. At first create a business type facebook app. Create app from [Facebook Deveoper Panel](https://developers.facebook.com/)
34-
2. Go to Facebook [Graph Api Explorer](https://developers.facebook.com/tools/explorer/)
35-
3. Here you will see three select option:
36-
- Meta App
37-
- User or Page
38-
- Permissions
39-
4. `Meta App`: Here you will see all facebook app that you have created. Select your business type app from the dropdown list.
40-
5. `User or Page`: Here you need to select page access token. Then it will redirect you to your facebook page list. Select your preferred page and give necessary permission.
41-
6. `Permissions`: Please select the following permission from this permission list
42-
- `pages_show_list`
43-
- `pages_read_engagement`
44-
- `pages_manage_engagement`
45-
- `pages_manage_posts`
46-
- `pages_read_user_content`
47-
48-
7. Finally click on the Generate Access Token button and it will generate temporary access token for one hour.
49-
50-
8. If you want to make this token as long lived, you need to go [Access Token Debugger](https://developers.facebook.com/tools/debug/accesstoken/). Insert the access token and click on the `Debug` button. Then it will show token information. Scroll down and you will see `Extend Access Token`. Click on this button and it will generate long lived access token.Then copy the access token and use this as `FACEBOOK_ACCESS_TOKEN`
51-
52-
### Note:
53-
If you want to generate never expiry access token, you need to follow this step:
54-
55-
- Please open an api testing tool like Postman and send a get request by using this url `https://graph.facebook.com/v19.0/{app-scoped-user-id}/accounts?access_token={long-lived-user-access-token}. If you want to generate user access token instead of page access token, just select user access token form from `User or Page` section that i have mentioned in step 5.
56-
- Extend this user access token as like as page access token extend method that i have mentioned in step 8.
57-
- Then debug this `long-lived-user-access-token` and you will get `app-scoped-user-id` from this debug information.
58-
- Finally send get request through this url `https://graph.facebook.com/v19.0/{app-scoped-user-id}/accounts?access_token={long-lived-user-access-token}`. You will get never expiry page access token from this request and use this access token as `FACEBOOK_ACCESS_TOKEN`
5932

6033
## Usage
6134

@@ -127,6 +100,34 @@ array:3 [
127100
- Multiple image upload is not supported.
128101
- Video upload is not supported
129102

103+
### How to generate access token?
104+
1. At first create a business type facebook app. Create app from [Facebook Deveoper Panel](https://developers.facebook.com/)
105+
2. Go to Facebook [Graph Api Explorer](https://developers.facebook.com/tools/explorer/)
106+
3. Here you will see three select option:
107+
- Meta App
108+
- User or Page
109+
- Permissions
110+
4. `Meta App`: Here you will see all facebook app that you have created. Select your business type app from the dropdown list.
111+
5. `User or Page`: Here you need to select page access token. Then it will redirect you to your facebook page list. Select your preferred page and give necessary permission.
112+
6. `Permissions`: Please select the following permission from this permission list
113+
- `pages_show_list`
114+
- `pages_read_engagement`
115+
- `pages_manage_engagement`
116+
- `pages_manage_posts`
117+
- `pages_read_user_content`
118+
119+
7. Finally click on the Generate Access Token button and it will generate temporary access token for one hour.
120+
121+
8. If you want to make this token as long lived, you need to go [Access Token Debugger](https://developers.facebook.com/tools/debug/accesstoken/). Insert the access token and click on the `Debug` button. Then it will show token information. Scroll down this page and you will see `Extend Access Token`. Click on this button and it will generate long lived access token.Then copy the access token and use this as `FACEBOOK_ACCESS_TOKEN`
122+
123+
### Note:
124+
If you want to generate never expiry access token, you need to follow this step:
125+
126+
- Please open an api testing tool like Postman and send a get request by using this url `https://graph.facebook.com/v19.0/{app-scoped-user-id}/accounts?access_token={long-lived-user-access-token}`. If you want to generate user access token instead of page access token, just select user access token from `User or Page` section that i have mentioned in step 5.
127+
- Extend expiry date of this user access token as like as page access token extend method that i have mentioned in step 8.
128+
- Then debug this `long-lived-user-access-token` and you will get `app-scoped-user-id` from this debug information.
129+
- Finally send get request to this url `https://graph.facebook.com/v19.0/{app-scoped-user-id}/accounts?access_token={long-lived-user-access-token}`. Now You will get never expiry page access token from this request and use this access token as `FACEBOOK_ACCESS_TOKEN`
130+
130131

131132
## License
132133

0 commit comments

Comments
 (0)