Twitter V2 Post Image

I’m using Pathfix to set up a call to Twitter. As things stand now you have to bridge the V1 and V2 plugins together to post images. The V2 plugin will handle text-only tweets, but a separate call is required for the Post media action.

I keep getting a 500 error when initializing the call. Here’s the method + JSON body:

POST https://labs.pathfix.com/oauth/method/twitteroauth2/call

{
    "url": "https://api.twitter.com/2/tweets",
    "method": "POST",
    "payload": {
        "text": "<message>", "media": {"media_ids": ["<media_id_string>”]}
    }
}

Has anyone had success with this setup?

Turns out the code was fine- Twitter has been randomly pulling apps from Projects on the Developer portal and it was preventing the call from initializing.

1 Like

@sydney22 can you share your bubble workflow for posting media on twitter? I have been trying the same thing using pathfix, my only text tweet is working but media posting is not. I have followed pathfix’s documentation for combining V1 and V2 plugins of twitter as well

The first thing you have to do is get the file size. I did this with the Get File Info plugin.

Next I made changes to the current user and saved the result from the Get File Info step to a field called file_size.

Use that for the V1 Twitter Step 1:

For the V1 Twitter Step 2, the image has to be encoded in base64:

Keep passing along the media_id_string for V1 Twitter Step 3:

Finally you use the V2 step to post the image + text:

Hope that helps.

@sydney22

Thank you for sharing these steps! I gave it a try but couldn’t replicate a successful post with image (saved in the database).

Do you have a link to your page you can share?

Thanks!

I would, but the company I built it for won’t let me.