Facebook Threads API icon

Facebook Threads API

Tương tác với Facebook Threads API

Actions6

Overview

This node interacts with the Facebook Threads API, specifically providing an operation to convert a short-lived Facebook access token into a long-lived access token. This is useful in scenarios where you need to extend the validity of a Facebook access token for prolonged API access without requiring frequent re-authentication.

A practical example is when integrating Facebook login or API calls in an application: after obtaining a short-lived token from user login, this node can exchange it for a long-lived token to maintain session continuity and reduce the need for users to frequently log in again.

Properties

Name Meaning
App ID The App ID of your Meta/Facebook application.
App Secret The App Secret key associated with your Meta/Facebook application.
Short-Lived Access Token The short-lived access token that you want to exchange for a long-lived access token.

Output

The output is a JSON object containing the response from the Facebook Graph API's token exchange endpoint. It typically includes:

  • access_token: The new long-lived access token string.
  • token_type: The type of token returned (usually "bearer").
  • expires_in: The lifetime of the token in seconds.

Example output JSON:

{
  "access_token": "EAAJZC...",
  "token_type": "bearer",
  "expires_in": 5183944
}

No binary data is produced by this operation.

Dependencies

  • Requires an active internet connection to call the Facebook Graph API.
  • Needs valid credentials: the Facebook App ID and App Secret.
  • Requires a valid short-lived access token obtained from Facebook's OAuth process.
  • No additional environment variables are needed beyond these inputs.

Troubleshooting

  • Invalid App ID or App Secret: If the credentials are incorrect, the API will return an authentication error. Verify that the App ID and App Secret are correct and correspond to the same Facebook app.
  • Expired or Invalid Short-Lived Token: If the short-lived token is expired or invalid, the exchange will fail. Ensure the token is fresh and correctly obtained.
  • Network Issues: Connectivity problems may cause request failures. Check network access and retry.
  • API Rate Limits: Excessive requests might be throttled by Facebook. Implement retries with backoff if necessary.
  • Error Messages: The node returns error messages from the Facebook API. Common errors include permission issues or invalid parameters. Review the error message details to adjust inputs accordingly.

Links and References

Discussion