# Proposals ## Proposal API: `/api/bw/v2/proposal` 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. --- ## Endpoints ### POST `/api/bw/v2/proposal` - Create/Update Proposal Create or update a Proposal using JSON data according to Schema. **Request:** - `json` (POST body) - 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. **Response `HTTP 200`** - Skipped (no update needed): ```json { "done": "Skip Proposal TEST111", "id": "TEST111", "new": false, "update": false } ``` **Response `HTTP 201`** - Created: ```json { "done": "Create Proposal TEST111", "id": "TEST111", "new": true, "update": true } ``` **Response `HTTP 202`** - Accepted (updated): ```json { "done": "Update Proposal TEST111", "id": "TEST111", "new": false, "update": true } ``` **Response `HTTP 400`** - Wrong request: ```json { "fail": "Wrong request" } ``` **Response `HTTP 401`** - Unauthorized: ```json { "fail": "Unauthorized" } ``` **Response `HTTP 409`** - Conflict (invalid contents): ```json { "fail": "Explanation of the problems encountered" } ``` --- ### GET `/api/bw/v2/proposal/{ids}` - Get Proposals Retrieve one or more Proposals by ID. **Request:** - `/{ids}` (path) - Id or Ids in CSV format (Optional) - `/published/{1|0|*}` (path) - Published status (Optional) (Default: 1) - `/fields/{fields}` (path) - Only these fields (Optional) (Omit for all) - `/ignoreFields/{fields}` (path) - Ignore these fields (Optional) (Omit for none) - `/excludeFiles` (path) - Ignore file fields (Optional) (Omit for none) **Response `HTTP 200`** - Success: Proposal data in JSON format according to Schema (`schema.json` or `schema.multiple.json`) **Response `HTTP 400`** - Wrong request: ```json { "fail": "Wrong request" } ``` **Response `HTTP 401`** - Unauthorized: ```json { "fail": "Unauthorized" } ``` **Response `HTTP 404`** - Not found: ```json { "fail": "ERROR: Export fail" } ``` --- ### DELETE `/api/bw/v2/proposal/{ids}` - Delete Proposals Delete one or more Proposals by ID. **Request:** - `/{ids}` (path) - Id or Ids in CSV format **Response `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"] } ``` **Response `HTTP 400`** - Wrong request: ```json { "fail": "Wrong request" } ``` **Response `HTTP 401`** - Unauthorized: ```json { "fail": "Unauthorized" } ``` **Response `HTTP 404`** - Not found: ```json { "fail": "No Proposals to delete" } ``` **Response `HTTP 409`** - Conflict: ```json { "fail": "Deletion of 5 Proposals not done" } ``` --- ### POST/GET `/api/bw/v2/proposal/clone/{id}` - Clone Proposal Clone a Proposal. **Request:** - `/{id}` (path) - Id (Optional) (Default: Proposal "Base" is cloned) **Response `HTTP 201`** - Cloned: ```json { "done": "Cloned Proposal TEST111 to Proposal TEST111_8PtTXiU6mcw", "id": "TEST111_8PtTXiU6mcw" } ``` **Response `HTTP 400`** - Wrong request: ```json { "fail": "Wrong request" } ``` **Response `HTTP 401`** - Unauthorized: ```json { "fail": "Unauthorized" } ``` **Response `HTTP 404`** - Not found: ```json { "fail": "There is no Proposal TEST111 to clone" } ``` **Response `HTTP 409`** - Conflict: ```json { "fail": "Not cloned Proposal TEST111" } ``` --- ### GET `/api/bw/v2/proposal/schema.json` - Get Schema Get JSON Schema from the data structure of a Proposal. **Request:** - `/full` (path) - Schema and data (Optional) **Response `HTTP 200`** - Success: JSON schema document --- ### GET `/api/bw/v2/proposal/schema.multiple.json` - Get Batch Schema Get JSON Schema of a group of Proposals in a batch process. **Request:** - `/full` (path) - Schema and data (Optional) **Response `HTTP 200`** - Success: JSON schema document --- (proposal-schema-documentation)= ```{include} proposal.schema.json.md.merge :parser: myst_parser.sphinx_ ```