X(原 Twitter)凭证#
¥X (formerly Twitter) credentials
你可以使用以下凭据验证以下节点:
¥You can use these credentials to authenticate the following nodes:
先决条件#
¥Prerequisites
- 创建 X 开发者 账户
¥Create an X developer account.
- 创建 Twitter 应用 账户,或使用注册开发者门户时创建的默认项目和应用。请参阅下方每种受支持的身份验证方法,了解有关应用配置的更多详细信息。
¥Create a Twitter app or use the default project and app created when you sign up for the developer portal. Refer to each supported authentication method below for more details on the app's configuration.
支持的身份验证方法#
¥Supported authentication methods
- OAuth2
Deprecation warning
n8n 过去支持 OAuth 身份验证方法,该方法使用 X 的 OAuth 1.0a 身份验证方法。n8n 在 0.236.0 版本中发布的 X 节点 V2 版本中弃用了此方法。
¥n8n used to support an OAuth authentication method, which used X's OAuth 1.0a authentication method. n8n deprecated this method with the release of V2 of the X node in n8n version 0.236.0.
相关资源#
¥Related resources
有关服务的更多信息,请参阅 X API 文档。有关服务身份验证的更多信息,请参阅 X API 身份验证文档。
¥Refer to X's API documentation for more information about the service. Refer to X's API authentication documentation for more information about authenticating with the service.
有关仅限应用身份验证的更多信息,请参阅 仅限应用的身份验证。
¥Refer to Application-only Authentication for more information about app-only authentication.
使用 OAuth2#
¥Using OAuth2
如果你使用的是 n8n 版本 0.236.0 或更高版本,请使用此方法。
¥Use this method if you're using n8n version 0.236.0 or later.
要配置此凭据,你需要:
¥To configure this credential, you'll need:
- 客户端 ID
¥A Client ID
- 客户端密钥:
¥A Client Secret
生成客户端 ID 和客户端密钥:
¥To generate your Client ID and Client Secret:
- 在 Twitter 开发者门户 中,打开你的项目。
¥In the Twitter developer portal, open your project. 2. 在项目的“概览”选项卡中,找到“应用”部分,然后选择“添加应用”。
¥On the project's Overview tab, find the Apps section and select Add App. 3. 为你的应用命名,然后选择“下一步”。
¥Give your app a Name and select Next. 4. 前往应用设置。
¥Go to the App Settings. 5. 在“用户身份验证设置”中,选择“设置”。
¥In the User authentication settings, select Set Up. 6. 设置应用权限。如果你想使用 n8n X 节点的所有功能,请选择“读写”和“私信”。
¥Set the App permissions. Choose Read and write and Direct message if you want to use all functions of the n8n X node. 7. 在“应用类型”部分,选择“Web 应用”、“自动化应用”或“机器人”。
¥In the Type of app section, select Web App, Automated App or Bot. 8. 在 n8n 中,复制 OAuth 重定向 URL。
¥In n8n, copy the OAuth Redirect URL. 9. 在 X 应用中,找到“应用信息”部分,并将该 URL 粘贴为“回调 URI / 重定向 URL”。
¥In your X app, find the App Info section and paste that URL in as the Callback URI / Redirect URL. 10. 添加网站 URL
1 | |
-
保存更改。
¥Save your changes. 12. 复制 X 中显示的客户端 ID 和客户端密钥,并将其添加到你的 n8n 凭据中的相应字段。
¥Copy the Client ID and Client Secret displayed in X and add them to the corresponding fields in your n8n credential.
请参阅 X 的 OAuth 2.0 身份验证文档 了解有关使用此身份验证方法的更多信息。
¥Refer to X's OAuth 2.0 Authentication documentation for more information on working with this authentication method.
X rate limits
此凭据使用 OAuth 2.0 Bearer Token 身份验证方法,因此你将受到应用速率限制。有关更多信息,请参阅下方的 X 速率限制。
¥This credential uses the OAuth 2.0 Bearer Token authentication method, so you'll be subject to app rate limits. Refer to X rate limits below for more information.
X 速率限制#
¥X rate limits
X 根据你的开发者访问计划级别,对每个端点设置基于时间的速率限制。X 独立计算应用速率限制和用户速率限制。有关访问计划级别的速率限制以及如何避免达到这些限制的指导,请参阅 速率限制。
¥X has time-based rate limits per endpoint based on your developer access plan level. X calculates app rate limits and user rate limits independently. Refer to Rate limits for the access plan level rate limits and guidance on avoiding hitting them.
请参考以下指南计算速率限制:
¥Use the guidance below for calculating rate limits:
- 如果你使用的是已弃用的 OAuth 方法,则适用用户速率限制。每组用户访问令牌在每个时间段内都将有一个请求数量限制。
¥If you're using the deprecated OAuth method, user rate limits apply. You'll have one limit per time window for each set of users' access tokens.
- 如果你使用的是 使用 OAuth2,则应用速率限制适用。你的应用在每个时间段内发出的请求数量将受到限制。
¥If you're Using OAuth2, app rate limits apply. You'll have a limit per time window for requests made by your app.
X 独立计算用户速率限制和应用速率限制。
¥X calculates user rate limits and app rate limits independently.
请参阅 X 的 速率限制和身份验证方法 了解有关这些速率限制类型的更多信息。
¥Refer to X's Rate limits and authentication methods for more information about these rate limit types.