Skip to content

Commit

Permalink
fix: send correct request to create tweet with poll
Browse files Browse the repository at this point in the history
  • Loading branch information
gr2m committed Feb 8, 2020
1 parent b685513 commit 082dcbd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/push/tweet.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ function createTweetWithPollCard(

// https://developer.twitter.com/en/docs/ads/creatives/api-reference/tweets#post-accounts-account-id-tweet
client.post(
`https://ads-api.twitter.com/6/accounts/${process.env.TWITTER_ACCOUNT_ID}/cards/poll`,
`https://ads-api.twitter.com/6/accounts/${process.env.TWITTER_ACCOUNT_ID}/tweet`,
{
as_user_id: userId,
text,
Expand Down
2 changes: 1 addition & 1 deletion test/push-master-has-tweet-with-poll/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ nock("https://ads-api.twitter.com")
return true;
})
.reply(201, { data: { card_uri: "card://123" } })
.post("/6/accounts/account123/cards/poll", body => {
.post("/6/accounts/account123/tweet", body => {
tap.equal(body.as_user_id, "123");
tap.equal(body.text, "Here is my poll"); // two days
tap.equal(body.card_uri, "card://123");
Expand Down

0 comments on commit 082dcbd

Please sign in to comment.