Skip to content

Instantly share code, notes, and snippets.

@devtin
Last active August 23, 2022 11:34
Show Gist options
  • Save devtin/4f6a42e144e60792dc5124403ee933e5 to your computer and use it in GitHub Desktop.
Save devtin/4f6a42e144e60792dc5124403ee933e5 to your computer and use it in GitHub Desktop.
api endpoints documentation template

Endpoints

<Additional information about your API call. Try to use verbs that match both request type (fetching vs modifying) and plurality (one vs multiple).>

GET /v1/endpoint-1

Header Params

Name Description
x-id-token* JWT of the user

Query Params

Name Description
x-id-token* JWT of the user

Payload

<If making a post request, what should the body payload look like? URL Params rules apply here too.>

Success Response

  • Code: 200
Name Type Description
message string Message of success
  • Example
{
    "message": "booyah!"
}

Error Response:

  • Code: 401 - UNAUTHORIZED
{
    "error": "say whaaat?"
}

OR

  • Code: 422 - UNPROCESSABLE ENTRY
{
    "error" : "Email Invalid"
}
  • Sample Call:

    <Just a sample call to your endpoint in a runnable format ($.ajax call or a curl request) - this makes life easier and more predictable.>

    curl -X GET ...
  • Notes:

    <This is where all uncertainties, commentary, discussion etc. can go. I recommend timestamping and identifying oneself when leaving comments here.>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment