{"action":"created","comment":{"url":"https://api.github.com/repos/osuosl/timesync/pulls/comments/28641574","id":28641574,"diff_hunk":"@@ -1,4 +1,228 @@\n .. _draft-api:\n \n-API\n-===\n+Draft API\n+=========\n+Below is the api specs for the Time Sync project.\n+\n+\n+Format\n+------\n+Responses will be returned in standard JSON format. An attempt will be made to\n+keep the structure simple. Https will be used for all endpoints. Null values\n+will be sent with the JSON null value.\n+\n+\n+Versions\n+--------\n+The API will be versioned with simple integers, 1, 2, 3, ...\n+\n+ex: https://timesync.osuosl.org/1/projects\n+\n+\n+Errors\n+------\n+Errors will be returned only when an error has occurred. They will consist\n+of an errno, an error category, and an error text. The existence of the 'error'\n+key indicates an error.\n+\n+ex:\n+\n+.. code:: json\n+\n+    {\n+        'error': \"Database save failed\",\n+        'errno': 2,\n+        'text': sql_error\n+    }\n+\n+Possible errors can include objects not found, invalid foreign keys, and\n+invalid names, etc.\n+\n+\n+GET Endpoints\n+-------------\n+*/projects*\n+\n+.. code:: json\n+\n+    [\n+      {\n+         \"uri\":\"https://code.osuosl.org/projects/ganeti-webmgr\",\n+         \"name\":\"Ganeti Web Manager\",\n+         \"slug\":\"gwm\",\n+         \"owner\": 2,\n+         \"id\": 1\n+      },\n+      {...},\n+      ...\n+    ]\n+\n+*/projects/<project_id>*\n+\n+.. code:: json\n+\n+    {\n+       \"uri\":\"https://code.osuosl.org/projects/ganeti-webmgr\",\n+       \"name\":\"Ganeti Web Manager\",\n+       \"slug\":\"gwm\",\n+       \"owner\": 2,\n+       \"id\": 1\n+    }\n+\n+*/activities*\n+\n+.. code:: json\n+    [\n+        {\n+           \"name\":\"Documentation\",\n+           \"slug\":\"doc\",\n+           \"id\": 1\n+        },\n+        {...}\n+    ]\n+\n+*/activities/id*\n+\n+.. code:: json\n+\n+    {\n+       \"name\":\"Documentation\",\n+       \"slug\":\"doc\",\n+       \"id\": 1\n+    }\n+\n+*/time*\n+\n+.. code:: json\n+\n+    [\n+      {\n+        \"duration\":12,\n+        \"user\": 2,\n+        \"project\": 3,\n+        \"activity\": 2,\n+        \"notes\":\"\",\n+        \"issue_uri\":\"https://github.com/osu-cass/whats-fresh-api/issues/56\",\n+        \"date_worked\":null,\n+        \"created_at\":null,\n+        \"updated_at\":null,\n+        \"id\": 1\n+      },\n+      {...}\n+    ]\n+\n+*/time/id*\n+\n+.. code:: json\n+\n+    {\n+      \"duration\":12,\n+      \"user\": 2,\n+      \"project\": 3,\n+      \"activity\": 2,\n+      \"notes\":\"\",\n+      \"issue_uri\":\"https://github.com/osu-cass/whats-fresh-api/issues/56\",\n+      \"date_worked\":null,\n+      \"created_at\":null,\n+      \"updated_at\":null,\n+      \"id\": 1\n+    }\n+\n+POST Endpoints\n+--------------\n+\n+To add a new object, POST to */<object name>/add* with a JSON body.\n+\n+\n+*/projects/add*\n+\n+.. code:: json\n+\n+    {\n+       \"uri\":\"https://code.osuosl.org/projects/ganeti-webmgr\",\n+       \"name\":\"Ganeti Web Manager\",\n+       \"slug\":\"gwm\",\n+       \"owner\": 2,\n+       \"id\": 1\n+    }\n+\n+*/activities/add*\n+\n+.. code:: json\n+\n+    {\n+       \"name\":\"Documentation\",\n+       \"slug\":\"doc\",\n+       \"id\": 1\n+    }\n+\n+*/time/add*\n+\n+.. code:: json\n+\n+    {\n+      \"duration\":12,\n+      \"user\": 2,\n+      \"project\": 3,\n+      \"activity\": 2,\n+      \"notes\":\"\",\n+      \"issue_uri\":\"https://github.com/osu-cass/whats-fresh-api/issues/56\",\n+      \"date_worked\":null,\n+      \"created_at\":null,\n+      \"updated_at\":null,\n+      \"id\": 1\n+    }\n+\n+To update an existing object, POST to */<object name>/update* with a JSON body.\n+The body only needs to contain the part that is being updated.\n+\n+\n+*/projects/1*","path":"docs/source/design/draft_api.rst","position":182,"original_position":182,"commit_id":"27df93eaea6445f112d37b5fad557b8140087fc5","original_commit_id":"27df93eaea6445f112d37b5fad557b8140087fc5","user":{"login":"tschuy","id":6532435,"avatar_url":"https://avatars.githubusercontent.com/u/6532435?v=3","gravatar_id":"","url":"https://api.github.com/users/tschuy","html_url":"https://github.com/tschuy","followers_url":"https://api.github.com/users/tschuy/followers","following_url":"https://api.github.com/users/tschuy/following{/other_user}","gists_url":"https://api.github.com/users/tschuy/gists{/gist_id}","starred_url":"https://api.github.com/users/tschuy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tschuy/subscriptions","organizations_url":"https://api.github.com/users/tschuy/orgs","repos_url":"https://api.github.com/users/tschuy/repos","events_url":"https://api.github.com/users/tschuy/events{/privacy}","received_events_url":"https://api.github.com/users/tschuy/received_events","type":"User","site_admin":false},"body":"No, I propose we POST to the id endpoint. The docs above were incorrect.","created_at":"2015-04-18T05:26:01Z","updated_at":"2015-04-18T05:26:01Z","html_url":"https://github.com/osuosl/timesync/pull/4#discussion_r28641574","pull_request_url":"https://api.github.com/repos/osuosl/timesync/pulls/4","_links":{"self":{"href":"https://api.github.com/repos/osuosl/timesync/pulls/comments/28641574"},"html":{"href":"https://github.com/osuosl/timesync/pull/4#discussion_r28641574"},"pull_request":{"href":"https://api.github.com/repos/osuosl/timesync/pulls/4"}}},"pull_request":{"url":"https://api.github.com/repos/osuosl/timesync/pulls/4","id":33585732,"html_url":"https://github.com/osuosl/timesync/pull/4","diff_url":"https://github.com/osuosl/timesync/pull/4.diff","patch_url":"https://github.com/osuosl/timesync/pull/4.patch","issue_url":"https://api.github.com/repos/osuosl/timesync/issues/4","number":4,"state":"open","locked":false,"title":"New draft API","user":{"login":"tschuy","id":6532435,"avatar_url":"https://avatars.githubusercontent.com/u/6532435?v=3","gravatar_id":"","url":"https://api.github.com/users/tschuy","html_url":"https://github.com/tschuy","followers_url":"https://api.github.com/users/tschuy/followers","following_url":"https://api.github.com/users/tschuy/following{/other_user}","gists_url":"https://api.github.com/users/tschuy/gists{/gist_id}","starred_url":"https://api.github.com/users/tschuy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tschuy/subscriptions","organizations_url":"https://api.github.com/users/tschuy/orgs","repos_url":"https://api.github.com/users/tschuy/repos","events_url":"https://api.github.com/users/tschuy/events{/privacy}","received_events_url":"https://api.github.com/users/tschuy/received_events","type":"User","site_admin":false},"body":"This changes the API significantly.\r\n\r\nThis puts the ADD, UPDATE request bodies into the body of the request as JSON.\r\n\r\nIt also removes the ext field (why is this a thing), and makes errors only show upon error. (This is how most APIs I'm familiar with implement errors.)\r\n\r\nIt also specifies the response bodies of API requests more fully.","created_at":"2015-04-17T21:53:22Z","updated_at":"2015-04-18T05:26:01Z","closed_at":null,"merged_at":null,"merge_commit_sha":"03cc60fa62c3016de08d3ee132cdd861c1066cdc","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/osuosl/timesync/pulls/4/commits","review_comments_url":"https://api.github.com/repos/osuosl/timesync/pulls/4/comments","review_comment_url":"https://api.github.com/repos/osuosl/timesync/pulls/comments{/number}","comments_url":"https://api.github.com/repos/osuosl/timesync/issues/4/comments","statuses_url":"https://api.github.com/repos/osuosl/timesync/statuses/27df93eaea6445f112d37b5fad557b8140087fc5","head":{"label":"osuosl:draft_docs_two","ref":"draft_docs_two","sha":"27df93eaea6445f112d37b5fad557b8140087fc5","user":{"login":"osuosl","id":1380625,"avatar_url":"https://avatars.githubusercontent.com/u/1380625?v=3","gravatar_id":"","url":"https://api.github.com/users/osuosl","html_url":"https://github.com/osuosl","followers_url":"https://api.github.com/users/osuosl/followers","following_url":"https://api.github.com/users/osuosl/following{/other_user}","gists_url":"https://api.github.com/users/osuosl/gists{/gist_id}","starred_url":"https://api.github.com/users/osuosl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/osuosl/subscriptions","organizations_url":"https://api.github.com/users/osuosl/orgs","repos_url":"https://api.github.com/users/osuosl/repos","events_url":"https://api.github.com/users/osuosl/events{/privacy}","received_events_url":"https://api.github.com/users/osuosl/received_events","type":"Organization","site_admin":false},"repo":{"id":33685026,"name":"timesync","full_name":"osuosl/timesync","owner":{"login":"osuosl","id":1380625,"avatar_url":"https://avatars.githubusercontent.com/u/1380625?v=3","gravatar_id":"","url":"https://api.github.com/users/osuosl","html_url":"https://github.com/osuosl","followers_url":"https://api.github.com/users/osuosl/followers","following_url":"https://api.github.com/users/osuosl/following{/other_user}","gists_url":"https://api.github.com/users/osuosl/gists{/gist_id}","starred_url":"https://api.github.com/users/osuosl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/osuosl/subscriptions","organizations_url":"https://api.github.com/users/osuosl/orgs","repos_url":"https://api.github.com/users/osuosl/repos","events_url":"https://api.github.com/users/osuosl/events{/privacy}","received_events_url":"https://api.github.com/users/osuosl/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/osuosl/timesync","description":"Time Tracking API","fork":false,"url":"https://api.github.com/repos/osuosl/timesync","forks_url":"https://api.github.com/repos/osuosl/timesync/forks","keys_url":"https://api.github.com/repos/osuosl/timesync/keys{/key_id}","collaborators_url":"https://api.github.com/repos/osuosl/timesync/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/osuosl/timesync/teams","hooks_url":"https://api.github.com/repos/osuosl/timesync/hooks","issue_events_url":"https://api.github.com/repos/osuosl/timesync/issues/events{/number}","events_url":"https://api.github.com/repos/osuosl/timesync/events","assignees_url":"https://api.github.com/repos/osuosl/timesync/assignees{/user}","branches_url":"https://api.github.com/repos/osuosl/timesync/branches{/branch}","tags_url":"https://api.github.com/repos/osuosl/timesync/tags","blobs_url":"https://api.github.com/repos/osuosl/timesync/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/osuosl/timesync/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/osuosl/timesync/git/refs{/sha}","trees_url":"https://api.github.com/repos/osuosl/timesync/git/trees{/sha}","statuses_url":"https://api.github.com/repos/osuosl/timesync/statuses/{sha}","languages_url":"https://api.github.com/repos/osuosl/timesync/languages","stargazers_url":"https://api.github.com/repos/osuosl/timesync/stargazers","contributors_url":"https://api.github.com/repos/osuosl/timesync/contributors","subscribers_url":"https://api.github.com/repos/osuosl/timesync/subscribers","subscription_url":"https://api.github.com/repos/osuosl/timesync/subscription","commits_url":"https://api.github.com/repos/osuosl/timesync/commits{/sha}","git_commits_url":"https://api.github.com/repos/osuosl/timesync/git/commits{/sha}","comments_url":"https://api.github.com/repos/osuosl/timesync/comments{/number}","issue_comment_url":"https://api.github.com/repos/osuosl/timesync/issues/comments{/number}","contents_url":"https://api.github.com/repos/osuosl/timesync/contents/{+path}","compare_url":"https://api.github.com/repos/osuosl/timesync/compare/{base}...{head}","merges_url":"https://api.github.com/repos/osuosl/timesync/merges","archive_url":"https://api.github.com/repos/osuosl/timesync/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/osuosl/timesync/downloads","issues_url":"https://api.github.com/repos/osuosl/timesync/issues{/number}","pulls_url":"https://api.github.com/repos/osuosl/timesync/pulls{/number}","milestones_url":"https://api.github.com/repos/osuosl/timesync/milestones{/number}","notifications_url":"https://api.github.com/repos/osuosl/timesync/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/osuosl/timesync/labels{/name}","releases_url":"https://api.github.com/repos/osuosl/timesync/releases{/id}","created_at":"2015-04-09T18:20:54Z","updated_at":"2015-04-09T18:20:54Z","pushed_at":"2015-04-17T21:53:22Z","git_url":"git://github.com/osuosl/timesync.git","ssh_url":"git@github.com:osuosl/timesync.git","clone_url":"https://github.com/osuosl/timesync.git","svn_url":"https://github.com/osuosl/timesync","homepage":null,"size":140,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":3,"forks":2,"open_issues":3,"watchers":0,"default_branch":"master"}},"base":{"label":"osuosl:master","ref":"master","sha":"e778f8431e389716166d9caea7d255c10dcf96a2","user":{"login":"osuosl","id":1380625,"avatar_url":"https://avatars.githubusercontent.com/u/1380625?v=3","gravatar_id":"","url":"https://api.github.com/users/osuosl","html_url":"https://github.com/osuosl","followers_url":"https://api.github.com/users/osuosl/followers","following_url":"https://api.github.com/users/osuosl/following{/other_user}","gists_url":"https://api.github.com/users/osuosl/gists{/gist_id}","starred_url":"https://api.github.com/users/osuosl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/osuosl/subscriptions","organizations_url":"https://api.github.com/users/osuosl/orgs","repos_url":"https://api.github.com/users/osuosl/repos","events_url":"https://api.github.com/users/osuosl/events{/privacy}","received_events_url":"https://api.github.com/users/osuosl/received_events","type":"Organization","site_admin":false},"repo":{"id":33685026,"name":"timesync","full_name":"osuosl/timesync","owner":{"login":"osuosl","id":1380625,"avatar_url":"https://avatars.githubusercontent.com/u/1380625?v=3","gravatar_id":"","url":"https://api.github.com/users/osuosl","html_url":"https://github.com/osuosl","followers_url":"https://api.github.com/users/osuosl/followers","following_url":"https://api.github.com/users/osuosl/following{/other_user}","gists_url":"https://api.github.com/users/osuosl/gists{/gist_id}","starred_url":"https://api.github.com/users/osuosl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/osuosl/subscriptions","organizations_url":"https://api.github.com/users/osuosl/orgs","repos_url":"https://api.github.com/users/osuosl/repos","events_url":"https://api.github.com/users/osuosl/events{/privacy}","received_events_url":"https://api.github.com/users/osuosl/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/osuosl/timesync","description":"Time Tracking API","fork":false,"url":"https://api.github.com/repos/osuosl/timesync","forks_url":"https://api.github.com/repos/osuosl/timesync/forks","keys_url":"https://api.github.com/repos/osuosl/timesync/keys{/key_id}","collaborators_url":"https://api.github.com/repos/osuosl/timesync/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/osuosl/timesync/teams","hooks_url":"https://api.github.com/repos/osuosl/timesync/hooks","issue_events_url":"https://api.github.com/repos/osuosl/timesync/issues/events{/number}","events_url":"https://api.github.com/repos/osuosl/timesync/events","assignees_url":"https://api.github.com/repos/osuosl/timesync/assignees{/user}","branches_url":"https://api.github.com/repos/osuosl/timesync/branches{/branch}","tags_url":"https://api.github.com/repos/osuosl/timesync/tags","blobs_url":"https://api.github.com/repos/osuosl/timesync/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/osuosl/timesync/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/osuosl/timesync/git/refs{/sha}","trees_url":"https://api.github.com/repos/osuosl/timesync/git/trees{/sha}","statuses_url":"https://api.github.com/repos/osuosl/timesync/statuses/{sha}","languages_url":"https://api.github.com/repos/osuosl/timesync/languages","stargazers_url":"https://api.github.com/repos/osuosl/timesync/stargazers","contributors_url":"https://api.github.com/repos/osuosl/timesync/contributors","subscribers_url":"https://api.github.com/repos/osuosl/timesync/subscribers","subscription_url":"https://api.github.com/repos/osuosl/timesync/subscription","commits_url":"https://api.github.com/repos/osuosl/timesync/commits{/sha}","git_commits_url":"https://api.github.com/repos/osuosl/timesync/git/commits{/sha}","comments_url":"https://api.github.com/repos/osuosl/timesync/comments{/number}","issue_comment_url":"https://api.github.com/repos/osuosl/timesync/issues/comments{/number}","contents_url":"https://api.github.com/repos/osuosl/timesync/contents/{+path}","compare_url":"https://api.github.com/repos/osuosl/timesync/compare/{base}...{head}","merges_url":"https://api.github.com/repos/osuosl/timesync/merges","archive_url":"https://api.github.com/repos/osuosl/timesync/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/osuosl/timesync/downloads","issues_url":"https://api.github.com/repos/osuosl/timesync/issues{/number}","pulls_url":"https://api.github.com/repos/osuosl/timesync/pulls{/number}","milestones_url":"https://api.github.com/repos/osuosl/timesync/milestones{/number}","notifications_url":"https://api.github.com/repos/osuosl/timesync/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/osuosl/timesync/labels{/name}","releases_url":"https://api.github.com/repos/osuosl/timesync/releases{/id}","created_at":"2015-04-09T18:20:54Z","updated_at":"2015-04-09T18:20:54Z","pushed_at":"2015-04-17T21:53:22Z","git_url":"git://github.com/osuosl/timesync.git","ssh_url":"git@github.com:osuosl/timesync.git","clone_url":"https://github.com/osuosl/timesync.git","svn_url":"https://github.com/osuosl/timesync","homepage":null,"size":140,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":3,"forks":2,"open_issues":3,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/osuosl/timesync/pulls/4"},"html":{"href":"https://github.com/osuosl/timesync/pull/4"},"issue":{"href":"https://api.github.com/repos/osuosl/timesync/issues/4"},"comments":{"href":"https://api.github.com/repos/osuosl/timesync/issues/4/comments"},"review_comments":{"href":"https://api.github.com/repos/osuosl/timesync/pulls/4/comments"},"review_comment":{"href":"https://api.github.com/repos/osuosl/timesync/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/osuosl/timesync/pulls/4/commits"},"statuses":{"href":"https://api.github.com/repos/osuosl/timesync/statuses/27df93eaea6445f112d37b5fad557b8140087fc5"}}}}