|
|
|
|
|
by mohamedattahri
4982 days ago
|
|
I'm sorry but your API is not what I would call RESTful nor a step in the right direction. I have spotted 3 issues after only 30 seconds on your doc: 1) HTTP features the "Accept" header which allows the user-agent to specify the format of the response. The "*.json" thing is not standard and breaks HTTP. 2) "tickets/search" endpoint is not a resource. It's a different projection of the "tickets" collection. It's basic filtering. Rule of thumb is whenever you're about to use a verb to name an API endpoint, you can guess you're probably about to do something wrong. 3) A RESTful API needs hyperlinks. Resources must point to each other to help the developer navigate the API tree and access every single point it contains. The API origin (company.supportbee.com) should be the only information I need to discover the structure of your API. The WWW is an example to follow. It's the most RESTful "service" out there. |
|
> The "*.json" thing is not standard and breaks HTTP. It's more of a Rails convention and so we just followed it in the docs. Everything works fine without .json using the HTTP Accept header.
> "tickets/search" endpoint is not a resource. It's a different projection of the "tickets" collection. It's basic filtering. Rule of thumb is whenever you're about to use a verb to name an API endpoint, you can guess you're probably about to do something wrong.
Interesting. How would you approach it? Extend the /tickets endpoint to include some search parameters?
> A RESTful API needs hyperlinks.
I agree. However at this point it just seems a lot more work and also I have never really seen anyone use it (except for a few often quoted examples). We should change our documentation to use the word RESTlike.
Thanks once again for your feedback. We will improve the documentation soon.