【发布时间】:2020-11-30 15:04:44
【问题描述】:
我正在尝试使用 Pipedream 集成平台来与推文不同。当我点击 Twitter 的 API for Like a Tweet 时,我得到一个 404。我仔细检查了,URL 与文档中的相同。
const body = {
config: {
method: "post",
url: `https://api.twitter.com/1.1/favorites/destroy.json`,
params : {
id : params.id,
include_entities : params.include_entities
},
},
token: {
key: auths.twitter.oauth_access_token,
secret: auths.twitter.oauth_refresh_token,
}
};
如您所见,该代码的 URL 是 https://developer.twitter.com/en/docs/tweets/post-and-engage/api-reference/post-favorites-destroy 文档中指定的 URL
关于如何纠正这个问题的任何建议?
【问题讨论】:
-
你确定你作为参数传递的推文 ID 是正确的吗? JavaScript 在处理大整数 ID 时存在问题,因此您应该改用字符串变体。
-
嗨@AndyPiper,你的建议是正确的。我不得不使用将 id 作为字符串而不是数字发送。我们尝试使用 BigInt 但这并没有在 Pipedream 平台中序列化,因此使用字符串是正确的解决方法。不确定您是否想发表您的评论作为答案,我会将其标记为正确。
标签: twitter