{"action":"created","comment":{"url":"https://api.github.com/repos/matrix-org/matrix-doc/pulls/comments/60612397","id":60612397,"diff_hunk":"@@ -0,0 +1,105 @@\n+Migrating from client-server API v1\n+===================================\n+\n+This guide assists developers of API clients that target the ``v1`` version of\n+the API to migrate their code to the later ``r0``. It does not aim to introduce\n+new concepts that were added in ``r0`` except where these replace things that\n+were removed since ``v1``.\n+\n+New Registration and Login Endpoints\n+====================================\n+\n+The ``r0`` version of the ``/register`` and ``/login`` endpoints is different\n+to the ``v1`` version. See the updated API documentation for details on how the\n+new API works. In brief, the changes are that the new version returns extra\n+information in the form of the ``params`` object, and that a sequence of\n+multiple calls may be statefully chained together by the ``session`` parameter.\n+\n+Additionally, whereas in ``v1`` the client performed a ``GET`` request to\n+discover the list of supported flows for ``/register``, in ``r0`` this is done\n+by sending a ``POST`` request with an empty data body. The ``/login`` endpoint\n+continues to use the ``GET`` method as before.\n+\n+Deprecated Endpoints\n+====================\n+\n+The following endpoints are now deprecated and replaced by the ``/sync`` API::\n+\n+  /initialSync\n+  /events\n+  /rooms/:roomId/initialSync\n+\n+The new ``/sync`` API takes an optional ``since`` parameter to distinguish the\n+initial sync from subsequent updates for more events. Instead of the ``limit``\n+parameter, supply an ad-hoc filter that provides the required event count::\n+\n+  GET .../sync?filter={\"room\":{\"timeline\":{\"limit:$limit}}}\n+\n+The return value takes a different structure to that from the previous\n+``/initialSync`` API. For full details see the API documentation, but the\n+following summary may be useful to compare with ``v1``:\n+\n+ * The ``/initialSync`` returned a ``state`` key containing the most recent","path":"supporting-docs/howtos/client-server-migrating-from-v1.rst","position":null,"original_position":42,"commit_id":"a077f8470ae9b38ba9d41e07370a91236637b033","original_commit_id":"ea6ac3e40fd65fcfa35d1be5ebd11d584f2ad42c","user":{"login":"leonerd","id":350941,"avatar_url":"https://avatars.githubusercontent.com/u/350941?v=3","gravatar_id":"","url":"https://api.github.com/users/leonerd","html_url":"https://github.com/leonerd","followers_url":"https://api.github.com/users/leonerd/followers","following_url":"https://api.github.com/users/leonerd/following{/other_user}","gists_url":"https://api.github.com/users/leonerd/gists{/gist_id}","starred_url":"https://api.github.com/users/leonerd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leonerd/subscriptions","organizations_url":"https://api.github.com/users/leonerd/orgs","repos_url":"https://api.github.com/users/leonerd/repos","events_url":"https://api.github.com/users/leonerd/events{/privacy}","received_events_url":"https://api.github.com/users/leonerd/received_events","type":"User","site_admin":false},"body":"Done a077f84","created_at":"2016-04-21T16:24:14Z","updated_at":"2016-04-21T16:24:14Z","html_url":"https://github.com/matrix-org/matrix-doc/pull/313#discussion_r60612397","pull_request_url":"https://api.github.com/repos/matrix-org/matrix-doc/pulls/313","_links":{"self":{"href":"https://api.github.com/repos/matrix-org/matrix-doc/pulls/comments/60612397"},"html":{"href":"https://github.com/matrix-org/matrix-doc/pull/313#discussion_r60612397"},"pull_request":{"href":"https://api.github.com/repos/matrix-org/matrix-doc/pulls/313"}}},"pull_request":{"url":"https://api.github.com/repos/matrix-org/matrix-doc/pulls/313","id":66502271,"html_url":"https://github.com/matrix-org/matrix-doc/pull/313","diff_url":"https://github.com/matrix-org/matrix-doc/pull/313.diff","patch_url":"https://github.com/matrix-org/matrix-doc/pull/313.patch","issue_url":"https://api.github.com/repos/matrix-org/matrix-doc/issues/313","number":313,"state":"open","locked":false,"title":"Initial hack at migration guide","user":{"login":"leonerd","id":350941,"avatar_url":"https://avatars.githubusercontent.com/u/350941?v=3","gravatar_id":"","url":"https://api.github.com/users/leonerd","html_url":"https://github.com/leonerd","followers_url":"https://api.github.com/users/leonerd/followers","following_url":"https://api.github.com/users/leonerd/following{/other_user}","gists_url":"https://api.github.com/users/leonerd/gists{/gist_id}","starred_url":"https://api.github.com/users/leonerd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leonerd/subscriptions","organizations_url":"https://api.github.com/users/leonerd/orgs","repos_url":"https://api.github.com/users/leonerd/repos","events_url":"https://api.github.com/users/leonerd/events{/privacy}","received_events_url":"https://api.github.com/users/leonerd/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-04-14T15:16:22Z","updated_at":"2016-04-21T16:24:14Z","closed_at":null,"merged_at":null,"merge_commit_sha":"dfc22b80f9412a27d6925b639ddf919f797c6de8","assignee":{"login":"leonerd","id":350941,"avatar_url":"https://avatars.githubusercontent.com/u/350941?v=3","gravatar_id":"","url":"https://api.github.com/users/leonerd","html_url":"https://github.com/leonerd","followers_url":"https://api.github.com/users/leonerd/followers","following_url":"https://api.github.com/users/leonerd/following{/other_user}","gists_url":"https://api.github.com/users/leonerd/gists{/gist_id}","starred_url":"https://api.github.com/users/leonerd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leonerd/subscriptions","organizations_url":"https://api.github.com/users/leonerd/orgs","repos_url":"https://api.github.com/users/leonerd/repos","events_url":"https://api.github.com/users/leonerd/events{/privacy}","received_events_url":"https://api.github.com/users/leonerd/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/matrix-org/matrix-doc/pulls/313/commits","review_comments_url":"https://api.github.com/repos/matrix-org/matrix-doc/pulls/313/comments","review_comment_url":"https://api.github.com/repos/matrix-org/matrix-doc/pulls/comments{/number}","comments_url":"https://api.github.com/repos/matrix-org/matrix-doc/issues/313/comments","statuses_url":"https://api.github.com/repos/matrix-org/matrix-doc/statuses/a077f8470ae9b38ba9d41e07370a91236637b033","head":{"label":"matrix-org:paul/migrating-from-v1","ref":"paul/migrating-from-v1","sha":"a077f8470ae9b38ba9d41e07370a91236637b033","user":{"login":"matrix-org","id":8418310,"avatar_url":"https://avatars.githubusercontent.com/u/8418310?v=3","gravatar_id":"","url":"https://api.github.com/users/matrix-org","html_url":"https://github.com/matrix-org","followers_url":"https://api.github.com/users/matrix-org/followers","following_url":"https://api.github.com/users/matrix-org/following{/other_user}","gists_url":"https://api.github.com/users/matrix-org/gists{/gist_id}","starred_url":"https://api.github.com/users/matrix-org/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matrix-org/subscriptions","organizations_url":"https://api.github.com/users/matrix-org/orgs","repos_url":"https://api.github.com/users/matrix-org/repos","events_url":"https://api.github.com/users/matrix-org/events{/privacy}","received_events_url":"https://api.github.com/users/matrix-org/received_events","type":"Organization","site_admin":false},"repo":{"id":24998719,"name":"matrix-doc","full_name":"matrix-org/matrix-doc","owner":{"login":"matrix-org","id":8418310,"avatar_url":"https://avatars.githubusercontent.com/u/8418310?v=3","gravatar_id":"","url":"https://api.github.com/users/matrix-org","html_url":"https://github.com/matrix-org","followers_url":"https://api.github.com/users/matrix-org/followers","following_url":"https://api.github.com/users/matrix-org/following{/other_user}","gists_url":"https://api.github.com/users/matrix-org/gists{/gist_id}","starred_url":"https://api.github.com/users/matrix-org/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matrix-org/subscriptions","organizations_url":"https://api.github.com/users/matrix-org/orgs","repos_url":"https://api.github.com/users/matrix-org/repos","events_url":"https://api.github.com/users/matrix-org/events{/privacy}","received_events_url":"https://api.github.com/users/matrix-org/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/matrix-org/matrix-doc","description":"Matrix Documentation (including The Spec)","fork":false,"url":"https://api.github.com/repos/matrix-org/matrix-doc","forks_url":"https://api.github.com/repos/matrix-org/matrix-doc/forks","keys_url":"https://api.github.com/repos/matrix-org/matrix-doc/keys{/key_id}","collaborators_url":"https://api.github.com/repos/matrix-org/matrix-doc/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/matrix-org/matrix-doc/teams","hooks_url":"https://api.github.com/repos/matrix-org/matrix-doc/hooks","issue_events_url":"https://api.github.com/repos/matrix-org/matrix-doc/issues/events{/number}","events_url":"https://api.github.com/repos/matrix-org/matrix-doc/events","assignees_url":"https://api.github.com/repos/matrix-org/matrix-doc/assignees{/user}","branches_url":"https://api.github.com/repos/matrix-org/matrix-doc/branches{/branch}","tags_url":"https://api.github.com/repos/matrix-org/matrix-doc/tags","blobs_url":"https://api.github.com/repos/matrix-org/matrix-doc/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/matrix-org/matrix-doc/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/matrix-org/matrix-doc/git/refs{/sha}","trees_url":"https://api.github.com/repos/matrix-org/matrix-doc/git/trees{/sha}","statuses_url":"https://api.github.com/repos/matrix-org/matrix-doc/statuses/{sha}","languages_url":"https://api.github.com/repos/matrix-org/matrix-doc/languages","stargazers_url":"https://api.github.com/repos/matrix-org/matrix-doc/stargazers","contributors_url":"https://api.github.com/repos/matrix-org/matrix-doc/contributors","subscribers_url":"https://api.github.com/repos/matrix-org/matrix-doc/subscribers","subscription_url":"https://api.github.com/repos/matrix-org/matrix-doc/subscription","commits_url":"https://api.github.com/repos/matrix-org/matrix-doc/commits{/sha}","git_commits_url":"https://api.github.com/repos/matrix-org/matrix-doc/git/commits{/sha}","comments_url":"https://api.github.com/repos/matrix-org/matrix-doc/comments{/number}","issue_comment_url":"https://api.github.com/repos/matrix-org/matrix-doc/issues/comments{/number}","contents_url":"https://api.github.com/repos/matrix-org/matrix-doc/contents/{+path}","compare_url":"https://api.github.com/repos/matrix-org/matrix-doc/compare/{base}...{head}","merges_url":"https://api.github.com/repos/matrix-org/matrix-doc/merges","archive_url":"https://api.github.com/repos/matrix-org/matrix-doc/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/matrix-org/matrix-doc/downloads","issues_url":"https://api.github.com/repos/matrix-org/matrix-doc/issues{/number}","pulls_url":"https://api.github.com/repos/matrix-org/matrix-doc/pulls{/number}","milestones_url":"https://api.github.com/repos/matrix-org/matrix-doc/milestones{/number}","notifications_url":"https://api.github.com/repos/matrix-org/matrix-doc/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/matrix-org/matrix-doc/labels{/name}","releases_url":"https://api.github.com/repos/matrix-org/matrix-doc/releases{/id}","deployments_url":"https://api.github.com/repos/matrix-org/matrix-doc/deployments","created_at":"2014-10-09T16:41:02Z","updated_at":"2016-04-18T14:06:08Z","pushed_at":"2016-04-21T16:23:07Z","git_url":"git://github.com/matrix-org/matrix-doc.git","ssh_url":"git@github.com:matrix-org/matrix-doc.git","clone_url":"https://github.com/matrix-org/matrix-doc.git","svn_url":"https://github.com/matrix-org/matrix-doc","homepage":null,"size":2826,"stargazers_count":35,"watchers_count":35,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":13,"mirror_url":null,"open_issues_count":14,"forks":13,"open_issues":14,"watchers":35,"default_branch":"master"}},"base":{"label":"matrix-org:master","ref":"master","sha":"98f1d4efecc9b18e693528c616db9fcf5fbdd5e7","user":{"login":"matrix-org","id":8418310,"avatar_url":"https://avatars.githubusercontent.com/u/8418310?v=3","gravatar_id":"","url":"https://api.github.com/users/matrix-org","html_url":"https://github.com/matrix-org","followers_url":"https://api.github.com/users/matrix-org/followers","following_url":"https://api.github.com/users/matrix-org/following{/other_user}","gists_url":"https://api.github.com/users/matrix-org/gists{/gist_id}","starred_url":"https://api.github.com/users/matrix-org/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matrix-org/subscriptions","organizations_url":"https://api.github.com/users/matrix-org/orgs","repos_url":"https://api.github.com/users/matrix-org/repos","events_url":"https://api.github.com/users/matrix-org/events{/privacy}","received_events_url":"https://api.github.com/users/matrix-org/received_events","type":"Organization","site_admin":false},"repo":{"id":24998719,"name":"matrix-doc","full_name":"matrix-org/matrix-doc","owner":{"login":"matrix-org","id":8418310,"avatar_url":"https://avatars.githubusercontent.com/u/8418310?v=3","gravatar_id":"","url":"https://api.github.com/users/matrix-org","html_url":"https://github.com/matrix-org","followers_url":"https://api.github.com/users/matrix-org/followers","following_url":"https://api.github.com/users/matrix-org/following{/other_user}","gists_url":"https://api.github.com/users/matrix-org/gists{/gist_id}","starred_url":"https://api.github.com/users/matrix-org/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matrix-org/subscriptions","organizations_url":"https://api.github.com/users/matrix-org/orgs","repos_url":"https://api.github.com/users/matrix-org/repos","events_url":"https://api.github.com/users/matrix-org/events{/privacy}","received_events_url":"https://api.github.com/users/matrix-org/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/matrix-org/matrix-doc","description":"Matrix Documentation (including The Spec)","fork":false,"url":"https://api.github.com/repos/matrix-org/matrix-doc","forks_url":"https://api.github.com/repos/matrix-org/matrix-doc/forks","keys_url":"https://api.github.com/repos/matrix-org/matrix-doc/keys{/key_id}","collaborators_url":"https://api.github.com/repos/matrix-org/matrix-doc/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/matrix-org/matrix-doc/teams","hooks_url":"https://api.github.com/repos/matrix-org/matrix-doc/hooks","issue_events_url":"https://api.github.com/repos/matrix-org/matrix-doc/issues/events{/number}","events_url":"https://api.github.com/repos/matrix-org/matrix-doc/events","assignees_url":"https://api.github.com/repos/matrix-org/matrix-doc/assignees{/user}","branches_url":"https://api.github.com/repos/matrix-org/matrix-doc/branches{/branch}","tags_url":"https://api.github.com/repos/matrix-org/matrix-doc/tags","blobs_url":"https://api.github.com/repos/matrix-org/matrix-doc/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/matrix-org/matrix-doc/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/matrix-org/matrix-doc/git/refs{/sha}","trees_url":"https://api.github.com/repos/matrix-org/matrix-doc/git/trees{/sha}","statuses_url":"https://api.github.com/repos/matrix-org/matrix-doc/statuses/{sha}","languages_url":"https://api.github.com/repos/matrix-org/matrix-doc/languages","stargazers_url":"https://api.github.com/repos/matrix-org/matrix-doc/stargazers","contributors_url":"https://api.github.com/repos/matrix-org/matrix-doc/contributors","subscribers_url":"https://api.github.com/repos/matrix-org/matrix-doc/subscribers","subscription_url":"https://api.github.com/repos/matrix-org/matrix-doc/subscription","commits_url":"https://api.github.com/repos/matrix-org/matrix-doc/commits{/sha}","git_commits_url":"https://api.github.com/repos/matrix-org/matrix-doc/git/commits{/sha}","comments_url":"https://api.github.com/repos/matrix-org/matrix-doc/comments{/number}","issue_comment_url":"https://api.github.com/repos/matrix-org/matrix-doc/issues/comments{/number}","contents_url":"https://api.github.com/repos/matrix-org/matrix-doc/contents/{+path}","compare_url":"https://api.github.com/repos/matrix-org/matrix-doc/compare/{base}...{head}","merges_url":"https://api.github.com/repos/matrix-org/matrix-doc/merges","archive_url":"https://api.github.com/repos/matrix-org/matrix-doc/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/matrix-org/matrix-doc/downloads","issues_url":"https://api.github.com/repos/matrix-org/matrix-doc/issues{/number}","pulls_url":"https://api.github.com/repos/matrix-org/matrix-doc/pulls{/number}","milestones_url":"https://api.github.com/repos/matrix-org/matrix-doc/milestones{/number}","notifications_url":"https://api.github.com/repos/matrix-org/matrix-doc/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/matrix-org/matrix-doc/labels{/name}","releases_url":"https://api.github.com/repos/matrix-org/matrix-doc/releases{/id}","deployments_url":"https://api.github.com/repos/matrix-org/matrix-doc/deployments","created_at":"2014-10-09T16:41:02Z","updated_at":"2016-04-18T14:06:08Z","pushed_at":"2016-04-21T16:23:07Z","git_url":"git://github.com/matrix-org/matrix-doc.git","ssh_url":"git@github.com:matrix-org/matrix-doc.git","clone_url":"https://github.com/matrix-org/matrix-doc.git","svn_url":"https://github.com/matrix-org/matrix-doc","homepage":null,"size":2826,"stargazers_count":35,"watchers_count":35,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":13,"mirror_url":null,"open_issues_count":14,"forks":13,"open_issues":14,"watchers":35,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/matrix-org/matrix-doc/pulls/313"},"html":{"href":"https://github.com/matrix-org/matrix-doc/pull/313"},"issue":{"href":"https://api.github.com/repos/matrix-org/matrix-doc/issues/313"},"comments":{"href":"https://api.github.com/repos/matrix-org/matrix-doc/issues/313/comments"},"review_comments":{"href":"https://api.github.com/repos/matrix-org/matrix-doc/pulls/313/comments"},"review_comment":{"href":"https://api.github.com/repos/matrix-org/matrix-doc/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/matrix-org/matrix-doc/pulls/313/commits"},"statuses":{"href":"https://api.github.com/repos/matrix-org/matrix-doc/statuses/a077f8470ae9b38ba9d41e07370a91236637b033"}}}}