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

ParameterTypeMandatory/OptionalMaximum character length/limitDescription
inputSendDocumentsToPlantInputMandatoryNot RelevantSendDocumentsToPlantInput model
applicationNamestringMandatoryShould be less than or equal to 10 charactersThe 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


ParameterTypeMandatory/OptionalDescription
PlantIdlongMandatoryId of the plant (Building/Property) to where the documents should be uploaded
PropertyOwnerEmailstringOptionalA notification is sent to the given email address when a document is uploaded to the property
Documents List<DocumentInput>MandatoryList 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

TypeDescription
SendDocumentsToPlantOutputSendDocumentsToPlantOutput model


SendDocumentsToPlantOutput


Parameter
Type
Description
StatusesList<DocumentUploadStatus>Document response model List
SummaryDocumentstringUrl 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 CodeDescription
111plantId does not exist for your company or your license does not authorize you to access this plantId
112There is no document to upload
113One 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
123An exception occurred while processing your request 
126 File extension is not specified
133 Url or Data must be provided to create a document file
136Provided Url is invalid
138 applicationName length has exceeded the maximum character limit allowed (10)
146 The applicationName is not set
15364 bit encoded data decoding failed
165 The given profession is not registered to your company
167You 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 

217An error occurred while sending the notification mail to the user 
218The PropertyOwnerEmail provided is not valid 
310One or more input chapter tags are invalid
311Professionals are not allowed to tag Chapter Tag Id 1 (Generell brukerveiledning bolig) 
330Document description has exceeded the maximum character limit allowed (360)
331Document title has exceeded the maximum character limit allowed (260)
332Document filename has exceeded the maximum character limit allowed (260)
333OrderNumber has exceeded the maximum character limit allowed (50)
335Either DocumentType or ChapterTag is mandatory