# Proposals ## Proposal API: `/api/bw/v2/proposal` API BW version 2 (Beta) Allows you to add, update or delete Proposals in a Boldest platform account. Among many other things, it can also be used to categorize Proposals. ## Methods ### POST: Create/Update Proposal - POST `json` Data to import in JSON format according to Schema /api/bw/v2/proposal/schema.json Consult the [**`Schema documentation`**](#proposal-schema-documentation) for the structure of the JSON data. **RESULT**: `HTTP 200` Skipped. The Proposal exists and does not need to be updated ```json { "done": "Skip Proposal TEST111", "id": "TEST111", "new": false, "update": false } ``` `HTTP 201` Created. The Proposal did not exist, so it was created ```json { "done": "Create Proposal TEST111", "id": "TEST111", "new": true, "update": true } ``` `HTTP 202` Accepted. The Proposal existed, so it was updated ```json { "done": "Update Proposal TEST111", "id": "TEST111", "new": false, "update": true } ``` `HTTP 400` Wrong request ```json { "fail": "Wrong request" } ``` `HTTP 401` Unauthorized ```json { "fail": "Unauthorized" } ``` `HTTP 409` Conflict. The submitted contents are not valid ```json { "fail": "Explanation of the problems encountered" } ``` ### GET: Get Proposal/s - `/{ids}` Id or Ids CSV format (Optional) - `/published/{1|0|*}` Published (Optional) (Default:1) - `/fields/{fields}` Only these fields (Optional) (Default:All) - `/ignoreFields/{fields}` Ignore these fields (Optional) (Default:None) - `/excludeFiles` Ignore file fields (Optional) (Default:No) **RESULT**: `HTTP 200` Success Proposal data in JSON format according to Schema (schema.json or schema.multiple.json) `HTTP 400` Wrong request ```json { "fail": "Wrong request" } ``` `HTTP 401` Unauthorized ```json { "fail": "Unauthorized" } ``` `HTTP 404` Not found ```json { "fail": "ERROR: Export fail" } ``` ``` ### DELETE: Delete Proposal/s - `/{ids}` Id or Ids CSV format **RESULT**: `HTTP 202` Deleted ```json { "done": "Deletion of 5 Proposals done", "count": 5 // Number of Proposals deleted } ``` Partial deletion ```json { "done": "Deletion of 3 Proposals done", "count": 3, // Number of Proposals deleted "fail": "Deletion of 2 Proposals not done", "failed": ["TEST114", "TEST115"] } ``` `HTTP 400` Wrong request ```json { "fail": "Wrong request" } ``` `HTTP 401` Unauthorized ```json { "fail": "Unauthorized" } ``` `HTTP 404` Not found ```json { "fail": "No Proposals to delete" } ``` `HTTP 409` Conflict. The submitted contents are not valid ```json { "fail": "Deletion of 5 Proposals not done" } ``` ### POST/GET: Clone a Proposal. Optionally can be added to a Map - `/clone` Command - `/{id}` Id (Optional) (Default: Proposal "Base" is cloned) **RESULT**: `HTTP 201` Cloned ```json { "done": "Cloned Proposal TEST111 to Proposal TEST111_8PtTXiU6mcw", "id": "TEST111_8PtTXiU6mcw" } ``` `HTTP 400` Wrong request ```json { "fail": "Wrong request" } ``` `HTTP 401` Unauthorized ```json { "fail": "Unauthorized" } ``` `HTTP 404` Error ```json { "fail": "There is no Proposal TEST111 to clone" } ``` `HTTP 409` Fail ```json { "fail": "Not cloned Proposal TEST111" } ``` ### GET: Get Schema JSON from the data structure of a Proposal - `/full` Schema and data (Optinal) - `/schema.json` JSON schema for import **RESULT**: `HTTP 200` Success JSON schema document ### GET: Get Schema JSON schema of a group of Proposals in a batch process - `/full` Schema and data (Optinal) - `/schema.multiple.json` Schema for batch import JSON **RESULT**: `HTTP 200` Success JSON schema document (proposal-schema-documentation)= ```{include} proposal.schema.json.md.merge :parser: myst_parser.sphinx_