Skip to content

Instantly share code, notes, and snippets.

@tucq88
Last active July 7, 2016 04:04
Show Gist options
  • Select an option

  • Save tucq88/ac049525f0fce8cb6a082d76c7d544a9 to your computer and use it in GitHub Desktop.

Select an option

Save tucq88/ac049525f0fce8cb6a082d76c7d544a9 to your computer and use it in GitHub Desktop.
API - the right way
  • response
    • Transform output
HTTP Status Code
{
  'message' => 'Single message to summarize about the response',
  'data' => [
    'store data - could be array or single item'
  ],
  'code' => 'error code',
  'errors' => [
    'list error messages, for form validation only'
  ]
}
@tucq88
Copy link
Copy Markdown
Author

tucq88 commented Jul 7, 2016

TODO : Adding pagination information

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