-
Notifications
You must be signed in to change notification settings - Fork 99
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1809 from nextcloud/enh/update-endpoints-put
enh: use PUT/PATCH for updating and move to API v2.2
- Loading branch information
Showing
16 changed files
with
149 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ | |
* @copyright Copyright (c] 2017 Vinzenz Rosenkranz <[email protected]> | ||
* | ||
* @author affan98 <[email protected]> | ||
* @author Christian Hartmann <[email protected]> | ||
* @author John Molakvoæ (skjnldsv) <[email protected]> | ||
* @author Jonas Rittershofer <[email protected]> | ||
* | ||
|
@@ -34,7 +35,7 @@ | |
[ | ||
'name' => 'config#updateAppConfig', | ||
'url' => '/config/update', | ||
'verb' => 'POST' | ||
'verb' => 'PATCH' | ||
], | ||
|
||
// Public Share Link | ||
|
@@ -72,7 +73,7 @@ | |
'verb' => 'OPTIONS', | ||
'requirements' => [ | ||
'path' => '.+', | ||
'apiVersion' => 'v2(\.1)?' | ||
'apiVersion' => 'v2(\.[1-2])?' | ||
] | ||
], | ||
|
||
|
@@ -82,63 +83,72 @@ | |
'url' => '/api/{apiVersion}/forms', | ||
'verb' => 'GET', | ||
'requirements' => [ | ||
'apiVersion' => 'v2(\.1)?' | ||
'apiVersion' => 'v2(\.[1-2])?' | ||
] | ||
], | ||
[ | ||
'name' => 'api#newForm', | ||
'url' => '/api/{apiVersion}/form', | ||
'verb' => 'POST', | ||
'requirements' => [ | ||
'apiVersion' => 'v2(\.1)?' | ||
'apiVersion' => 'v2(\.[1-2])?' | ||
] | ||
], | ||
[ | ||
'name' => 'api#getForm', | ||
'url' => '/api/{apiVersion}/form/{id}', | ||
'verb' => 'GET', | ||
'requirements' => [ | ||
'apiVersion' => 'v2(\.1)?' | ||
'apiVersion' => 'v2(\.[1-2])?' | ||
] | ||
], | ||
[ | ||
'name' => 'api#cloneForm', | ||
'url' => '/api/{apiVersion}/form/clone/{id}', | ||
'verb' => 'POST', | ||
'requirements' => [ | ||
'apiVersion' => 'v2(\.1)?' | ||
'apiVersion' => 'v2(\.[1-2])?' | ||
] | ||
], | ||
// TODO: Remove POST in next API release | ||
[ | ||
'name' => 'api#updateForm', | ||
'url' => '/api/{apiVersion}/form/update', | ||
'verb' => 'POST', | ||
'requirements' => [ | ||
'apiVersion' => 'v2(\.1)?' | ||
'apiVersion' => 'v2(\.[1-2])?' | ||
] | ||
], | ||
[ | ||
'name' => 'api#updateForm', | ||
'url' => '/api/{apiVersion}/form/update', | ||
'verb' => 'PATCH', | ||
'requirements' => [ | ||
'apiVersion' => 'v2.2' | ||
] | ||
], | ||
[ | ||
'name' => 'api#deleteForm', | ||
'url' => '/api/{apiVersion}/form/{id}', | ||
'verb' => 'DELETE', | ||
'requirements' => [ | ||
'apiVersion' => 'v2(\.1)?' | ||
'apiVersion' => 'v2(\.[1-2])?' | ||
] | ||
], | ||
[ | ||
'name' => 'api#getPartialForm', | ||
'url' => '/api/{apiVersion}/partial_form/{hash}', | ||
'verb' => 'GET', | ||
'requirements' => [ | ||
'apiVersion' => 'v2(\.1)?' | ||
'apiVersion' => 'v2(\.[1-2])?' | ||
] | ||
], | ||
[ | ||
'name' => 'api#getSharedForms', | ||
'url' => '/api/{apiVersion}/shared_forms', | ||
'verb' => 'GET', | ||
'requirements' => [ | ||
'apiVersion' => 'v2(\.1)?' | ||
'apiVersion' => 'v2(\.[1-2])?' | ||
] | ||
], | ||
|
||
|
@@ -148,31 +158,49 @@ | |
'url' => '/api/{apiVersion}/question', | ||
'verb' => 'POST', | ||
'requirements' => [ | ||
'apiVersion' => 'v2(\.1)?' | ||
'apiVersion' => 'v2(\.[1-2])?' | ||
] | ||
], | ||
// TODO: Remove POST in next API release | ||
[ | ||
'name' => 'api#updateQuestion', | ||
'url' => '/api/{apiVersion}/question/update', | ||
'verb' => 'POST', | ||
'requirements' => [ | ||
'apiVersion' => 'v2(\.1)?' | ||
'apiVersion' => 'v2(\.[1-2])?' | ||
] | ||
], | ||
[ | ||
'name' => 'api#updateQuestion', | ||
'url' => '/api/{apiVersion}/question/update', | ||
'verb' => 'PATCH', | ||
'requirements' => [ | ||
'apiVersion' => 'v2.2' | ||
] | ||
], | ||
// TODO: Remove POST in next API release | ||
[ | ||
'name' => 'api#reorderQuestions', | ||
'url' => '/api/{apiVersion}/question/reorder', | ||
'verb' => 'POST', | ||
'requirements' => [ | ||
'apiVersion' => 'v2(\.1)?' | ||
'apiVersion' => 'v2(\.[1-2])?' | ||
] | ||
], | ||
[ | ||
'name' => 'api#reorderQuestions', | ||
'url' => '/api/{apiVersion}/question/reorder', | ||
'verb' => 'PUT', | ||
'requirements' => [ | ||
'apiVersion' => 'v2.2' | ||
] | ||
], | ||
[ | ||
'name' => 'api#deleteQuestion', | ||
'url' => '/api/{apiVersion}/question/{id}', | ||
'verb' => 'DELETE', | ||
'requirements' => [ | ||
'apiVersion' => 'v2(\.1)?' | ||
'apiVersion' => 'v2(\.[1-2])?' | ||
] | ||
], | ||
|
||
|
@@ -182,23 +210,32 @@ | |
'url' => '/api/{apiVersion}/option', | ||
'verb' => 'POST', | ||
'requirements' => [ | ||
'apiVersion' => 'v2(\.1)?' | ||
'apiVersion' => 'v2(\.[1-2])?' | ||
] | ||
], | ||
// TODO: Remove POST in next API release | ||
[ | ||
'name' => 'api#updateOption', | ||
'url' => '/api/{apiVersion}/option/update', | ||
'verb' => 'POST', | ||
'requirements' => [ | ||
'apiVersion' => 'v2(\.1)?' | ||
'apiVersion' => 'v2(\.[1-2])?' | ||
] | ||
], | ||
[ | ||
'name' => 'api#updateOption', | ||
'url' => '/api/{apiVersion}/option/update', | ||
'verb' => 'PATCH', | ||
'requirements' => [ | ||
'apiVersion' => 'v2.2' | ||
] | ||
], | ||
[ | ||
'name' => 'api#deleteOption', | ||
'url' => '/api/{apiVersion}/option/{id}', | ||
'verb' => 'DELETE', | ||
'requirements' => [ | ||
'apiVersion' => 'v2(\.1)?' | ||
'apiVersion' => 'v2(\.[1-2])?' | ||
] | ||
], | ||
|
||
|
@@ -208,17 +245,18 @@ | |
'url' => '/api/{apiVersion}/share', | ||
'verb' => 'POST', | ||
'requirements' => [ | ||
'apiVersion' => 'v2(\.1)?' | ||
'apiVersion' => 'v2(\.[1-2])?' | ||
] | ||
], | ||
[ | ||
'name' => 'shareApi#deleteShare', | ||
'url' => '/api/{apiVersion}/share/{id}', | ||
'verb' => 'DELETE', | ||
'requirements' => [ | ||
'apiVersion' => 'v2(\.1)?' | ||
'apiVersion' => 'v2(\.[1-2])?' | ||
] | ||
], | ||
// TODO: Remove POST in next API release | ||
[ | ||
'name' => 'shareApi#updateShare', | ||
'url' => '/api/{apiVersion}/share/update', | ||
|
@@ -227,54 +265,62 @@ | |
'apiVersion' => 'v2.1' | ||
] | ||
], | ||
[ | ||
'name' => 'shareApi#updateShare', | ||
'url' => '/api/{apiVersion}/share/update', | ||
'verb' => 'PATCH', | ||
'requirements' => [ | ||
'apiVersion' => 'v2.2' | ||
] | ||
], | ||
|
||
// Submissions | ||
[ | ||
'name' => 'api#getSubmissions', | ||
'url' => '/api/{apiVersion}/submissions/{hash}', | ||
'verb' => 'GET', | ||
'requirements' => [ | ||
'apiVersion' => 'v2(\.1)?' | ||
'apiVersion' => 'v2(\.[1-2])?' | ||
] | ||
], | ||
[ | ||
'name' => 'api#exportSubmissions', | ||
'url' => '/api/{apiVersion}/submissions/export/{hash}', | ||
'verb' => 'GET', | ||
'requirements' => [ | ||
'apiVersion' => 'v2(\.1)?' | ||
'apiVersion' => 'v2(\.[1-2])?' | ||
] | ||
], | ||
[ | ||
'name' => 'api#exportSubmissionsToCloud', | ||
'url' => '/api/{apiVersion}/submissions/export', | ||
'verb' => 'POST', | ||
'requirements' => [ | ||
'apiVersion' => 'v2(\.1)?' | ||
'apiVersion' => 'v2(\.[1-2])?' | ||
] | ||
], | ||
[ | ||
'name' => 'api#deleteAllSubmissions', | ||
'url' => '/api/{apiVersion}/submissions/{formId}', | ||
'verb' => 'DELETE', | ||
'requirements' => [ | ||
'apiVersion' => 'v2(\.1)?' | ||
'apiVersion' => 'v2(\.[1-2])?' | ||
] | ||
], | ||
[ | ||
'name' => 'api#insertSubmission', | ||
'url' => '/api/{apiVersion}/submission/insert', | ||
'verb' => 'POST', | ||
'requirements' => [ | ||
'apiVersion' => 'v2(\.1)?' | ||
'apiVersion' => 'v2(\.[1-2])?' | ||
] | ||
], | ||
[ | ||
'name' => 'api#deleteSubmission', | ||
'url' => '/api/{apiVersion}/submission/{id}', | ||
'verb' => 'DELETE', | ||
'requirements' => [ | ||
'apiVersion' => 'v2(\.1)?' | ||
'apiVersion' => 'v2(\.[1-2])?' | ||
] | ||
], | ||
] | ||
|
Oops, something went wrong.