facebook_pages_refresh_token
Exchange an unexpired User access token for a Page token that does not expire, then use it for subsequent Facebook Pages API calls.
Instructions
Mint a Page access token that does not expire, and use it now Exchange a User access token for a long-lived one with the app's credentials, read me/accounts with it, and use the Page token that returns for every later call in this process. A Page token taken from a long-lived User token has no expiry, so this is how to stop the token expiring. Needs FB_APP_ID and FB_APP_SECRET, and a User token that has not expired: pass user_token, or have FB_USER_TOKEN set. The token is not written to the environment, so set FB_PAGE_TOKEN to keep it after a restart. Graph API: GET /oauth/access_token then GET me/accounts. A User token cannot be exchanged after it has expired; a new one must be obtained from the Graph API Explorer. The App Secret is sent only to the token exchange, never with a Page call.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "facebook_pages_refresh_token"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| app_id | No | ||
| page_id | No | ||
| app_secret | No | ||
| user_token | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||