X(原 Twitter)凭证(X (formerly Twitter) credentials)#
你可以使用以下凭据验证以下节点:
🌐 You can use these credentials to authenticate the following nodes:
先决条件(Prerequisites)#
- 创建一个 X 开发者 账户。
- 创建一个 Twitter 应用,或使用在注册开发者门户时创建的默认项目和应用。有关应用配置的更多详细信息,请参阅下面每种支持的身份验证方法。
支持的身份验证方法(Supported authentication methods)#
- OAuth2
弃用警告
n8n 过去支持一种 OAuth 认证方法,该方法使用 X 的 OAuth 1.0a 认证方式。随着 n8n 在版本 0.236.0 中发布 X 节点的 V2,该方法已被 n8n 弃用。
相关资源(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
- 客户端密钥
生成客户端 ID 和客户端密钥:
🌐 To generate your Client ID and Client Secret:
- 在 Twitter 开发者门户 中,打开你的项目。
- 在项目的概览标签中,找到应用部分并选择添加应用。
- 为你的应用输入名称,然后选择下一步。
- 进入应用设置。
- 在用户身份验证设置中,选择设置。
- 设置 应用权限。如果你想使用 n8n X 节点的所有功能,请选择 读写和直接消息。
- 在应用类型部分,选择Web 应用、自动化应用或机器人。
- 在 n8n 中,复制 OAuth 重定向 URL。
- 在你的 X 应用中,找到 应用信息 部分,并将该 URL 粘贴为 回调 URI / 重定向 URL。
- 添加 网站网址。
- 保存更改。
- 复制 X 中显示的 客户端 ID 和 客户端密钥,并将它们添加到 n8n 凭证中的相应字段。
有关使用此身份验证方法的更多信息,请参阅 X 的 OAuth 2.0 身份验证文档。
🌐 Refer to X's OAuth 2.0 Authentication documentation for more information on working with this authentication method.
X 速率限制
此凭据使用 OAuth 2.0 Bearer Token 认证方法,因此你将受到应用速率限制。有关更多信息,请参阅下面的X 速率限制。
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 方法,将会应用用户速率限制。每一组用户的访问令牌在每个时间窗口内都有一个限制。
- 如果你使用 OAuth2,应用速率限制将会生效。你的应用在每个时间窗口内的请求将会有上限。
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.