You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/API_v3.md
+17-8Lines changed: 17 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -54,7 +54,7 @@ This file contains the API-Documentation. For more information on the returned D
54
54
-`GET /api/v3/forms/{formId}/questions/{questionId}` to get a single question
55
55
-`POST /api/v3/forms/{formId}/questions/{questionId}/options` does now accept more options at once
56
56
-`PATCH /api/v3/forms/{formId}/questions/{questionId}/options` to reorder the options (request body `newOrder`, optional `optionType`)
57
-
-`POST /api/v3/forms/{formId}/submissions/files/{questionId}` to upload a file to a file question before submitting the form
57
+
-`POST /api/v3/forms/{formId}/submissions/files/{questionId}` to upload a file to a file question before submitting the form (response includes `uploadToken`; submissions must include it with `uploadedFileId`)
58
58
-`GET /api/v3/forms/{formId}/submissions/{submissionId}` to get a single submission
59
59
-`PUT /api/v3/forms/{formId}/submissions/{submissionId}` to update an existing submission
60
60
- In API version 2.5 the following endpoints were introduced:
@@ -858,25 +858,34 @@ Delete all Submissions to a form
858
858
859
859
### Upload a file
860
860
861
-
Upload a file to an answer before form submission
861
+
Upload a file to a file question before form submission. Each uploaded file is stored temporarily and bound to the given `formId` and `questionId`. The response includes an `uploadToken` that must be sent back when submitting the form, together with `uploadedFileId`.
When submitting the form, each file answer must include both `uploadedFileId` and `uploadToken` from this response for the same `questionId`. Uploads from other forms, questions, or sessions are rejected.
888
+
880
889
### Get a specific submission
881
890
882
891
Get a specific submission of a form. Viewing another user's submission requires the `results` permission; otherwise only the submission owner may view it.
@@ -933,15 +942,15 @@ Store Submission to Database
933
942
- QuestionID as key
934
943
- An **array** of values as value --> Even for short Text Answers, wrapped into Array.
935
944
- For Question-Types with pre-defined answers (`multiple`, `multiple_unique`, `dropdown`), the array contains the corresponding option-IDs.
936
-
- For File-Uploads, the array contains the objects with key `uploadedFileId`(value from Upload a file endpoint).
945
+
- For File-Uploads, the array contains objects with `uploadedFileId`and `uploadToken` (both from the [Upload a file] endpoint for the same `questionId`).
937
946
938
947
```
939
948
{
940
949
"1":[27,32], // dropdown or multiple
941
950
"2":["ShortTextAnswer"], // All Text-Based Question-Types
thrownew \InvalidArgumentException(sprintf('File "%s" for question "%s" not exists anymore. Please delete and re-upload the file.', $answer['fileName'] ?? $answer['uploadedFileId'], $question['text']));
0 commit comments