Hi
I've just come across something I can’t find in the API documentation. I’ve made a call to the /3/movie/{id}/rating method and passed an invalid rating-value as parameter.
JSON Body:
{"value":9.1 }
According to the documentation the API should have returned something like this:
{
"status_code": 5,
"status_message": "Failed…?"
}
But the API has returned:
{"failure":true,"error":"Unable to save the rating because: Value is not a multiple of .50."}
Have I missed something in the documentation?
Nie możesz znaleźć filmu lub serialu? Zaloguj się, aby go utworzyć.
Want to rate or add this item to a list?
Not a member?
Odpowiedź użytkownika Travis Bell
27 czerwca 2013 o godz. 9:35AM
Hi Dave,
Good find. The API should still serve the standard status_code error block. I've created a new ticket and will look at this shortly.
Odpowiedź użytkownika tmdb78260312
28 czerwca 2013 o godz. 3:14AM
Thanks for your support.
Odpowiedź użytkownika Travis Bell
28 czerwca 2013 o godz. 10:20AM
Fix for this was just deployed.
Odpowiedź użytkownika tmdb78260312
28 czerwca 2013 o godz. 12:23PM
Just tested it, now it returns a (400) Bad Request error. (Movie 550, rating: 9.1)
Odpowiedź użytkownika Travis Bell
28 czerwca 2013 o godz. 12:49PM
Yes, the HTTP status code on a validation error like this is 400. We still respond with body and a valid
status_code
error:Cheers.
Odpowiedź użytkownika tmdb78260312
28 czerwca 2013 o godz. 1:01PM
Sorry was my fault…
I haven’t seen the error message, because of .net (which I’m using) per default throws an error when a server returns an http error code….
(Details for the .Net developers with the same problem: http://stackoverflow.com/questions/692342/net-httpwebrequest-getresponse-raises-exception-when-http-status-code-400-ba)
Thanks your answer.