{"action":"created","comment":{"url":"https://api.github.com/repos/everydayhero/developer.everydayhero.com/pulls/comments/40612799","id":40612799,"diff_hunk":"@@ -0,0 +1,126 @@\n+---\n+title: Custom Authentication Integration\n+---\n+\n+* TOC\n+{:toc}\n+\n+## Create a new user / Sign in\n+\n+<p class='info'><strong>Authentication types</strong>: Public OAuth Client ID</p>\n+\n+    POST https://everydayhero-staging.com/api/v2/authentication/sign_up\n+\n+### Payload\n+\n+user[name] : _required_ **string**<br/>\n+The name of the new user.\n+\n+user[email] : _required_ **string**<br/>\n+The email of the new user.\n+\n+user[password] : _required_ **string**<br/>\n+The password of the new user.\n+\n+user[phone] : _required_ **string**<br/>\n+The phone number of the new user.\n+\n+country : _required_ **string**<br/>\n+The region of the new user, valid regions: AU, NZ, UK, US, IE.\n+\n+client_id: _required_ **integer**<br/>\n+The client ID of the OAuth application.\n+\n+\n+The response will either be 201, 422 or a 404.\n+\n+If the response is successful, the response will include a user OAuth token,\n+along with the user_id. This can be used with the [user endpoint](/users/#get-current-user) \n+to fetch the user details.\n+\n+### Response\n+\n+Success:\n+\n+<%= json \\\n+  token: 'abc',\n+  user_id: 123\n+%>\n+\n+If the request failures, a hash of errors will be returned.\n+If the user tries to sign up with an existing email, the API will respond with a success if the provided password matches,\n+if not, a 422 with an related error will be returned.\n+A 404 will be returned if a country, or client_id is mising.\n+\n+Failure:\n+\n+<%= json \\\n+  error: {\n+    message: \"Validation failed\",\n+    errors: [{\n+      field: \"email\",\n+      code: \"invalid\"\n+    }\n+    ]\n+  }\n+%>\n+\n+\n+## Authenticate a user / Login\n+\n+<p class='info'><strong>Authentication types</strong>: Public OAuth Client ID</p>\n+\n+    POST https://everydayhero-staging.com/api/v2/authentication/sign_in","path":"content/custom-authentication.md","position":73,"original_position":73,"commit_id":"6db81ef562917690ac3ec204783acebf837e3851","original_commit_id":"6db81ef562917690ac3ec204783acebf837e3851","user":{"login":"HelenRoss","id":2100666,"avatar_url":"https://avatars.githubusercontent.com/u/2100666?v=3","gravatar_id":"","url":"https://api.github.com/users/HelenRoss","html_url":"https://github.com/HelenRoss","followers_url":"https://api.github.com/users/HelenRoss/followers","following_url":"https://api.github.com/users/HelenRoss/following{/other_user}","gists_url":"https://api.github.com/users/HelenRoss/gists{/gist_id}","starred_url":"https://api.github.com/users/HelenRoss/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HelenRoss/subscriptions","organizations_url":"https://api.github.com/users/HelenRoss/orgs","repos_url":"https://api.github.com/users/HelenRoss/repos","events_url":"https://api.github.com/users/HelenRoss/events{/privacy}","received_events_url":"https://api.github.com/users/HelenRoss/received_events","type":"User","site_admin":false},"body":"Ditto everydayhero-staging","created_at":"2015-09-28T22:16:44Z","updated_at":"2015-09-28T22:16:44Z","html_url":"https://github.com/everydayhero/developer.everydayhero.com/pull/116#discussion_r40612799","pull_request_url":"https://api.github.com/repos/everydayhero/developer.everydayhero.com/pulls/116","_links":{"self":{"href":"https://api.github.com/repos/everydayhero/developer.everydayhero.com/pulls/comments/40612799"},"html":{"href":"https://github.com/everydayhero/developer.everydayhero.com/pull/116#discussion_r40612799"},"pull_request":{"href":"https://api.github.com/repos/everydayhero/developer.everydayhero.com/pulls/116"}}},"pull_request":{"url":"https://api.github.com/repos/everydayhero/developer.everydayhero.com/pulls/116","id":46124529,"html_url":"https://github.com/everydayhero/developer.everydayhero.com/pull/116","diff_url":"https://github.com/everydayhero/developer.everydayhero.com/pull/116.diff","patch_url":"https://github.com/everydayhero/developer.everydayhero.com/pull/116.patch","issue_url":"https://api.github.com/repos/everydayhero/developer.everydayhero.com/issues/116","number":116,"state":"open","locked":false,"title":"Include custom auth docs","user":{"login":"joelr","id":17657,"avatar_url":"https://avatars.githubusercontent.com/u/17657?v=3","gravatar_id":"","url":"https://api.github.com/users/joelr","html_url":"https://github.com/joelr","followers_url":"https://api.github.com/users/joelr/followers","following_url":"https://api.github.com/users/joelr/following{/other_user}","gists_url":"https://api.github.com/users/joelr/gists{/gist_id}","starred_url":"https://api.github.com/users/joelr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joelr/subscriptions","organizations_url":"https://api.github.com/users/joelr/orgs","repos_url":"https://api.github.com/users/joelr/repos","events_url":"https://api.github.com/users/joelr/events{/privacy}","received_events_url":"https://api.github.com/users/joelr/received_events","type":"User","site_admin":false},"body":"Also includes less offensive styling.\r\n\r\n<img width=\"939\" alt=\"screen shot 2015-09-28 at 4 44 39 pm\" src=\"https://cloud.githubusercontent.com/assets/17657/10129328/41899a70-6600-11e5-897f-cbd46c507b8d.png\">\r\n","created_at":"2015-09-28T06:45:12Z","updated_at":"2015-09-28T22:16:44Z","closed_at":null,"merged_at":null,"merge_commit_sha":"17c2c1ebc40658a4e874abe5f43608978208502c","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/everydayhero/developer.everydayhero.com/pulls/116/commits","review_comments_url":"https://api.github.com/repos/everydayhero/developer.everydayhero.com/pulls/116/comments","review_comment_url":"https://api.github.com/repos/everydayhero/developer.everydayhero.com/pulls/comments{/number}","comments_url":"https://api.github.com/repos/everydayhero/developer.everydayhero.com/issues/116/comments","statuses_url":"https://api.github.com/repos/everydayhero/developer.everydayhero.com/statuses/6db81ef562917690ac3ec204783acebf837e3851","head":{"label":"everydayhero:jr-auth","ref":"jr-auth","sha":"6db81ef562917690ac3ec204783acebf837e3851","user":{"login":"everydayhero","id":558383,"avatar_url":"https://avatars.githubusercontent.com/u/558383?v=3","gravatar_id":"","url":"https://api.github.com/users/everydayhero","html_url":"https://github.com/everydayhero","followers_url":"https://api.github.com/users/everydayhero/followers","following_url":"https://api.github.com/users/everydayhero/following{/other_user}","gists_url":"https://api.github.com/users/everydayhero/gists{/gist_id}","starred_url":"https://api.github.com/users/everydayhero/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/everydayhero/subscriptions","organizations_url":"https://api.github.com/users/everydayhero/orgs","repos_url":"https://api.github.com/users/everydayhero/repos","events_url":"https://api.github.com/users/everydayhero/events{/privacy}","received_events_url":"https://api.github.com/users/everydayhero/received_events","type":"Organization","site_admin":false},"repo":{"id":7868184,"name":"developer.everydayhero.com","full_name":"everydayhero/developer.everydayhero.com","owner":{"login":"everydayhero","id":558383,"avatar_url":"https://avatars.githubusercontent.com/u/558383?v=3","gravatar_id":"","url":"https://api.github.com/users/everydayhero","html_url":"https://github.com/everydayhero","followers_url":"https://api.github.com/users/everydayhero/followers","following_url":"https://api.github.com/users/everydayhero/following{/other_user}","gists_url":"https://api.github.com/users/everydayhero/gists{/gist_id}","starred_url":"https://api.github.com/users/everydayhero/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/everydayhero/subscriptions","organizations_url":"https://api.github.com/users/everydayhero/orgs","repos_url":"https://api.github.com/users/everydayhero/repos","events_url":"https://api.github.com/users/everydayhero/events{/privacy}","received_events_url":"https://api.github.com/users/everydayhero/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/everydayhero/developer.everydayhero.com","description":"API documentation for developer.everydayhero.com","fork":false,"url":"https://api.github.com/repos/everydayhero/developer.everydayhero.com","forks_url":"https://api.github.com/repos/everydayhero/developer.everydayhero.com/forks","keys_url":"https://api.github.com/repos/everydayhero/developer.everydayhero.com/keys{/key_id}","collaborators_url":"https://api.github.com/repos/everydayhero/developer.everydayhero.com/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/everydayhero/developer.everydayhero.com/teams","hooks_url":"https://api.github.com/repos/everydayhero/developer.everydayhero.com/hooks","issue_events_url":"https://api.github.com/repos/everydayhero/developer.everydayhero.com/issues/events{/number}","events_url":"https://api.github.com/repos/everydayhero/developer.everydayhero.com/events","assignees_url":"https://api.github.com/repos/everydayhero/developer.everydayhero.com/assignees{/user}","branches_url":"https://api.github.com/repos/everydayhero/developer.everydayhero.com/branches{/branch}","tags_url":"https://api.github.com/repos/everydayhero/developer.everydayhero.com/tags","blobs_url":"https://api.github.com/repos/everydayhero/developer.everydayhero.com/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/everydayhero/developer.everydayhero.com/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/everydayhero/developer.everydayhero.com/git/refs{/sha}","trees_url":"https://api.github.com/repos/everydayhero/developer.everydayhero.com/git/trees{/sha}","statuses_url":"https://api.github.com/repos/everydayhero/developer.everydayhero.com/statuses/{sha}","languages_url":"https://api.github.com/repos/everydayhero/developer.everydayhero.com/languages","stargazers_url":"https://api.github.com/repos/everydayhero/developer.everydayhero.com/stargazers","contributors_url":"https://api.github.com/repos/everydayhero/developer.everydayhero.com/contributors","subscribers_url":"https://api.github.com/repos/everydayhero/developer.everydayhero.com/subscribers","subscription_url":"https://api.github.com/repos/everydayhero/developer.everydayhero.com/subscription","commits_url":"https://api.github.com/repos/everydayhero/developer.everydayhero.com/commits{/sha}","git_commits_url":"https://api.github.com/repos/everydayhero/developer.everydayhero.com/git/commits{/sha}","comments_url":"https://api.github.com/repos/everydayhero/developer.everydayhero.com/comments{/number}","issue_comment_url":"https://api.github.com/repos/everydayhero/developer.everydayhero.com/issues/comments{/number}","contents_url":"https://api.github.com/repos/everydayhero/developer.everydayhero.com/contents/{+path}","compare_url":"https://api.github.com/repos/everydayhero/developer.everydayhero.com/compare/{base}...{head}","merges_url":"https://api.github.com/repos/everydayhero/developer.everydayhero.com/merges","archive_url":"https://api.github.com/repos/everydayhero/developer.everydayhero.com/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/everydayhero/developer.everydayhero.com/downloads","issues_url":"https://api.github.com/repos/everydayhero/developer.everydayhero.com/issues{/number}","pulls_url":"https://api.github.com/repos/everydayhero/developer.everydayhero.com/pulls{/number}","milestones_url":"https://api.github.com/repos/everydayhero/developer.everydayhero.com/milestones{/number}","notifications_url":"https://api.github.com/repos/everydayhero/developer.everydayhero.com/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/everydayhero/developer.everydayhero.com/labels{/name}","releases_url":"https://api.github.com/repos/everydayhero/developer.everydayhero.com/releases{/id}","created_at":"2013-01-28T11:02:36Z","updated_at":"2015-09-11T00:53:16Z","pushed_at":"2015-09-28T06:45:13Z","git_url":"git://github.com/everydayhero/developer.everydayhero.com.git","ssh_url":"git@github.com:everydayhero/developer.everydayhero.com.git","clone_url":"https://github.com/everydayhero/developer.everydayhero.com.git","svn_url":"https://github.com/everydayhero/developer.everydayhero.com","homepage":"http://developer.everydayhero.com","size":3661,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":2,"mirror_url":null,"open_issues_count":1,"forks":2,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"everydayhero:master","ref":"master","sha":"a34d545a285c6fe6a0c920b634a324fa05c03578","user":{"login":"everydayhero","id":558383,"avatar_url":"https://avatars.githubusercontent.com/u/558383?v=3","gravatar_id":"","url":"https://api.github.com/users/everydayhero","html_url":"https://github.com/everydayhero","followers_url":"https://api.github.com/users/everydayhero/followers","following_url":"https://api.github.com/users/everydayhero/following{/other_user}","gists_url":"https://api.github.com/users/everydayhero/gists{/gist_id}","starred_url":"https://api.github.com/users/everydayhero/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/everydayhero/subscriptions","organizations_url":"https://api.github.com/users/everydayhero/orgs","repos_url":"https://api.github.com/users/everydayhero/repos","events_url":"https://api.github.com/users/everydayhero/events{/privacy}","received_events_url":"https://api.github.com/users/everydayhero/received_events","type":"Organization","site_admin":false},"repo":{"id":7868184,"name":"developer.everydayhero.com","full_name":"everydayhero/developer.everydayhero.com","owner":{"login":"everydayhero","id":558383,"avatar_url":"https://avatars.githubusercontent.com/u/558383?v=3","gravatar_id":"","url":"https://api.github.com/users/everydayhero","html_url":"https://github.com/everydayhero","followers_url":"https://api.github.com/users/everydayhero/followers","following_url":"https://api.github.com/users/everydayhero/following{/other_user}","gists_url":"https://api.github.com/users/everydayhero/gists{/gist_id}","starred_url":"https://api.github.com/users/everydayhero/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/everydayhero/subscriptions","organizations_url":"https://api.github.com/users/everydayhero/orgs","repos_url":"https://api.github.com/users/everydayhero/repos","events_url":"https://api.github.com/users/everydayhero/events{/privacy}","received_events_url":"https://api.github.com/users/everydayhero/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/everydayhero/developer.everydayhero.com","description":"API documentation for developer.everydayhero.com","fork":false,"url":"https://api.github.com/repos/everydayhero/developer.everydayhero.com","forks_url":"https://api.github.com/repos/everydayhero/developer.everydayhero.com/forks","keys_url":"https://api.github.com/repos/everydayhero/developer.everydayhero.com/keys{/key_id}","collaborators_url":"https://api.github.com/repos/everydayhero/developer.everydayhero.com/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/everydayhero/developer.everydayhero.com/teams","hooks_url":"https://api.github.com/repos/everydayhero/developer.everydayhero.com/hooks","issue_events_url":"https://api.github.com/repos/everydayhero/developer.everydayhero.com/issues/events{/number}","events_url":"https://api.github.com/repos/everydayhero/developer.everydayhero.com/events","assignees_url":"https://api.github.com/repos/everydayhero/developer.everydayhero.com/assignees{/user}","branches_url":"https://api.github.com/repos/everydayhero/developer.everydayhero.com/branches{/branch}","tags_url":"https://api.github.com/repos/everydayhero/developer.everydayhero.com/tags","blobs_url":"https://api.github.com/repos/everydayhero/developer.everydayhero.com/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/everydayhero/developer.everydayhero.com/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/everydayhero/developer.everydayhero.com/git/refs{/sha}","trees_url":"https://api.github.com/repos/everydayhero/developer.everydayhero.com/git/trees{/sha}","statuses_url":"https://api.github.com/repos/everydayhero/developer.everydayhero.com/statuses/{sha}","languages_url":"https://api.github.com/repos/everydayhero/developer.everydayhero.com/languages","stargazers_url":"https://api.github.com/repos/everydayhero/developer.everydayhero.com/stargazers","contributors_url":"https://api.github.com/repos/everydayhero/developer.everydayhero.com/contributors","subscribers_url":"https://api.github.com/repos/everydayhero/developer.everydayhero.com/subscribers","subscription_url":"https://api.github.com/repos/everydayhero/developer.everydayhero.com/subscription","commits_url":"https://api.github.com/repos/everydayhero/developer.everydayhero.com/commits{/sha}","git_commits_url":"https://api.github.com/repos/everydayhero/developer.everydayhero.com/git/commits{/sha}","comments_url":"https://api.github.com/repos/everydayhero/developer.everydayhero.com/comments{/number}","issue_comment_url":"https://api.github.com/repos/everydayhero/developer.everydayhero.com/issues/comments{/number}","contents_url":"https://api.github.com/repos/everydayhero/developer.everydayhero.com/contents/{+path}","compare_url":"https://api.github.com/repos/everydayhero/developer.everydayhero.com/compare/{base}...{head}","merges_url":"https://api.github.com/repos/everydayhero/developer.everydayhero.com/merges","archive_url":"https://api.github.com/repos/everydayhero/developer.everydayhero.com/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/everydayhero/developer.everydayhero.com/downloads","issues_url":"https://api.github.com/repos/everydayhero/developer.everydayhero.com/issues{/number}","pulls_url":"https://api.github.com/repos/everydayhero/developer.everydayhero.com/pulls{/number}","milestones_url":"https://api.github.com/repos/everydayhero/developer.everydayhero.com/milestones{/number}","notifications_url":"https://api.github.com/repos/everydayhero/developer.everydayhero.com/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/everydayhero/developer.everydayhero.com/labels{/name}","releases_url":"https://api.github.com/repos/everydayhero/developer.everydayhero.com/releases{/id}","created_at":"2013-01-28T11:02:36Z","updated_at":"2015-09-11T00:53:16Z","pushed_at":"2015-09-28T06:45:13Z","git_url":"git://github.com/everydayhero/developer.everydayhero.com.git","ssh_url":"git@github.com:everydayhero/developer.everydayhero.com.git","clone_url":"https://github.com/everydayhero/developer.everydayhero.com.git","svn_url":"https://github.com/everydayhero/developer.everydayhero.com","homepage":"http://developer.everydayhero.com","size":3661,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":2,"mirror_url":null,"open_issues_count":1,"forks":2,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/everydayhero/developer.everydayhero.com/pulls/116"},"html":{"href":"https://github.com/everydayhero/developer.everydayhero.com/pull/116"},"issue":{"href":"https://api.github.com/repos/everydayhero/developer.everydayhero.com/issues/116"},"comments":{"href":"https://api.github.com/repos/everydayhero/developer.everydayhero.com/issues/116/comments"},"review_comments":{"href":"https://api.github.com/repos/everydayhero/developer.everydayhero.com/pulls/116/comments"},"review_comment":{"href":"https://api.github.com/repos/everydayhero/developer.everydayhero.com/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/everydayhero/developer.everydayhero.com/pulls/116/commits"},"statuses":{"href":"https://api.github.com/repos/everydayhero/developer.everydayhero.com/statuses/6db81ef562917690ac3ec204783acebf837e3851"}}}}