Create Asset Documents

Creates one or more document attachments for the given asset. To specify the documents to be attached, use the HTTP header "Content-Type:multipart/form-data" and form-data for "uploadedFile" and "fileInfo". Note that the "fileInfo" is a string containing an array of file attributes. Use "fileInfo" to specify one or more documents to be attached.

Resource Information

Scope assets
App Type Agency
Authorization Type Access token
URI /v4/assets/{assetId}/documents
HTTP Method POST
Automation Version(s) 9.0.0

Request Information

Field or Parameter Type Required Values Description Automation Version
assetId string No Get All Assets The unique identifier for the asset assigned by the Civic Platform server. 9.0.0
category string No   The document category. The list of category options varies depending on the document group. 9.0.0
group string No   The group query parameter. 9.0.0
lang String No   Indicates the language applied. 9.0.0
password string No   The password related to the operation. 9.0.0
userId string No   The users login ID for the Accela Civic Platform, created by agency administrators. 9.0.0

Example

Sample Request Head

POST https://apis.accela.com/v4/assets/355148/documents
Content-Type : multipart/form-data

Sample Request Body

Form-data:
Content-Disposition: form-data; name="uploadedFile"; filename="assetIssues.xlsx"
Content-Type: application/vnd.ms-excel

Content-Disposition: form-data; name="uploadedFile"; filename="assetIssue1.jpg"
Content-Type: image/jpeg
Content-Disposition: form-data; name="fileInfo"
[
      {
      "serviceProviderCode": "BPTDEV",
      "fileName": "assetIssues.xlsx",
      "type": "application/vnd.ms-excel",
      "description": "Upload excel file containing asset issues"
   },
  {
      "serviceProviderCode": "BPTDEV",
      "fileName": "assetIssue1.jpg",
      "type": "image/jpeg",
      "description": "Upload jpg file for asset issue 1"
   }]

Response Information

Field Type Description Automation Version
result[] result{}   9.0.0
result.code string A code identifying an associated item 9.0.0
result.id string The unique identifier for the object, assigned by the Civic Platform server and provided in a response. 9.0.0
result.isSuccess boolean Indicates whether or not the operation on the item is successful. 9.0.0
result.message string A text message related to the operation. 9.0.0
status integer The record status. 9.0.0

Example

Sample Response Body

{
  "status": 200,
  "result": [
    {
      "id": 3413416
    },
    {
      "id": 3413417
    }
  ]
}