Hint: This is heavily based on https://gist.github.com/3428555.
Additional information about your API call. Try to use verbs that match both request type (fetching vs modifying) and plurality (one vs multiple).
The request type and the URL Structure (path only, no root url). METHOD may be GET
| POST
| DELETE
| PUT
.
If URL params exist, specify them in accordance with name mentioned in URL section. Separate into optional and required. Document data constraints.
Required
id
integer
Optional
photo_id
alphanumeric
If making a post request, what should the body payload look like? URL Params rules apply here too.
What should the status code be on success and is there any returned data? This is useful when people need to to know what their callbacks should expect!
{"id": 12}
Most endpoints will have many ways they can fail. From unauthorized access, to wrongful parameters etc. All of those should be listed here. It might seem repetitive, but it helps prevent assumptions from being made where they should be.
{"error": "Log in"}
It might seem repetitive, but it helps prevent assumptions from being made where they should be.
{"error": "Email Invalid" }
Just a sample call to your endpoint in a runnable format ($.ajax call or a curl request) - this makes life easier and more predictable.
This is where all uncertainties, commentary, discussion etc. can go. I recommend timestamping and identifying oneself when leaving comments here.