Convert policy Excel to JSON
const url = 'https://localhost:10001/api/v1/policies/convert';const form = new FormData();form.append('file', 'file');
const options = {method: 'POST', headers: {Authorization: '<Authorization>'}};
options.body = form;
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://localhost:10001/api/v1/policies/convert \ --header 'Authorization: <Authorization>' \ --header 'Content-Type: multipart/form-data' \ --form file=@fileParses an uploaded Excel workbook and returns structured JSON policy data
Authorizations
Section titled “Authorizations ”Parameters
Section titled “ Parameters ”FormData Parameters
Section titled “FormData Parameters ”Excel file (.xlsx or .xls)
Responses
Section titled “ Responses ”Converted policy data
A policy parsed from an uploaded workbook, shaped to post to the create-policy endpoint
object
object
Empty unless the workbook has a Citations sheet
object
Example generated
{ "controls": [ { "citations": [ { "title": "example", "url": "example" } ], "controlCode": "example", "description": "example", "title": "example" } ], "description": "example", "iconUrl": "example", "name": "example", "type": "example", "version": "example"}Bad request - Invalid or malformed Excel file
Error body for the policy conversion, policy export, and event ingestion endpoints, carrying a machine-readable code
object
Example
{ "code": "INVALID_REQUEST", "details": "unexpected end of JSON input", "message": "Invalid request body"}Unauthorized - Authentication required
Error body for the policy conversion, policy export, and event ingestion endpoints, carrying a machine-readable code
object
Example
{ "code": "INVALID_REQUEST", "details": "unexpected end of JSON input", "message": "Invalid request body"}Forbidden - Insufficient permissions
Error body for the policy conversion, policy export, and event ingestion endpoints, carrying a machine-readable code
object
Example
{ "code": "INVALID_REQUEST", "details": "unexpected end of JSON input", "message": "Invalid request body"}Internal server error
Error body for the policy conversion, policy export, and event ingestion endpoints, carrying a machine-readable code
object
Example
{ "code": "INVALID_REQUEST", "details": "unexpected end of JSON input", "message": "Invalid request body"}