Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Twitter API v2 not supported #43

Open
tom-bywild opened this issue Dec 19, 2022 · 8 comments
Open

Twitter API v2 not supported #43

tom-bywild opened this issue Dec 19, 2022 · 8 comments

Comments

@tom-bywild
Copy link

Describe the bug

Description

The current implementation for the Twitter-Provider uses the legacy /1.1/...-endpoints. Twitter has changed their permission model, having now different levels of access.

  • essential: used for new projects, free, includes ability to call a subset of endpoints
  • elevated: higher tier, commercial, higher limits and access to more endpoints

Using the /1.1/...-endpoints, as the plugin does now, therefore doesn't work with the endpoints that are being called by the plugin with only the essential-access. A migration is required.

The error-log looks something like this:

{
  'message': 
     'You currently have Essential access which includes access 
     to Twitter API v2 endpoints only. If you need access to this endpoint, you’ll need 
     to apply for Elevated access via the Developer Portal. You can learn more here: 
     https://developer.twitter.com/en/docs/twitter-api/getting-started/about-twitter- 
     api#v2-access-level',
  'code': 453
}

It doesn't look like there's any way to only use legacy endpoints w/ a legacy permission model.

Quick local test

A quick test by changing the plugin's code to call the /2/...-endpoints results in an error related to calling an unknown API-endpoint.

Summary

To enable usage with the Twitter-API for essential users, the endpoints have to be migrated from /1.1/... to /2/..., or the developer has to apply for elevated access.

Therefore, the plugin is currently broken for probably the vast majority of devs using the Twitter-provider, as even for testing one needs elevated access.

Steps to reproduce

  1. Create a new application in the Twitter API-console, using the essential access level
  2. Connect the application with SocialPoster in Craft
  3. Enable auto-posting
  4. Publish a post
  5. See error (logs, no tweet gets posted)

Craft CMS version

Craft Pro 4.3.5

Plugin version

3.0.2

Multi-site?

No response

Additional context

No response

@tom-bywild
Copy link
Author

I can image that it might be enough to provide a selection between the v1.1/v2 api surface to use in the CP (or via configuration).

In code, a simple mapping of the respective endpoints to endpoint-generators for v1.1/v2 might work. If no selection is made, v1.1 is used. This shouldn't introduce any breaking changes.

@tom-bywild
Copy link
Author

tom-bywild commented Dec 20, 2022

Looking further into the issue, the 3rd party OAuth library might also be the cause of failed requests here. The plugin currently uses the OAuth1-handler from League, but we might actually need OAuth2 (Twitter doc).

@engram-design
Copy link
Member

FYI we’re in the middle of some major changes to the plugin, so this will be addressed in the next major release.

@tom-bywild
Copy link
Author

Thanks for the heads up, can you provide a (rough) timeline? It would help me estimate if we have to roll our own solution, or go with Verbb. Thanks!

@engram-design
Copy link
Member

engram-design commented Dec 20, 2022

I can’t provide a firm timeline but looking like Q1 for a major version update, which will include Twitter v2 API integration, among a few other major changes.

@tom-bywild
Copy link
Author

Thanks for the update! Would it be possible to participate in a beta? I'll probably need an implementation end of January/start of February. Maybe I could meet the requirements with a beta-release and update to production at a later point.

@tom-bywild
Copy link
Author

@engram-design Do you have any more information on this? Feedback would be much appreciated! Thanks!

@engram-design
Copy link
Member

engram-design commented Jan 19, 2023

Nothing yet, but expect it still in this Q1. Nothing solid enough for a beta, but things are progressing as planned for a release soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants