{"action":"created","comment":{"url":"https://api.github.com/repos/openedinc/opened-oauth.js/pulls/comments/23245350","id":23245350,"diff_hunk":"@@ -0,0 +1,114 @@\n+# opened-oauth.js\n+## Getting started\n+1. Create a callback route on your website (you can see an exmaple at callback.html)\n+2. Get application key(redirect_uri must be an url that you created in step 1)\n+3. Download and include opened-oauth.js to your web-site\n+4. ``` window.OpenEd.api.init({client_id: 'your app id here', redirect_uri: 'your application success callback uri'}) ```\n+5. ``` window.OpenEd.api.login() ``` will open a popup with OpenEd oauth flow\n+6. After success u have your token avaivable via ``` window.OpenEd.api.getToken() ```\n+7. Now u can access OpenEd API endpoints  via ``` window.OpenEd.api.request() ```\n+\n+## Methods\n+### init(initOptions)\n+```\n+window.OpenEd.api.init(initOptions)\n+```\n+initOptions:\n+ - client_id - String, required\n+\n+ Your client app id. Exmaple: 'fj34892fj20984ujgf3029guj89324ujgt09u4g'\n+ - redirect_uri - String, required\n+\n+ Your apps callback url. Exmaple: 'https://exmaple.com/oauth-callback/'\n+\n+### login(callback)\n+```\n+window.OpenEd.api.login(callback)\n+```\n+callback(error) - function\n+\n+error is empty if success\n+\n+### logout(callback)\n+```\n+window.OpenEd.api.logout(callback)\n+```\n+callback(error) - function\n+\n+error is empty if success\n+\n+### request(apiName, data, callback)\n+```\n+window.OpenEd.api.request(apiName, data, callback)\n+```\n+callback(responseData) - function\n+\n+responseData - result data object\n+\n+## API endpoints\n+\n+### /current_user.json \n+\n+Returns current user object\n+\n+Exmaple: \n+\n+request:\n+```\n+window.OpenEd.api.request('/current_user.json', null, callback)\n+```\n+response:\n+```\n+{\n+    \"current_user\":{\n+        \"first_name\":\"Andrew\",\n+        \"last_name\":\"Saenkov\",\n+        \"full_name\":\"Andrew Saenkov\",\n+        \"username\":\"andrew\",\n+        \"email\":\"andrew@example.com\"\n+     }\n+}\n+```\n+\n+### /resources.json \n+\n+Makes a resource query. \n+\n+Returns an array of resources and pagination info\n+\n+Example:\n+\n+request:\n+```\n+window.OpenEd.api.request('/resources.json', {\n+    offset: 10,\n+    limit: 10,\n+    descriptive: 'keyword search',\n+    grade: 'k',\n+    resource_type: 'game',\n+    contribution_name: 'Pearson'\n+}, callback)\n+```\n+response:\n+```\n+{\"meta\":\n+    {\"pagination\":\n+        {\n+            \"offset\":10,\n+            \"total_entries\":894208,","path":"README.md","position":98,"original_position":98,"commit_id":"f300be4e3960ad0f1b1842cc3faa2c36eb6aedef","original_commit_id":"f300be4e3960ad0f1b1842cc3faa2c36eb6aedef","user":{"login":"LeonidMorozov","id":2562446,"avatar_url":"https://avatars.githubusercontent.com/u/2562446?v=3","gravatar_id":"","url":"https://api.github.com/users/LeonidMorozov","html_url":"https://github.com/LeonidMorozov","followers_url":"https://api.github.com/users/LeonidMorozov/followers","following_url":"https://api.github.com/users/LeonidMorozov/following{/other_user}","gists_url":"https://api.github.com/users/LeonidMorozov/gists{/gist_id}","starred_url":"https://api.github.com/users/LeonidMorozov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LeonidMorozov/subscriptions","organizations_url":"https://api.github.com/users/LeonidMorozov/orgs","repos_url":"https://api.github.com/users/LeonidMorozov/repos","events_url":"https://api.github.com/users/LeonidMorozov/events{/privacy}","received_events_url":"https://api.github.com/users/LeonidMorozov/received_events","type":"User","site_admin":false},"body":"number is wrong","created_at":"2015-01-20T18:55:58Z","updated_at":"2015-01-20T18:55:58Z","html_url":"https://github.com/openedinc/opened-oauth.js/pull/1#discussion_r23245350","pull_request_url":"https://api.github.com/repos/openedinc/opened-oauth.js/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/openedinc/opened-oauth.js/pulls/comments/23245350"},"html":{"href":"https://github.com/openedinc/opened-oauth.js/pull/1#discussion_r23245350"},"pull_request":{"href":"https://api.github.com/repos/openedinc/opened-oauth.js/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/openedinc/opened-oauth.js/pulls/1","id":27627997,"html_url":"https://github.com/openedinc/opened-oauth.js/pull/1","diff_url":"https://github.com/openedinc/opened-oauth.js/pull/1.diff","patch_url":"https://github.com/openedinc/opened-oauth.js/pull/1.patch","issue_url":"https://api.github.com/repos/openedinc/opened-oauth.js/issues/1","number":1,"state":"open","locked":false,"title":"added read me","user":{"login":"mikrowelt","id":1247546,"avatar_url":"https://avatars.githubusercontent.com/u/1247546?v=3","gravatar_id":"","url":"https://api.github.com/users/mikrowelt","html_url":"https://github.com/mikrowelt","followers_url":"https://api.github.com/users/mikrowelt/followers","following_url":"https://api.github.com/users/mikrowelt/following{/other_user}","gists_url":"https://api.github.com/users/mikrowelt/gists{/gist_id}","starred_url":"https://api.github.com/users/mikrowelt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mikrowelt/subscriptions","organizations_url":"https://api.github.com/users/mikrowelt/orgs","repos_url":"https://api.github.com/users/mikrowelt/repos","events_url":"https://api.github.com/users/mikrowelt/events{/privacy}","received_events_url":"https://api.github.com/users/mikrowelt/received_events","type":"User","site_admin":false},"body":"added some inprovments","created_at":"2015-01-19T18:53:14Z","updated_at":"2015-01-20T18:55:58Z","closed_at":null,"merged_at":null,"merge_commit_sha":"368f4b23dd2fce8af79aec635a242f64b51439a7","assignee":{"login":"LeonidMorozov","id":2562446,"avatar_url":"https://avatars.githubusercontent.com/u/2562446?v=3","gravatar_id":"","url":"https://api.github.com/users/LeonidMorozov","html_url":"https://github.com/LeonidMorozov","followers_url":"https://api.github.com/users/LeonidMorozov/followers","following_url":"https://api.github.com/users/LeonidMorozov/following{/other_user}","gists_url":"https://api.github.com/users/LeonidMorozov/gists{/gist_id}","starred_url":"https://api.github.com/users/LeonidMorozov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LeonidMorozov/subscriptions","organizations_url":"https://api.github.com/users/LeonidMorozov/orgs","repos_url":"https://api.github.com/users/LeonidMorozov/repos","events_url":"https://api.github.com/users/LeonidMorozov/events{/privacy}","received_events_url":"https://api.github.com/users/LeonidMorozov/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/openedinc/opened-oauth.js/pulls/1/commits","review_comments_url":"https://api.github.com/repos/openedinc/opened-oauth.js/pulls/1/comments","review_comment_url":"https://api.github.com/repos/openedinc/opened-oauth.js/pulls/comments/{number}","comments_url":"https://api.github.com/repos/openedinc/opened-oauth.js/issues/1/comments","statuses_url":"https://api.github.com/repos/openedinc/opened-oauth.js/statuses/f300be4e3960ad0f1b1842cc3faa2c36eb6aedef","head":{"label":"openedinc:readme-file","ref":"readme-file","sha":"f300be4e3960ad0f1b1842cc3faa2c36eb6aedef","user":{"login":"openedinc","id":1932596,"avatar_url":"https://avatars.githubusercontent.com/u/1932596?v=3","gravatar_id":"","url":"https://api.github.com/users/openedinc","html_url":"https://github.com/openedinc","followers_url":"https://api.github.com/users/openedinc/followers","following_url":"https://api.github.com/users/openedinc/following{/other_user}","gists_url":"https://api.github.com/users/openedinc/gists{/gist_id}","starred_url":"https://api.github.com/users/openedinc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openedinc/subscriptions","organizations_url":"https://api.github.com/users/openedinc/orgs","repos_url":"https://api.github.com/users/openedinc/repos","events_url":"https://api.github.com/users/openedinc/events{/privacy}","received_events_url":"https://api.github.com/users/openedinc/received_events","type":"Organization","site_admin":false},"repo":{"id":29311420,"name":"opened-oauth.js","full_name":"openedinc/opened-oauth.js","owner":{"login":"openedinc","id":1932596,"avatar_url":"https://avatars.githubusercontent.com/u/1932596?v=3","gravatar_id":"","url":"https://api.github.com/users/openedinc","html_url":"https://github.com/openedinc","followers_url":"https://api.github.com/users/openedinc/followers","following_url":"https://api.github.com/users/openedinc/following{/other_user}","gists_url":"https://api.github.com/users/openedinc/gists{/gist_id}","starred_url":"https://api.github.com/users/openedinc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openedinc/subscriptions","organizations_url":"https://api.github.com/users/openedinc/orgs","repos_url":"https://api.github.com/users/openedinc/repos","events_url":"https://api.github.com/users/openedinc/events{/privacy}","received_events_url":"https://api.github.com/users/openedinc/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/openedinc/opened-oauth.js","description":"","fork":false,"url":"https://api.github.com/repos/openedinc/opened-oauth.js","forks_url":"https://api.github.com/repos/openedinc/opened-oauth.js/forks","keys_url":"https://api.github.com/repos/openedinc/opened-oauth.js/keys{/key_id}","collaborators_url":"https://api.github.com/repos/openedinc/opened-oauth.js/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/openedinc/opened-oauth.js/teams","hooks_url":"https://api.github.com/repos/openedinc/opened-oauth.js/hooks","issue_events_url":"https://api.github.com/repos/openedinc/opened-oauth.js/issues/events{/number}","events_url":"https://api.github.com/repos/openedinc/opened-oauth.js/events","assignees_url":"https://api.github.com/repos/openedinc/opened-oauth.js/assignees{/user}","branches_url":"https://api.github.com/repos/openedinc/opened-oauth.js/branches{/branch}","tags_url":"https://api.github.com/repos/openedinc/opened-oauth.js/tags","blobs_url":"https://api.github.com/repos/openedinc/opened-oauth.js/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/openedinc/opened-oauth.js/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/openedinc/opened-oauth.js/git/refs{/sha}","trees_url":"https://api.github.com/repos/openedinc/opened-oauth.js/git/trees{/sha}","statuses_url":"https://api.github.com/repos/openedinc/opened-oauth.js/statuses/{sha}","languages_url":"https://api.github.com/repos/openedinc/opened-oauth.js/languages","stargazers_url":"https://api.github.com/repos/openedinc/opened-oauth.js/stargazers","contributors_url":"https://api.github.com/repos/openedinc/opened-oauth.js/contributors","subscribers_url":"https://api.github.com/repos/openedinc/opened-oauth.js/subscribers","subscription_url":"https://api.github.com/repos/openedinc/opened-oauth.js/subscription","commits_url":"https://api.github.com/repos/openedinc/opened-oauth.js/commits{/sha}","git_commits_url":"https://api.github.com/repos/openedinc/opened-oauth.js/git/commits{/sha}","comments_url":"https://api.github.com/repos/openedinc/opened-oauth.js/comments{/number}","issue_comment_url":"https://api.github.com/repos/openedinc/opened-oauth.js/issues/comments/{number}","contents_url":"https://api.github.com/repos/openedinc/opened-oauth.js/contents/{+path}","compare_url":"https://api.github.com/repos/openedinc/opened-oauth.js/compare/{base}...{head}","merges_url":"https://api.github.com/repos/openedinc/opened-oauth.js/merges","archive_url":"https://api.github.com/repos/openedinc/opened-oauth.js/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/openedinc/opened-oauth.js/downloads","issues_url":"https://api.github.com/repos/openedinc/opened-oauth.js/issues{/number}","pulls_url":"https://api.github.com/repos/openedinc/opened-oauth.js/pulls{/number}","milestones_url":"https://api.github.com/repos/openedinc/opened-oauth.js/milestones{/number}","notifications_url":"https://api.github.com/repos/openedinc/opened-oauth.js/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/openedinc/opened-oauth.js/labels{/name}","releases_url":"https://api.github.com/repos/openedinc/opened-oauth.js/releases{/id}","created_at":"2015-01-15T18:25:06Z","updated_at":"2015-01-16T14:41:53Z","pushed_at":"2015-01-20T18:48:45Z","git_url":"git://github.com/openedinc/opened-oauth.js.git","ssh_url":"git@github.com:openedinc/opened-oauth.js.git","clone_url":"https://github.com/openedinc/opened-oauth.js.git","svn_url":"https://github.com/openedinc/opened-oauth.js","homepage":null,"size":0,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"base":{"label":"openedinc:master","ref":"master","sha":"9eb3367b72c4353bb7edcab0549a71f4220f61e5","user":{"login":"openedinc","id":1932596,"avatar_url":"https://avatars.githubusercontent.com/u/1932596?v=3","gravatar_id":"","url":"https://api.github.com/users/openedinc","html_url":"https://github.com/openedinc","followers_url":"https://api.github.com/users/openedinc/followers","following_url":"https://api.github.com/users/openedinc/following{/other_user}","gists_url":"https://api.github.com/users/openedinc/gists{/gist_id}","starred_url":"https://api.github.com/users/openedinc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openedinc/subscriptions","organizations_url":"https://api.github.com/users/openedinc/orgs","repos_url":"https://api.github.com/users/openedinc/repos","events_url":"https://api.github.com/users/openedinc/events{/privacy}","received_events_url":"https://api.github.com/users/openedinc/received_events","type":"Organization","site_admin":false},"repo":{"id":29311420,"name":"opened-oauth.js","full_name":"openedinc/opened-oauth.js","owner":{"login":"openedinc","id":1932596,"avatar_url":"https://avatars.githubusercontent.com/u/1932596?v=3","gravatar_id":"","url":"https://api.github.com/users/openedinc","html_url":"https://github.com/openedinc","followers_url":"https://api.github.com/users/openedinc/followers","following_url":"https://api.github.com/users/openedinc/following{/other_user}","gists_url":"https://api.github.com/users/openedinc/gists{/gist_id}","starred_url":"https://api.github.com/users/openedinc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openedinc/subscriptions","organizations_url":"https://api.github.com/users/openedinc/orgs","repos_url":"https://api.github.com/users/openedinc/repos","events_url":"https://api.github.com/users/openedinc/events{/privacy}","received_events_url":"https://api.github.com/users/openedinc/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/openedinc/opened-oauth.js","description":"","fork":false,"url":"https://api.github.com/repos/openedinc/opened-oauth.js","forks_url":"https://api.github.com/repos/openedinc/opened-oauth.js/forks","keys_url":"https://api.github.com/repos/openedinc/opened-oauth.js/keys{/key_id}","collaborators_url":"https://api.github.com/repos/openedinc/opened-oauth.js/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/openedinc/opened-oauth.js/teams","hooks_url":"https://api.github.com/repos/openedinc/opened-oauth.js/hooks","issue_events_url":"https://api.github.com/repos/openedinc/opened-oauth.js/issues/events{/number}","events_url":"https://api.github.com/repos/openedinc/opened-oauth.js/events","assignees_url":"https://api.github.com/repos/openedinc/opened-oauth.js/assignees{/user}","branches_url":"https://api.github.com/repos/openedinc/opened-oauth.js/branches{/branch}","tags_url":"https://api.github.com/repos/openedinc/opened-oauth.js/tags","blobs_url":"https://api.github.com/repos/openedinc/opened-oauth.js/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/openedinc/opened-oauth.js/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/openedinc/opened-oauth.js/git/refs{/sha}","trees_url":"https://api.github.com/repos/openedinc/opened-oauth.js/git/trees{/sha}","statuses_url":"https://api.github.com/repos/openedinc/opened-oauth.js/statuses/{sha}","languages_url":"https://api.github.com/repos/openedinc/opened-oauth.js/languages","stargazers_url":"https://api.github.com/repos/openedinc/opened-oauth.js/stargazers","contributors_url":"https://api.github.com/repos/openedinc/opened-oauth.js/contributors","subscribers_url":"https://api.github.com/repos/openedinc/opened-oauth.js/subscribers","subscription_url":"https://api.github.com/repos/openedinc/opened-oauth.js/subscription","commits_url":"https://api.github.com/repos/openedinc/opened-oauth.js/commits{/sha}","git_commits_url":"https://api.github.com/repos/openedinc/opened-oauth.js/git/commits{/sha}","comments_url":"https://api.github.com/repos/openedinc/opened-oauth.js/comments{/number}","issue_comment_url":"https://api.github.com/repos/openedinc/opened-oauth.js/issues/comments/{number}","contents_url":"https://api.github.com/repos/openedinc/opened-oauth.js/contents/{+path}","compare_url":"https://api.github.com/repos/openedinc/opened-oauth.js/compare/{base}...{head}","merges_url":"https://api.github.com/repos/openedinc/opened-oauth.js/merges","archive_url":"https://api.github.com/repos/openedinc/opened-oauth.js/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/openedinc/opened-oauth.js/downloads","issues_url":"https://api.github.com/repos/openedinc/opened-oauth.js/issues{/number}","pulls_url":"https://api.github.com/repos/openedinc/opened-oauth.js/pulls{/number}","milestones_url":"https://api.github.com/repos/openedinc/opened-oauth.js/milestones{/number}","notifications_url":"https://api.github.com/repos/openedinc/opened-oauth.js/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/openedinc/opened-oauth.js/labels{/name}","releases_url":"https://api.github.com/repos/openedinc/opened-oauth.js/releases{/id}","created_at":"2015-01-15T18:25:06Z","updated_at":"2015-01-16T14:41:53Z","pushed_at":"2015-01-20T18:48:45Z","git_url":"git://github.com/openedinc/opened-oauth.js.git","ssh_url":"git@github.com:openedinc/opened-oauth.js.git","clone_url":"https://github.com/openedinc/opened-oauth.js.git","svn_url":"https://github.com/openedinc/opened-oauth.js","homepage":null,"size":0,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/openedinc/opened-oauth.js/pulls/1"},"html":{"href":"https://github.com/openedinc/opened-oauth.js/pull/1"},"issue":{"href":"https://api.github.com/repos/openedinc/opened-oauth.js/issues/1"},"comments":{"href":"https://api.github.com/repos/openedinc/opened-oauth.js/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/openedinc/opened-oauth.js/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/openedinc/opened-oauth.js/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/openedinc/opened-oauth.js/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/openedinc/opened-oauth.js/statuses/f300be4e3960ad0f1b1842cc3faa2c36eb6aedef"}}}}