-
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.
enh: use PUT for updating and move to API v2.2
Signed-off-by: Christian Hartmann <[email protected]>
- Loading branch information
1 parent
0283add
commit c84e09d
Showing
16 changed files
with
154 additions
and
93 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]> | ||
* | ||
|
@@ -31,11 +32,17 @@ | |
'url' => '/config', | ||
'verb' => 'GET' | ||
], | ||
// TODO: Remove POST in next API release | ||
[ | ||
'name' => 'config#updateAppConfig', | ||
'url' => '/config/update', | ||
'verb' => 'POST' | ||
], | ||
[ | ||
'name' => 'config#updateAppConfig', | ||
'url' => '/config/update', | ||
'verb' => 'PATCH' | ||
], | ||
|
||
// Public Share Link | ||
[ | ||
|
@@ -72,7 +79,7 @@ | |
'verb' => 'OPTIONS', | ||
'requirements' => [ | ||
'path' => '.+', | ||
'apiVersion' => 'v2(\.1)?' | ||
'apiVersion' => 'v2(\.[1-2])?' | ||
] | ||
], | ||
|
||
|
@@ -82,63 +89,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 +164,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 +216,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 +251,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 +271,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.