-
Clone the repository (if applicable):
git clone <repository-url> cd webhooks
-
Install dependencies:
npm install
-
Run the development server:
npm run dev
-
Access the application: Open your browser and navigate to
http://localhost:3000.
Facebook webhook API is located at /api/facebook
Twitter webhook API is located at /api/twitter
Go to Facebook Graph API Explorer and check if you have the required permissions. https://developers.facebook.com/tools/explorer/
- Generate a User Access Token with:
• pages_read_engagement • pages_manage_posts • publish_to_groups (if posting to a group)
- If posting to a Page, use a Page Access Token.
https://graph.facebook.com/v18.0/oauth/access_token ?grant_type=fb_exchange_token &client_id={your-app-id} &client_secret={your-app-secret} &fb_exchange_token={short-lived-user-token}
- Then, exchange it for a Page Access Token:
https://graph.facebook.com/v18.0/{page-id}?fields=access_token&access_token={long-lived-user-token}