/splice

Splice the object list of the collection identified by collectionId: remove count objects at position index and insert the supplied objects at that position. The request body is a single object carrying the index, count and objects fields. The collection _version is not changed.

POST /collection/splice/{collection_id} — Remove and add objects to a collection.

Remove and add objects to a collection.

post
  • The splice call removes count objects at position index and adds the delivered objects at that position. Existing objects are moved to make room.
  • index, count and objects are supplied as fields of the request body object, not as query parameters.
  • index must be >= 0 and must not exceed the current number of objects. count must be >= -1; -1 deletes all objects from index to the end.
  • Requires an authenticated user with BAG_READ permission.
  • Linking objects to a collection requires LINK permission.
  • If objects will be unlinked from the collection, the UNLINK permission is needed.
  • The _version of the collection is not changed.
Authorizations
AuthorizationstringRequired

Access token in the Authorization header: Authorization: Bearer <token>.

Path parameters
collection_idintegerRequired

The collection id of the collection to access.

Query parameters
allow_invalid_aclstring · booleanOptional

Allow storing the collection even if the owner doesn't have the necessary permissions for all objects to share the rights defined in the _acl property of the collection. The _invalid_acl flag will be set, if the user doesn't have sufficient permissions to share all objects of the collection. The user needs the permission BAG_ACL for the collection in order to use this parameter.

Differs from easydb 5: this confirmation is driven by the boolean allow_invalid_acl parameter. easydb 5 instead resolves the 202 confirmation with a collection_rights_policy query parameter; there is no allow_invalid_acl parameter in easydb 5.

background_invalid_aclstring · booleanOptional

If set, the invalid-ACL validity check (whether the collection owner may grant the rights of all linked objects) is not run inline. Instead a queued ACTION_COLLECTION_ACL_CHECK job is scheduled and the request returns immediately, before the check has resolved.

skip_indexstring · booleanOptional

If set, do not queue index jobs for objects added to or removed from the collection.

Header parameters
x-fylr-authorizationstringOptional

The access token in form of Bearer <token>. You can also use authorization which does the same. authorization is looked at first.

authorizationstringOptional

The access token in form of Bearer <token>.

Body
_versionintegerRead-onlyOptional

The _version of the collection.

countintegerOptional

The number of objects linked to this collection. In /api/collection/splice the number of objects to delete. Use -1 to delete all objects.

indexinteger · nullableOptional

The index to use for /api/collection/splice. Index 0 is to the left of the first object. Index which equals the number of existing objects in the collection is to the right of the last object.

offsetintegerRead-onlyOptional

The offset of list of objects.

limitintegerRead-onlyOptional

The maximum count of objects to list.

Responses

Last updated