{"action":"created","comment":{"url":"https://api.github.com/repos/layerhq/documentation/pulls/comments/50338249","id":50338249,"diff_hunk":"@@ -0,0 +1,67 @@\n+# Push Tokens\n+\n+When the Client API is used from mobile frameworks (React Native, Cordova, Titanium, etc.), users can register and unregister the native push tokens for APNs and GCM to allow OS notifications for the app, just like with a native Layer mobile app.\n+\n+## Registering a Push Token\n+\n+You can create and send a Message using:\n+\n+```request\n+POST /push_tokens\n+\n+```\n+\n+### Parameters\n+\n+| Name    | Type |  Description  |\n+|---------|------|---------------|\n+| **token**           | string | The APNs or GCM push token to register |\n+| **type**      | string | Either `apns` or `gcm` |\n+| **device_id** | string | A stable id that identified the device, from the OS. This is only used to avoid duplicate tokens on a device |\n+| **apns_bundle_id**  | string | (optional) The APNS bundle id corresponding to the token |\n+| **gcm_sender_id**  | string | (optional) The GCM sender id corresponding to the token |\n+\n+### Example\n+\n+```json\n+{\n+    \"token\": \"105ebe3fcb7e93efda22257caaf5b9c465043f6d0b2abf3bc8ae7c939655e949\",\n+    \"type\": \"apns\",\n+    \"device_id\": \"a7775566-bfbf-11e5-bf72-359a01002888\",\n+    \"apns_bundle_id\": \"com.layer.bundleid\"\n+}\n+```\n+\n+```console\n+curl  -X POST \\\n+      -H \"Accept: application/vnd.layer+json; version=1.0\" \\\n+      -H \"Authorization: Layer session-token='TOKEN'\" \\\n+      -H \"Content-Type: application/json\" \\\n+      -d '{\"token\": \"105ebe3fcb7e93efda22257caaf5b9c465043f6d0b2abf3bc8ae7c939655e949\", \"type\": \"apns\", \"device_id\": \"a7775566-bfbf-11e5-bf72-359a01002888\", \"apns_bundle_id\": \"com.layer.bundleid\"}' \\\n+      https://api.layer.com/push_tokens\n+```\n+\n+### Response `202 (Accepted)`\n+\n+Empty Body\n+\n+## Unregister a Push Token\n+\n+You can delete a push token using:\n+\n+```request\n+DELETE /push_tokens/:device_id\n+```\n+\n+### Example\n+\n+```console\n+curl  -X DELETE \\\n+      -H \"Accept: application/vnd.layer+json; version=1.0\" \\\n+      -H \"Authorization: Layer session-token='TOKEN'\" \\\n+      https://api.layer.com/push_tokens/a7775566-bfbf-11e5-bf72-359a01002888\n+```\n+\n+### Response `202 (Accepted)`","path":"client/rest/push-tokens.md","position":65,"original_position":65,"commit_id":"0c00c6866d1b63a4d7da47c9058cbd9e7ecd6ef0","original_commit_id":"0c00c6866d1b63a4d7da47c9058cbd9e7ecd6ef0","user":{"login":"drapp","id":1399280,"avatar_url":"https://avatars.githubusercontent.com/u/1399280?v=3","gravatar_id":"","url":"https://api.github.com/users/drapp","html_url":"https://github.com/drapp","followers_url":"https://api.github.com/users/drapp/followers","following_url":"https://api.github.com/users/drapp/following{/other_user}","gists_url":"https://api.github.com/users/drapp/gists{/gist_id}","starred_url":"https://api.github.com/users/drapp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/drapp/subscriptions","organizations_url":"https://api.github.com/users/drapp/orgs","repos_url":"https://api.github.com/users/drapp/repos","events_url":"https://api.github.com/users/drapp/events{/privacy}","received_events_url":"https://api.github.com/users/drapp/received_events","type":"User","site_admin":false},"body":"It's an async operation since we just stick stuff in a queue, so I think this is right","created_at":"2016-01-20T23:29:41Z","updated_at":"2016-01-20T23:29:41Z","html_url":"https://github.com/layerhq/documentation/pull/142#discussion_r50338249","pull_request_url":"https://api.github.com/repos/layerhq/documentation/pulls/142","_links":{"self":{"href":"https://api.github.com/repos/layerhq/documentation/pulls/comments/50338249"},"html":{"href":"https://github.com/layerhq/documentation/pull/142#discussion_r50338249"},"pull_request":{"href":"https://api.github.com/repos/layerhq/documentation/pulls/142"}}},"pull_request":{"url":"https://api.github.com/repos/layerhq/documentation/pulls/142","id":56683422,"html_url":"https://github.com/layerhq/documentation/pull/142","diff_url":"https://github.com/layerhq/documentation/pull/142.diff","patch_url":"https://github.com/layerhq/documentation/pull/142.patch","issue_url":"https://api.github.com/repos/layerhq/documentation/issues/142","number":142,"state":"open","locked":false,"title":"dock participant blocked error and push token endpoints","user":{"login":"drapp","id":1399280,"avatar_url":"https://avatars.githubusercontent.com/u/1399280?v=3","gravatar_id":"","url":"https://api.github.com/users/drapp","html_url":"https://github.com/drapp","followers_url":"https://api.github.com/users/drapp/followers","following_url":"https://api.github.com/users/drapp/following{/other_user}","gists_url":"https://api.github.com/users/drapp/gists{/gist_id}","starred_url":"https://api.github.com/users/drapp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/drapp/subscriptions","organizations_url":"https://api.github.com/users/drapp/orgs","repos_url":"https://api.github.com/users/drapp/repos","events_url":"https://api.github.com/users/drapp/events{/privacy}","received_events_url":"https://api.github.com/users/drapp/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-01-20T23:25:28Z","updated_at":"2016-01-20T23:29:41Z","closed_at":null,"merged_at":null,"merge_commit_sha":"50aa558f33a36fdbf4f5c7207bd754f69d734c35","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/layerhq/documentation/pulls/142/commits","review_comments_url":"https://api.github.com/repos/layerhq/documentation/pulls/142/comments","review_comment_url":"https://api.github.com/repos/layerhq/documentation/pulls/comments{/number}","comments_url":"https://api.github.com/repos/layerhq/documentation/issues/142/comments","statuses_url":"https://api.github.com/repos/layerhq/documentation/statuses/0c00c6866d1b63a4d7da47c9058cbd9e7ecd6ef0","head":{"label":"layerhq:push-and-blocking","ref":"push-and-blocking","sha":"0c00c6866d1b63a4d7da47c9058cbd9e7ecd6ef0","user":{"login":"layerhq","id":5497685,"avatar_url":"https://avatars.githubusercontent.com/u/5497685?v=3","gravatar_id":"","url":"https://api.github.com/users/layerhq","html_url":"https://github.com/layerhq","followers_url":"https://api.github.com/users/layerhq/followers","following_url":"https://api.github.com/users/layerhq/following{/other_user}","gists_url":"https://api.github.com/users/layerhq/gists{/gist_id}","starred_url":"https://api.github.com/users/layerhq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/layerhq/subscriptions","organizations_url":"https://api.github.com/users/layerhq/orgs","repos_url":"https://api.github.com/users/layerhq/repos","events_url":"https://api.github.com/users/layerhq/events{/privacy}","received_events_url":"https://api.github.com/users/layerhq/received_events","type":"Organization","site_admin":false},"repo":{"id":24078097,"name":"documentation","full_name":"layerhq/documentation","owner":{"login":"layerhq","id":5497685,"avatar_url":"https://avatars.githubusercontent.com/u/5497685?v=3","gravatar_id":"","url":"https://api.github.com/users/layerhq","html_url":"https://github.com/layerhq","followers_url":"https://api.github.com/users/layerhq/followers","following_url":"https://api.github.com/users/layerhq/following{/other_user}","gists_url":"https://api.github.com/users/layerhq/gists{/gist_id}","starred_url":"https://api.github.com/users/layerhq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/layerhq/subscriptions","organizations_url":"https://api.github.com/users/layerhq/orgs","repos_url":"https://api.github.com/users/layerhq/repos","events_url":"https://api.github.com/users/layerhq/events{/privacy}","received_events_url":"https://api.github.com/users/layerhq/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/layerhq/documentation","description":"Layer SDK Documentation content","fork":false,"url":"https://api.github.com/repos/layerhq/documentation","forks_url":"https://api.github.com/repos/layerhq/documentation/forks","keys_url":"https://api.github.com/repos/layerhq/documentation/keys{/key_id}","collaborators_url":"https://api.github.com/repos/layerhq/documentation/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/layerhq/documentation/teams","hooks_url":"https://api.github.com/repos/layerhq/documentation/hooks","issue_events_url":"https://api.github.com/repos/layerhq/documentation/issues/events{/number}","events_url":"https://api.github.com/repos/layerhq/documentation/events","assignees_url":"https://api.github.com/repos/layerhq/documentation/assignees{/user}","branches_url":"https://api.github.com/repos/layerhq/documentation/branches{/branch}","tags_url":"https://api.github.com/repos/layerhq/documentation/tags","blobs_url":"https://api.github.com/repos/layerhq/documentation/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/layerhq/documentation/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/layerhq/documentation/git/refs{/sha}","trees_url":"https://api.github.com/repos/layerhq/documentation/git/trees{/sha}","statuses_url":"https://api.github.com/repos/layerhq/documentation/statuses/{sha}","languages_url":"https://api.github.com/repos/layerhq/documentation/languages","stargazers_url":"https://api.github.com/repos/layerhq/documentation/stargazers","contributors_url":"https://api.github.com/repos/layerhq/documentation/contributors","subscribers_url":"https://api.github.com/repos/layerhq/documentation/subscribers","subscription_url":"https://api.github.com/repos/layerhq/documentation/subscription","commits_url":"https://api.github.com/repos/layerhq/documentation/commits{/sha}","git_commits_url":"https://api.github.com/repos/layerhq/documentation/git/commits{/sha}","comments_url":"https://api.github.com/repos/layerhq/documentation/comments{/number}","issue_comment_url":"https://api.github.com/repos/layerhq/documentation/issues/comments{/number}","contents_url":"https://api.github.com/repos/layerhq/documentation/contents/{+path}","compare_url":"https://api.github.com/repos/layerhq/documentation/compare/{base}...{head}","merges_url":"https://api.github.com/repos/layerhq/documentation/merges","archive_url":"https://api.github.com/repos/layerhq/documentation/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/layerhq/documentation/downloads","issues_url":"https://api.github.com/repos/layerhq/documentation/issues{/number}","pulls_url":"https://api.github.com/repos/layerhq/documentation/pulls{/number}","milestones_url":"https://api.github.com/repos/layerhq/documentation/milestones{/number}","notifications_url":"https://api.github.com/repos/layerhq/documentation/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/layerhq/documentation/labels{/name}","releases_url":"https://api.github.com/repos/layerhq/documentation/releases{/id}","created_at":"2014-09-15T23:42:50Z","updated_at":"2016-01-11T22:12:42Z","pushed_at":"2016-01-20T23:25:29Z","git_url":"git://github.com/layerhq/documentation.git","ssh_url":"git@github.com:layerhq/documentation.git","clone_url":"https://github.com/layerhq/documentation.git","svn_url":"https://github.com/layerhq/documentation","homepage":"https://developer.layer.com/docs","size":1074,"stargazers_count":16,"watchers_count":16,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":36,"mirror_url":null,"open_issues_count":3,"forks":36,"open_issues":3,"watchers":16,"default_branch":"master"}},"base":{"label":"layerhq:master","ref":"master","sha":"39aff5ad795042d87485c576b34043a6d65a44a0","user":{"login":"layerhq","id":5497685,"avatar_url":"https://avatars.githubusercontent.com/u/5497685?v=3","gravatar_id":"","url":"https://api.github.com/users/layerhq","html_url":"https://github.com/layerhq","followers_url":"https://api.github.com/users/layerhq/followers","following_url":"https://api.github.com/users/layerhq/following{/other_user}","gists_url":"https://api.github.com/users/layerhq/gists{/gist_id}","starred_url":"https://api.github.com/users/layerhq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/layerhq/subscriptions","organizations_url":"https://api.github.com/users/layerhq/orgs","repos_url":"https://api.github.com/users/layerhq/repos","events_url":"https://api.github.com/users/layerhq/events{/privacy}","received_events_url":"https://api.github.com/users/layerhq/received_events","type":"Organization","site_admin":false},"repo":{"id":24078097,"name":"documentation","full_name":"layerhq/documentation","owner":{"login":"layerhq","id":5497685,"avatar_url":"https://avatars.githubusercontent.com/u/5497685?v=3","gravatar_id":"","url":"https://api.github.com/users/layerhq","html_url":"https://github.com/layerhq","followers_url":"https://api.github.com/users/layerhq/followers","following_url":"https://api.github.com/users/layerhq/following{/other_user}","gists_url":"https://api.github.com/users/layerhq/gists{/gist_id}","starred_url":"https://api.github.com/users/layerhq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/layerhq/subscriptions","organizations_url":"https://api.github.com/users/layerhq/orgs","repos_url":"https://api.github.com/users/layerhq/repos","events_url":"https://api.github.com/users/layerhq/events{/privacy}","received_events_url":"https://api.github.com/users/layerhq/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/layerhq/documentation","description":"Layer SDK Documentation content","fork":false,"url":"https://api.github.com/repos/layerhq/documentation","forks_url":"https://api.github.com/repos/layerhq/documentation/forks","keys_url":"https://api.github.com/repos/layerhq/documentation/keys{/key_id}","collaborators_url":"https://api.github.com/repos/layerhq/documentation/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/layerhq/documentation/teams","hooks_url":"https://api.github.com/repos/layerhq/documentation/hooks","issue_events_url":"https://api.github.com/repos/layerhq/documentation/issues/events{/number}","events_url":"https://api.github.com/repos/layerhq/documentation/events","assignees_url":"https://api.github.com/repos/layerhq/documentation/assignees{/user}","branches_url":"https://api.github.com/repos/layerhq/documentation/branches{/branch}","tags_url":"https://api.github.com/repos/layerhq/documentation/tags","blobs_url":"https://api.github.com/repos/layerhq/documentation/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/layerhq/documentation/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/layerhq/documentation/git/refs{/sha}","trees_url":"https://api.github.com/repos/layerhq/documentation/git/trees{/sha}","statuses_url":"https://api.github.com/repos/layerhq/documentation/statuses/{sha}","languages_url":"https://api.github.com/repos/layerhq/documentation/languages","stargazers_url":"https://api.github.com/repos/layerhq/documentation/stargazers","contributors_url":"https://api.github.com/repos/layerhq/documentation/contributors","subscribers_url":"https://api.github.com/repos/layerhq/documentation/subscribers","subscription_url":"https://api.github.com/repos/layerhq/documentation/subscription","commits_url":"https://api.github.com/repos/layerhq/documentation/commits{/sha}","git_commits_url":"https://api.github.com/repos/layerhq/documentation/git/commits{/sha}","comments_url":"https://api.github.com/repos/layerhq/documentation/comments{/number}","issue_comment_url":"https://api.github.com/repos/layerhq/documentation/issues/comments{/number}","contents_url":"https://api.github.com/repos/layerhq/documentation/contents/{+path}","compare_url":"https://api.github.com/repos/layerhq/documentation/compare/{base}...{head}","merges_url":"https://api.github.com/repos/layerhq/documentation/merges","archive_url":"https://api.github.com/repos/layerhq/documentation/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/layerhq/documentation/downloads","issues_url":"https://api.github.com/repos/layerhq/documentation/issues{/number}","pulls_url":"https://api.github.com/repos/layerhq/documentation/pulls{/number}","milestones_url":"https://api.github.com/repos/layerhq/documentation/milestones{/number}","notifications_url":"https://api.github.com/repos/layerhq/documentation/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/layerhq/documentation/labels{/name}","releases_url":"https://api.github.com/repos/layerhq/documentation/releases{/id}","created_at":"2014-09-15T23:42:50Z","updated_at":"2016-01-11T22:12:42Z","pushed_at":"2016-01-20T23:25:29Z","git_url":"git://github.com/layerhq/documentation.git","ssh_url":"git@github.com:layerhq/documentation.git","clone_url":"https://github.com/layerhq/documentation.git","svn_url":"https://github.com/layerhq/documentation","homepage":"https://developer.layer.com/docs","size":1074,"stargazers_count":16,"watchers_count":16,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":36,"mirror_url":null,"open_issues_count":3,"forks":36,"open_issues":3,"watchers":16,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/layerhq/documentation/pulls/142"},"html":{"href":"https://github.com/layerhq/documentation/pull/142"},"issue":{"href":"https://api.github.com/repos/layerhq/documentation/issues/142"},"comments":{"href":"https://api.github.com/repos/layerhq/documentation/issues/142/comments"},"review_comments":{"href":"https://api.github.com/repos/layerhq/documentation/pulls/142/comments"},"review_comment":{"href":"https://api.github.com/repos/layerhq/documentation/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/layerhq/documentation/pulls/142/commits"},"statuses":{"href":"https://api.github.com/repos/layerhq/documentation/statuses/0c00c6866d1b63a4d7da47c9058cbd9e7ecd6ef0"}}}}