osome-iu / botometer-python

A Python API for Botometer by OSoMe
https://botometer.osome.iu.edu
MIT License
378 stars 60 forks source link

500 error #8

Closed patrikhermansson closed 7 years ago

patrikhermansson commented 7 years ago

I’m getting a 500 server error when I call your endpoint. The app is in nodejs but I don’t think that’s the main problem, I got some error messages before but now I mostly get this. Do you have any idea what could cause this? It’s difficult to debug as it doesn’t give any data.

clayadavis commented 7 years ago

I'm working on making the backend error messages more informative. I should have that done by the end of next week, maybe sooner.

But 9 times out of 10 this error happens because you're missing something the backend code is looking for in the request body. Make sure the following are true:

  1. The body of your POST request is a JSON string and not form-data
  2. The content field of the request object is an array of tweet objects, each of which contain their user objects (this is how they usually come from Twitter)
  3. The user_id and screen_name are provided in the meta object

If none of that works, let me know. In the mean time, I'll prioritize my work on verifying the requests.

patrikhermansson commented 7 years ago

Thanks for the answer! Got it to work, think it was because it was sent as form data... A bit more descriptive error messages would be really great :)

clayadavis commented 7 years ago

Glad I could help. Yes, the middle layer between the client API and the backend classifier would be generously described as a hack job (I wrote it so I can say that :ok_hand:). Follow @TruthyBotOrNot on Twitter for updates .

clayadavis commented 7 years ago

This answer documented in the Wiki Troubleshooting & FAQ. Please let me know if you have any suggestions for improvements to that page.