Create or revise a layer
const url = 'https://app.civillo.com/api/v1/example/projects/1/layers';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"mode":0,"fileNames":["test1.dwg","test2.dwg"],"fileLastModifieds":[1680673841108,1680673841109],"replaceLayerId":1,"revisionComment":"This is a comment!","srid":-1,"units":"m","title":"My layer","description":"This is the layer description.","permitSelf":true,"makeGlobal":false,"makeOnByDefault":false,"allowInPermits":false,"shpColorMode":"fixed","shpColorFixed":null,"shpColorAttribute":null,"shpFieldsToSkip":null,"csvIdField":null,"csvXField":null,"csvYField":null,"csvZField":null,"csvColor":null,"csvColorField":null,"revisionTruncate":false,"maxRevisions":null,"dataRightsSelectedItem":1,"ifcSublayerGroupBy":"Name","convert3dFaces":false,"convert3dFacesToTerrain":null}'};
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://app.civillo.com/api/v1/example/projects/1/layers \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "mode": 0, "fileNames": [ "test1.dwg", "test2.dwg" ], "fileLastModifieds": [ 1680673841108, 1680673841109 ], "replaceLayerId": 1, "revisionComment": "This is a comment!", "srid": -1, "units": "m", "title": "My layer", "description": "This is the layer description.", "permitSelf": true, "makeGlobal": false, "makeOnByDefault": false, "allowInPermits": false, "shpColorMode": "fixed", "shpColorFixed": null, "shpColorAttribute": null, "shpFieldsToSkip": null, "csvIdField": null, "csvXField": null, "csvYField": null, "csvZField": null, "csvColor": null, "csvColorField": null, "revisionTruncate": false, "maxRevisions": null, "dataRightsSelectedItem": 1, "ifcSublayerGroupBy": "Name", "convert3dFaces": false, "convert3dFacesToTerrain": null }'Begin the creation or revision process for a layer.
Authorizations
Section titled “Authorizations”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters”The organization nickname
The project id
Request Body
Section titled “Request Body”object
Whether this is a layer creation or revision. Use 0 for a layer creation or 1 for a layer revision.
Example
0The source file names for this layer.
Example
[ "test1.dwg", "test2.dwg"]The last modified values for source files.
Example
[ 1680673841108, 1680673841109]The id of the layer to revise. This is required when using mode 1.
Example
1A comment about the revision. Only valid when mode = 1.
Example
This is a comment!The spatial reference system. A value of -1 means auto-detection.
Example
3857The measurement units for this layer.
The unique name of the layer. Required when mode = 0. Only valid when mode = 0.
Example
My layerThe description of the layer. When mode = 1 you cannot remove the description, only update it.
Example
This is the layer description.If true, allow yourself automatic access to this layer once created. Only valid when mode = 0.
Example
falseIf true, this layer is automatically accessible to all users in the project (overrides user or group permissions). Only valid when mode = 0.
Example
trueIf true, this layer will be automatically turned on in the project map view. Only valid when mode = 0.
Example
trueIf true, this layer will be available for adding to permit categories and attaching to permits. Overridden by makeGlobal. Requires access to the permit feature. Only valid when mode = 0.
Example
trueThe shapefile colouring mode.
Example
fixedThe hex color to be used for all shapefile features.
Example
#94C296The name of the attribute from which pre-feature hex color values will be taken.
Shapefile attribute fields to skip (to not import).
The name of the ID field in the CSV.
The name of the X field in the CSV.
The name of the Y field in the CSV.
The name of the Z field in the CSV.
The hex color value for the CSV.
The field to use for setting geometry colors. Should not be mixed with csvColor.
Set to true if this upload should attempt to truncate existing revisions. (Should be paired with the MaxRevisions parameter)
When using RevisionTruncate parameter, MaxRevisions will be used to know the max number of revisions to keep. Has no use outside of pairing with RevisionTruncate.
When uploading imagery, users must declare that they have certain rights to use and upload the data, along with whether they can allow others to download the data. 1 = Viewing rights only (for other users). 2 = Full rights for sharing and downloading
When uploading IFC data, identify how Civillo sublayers are grouped. Common IFC properties are Name and Type, while all IFC geometric shapes have a IFC Data Type (e.g. IfcSlab).
Example
NameWhen uploading CAD data, identify if DXF AcDbFace entities should be converted to PolyfaceMesh objects.
When uploading CAD data, identify if DXF AcDbFace entities should be converted to a Terrain layer.
Responses
Section titled “ Responses ”Successful response
object
The job ID
Authorizes you to upload this layer to the upload processor.
The URL to the upload processor.
The organization nickname.
Example
{ "job": 123, "token": "ABCDEFGHIJKLMNOP12345678910", "processPath": "https://path/to/the/upload-processor", "application": "my-org"}Bad Request
Unauthorized
Forbidden