{"action":"created","comment":{"url":"https://api.github.com/repos/smooch/smooch-docs/pulls/comments/90381573","pull_request_review_id":10900192,"id":90381573,"diff_hunk":"@@ -5,3 +5,83 @@ 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+Smooch provides a [REST API for programmatically connecting to channels like Facebook Messenger](http://docs.smooch.io/rest/#managed-accounts), but you're going to do this part through the UI to get started more quickly.\n+\n+First, sign-in to a Facebook account and [create a new page](https://www.facebook.com/pages/create/). I created a page for a fictional character (double fictional because I just made it up).\n+\n+![Create a new Facebook page for a fictional character](/images/create_facebook_page.png)\n+\n+You can skip through all the setup steps for the new Facebook page. You'll end up with [a page like this](https://www.facebook.com/Manfredi-pilgillets-341436779570384/).\n+\n+## Connect Facebook to Smooch\n+\n+Great, now let's setup Smooch. If you haven't already, [Sign-up for a Smooch account](https://app.smooch.io/). You'll be greeted by SmoochBot.\n+\n+![SmoochBot](/images/smoochbot.png)\n+\n+SmoochBot will guide you through setting up your first Smooch App and even connecting to Facebook Messenger!\n+\n+If you didn't connect to Facebook Messenger with SmoochBot, or you already have a Smooch account, just head over to [the integration page for Facebook Messenger](https://app.smooch.io/integrations/messenger) and connect your account now.\n+\n+Now whenever someone sends a message to your Facebook page, it will also be sent to Smooch. So 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+I wrote my server in NodeJS and used [a service called ngrok](https://ngrok.com/) to create a secure tunnel to localhost so that I could run a server from my laptop. If you need inspiration, [here's the complete code I used for this quickstart guide](https://gist.github.com/spasiu/fb53541053564ca4cf2052e6e1996ee3).\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. When you go check your server logs, you'll see the payload in all of its JSON glory.\n+\n+**[JSON like this](https://gist.github.com/spasiu/3e98c7b0e7de87302a9faf2cc0d32df3)**.\n+\n+## Authorization\n+\n+Now it's time to call the Smooch REST API.\n+\n+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":51,"original_position":51,"commit_id":"1b7e0044d1b43d468c46ecb0a0d3500c227459de","original_commit_id":"1b7e0044d1b43d468c46ecb0a0d3500c227459de","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":"App scoped key is generated from settings page though, and there's no link to that.","created_at":"2016-12-01T04:26:53Z","updated_at":"2016-12-01T04:26:53Z","html_url":"https://github.com/smooch/smooch-docs/pull/173#discussion_r90381573","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/90381573"},"html":{"href":"https://github.com/smooch/smooch-docs/pull/173#discussion_r90381573"},"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-01T04:26:53Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6cb9f1e21d2defaa2e18ad127388dfbd00e14d17","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/1b7e0044d1b43d468c46ecb0a0d3500c227459de","head":{"label":"smooch:f/api-quickstart-v2","ref":"f/api-quickstart-v2","sha":"1b7e0044d1b43d468c46ecb0a0d3500c227459de","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-11-30T21:06:00Z","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":178363,"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-11-30T21:06:00Z","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":178363,"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/1b7e0044d1b43d468c46ecb0a0d3500c227459de"}}}}
{"actor":{"display_login":"spasiu"}}