SendDocumentsToPlant - New
Note
This is an upgraded version of the SendDocuments method with more metadata. Use this method as the previous is now obsolete.
SendDocumentsToPlantInput is a single input parameter introduced in this method to enclose all the existing input parameters of the previous method in a single place with the exception of the applicationName.
Description
This method is used to submit document(s) to Boligmappa. The document is associated with a specific property and company through a plantId. The company is identified by the current user's credentials. It is possible to tag a document with related rooms, chapter tags and a device.
Request
Parameter | Type | Mandatory/Optional | Maximum character length/limit | Description |
---|---|---|---|---|
input | SendDocumentsToPlantInput | Mandatory | Not Relevant | SendDocumentsToPlantInput model |
applicationName | string | Mandatory | Should be less than or equal to 10 characters | The name of the integration partner |
Note
No errors are thrown when 0 is provided for the RoomIds as it considered as no RoomId provided.
SendDocumentsToPlantInput
Parameter | Type | Mandatory/Optional | Description |
---|---|---|---|
PlantId | long | Mandatory | Id of the plant (Building/Property) to where the documents should be uploaded |
PropertyOwnerEmail | string | Optional | A notification is sent to the given email address when a document is uploaded to the property |
Documents | List<DocumentInput> | Mandatory | List of documents to be uploaded. |
Note
The following parameters of DocumentInput Model are mandatory for this method.
- FileName
- DocumentTypeId
- Url / Data (*either the Url or the data must be provided)
- Title
- OrderNumber
- ProfessionId
Request - input sample
<SendDocumentsToPlant>
<MethodParameters>
<UserAuthentication>
<UserName>username</UserName>
<Password>password</Password>
<AnyAttr attr0="XmlAttributeArray" isNull="false">
<XmlAttributeArray0>System.Xml.XmlAttribute</XmlAttributeArray0>
</AnyAttr>
</UserAuthentication>
<input>
<PlantId>6731</PlantId>
<PropertyOwnerEmail isNull="false" />
<Documents attr0="DocumentInputArray" isNull="false">
<DocumentInputArray0>
<FileName>test.pdf</FileName>
<DocumentTypeId>2</DocumentTypeId>
<Url>https://www.ets.org/Media/Tests/GRE/pdf/gre_research_validity_data.pdf</Url>
<Title>test</Title>
<Description isNull="false" />
<OrderNumber>34324232</OrderNumber>
<Data isNull="false" />
<IsVisibleInBoligmappa>False</IsVisibleInBoligmappa>
<ProfessionId>1</ProfessionId>
<BuildingId>0</BuildingId>
<RoomIds attr0="Int64Array" isNull="false">
<Int64Array0>0</Int64Array0>
</RoomIds>
<DeviceId>0</DeviceId>
<ChapterTagIds isNull="true" />
<ApartmentTagIds attr0="Int32Array" isNull="false">
<Int32Array0>0</Int32Array0>
</ApartmentTagIds>
</DocumentInputArray0>
</Documents>
</input>
<applicationName>test</applicationName>
</MethodParameters>
</SendDocumentsToPlant>
Response
Type | Description |
---|---|
SendDocumentsToPlantOutput | SendDocumentsToPlantOutput model |
SendDocumentsToPlantOutput
Parameter | Type | Description |
---|---|---|
Statuses | List<DocumentUploadStatus> | Document response model List |
SummaryDocument | string | Url of the summary document, This document contains urls for all the successfully sent documents, plant details and company details. This document will be created only if the relevant plant is owned by a company. |
Response - output sample
<SendDocumentsToPlant>
<MethodParameters>
<SendDocumentsToPlantOutput>
<Statuses attr0="DocumentUploadStatusArray" isNull="false">
<DocumentUploadStatusArray0>
<DocumentTitle>test</DocumentTitle>
<DocumentId>57463</DocumentId>
<UploadStatusCode>1</UploadStatusCode>
<ErrorCode>0</ErrorCode>
</DocumentUploadStatusArray0>
</Statuses>
<SummaryDocument isNull="true" />
</SendDocumentsToPlantOutput>
</MethodParameters>
</SendDocumentsToPlant>
Exceptions
Error Code | Description |
---|---|
111 | plantId does not exist for your company or your license does not authorize you to access this plantId |
112 | There is no document to upload |
113 | One or more mandatory fields have not been supplied in input |
114 | File name contains invalid charactor(s) |
115 | Given ProfessionId(s) are not valid |
116 | Invalid DocumentTypeId |
123 | An exception occurred while processing your request |
126 | File extension is not specified |
133 | Url or Data must be provided to create a document file |
136 | Provided Url is invalid |
138 | applicationName length has exceeded the maximum character limit allowed (10) |
146 | The applicationName is not set |
153 | 64 bit encoded data decoding failed |
165 | The given profession is not registered to your company |
167 | You are not authorized to use this web method |
179 | One or more of the attached RoomIds do not belong to the given plant |
180 | One of more of the attached DeviceIds do not belong to the given plant |
181 | To tag a document to a room or a device, the given plant needs to be connected to a property |
182 | One or more of the attached BuildingIds do not belong to the given plant |
203 | BuildingId of the document should be either 0 or match the building plant provided |
217 | An error occurred while sending the notification mail to the user |
218 | The PropertyOwnerEmail provided is not valid |
310 | One or more input chapter tags are invalid |
311 | Professionals are not allowed to tag Chapter Tag Id 1 (Generell brukerveiledning bolig) |
330 | Document description has exceeded the maximum character limit allowed (360) |
331 | Document title has exceeded the maximum character limit allowed (260) |
332 | Document filename has exceeded the maximum character limit allowed (260) |
333 | OrderNumber has exceeded the maximum character limit allowed (50) |
335 | Either DocumentType or ChapterTag is mandatory |