{"action":"created","comment":{"url":"https://api.github.com/repos/smooch/smooch-docs/pulls/comments/90477179","pull_request_review_id":10993993,"id":90477179,"diff_hunk":"@@ -5,3 +5,175 @@ layout: two-column\n ---\n \n # API Quickstart\n+\n+## Introduction\n+\n+This quickstart guide will walk you through getting started with Smooch's REST API. When you complete the guide, you'll know how to connect Facebook Messenger to Smooch and send an automated response to any Facebook Messenger user who sends you a message.\n+\n+## Create a new Facebook page\n+\n+This guide uses the Smooch Dashboard to configure Facebook messenger. I is also possible to configure thus via the [integration API](http://docs.smooch.io/rest/#managed-accounts).\n+\n+First, sign in to a Facebook account and [create a new page](https://www.facebook.com/pages/create/).\n+\n+![Create a new Facebook page for a fictional character](/images/create_facebook_page.png)\n+\n+## Connect Facebook to Smooch\n+\n+If you haven't already, sign up for a [Smooch account](https://app.smooch.io/), and follow SmoochBot's instructions to connect Facebook Messenger.\n+\n+![SmoochBot](/images/smoochbot.png)\n+\n+ You can also connect Facebook Messenger from the [integration page for Facebook Messenger](https://app.smooch.io/integrations/messenger).\n+\n+Now, whenever someone sends a message to your Facebook page, it will also be sent to Smooch. Great! Let's figure out a way to answer them!\n+\n+## Deploy a server\n+\n+Now you need to deploy a server and expose a POST `/messages` endpoint to receive user messages. All you want to do for now is log those messages.\n+\n+We wrote our server in Node.js and used a service called [ngrok](https://ngrok.com/) to create a secure tunnel to localhost. If you need inspiration, check out the complete code at the end of this quickstart.\n+\n+## Create a Webhook\n+\n+Once your server is listening for requests, you can create a Smooch Webhook [on this page](https://app.smooch.io/integrations/webhook). In the Webhook URL field, enter the URL for your service and the POST `/messages` route. Pick \"App User Messages\" as a trigger.\n+\n+![Create a Webhook](/images/create_webhook.png)\n+\n+As soon as you \"Confirm and Save\", you'll be able to inspect the messages you're receiving from Facebook users. Try sending a message to your Facebook page as a Facebook user. Once you check your server logs, you'll see the payload in all of its JSON glory.\n+\n+**[JSON like this](http://docs.smooch.io/rest/#webhooks-payload)**.\n+\n+## Authorization\n+\n+Now it's time to call the Smooch REST API. First thing you'll need is a secret key. Go to your settings page from the Smooch dashboard, and create a new secret key.","path":"pages/docs/api-quickstart.md","position":45,"original_position":45,"commit_id":"8ff0d175667139efc16361295eef5d63555161c3","original_commit_id":"8ff0d175667139efc16361295eef5d63555161c3","user":{"login":"heatheratsmooch","id":21180253,"avatar_url":"https://avatars.githubusercontent.com/u/21180253?v=3","gravatar_id":"","url":"https://api.github.com/users/heatheratsmooch","html_url":"https://github.com/heatheratsmooch","followers_url":"https://api.github.com/users/heatheratsmooch/followers","following_url":"https://api.github.com/users/heatheratsmooch/following{/other_user}","gists_url":"https://api.github.com/users/heatheratsmooch/gists{/gist_id}","starred_url":"https://api.github.com/users/heatheratsmooch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/heatheratsmooch/subscriptions","organizations_url":"https://api.github.com/users/heatheratsmooch/orgs","repos_url":"https://api.github.com/users/heatheratsmooch/repos","events_url":"https://api.github.com/users/heatheratsmooch/events{/privacy}","received_events_url":"https://api.github.com/users/heatheratsmooch/received_events","type":"User","site_admin":false},"body":"Should Secret Key in this doc be capitalized, like Webhook?","created_at":"2016-12-01T16:02:25Z","updated_at":"2016-12-01T16:16:36Z","html_url":"https://github.com/smooch/smooch-docs/pull/173#discussion_r90477179","pull_request_url":"https://api.github.com/repos/smooch/smooch-docs/pulls/173","_links":{"self":{"href":"https://api.github.com/repos/smooch/smooch-docs/pulls/comments/90477179"},"html":{"href":"https://github.com/smooch/smooch-docs/pull/173#discussion_r90477179"},"pull_request":{"href":"https://api.github.com/repos/smooch/smooch-docs/pulls/173"}}},"pull_request":{"url":"https://api.github.com/repos/smooch/smooch-docs/pulls/173","id":95346948,"html_url":"https://github.com/smooch/smooch-docs/pull/173","diff_url":"https://github.com/smooch/smooch-docs/pull/173.diff","patch_url":"https://github.com/smooch/smooch-docs/pull/173.patch","issue_url":"https://api.github.com/repos/smooch/smooch-docs/issues/173","number":173,"state":"open","locked":false,"title":"Add Quickstart docs v2","user":{"login":"spasiu","id":2235885,"avatar_url":"https://avatars.githubusercontent.com/u/2235885?v=3","gravatar_id":"","url":"https://api.github.com/users/spasiu","html_url":"https://github.com/spasiu","followers_url":"https://api.github.com/users/spasiu/followers","following_url":"https://api.github.com/users/spasiu/following{/other_user}","gists_url":"https://api.github.com/users/spasiu/gists{/gist_id}","starred_url":"https://api.github.com/users/spasiu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spasiu/subscriptions","organizations_url":"https://api.github.com/users/spasiu/orgs","repos_url":"https://api.github.com/users/spasiu/repos","events_url":"https://api.github.com/users/spasiu/events{/privacy}","received_events_url":"https://api.github.com/users/spasiu/received_events","type":"User","site_admin":false},"body":"@debbiepapoulis @gozman @jpjoyal \r\n\r\nRewrote the quickstart for seasoned developers.","created_at":"2016-11-25T20:55:46Z","updated_at":"2016-12-01T16:31:49Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7a6045cea385ae46c163e474d2867bad7b06ecc7","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/smooch/smooch-docs/pulls/173/commits","review_comments_url":"https://api.github.com/repos/smooch/smooch-docs/pulls/173/comments","review_comment_url":"https://api.github.com/repos/smooch/smooch-docs/pulls/comments{/number}","comments_url":"https://api.github.com/repos/smooch/smooch-docs/issues/173/comments","statuses_url":"https://api.github.com/repos/smooch/smooch-docs/statuses/8ff0d175667139efc16361295eef5d63555161c3","head":{"label":"smooch:f/api-quickstart-v2","ref":"f/api-quickstart-v2","sha":"8ff0d175667139efc16361295eef5d63555161c3","user":{"login":"smooch","id":14301989,"avatar_url":"https://avatars.githubusercontent.com/u/14301989?v=3","gravatar_id":"","url":"https://api.github.com/users/smooch","html_url":"https://github.com/smooch","followers_url":"https://api.github.com/users/smooch/followers","following_url":"https://api.github.com/users/smooch/following{/other_user}","gists_url":"https://api.github.com/users/smooch/gists{/gist_id}","starred_url":"https://api.github.com/users/smooch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smooch/subscriptions","organizations_url":"https://api.github.com/users/smooch/orgs","repos_url":"https://api.github.com/users/smooch/repos","events_url":"https://api.github.com/users/smooch/events{/privacy}","received_events_url":"https://api.github.com/users/smooch/received_events","type":"Organization","site_admin":false},"repo":{"id":39525331,"name":"smooch-docs","full_name":"smooch/smooch-docs","owner":{"login":"smooch","id":14301989,"avatar_url":"https://avatars.githubusercontent.com/u/14301989?v=3","gravatar_id":"","url":"https://api.github.com/users/smooch","html_url":"https://github.com/smooch","followers_url":"https://api.github.com/users/smooch/followers","following_url":"https://api.github.com/users/smooch/following{/other_user}","gists_url":"https://api.github.com/users/smooch/gists{/gist_id}","starred_url":"https://api.github.com/users/smooch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smooch/subscriptions","organizations_url":"https://api.github.com/users/smooch/orgs","repos_url":"https://api.github.com/users/smooch/repos","events_url":"https://api.github.com/users/smooch/events{/privacy}","received_events_url":"https://api.github.com/users/smooch/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/smooch/smooch-docs","description":"Docs living at docs.smooch.io","fork":false,"url":"https://api.github.com/repos/smooch/smooch-docs","forks_url":"https://api.github.com/repos/smooch/smooch-docs/forks","keys_url":"https://api.github.com/repos/smooch/smooch-docs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/smooch/smooch-docs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/smooch/smooch-docs/teams","hooks_url":"https://api.github.com/repos/smooch/smooch-docs/hooks","issue_events_url":"https://api.github.com/repos/smooch/smooch-docs/issues/events{/number}","events_url":"https://api.github.com/repos/smooch/smooch-docs/events","assignees_url":"https://api.github.com/repos/smooch/smooch-docs/assignees{/user}","branches_url":"https://api.github.com/repos/smooch/smooch-docs/branches{/branch}","tags_url":"https://api.github.com/repos/smooch/smooch-docs/tags","blobs_url":"https://api.github.com/repos/smooch/smooch-docs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/smooch/smooch-docs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/smooch/smooch-docs/git/refs{/sha}","trees_url":"https://api.github.com/repos/smooch/smooch-docs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/smooch/smooch-docs/statuses/{sha}","languages_url":"https://api.github.com/repos/smooch/smooch-docs/languages","stargazers_url":"https://api.github.com/repos/smooch/smooch-docs/stargazers","contributors_url":"https://api.github.com/repos/smooch/smooch-docs/contributors","subscribers_url":"https://api.github.com/repos/smooch/smooch-docs/subscribers","subscription_url":"https://api.github.com/repos/smooch/smooch-docs/subscription","commits_url":"https://api.github.com/repos/smooch/smooch-docs/commits{/sha}","git_commits_url":"https://api.github.com/repos/smooch/smooch-docs/git/commits{/sha}","comments_url":"https://api.github.com/repos/smooch/smooch-docs/comments{/number}","issue_comment_url":"https://api.github.com/repos/smooch/smooch-docs/issues/comments{/number}","contents_url":"https://api.github.com/repos/smooch/smooch-docs/contents/{+path}","compare_url":"https://api.github.com/repos/smooch/smooch-docs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/smooch/smooch-docs/merges","archive_url":"https://api.github.com/repos/smooch/smooch-docs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/smooch/smooch-docs/downloads","issues_url":"https://api.github.com/repos/smooch/smooch-docs/issues{/number}","pulls_url":"https://api.github.com/repos/smooch/smooch-docs/pulls{/number}","milestones_url":"https://api.github.com/repos/smooch/smooch-docs/milestones{/number}","notifications_url":"https://api.github.com/repos/smooch/smooch-docs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/smooch/smooch-docs/labels{/name}","releases_url":"https://api.github.com/repos/smooch/smooch-docs/releases{/id}","deployments_url":"https://api.github.com/repos/smooch/smooch-docs/deployments","created_at":"2015-07-22T19:13:33Z","updated_at":"2016-10-25T18:02:09Z","pushed_at":"2016-12-01T05:03:01Z","git_url":"git://github.com/smooch/smooch-docs.git","ssh_url":"git@github.com:smooch/smooch-docs.git","clone_url":"https://github.com/smooch/smooch-docs.git","svn_url":"https://github.com/smooch/smooch-docs","homepage":"http://docs.supportkit.io","size":178365,"stargazers_count":2,"watchers_count":2,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":6,"mirror_url":null,"open_issues_count":5,"forks":6,"open_issues":5,"watchers":2,"default_branch":"integration"}},"base":{"label":"smooch:f/new-docs","ref":"f/new-docs","sha":"2e30c3f7cf19a365f6f57d0a4a92326670ac4c25","user":{"login":"smooch","id":14301989,"avatar_url":"https://avatars.githubusercontent.com/u/14301989?v=3","gravatar_id":"","url":"https://api.github.com/users/smooch","html_url":"https://github.com/smooch","followers_url":"https://api.github.com/users/smooch/followers","following_url":"https://api.github.com/users/smooch/following{/other_user}","gists_url":"https://api.github.com/users/smooch/gists{/gist_id}","starred_url":"https://api.github.com/users/smooch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smooch/subscriptions","organizations_url":"https://api.github.com/users/smooch/orgs","repos_url":"https://api.github.com/users/smooch/repos","events_url":"https://api.github.com/users/smooch/events{/privacy}","received_events_url":"https://api.github.com/users/smooch/received_events","type":"Organization","site_admin":false},"repo":{"id":39525331,"name":"smooch-docs","full_name":"smooch/smooch-docs","owner":{"login":"smooch","id":14301989,"avatar_url":"https://avatars.githubusercontent.com/u/14301989?v=3","gravatar_id":"","url":"https://api.github.com/users/smooch","html_url":"https://github.com/smooch","followers_url":"https://api.github.com/users/smooch/followers","following_url":"https://api.github.com/users/smooch/following{/other_user}","gists_url":"https://api.github.com/users/smooch/gists{/gist_id}","starred_url":"https://api.github.com/users/smooch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smooch/subscriptions","organizations_url":"https://api.github.com/users/smooch/orgs","repos_url":"https://api.github.com/users/smooch/repos","events_url":"https://api.github.com/users/smooch/events{/privacy}","received_events_url":"https://api.github.com/users/smooch/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/smooch/smooch-docs","description":"Docs living at docs.smooch.io","fork":false,"url":"https://api.github.com/repos/smooch/smooch-docs","forks_url":"https://api.github.com/repos/smooch/smooch-docs/forks","keys_url":"https://api.github.com/repos/smooch/smooch-docs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/smooch/smooch-docs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/smooch/smooch-docs/teams","hooks_url":"https://api.github.com/repos/smooch/smooch-docs/hooks","issue_events_url":"https://api.github.com/repos/smooch/smooch-docs/issues/events{/number}","events_url":"https://api.github.com/repos/smooch/smooch-docs/events","assignees_url":"https://api.github.com/repos/smooch/smooch-docs/assignees{/user}","branches_url":"https://api.github.com/repos/smooch/smooch-docs/branches{/branch}","tags_url":"https://api.github.com/repos/smooch/smooch-docs/tags","blobs_url":"https://api.github.com/repos/smooch/smooch-docs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/smooch/smooch-docs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/smooch/smooch-docs/git/refs{/sha}","trees_url":"https://api.github.com/repos/smooch/smooch-docs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/smooch/smooch-docs/statuses/{sha}","languages_url":"https://api.github.com/repos/smooch/smooch-docs/languages","stargazers_url":"https://api.github.com/repos/smooch/smooch-docs/stargazers","contributors_url":"https://api.github.com/repos/smooch/smooch-docs/contributors","subscribers_url":"https://api.github.com/repos/smooch/smooch-docs/subscribers","subscription_url":"https://api.github.com/repos/smooch/smooch-docs/subscription","commits_url":"https://api.github.com/repos/smooch/smooch-docs/commits{/sha}","git_commits_url":"https://api.github.com/repos/smooch/smooch-docs/git/commits{/sha}","comments_url":"https://api.github.com/repos/smooch/smooch-docs/comments{/number}","issue_comment_url":"https://api.github.com/repos/smooch/smooch-docs/issues/comments{/number}","contents_url":"https://api.github.com/repos/smooch/smooch-docs/contents/{+path}","compare_url":"https://api.github.com/repos/smooch/smooch-docs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/smooch/smooch-docs/merges","archive_url":"https://api.github.com/repos/smooch/smooch-docs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/smooch/smooch-docs/downloads","issues_url":"https://api.github.com/repos/smooch/smooch-docs/issues{/number}","pulls_url":"https://api.github.com/repos/smooch/smooch-docs/pulls{/number}","milestones_url":"https://api.github.com/repos/smooch/smooch-docs/milestones{/number}","notifications_url":"https://api.github.com/repos/smooch/smooch-docs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/smooch/smooch-docs/labels{/name}","releases_url":"https://api.github.com/repos/smooch/smooch-docs/releases{/id}","deployments_url":"https://api.github.com/repos/smooch/smooch-docs/deployments","created_at":"2015-07-22T19:13:33Z","updated_at":"2016-10-25T18:02:09Z","pushed_at":"2016-12-01T05:03:01Z","git_url":"git://github.com/smooch/smooch-docs.git","ssh_url":"git@github.com:smooch/smooch-docs.git","clone_url":"https://github.com/smooch/smooch-docs.git","svn_url":"https://github.com/smooch/smooch-docs","homepage":"http://docs.supportkit.io","size":178365,"stargazers_count":2,"watchers_count":2,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":6,"mirror_url":null,"open_issues_count":5,"forks":6,"open_issues":5,"watchers":2,"default_branch":"integration"}},"_links":{"self":{"href":"https://api.github.com/repos/smooch/smooch-docs/pulls/173"},"html":{"href":"https://github.com/smooch/smooch-docs/pull/173"},"issue":{"href":"https://api.github.com/repos/smooch/smooch-docs/issues/173"},"comments":{"href":"https://api.github.com/repos/smooch/smooch-docs/issues/173/comments"},"review_comments":{"href":"https://api.github.com/repos/smooch/smooch-docs/pulls/173/comments"},"review_comment":{"href":"https://api.github.com/repos/smooch/smooch-docs/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/smooch/smooch-docs/pulls/173/commits"},"statuses":{"href":"https://api.github.com/repos/smooch/smooch-docs/statuses/8ff0d175667139efc16361295eef5d63555161c3"}}}}
{"actor":{"display_login":"heatheratsmooch"}}