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
API docs for 2024.2, mainly submission deletes (#1199)
* Extra entity fields for offline management
* submission deletes
* notes about restoring deleted forms by id
* link changelog to parts of docs
* Add additional server audit log events to list
Copy file name to clipboardExpand all lines: docs/api.yaml
+183-4Lines changed: 183 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -44,7 +44,12 @@ info:
44
44
45
45
**Added**:
46
46
47
-
- Extended metadata for Forms includes a new property `publicLinks`, which is the number of Public Links that can submit to the Form.
47
+
* Submission Delete!
48
+
- New [DELETE](/central-api-submission-management/#deleting-a-submission) and [RESTORE](/central-api-submission-management/#restoring-a-deleted-submission) endpoints for submissions!
49
+
- Submissions that have been soft-deleted for 30 days will automatically be purged.
50
+
* Additional properties on certain responses:
51
+
- Extended metadata for Forms includes a new property `publicLinks`, which is the number of Public Links that can submit to the Form.
52
+
- Data for Entity versions now includes the properties `branchId`, `trunkVersion`, and `branchBaseVersion` for supporting offline functionality.
48
53
49
54
## ODK Central v2024.1
50
55
@@ -847,6 +852,10 @@ tags:
847
852
* `submission.update` when a Submission's metadata is updated.
848
853
* `submission.update.version` when a Submission XML data is updated.
849
854
* `submission.attachment.update` when a Submission Attachment binary is set or cleared, but _only via the REST API_. Attachments created alongside the submission over the OpenRosa `/submission` API (including submissions from Collect) do not generate audit log entries.
855
+
* `submission.delete` when a Submission is soft-deleted.
856
+
* `submission.purge` when soft-deleted Submissions are purged.
857
+
* `submission.restore` when a Submission is restored.
858
+
* `submission.reprocess` when an Entity Submission is held in a processing backlog and then removed.
850
859
* `dataset.create` when a Dataset is created.
851
860
* `dataset.update` when a Dataset is updated.
852
861
* `dataset.update.publish` when a Dataset is published.
@@ -857,6 +866,8 @@ tags:
857
866
* `entity.delete` when an Entity is deleted.
858
867
* `config.set` when a system configuration is set.
859
868
* `analytics` when a Usage Report is attempted.
869
+
* `blobs.s3.upload` when blobs are moved from the database to external storage.
870
+
* `blobs.s3.failed-to-pending` when blobs that failed to upload are reset to the pending state to be retried.
860
871
* Deprecated: `backup` when a backup operation is attempted for Google Drive backups.
861
872
- name: Direct Backup
862
873
x-parent-tag: System Endpoints
@@ -2971,6 +2982,8 @@ paths:
2971
2982
As of version 1.2, Forms that are unpublished (that only carry a draft and have never been published) will appear with full metadata detail. Previously, certain details like `name` were omitted. You can determine that a Form is unpublished by checking the `publishedAt` value: it will be `null` for unpublished forms.
2972
2983
2973
2984
This endpoint supports retrieving extended metadata; provide a header `X-Extended-Metadata: true` to additionally retrieve the `submissions` count of the number of Submissions that each Form has, the `reviewStates` object of counts of Submissions with specific review states, the `lastSubmission` most recent submission timestamp, the Actor the Form was `createdBy`, as well as other metadata.
2985
+
2986
+
The query `?deleted=true` can be added to list deleted Forms with their numeric form IDs, which can be used to [restore](/central-api-form-management/#restoring-a-form) a deleted Form.
2974
2987
operationId: List all Forms
2975
2988
parameters:
2976
2989
- name: projectId
@@ -2980,6 +2993,12 @@ paths:
2980
2993
schema:
2981
2994
type: number
2982
2995
example: "16"
2996
+
- name: deleted
2997
+
in: query
2998
+
description: If set to `true`, will return only deleted Forms and their IDs
2999
+
schema:
3000
+
type: boolean
3001
+
example: "true"
2983
3002
responses:
2984
3003
200:
2985
3004
description: OK
@@ -3299,13 +3318,18 @@ paths:
3299
3318
tags:
3300
3319
- Individual Form
3301
3320
summary: Deleting a Form
3302
-
description: When a Form is deleted, it goes into the Trash section, but it
3321
+
description: -|
3322
+
When a Form is deleted, it goes into the Trash section, but it
3303
3323
can now be restored from the Trash. After 30 days in the Trash, the Form and
3304
3324
all of its resources and submissions will be automatically purged. If your
3305
3325
goal is to prevent it from showing up on survey clients like ODK Collect,
3306
3326
consider setting its `state` to `closing` or `closed` instead (see [Modifying
3307
3327
a Form](/central-api-form-management/#modifying-a-form) just above for
3308
3328
more details).
3329
+
3330
+
The API usually identifies forms by their `projectId` and `xmlFormId`, but if a Form
3331
+
is deleted, the same `xmlFormId` can be reused. To [restore](/central-api-form-management/#restoring-a-form) a deleted Form, use its
3332
+
_numeric ID_, which can be retrieved by [listing Forms with `?deleted=true`](/central-api-form-management/#list-all-forms).
3309
3333
operationId: Deleting a Form
3310
3334
parameters:
3311
3335
- name: xmlFormId
@@ -3811,7 +3835,9 @@ paths:
3811
3835
description: |-
3812
3836
_(introduced: version 1.4)_
3813
3837
3814
-
Deleted forms can now be restored (as long as they have been in the Trash less than 30 days and have not been purged). However, a deleted Form with the same `xmlFormId` as an active Form cannot be restored while that other Form is active. This `/restore` URL uses the numeric ID of the Form (now returned by the `/forms` endpoint) rather than the `xmlFormId` to unambigously restore.
3838
+
Deleted forms can now be restored (as long as they have been in the Trash less than 30 days and have not been purged). However, a deleted Form with the same `xmlFormId` as an active Form cannot be restored while that other Form is active.
3839
+
3840
+
This `/restore` URL uses the numeric ID of the Form (now returned by the `/forms?deleted=true` endpoint) rather than the `xmlFormId` to unambigously restore. Note that the numeric ID of a Form is not returned by default on the [Form list](/central-api-form-management/#list-all-forms) and is only returned when listing deleted Forms.
3815
3841
operationId: Restoring a Form
3816
3842
parameters:
3817
3843
- name: projectId
@@ -6231,6 +6257,123 @@ paths:
6231
6257
application/json:
6232
6258
schema:
6233
6259
$ref: '#/components/schemas/Error403'
6260
+
delete:
6261
+
tags:
6262
+
- Submissions
6263
+
summary: Deleting a Submission
6264
+
description: When a Submission is deleted, there is a period of time (30 days)
6265
+
during which it can be restored. After this time, all of its resources and attachments
6266
+
are automatically purged. Purging deleted Submissions can also be triggered from the command line.
6267
+
operationId: Deleting a Submission
6268
+
parameters:
6269
+
- name: projectId
6270
+
in: path
6271
+
description: The numeric ID of the Project
6272
+
required: true
6273
+
schema:
6274
+
type: number
6275
+
example: "16"
6276
+
- name: xmlFormId
6277
+
in: path
6278
+
description: The `xmlFormId` of the Form being referenced.
6279
+
required: true
6280
+
schema:
6281
+
type: string
6282
+
example: simple
6283
+
- name: instanceId
6284
+
in: path
6285
+
description: The `instanceId` of the Submission being referenced.
description: The version number of the version that was the "base version" of this version. The base version is the version that was shown to the data collector when they made their update.
12431
+
description: The version number of the version that was the "base version" of this version.
12432
+
example: 1
12433
+
branchId:
12434
+
type: string
12435
+
description: The uuid of a branch linking multiple offline entity updates together.
12436
+
example: b0e927b6-958a-42f6-8344-1deb37ee9672
12437
+
trunkVersion:
12438
+
type: number
12439
+
description: The version number of the last known base server version of an entity, in the case of an offline branch of updates.
12440
+
example: 1
12441
+
branchBaseVersion:
12442
+
type: number
12443
+
description: The base version of the entity according to the submission. In the case of an offline branch of updates, this may not match the version of the base submission on Central.
0 commit comments