Add/Replace Scenario
Add a new scenario or replace an existing one.
info
Available in Contextal Platform 1.0 and later.
Request
- Path:
/api/v1/scenarios - Verb:
PUTorPOST - Content-Type:
application/json - URL parameters:
replace_id: the id of an existing scenario to atomically delete (optional)
- Body: JSON object with the following format (see the Scenarios section for more information):
The Optional{"name": String,"compatible_with": Optional String,"creator": String,"description": String,"local_query": String,"context": Optional Object,"action": String,}
contextobject has this form:{"global_query": String,}
Reply
On success:
- Status:
201 - Created - Content-Type:
application/json - Body: a JSON object with the following format:
{"id": Number,"name": String,"creator": String,"description": String,"t": Date and time,"action": String,}
On failure:
- Status:
409 - Conflictif the name of the scenario already exists - Status:
404 - Not Foundif thereplace_idparameter was provided but it does not match an existing scenario - Status: 4xx or 5xx