Here’s the part of code that run into 403 error:
tweets = collect_results(rule,
max_results=100,
result_stream_args=premium_search_args)
retrying request; current status code: 403
retrying request; current status code: 403
retrying request; current status code: 403
HTTP Error code: 403: Forbidden: Authentication succeeded but account is not authorized to access this resource.
Rule payload: {‘query’: ‘bitcoin’, ‘maxResults’: 100}
I applied the developer account and it got through last week. My application environment is now in full archive/premium. Can you help me find where’s wrong or what happened with my account or app? My account is @michelle17058
Below is the detailed description of the error if it helps:
HTTPError Traceback (most recent call last)
in ()
1 tweets = collect_results(rule,
2 max_results=100,
----> 3 result_stream_args=premium_search_args)
/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/searchtweets/result_stream.py in collect_results(rule, max_results, result_stream_args)
299 max_results=max_results,
300 **result_stream_args)
–> 301 return list(rs.stream())
/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/searchtweets/result_stream.py in stream(self)
200 self.init_session()
201 self.check_counts()
–> 202 self.execute_request()
203 self.stream_started = True
204 while True:
/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/searchtweets/result_stream.py in execute_request(self)
251 resp = request(session=self.session,
252 url=self.endpoint,
–> 253 rule_payload=self.rule_payload)
254 self.n_requests += 1
255 ResultStream.session_request_counter += 1
/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/searchtweets/result_stream.py in retried_func(*args, **kwargs)
99 logger.error(“HTTP Error code: {}: {}”.format(resp.status_code, error_message))
100 logger.error(“Rule payload: {}”.format(kwargs[“rule_payload”]))
–> 101 raise requests.exceptions.HTTPError
102
103 return resp
For the first trial, I use sandbox and it gives this error. Then I purchased Premium but still it gives the same error. Even I tried with the generated Bearer it gives similar error:
{
“error”: {
“message”: “Invalid or expired token.”,
“sent”: “2018-06-04T20:56:26+00:00”,
“transactionId”: “000a847500e5c1e9”
}
}
Thank you!