Up - API Reference - Home
Requires JWT.
Commit the schema items in bulk using the selection parameter.
Processing is done as a job running in the background, it may be incomplete when you receive the response. Job progress can be queried using the returned
job.token.
Learn more about the selection parameter and responses to bulk requests.
We used a copy to keep track of the changes; now we need to apply those changes to the originals, and remove the copies.
Afterwards, the schema items are no longer working copies. All places where this schema item is used will now work with the newly committed schema item - this includes records that use this (definition) schema item and now have new or removed fields.
Note: record data can be lost if you commit a definition!
The accompanying layout is committed too.
Note: you cannot commit an extended definition
POST /api/p/<project gid>/schema/bulk/commit
Authorization: Bearer <JWT>
{
"selection": [
"<gid-1>",
"<gid-2>",
"<gid-3>",
{
"search": {
"language": "nl",
"q": "+cms 225",
"filter": ["is_committed", "is_false", null],
},
"exclude": ["<gid-a>", "<gid-b>", "<gid-c>"]
},
],
}
selection is the selection of schema items to commit.
For many bulk operations, we don't report on individual items, because that report can potentially be very large, or it is processed in the background. We return a job.token, and you can look for it when you handle sync information - we report on the job while it is running and post a completion status there as soon as the operation is done.
Authorization: <JWT>
{
"success": true,
"result": {
"job.token": "7c136ddb-4dfa-4ec1-bad4-15067cbf80d9",
},
"data": {}
}
job.token the job token to look for in sync events.
Look for the job.token in sync events to find status updates on the operation. The sync event looks like this:
{
"type": "cc",
"cursor": <cursor>,
"action": "UPDATE",
"data_type": "jobs",
"data_key": "7c136ddb-4dfa-4ec1-bad4-15067cbf80d9",
"data": {
"project_gid": "<project_gid>",
"job": "bulk_commit_schema_items",
"status": "processing",
"info": {
"total": 120,
"remaining": 26
},
"created_on": 1613565541.4195538,
"updated_on": 1613565543.2836412,
}
}
status can be either queued, rejected, processing, or done.
400 Bad request - missing parameters or wrong type or value
401 Unauthorized - missing or expired JWT
403 Forbidden - not a member of this project
1006 Selection error - selection or cursor parameter is invalid