Authentication for sampled stream

What endpoint are you using?
2/tweets/sample/stream

What API version are you on?
version 2

Are you using a library or SDK? Which one?
No. Just curl

What is the issue?
Bearer token seems to lack privilege?

Steps to reproduce the issue
(see below)

What is the error message?
(see below)

When did it start?
Today. 2023-04-06

What have you tried to troubleshoot?

I’m going against the sample stream endpoint and seeing something similar issues here, here and here, but none of those have been for this endpoint. I’ve followed the steps on the Sampled stream quick start page to create a Project & App in the dev portal a couple of times now with similar results. I’m using the Bearer token that gets generated in place of the $APP_ACCESS_TOKEN variable in this curl request:

curl -X GET "https://api.twitter.com/2/tweets/sample/stream" \
-H "Authorization: Bearer $APP_ACCESS_TOKEN" 

but it’s responded each time with this:

{
  "client_id":"00000000",
  "detail":"When authenticating requests to the Twitter API v2 endpoints, you must use keys and tokens from a Twitter developer App that is attached to a Project. You can create a project via the developer portal.",
  "registration_url":"https://developer.twitter.com/en/docs/projects/overview",
  "title":"Client Forbidden",
  "required_enrollment":"Appropriate Level of API Access",
  "reason":"client-not-enrolled",
  "type":"https://api.twitter.com/2/problems/client-forbidden"
}

I wondered about the "required_enrollment":"Appropriate Level of API Access" and "reason":"client-not-enrolled". I looked over the docs several times and as far as I can see, I have followed the steps they outline. I have the free tier account, meaning I can only do one project/app at a time. I haven’t seen anything that looks like that should be a problem, however. The only other thing I can see on the portal is that User authentication settings are not set up. I don’t see anything in the docs that looks like that should be problem, though. I looked at that page and I don’t have a Callback URI or Website URL to specify.

1 Like

Are you on Basic or Free plan? The stream does not work with either.

1 Like

I am on the Free plan. I see the Basic costs $100/mo. Does that mean that the only account level that can access that endpoint is Enterprise? Seems a bit steep. :confused:

1 Like

Yes, it appears there is no other way to access the stream.

I joined the Basic plan because I wanted to use volume streams. If volume streams are not available, I wish the Basic plan had made that clear.

1% sampled stream,Available at all levels of access.

Are there any plans to use this mode at a lower cost?

I’m trying to access the rules endpoint /2/tweets/search/stream/rules
And it gives 403 Forbidden error
When authenticating requests to the Twitter API v2 endpoints, you must use keys and tokens from a Twitter developer App that is attached to a Project. You can create a project via the developer portal.

I’ve confirmed that the app is under the project and not in standalone.
On dashboard it shows the tag of both v1 and v2 API access.
I tried removing the app from project and adding it again but still same issue.
Then I tried deleting the app and creating the new one but same error message.

EDIT: Now I tried to delete the project to create a new project and give fresh start but it gives the following error
You must remove all apps from a project before it can be deleted.
Even tho there are currently no apps connected to it and no apps in standalone as well.

At this point I can’t even access a single v2 endpoint.

EDIT 2: So after going through different similar errors I see that filtered stream is only available for Enterprise access.

Here from @IgorBrigadir Response in the mentioned tweet.

But wait wasn’t filtered stream there for Essential access with 25 rules per stream?

I hope someone from twitter API developer team replies and clarify on this.

Thank you.

If you are on the paid Basic Plan, Stream is not available - if you are on the older essential or elevated access you may or may not be able to connect - but by now heading closer to the April 29th shutoff date, the stream could have been disabled also.

@IgorBrigadir Thank your for your prompt reply and I see you are really busy helping people on other community posts (most of the posts I visit has your reply)
Please clarify this last thing. So we can plan further on how to move with recent changes of twitter

Does that mean stream is now only available for enterprise access and can not be accessed after April 29th using essential, elevated or basic access?

1 Like

Yep - looks like it. There’s no more streaming access unless it’s Enterprise: Getting Started with the Twitter API | Docs | Twitter Developer Platform