Twitter API v2 via Pathfix

Hey there,

I’ve managed to successfully configure Pathfix to handle OAuth authentication for Twitter v2 API. However, it seems like all their APIs are exposed as “Data” APIs and not as “Action” ones:

How is the “Post text” method a Data API? Am I missing something?

I’m trying to build a functionality to allow authenticated users to be able to post tweets through my app hence I need that as an Action API.

@Pathfix

Many thanks!

1 Like

@pavilaflores did you ever figure this out?

Yes, their API connection is pretty much broken for Twitter V2 and hence pathfix is not an option for that, nor any other plugin you’ll find in the marketplace.

You’ll have to go with a custom integration I’m afraid!

1 Like

their API connection

“Their” meaning Pathfix. When did it break for you? Sounds like you were able to set everything up in the API Connector which is encouraging.

Yes, pathfix told me their solution for V2 wasn’t really there.
I wasn’t really able to set much up. It seems like there isnt currently a way to handle Twitter’s three-legged Oauth process at the moment…

1 Like

Hmm interesting, thanks for the tidbit!

1 Like

Anyone found any solution regarding this?

Yes, you can use the Pathfix Twitter V2 plugin to post Tweets using the V2 API. :slight_smile:

Twitter is constantly making changes to their APIs and app access and have yet to port some of their existing APIs from V1 to V2.

That being said, we have updated the plugin to allow you to post text using V2. You can find the documentation here:

Reach out to our support if you need any specific assistance with the V2 APIs, the team is monitoring the APIs and updating the plugin.

Many thanks for the update @Pathfix , this was very much needed.

I´ve given it a try and I´m able to connect my account with Twitter, however not the “Post Tweet” nor the “Get users Tweet” actions seem to be working for me (I´m not getting any errors, I´m just not seeing anything that I “post” nor I´m able to retrieve my tweets. Any thoughts on this?

Here are some screenshots on how it´s configured:

Hey @pavilaflores- for the Post Tweet action make sure you have the tweets.write scope included on the Pathfix dashboard. I also had to regenerate a new key for the client secret key since V2’s OAuth is different.

Apparently in order to post images you need to create a separate call and stitch V1 and V2’s actions together to substitute for the Step 4 Post Media action from V1 (which has been deprecated).

The JSON body is a slight alteration to the Post Tweet method for V2:

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

So you’d set that up in the API Connector and use Steps 1-3 from the V1 plugin to generate and pass the media_id. I can’t get it initialized yet but I’ll report back once I figure it out.

2 Likes

Many thanks @sydney22 , that did solve the problem indeed and I can now post tweets!
Trying to figure out now how to post conversations as well (Tweets longer than Twitter´s default char limit).

Any luck with posting media?

1 Like

Still no on the media part (500 error). The JSON body matches up with Twitter’s docs so I’m not quite sure what the problem is.

Good day, having an issue connecting, I followed the steps but still having this issue.

This looks like an error in the configuration. Most likely, you may have copied the incorrect key for your ClientID and Secret.

Since this is Twitter V2, you need to use the OAuth 2.0 Client ID and Client Secret (not the Consumer keys)

Thanks for the reply.

I used Client ID and Client Secret respectively on the fields below. Still having the issue.

Reach out to our support (live or via email) and one of our tech team will check your Twitter configuration, it could be related to the apps you have on Twitter (they are blocking access to accounts that have multiple apps/products of V1 and V2)

2 Likes

Update - the team has released the documentation with a temporary workaround for posting Tweet with media using a combination of V1 and V2 endpoints.

It details how you can setup your Twitter dev portal + setting this up in your Bubble app :rocket:

The Twitter V2 plugin has also been updated, please update to the latest plugin version 2.2.1 before proceeding.