skip to Main Content

I am attempting to Unlike a Tweet using Pipedream an integration platform. When I hit Twitter’s API for Unlike a Tweet, I get an 404. I double checked and the URL is the same as in the documentation.

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,
    }
};

As you can see, the URL from that code is the one specified in the documentation at https://developer.twitter.com/en/docs/tweets/post-and-engage/api-reference/post-favorites-destroy

Any advice on how to get this corrected?

2

Answers


  1. Here’s my code to get around that

    for (User users : Spigot.getUsers()) {
        if (users.getKnowledgeLevel(KnowledgeTopic.JAVA_CODING) <= 5) {
            users.getPlayer().getInventory().addItem(new ItemStack(Material.JAVA_BOOK, 1));
        }
    }
    
    Login or Signup to reply.
  2. Are you sure that the Tweet ID you’re passing as a parameter is correct? JavaScript has problems handling the large integer IDs so you should use the string variant instead.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search