EditDocument

Description

This method is used to edit a document that is uploaded to a plant (property plant/ building plant), a project (property project /building project / anonymous project) or a tenant.


Request

Parameter

Type

Mandatory/Optional

Maximum character length/limit

Description

input

EditDocumentInput

Mandatory

Not Relevant

EditDocumentInput model

applicationName

string

Mandatory

Should be less than or equal to 10 characters

The name of the integration partner


EditDocumentInput 

Parameter

Type

Mandatory/Optional

Description

DocumentId

long

Mandatory

Id of the plant/project document which should be edited

Document 

DocumentEditDetailsInput

Mandatory

Document details to be edited

Note

  • Following parameters of the DocumentEditDetailsInput Model are mandatory for this method. 
  • Title
  • DocumentType/ChapterTagIds
  • Maximum 3 chapter tags can be given in the input
  • Rooms and Devices can only be tagged for property plant/ project documents
  • Apartment tag Ids can only be given for project documents. Apartment tag Ids given for a plant document are ignored.
  • If the document is not being stored in your database or details to edit the fields are unavailable, implement it as follows:

          Or else, directly call the EditDocument method.

  • Fields left empty/null are replaced with empty/null values.
  • Project owner is allowed to edit documents uploaded by invitees, but project owner will not be able to change IsVisibleInBoligmappa and Profession. Values sent for those fields, in case of project owner editing an invitee document, are ignored.

Request - sample input

<EditDocument>
  <MethodParameters>
    <UserAuthentication>
      <UserName>username</UserName>
      <Password>password</Password>
      <AnyAttr attr0="XmlAttributeArray" isNull="false">
        <XmlAttributeArray0>System.Xml.XmlAttribute</XmlAttributeArray0>
      </AnyAttr>
    </UserAuthentication>
    <input>
      <DocumentId>57226</DocumentId>
      <Document>
        <Title>download100.png</Title>
        <OrderNo isNull="false" />
        <DocumentType>13</DocumentType>
        <Description>A new doc for chapter 2</Description>
        <ProfessionId>1</ProfessionId>
        <ChapterTagIds attr0="Int32Array" isNull="false">
          <Int32Array0>2</Int32Array0>
        </ChapterTagIds>
        <PropertyUnitIdList isNull="true" />
        <DeviceId>0</DeviceId>
        <ApartmentTagIdList isNull="true" />
        <IsVisibleInBoligmappa>True</IsVisibleInBoligmappa>

 
      </Document>
    </input>
    <applicationName>test</applicationName>
  </MethodParameters>
</EditDocument>


Response

Type

Description

EditDocumentOutput

EditDocumentOutput model


EditPlantDocumentOutput 

Parameter

Type

Comments

Statuses

List<DocumentEditStatus>

Document edit response


Response - sample output

<EditDocument>
  <MethodParameters>
    <EditDocumentOutput>
      <EditStatus>
        <DocumentTitle>download100.png</DocumentTitle>
        <DocumentId>57226</DocumentId>
        <EditStatusCode>1</EditStatusCode>
      </EditStatus>
    </EditDocumentOutput>
  </MethodParameters>
</EditDocument>

Exceptions

Error Code

Description

110

Input parameters contain null or invalid data

113

One or more mandatory fields have not been supplied in input

115 

Given ProfessionId(s) are not valid

116 

Invalid DocumentTypeId

123

An exception occurred while processing your request 

134

Document does not exist for the given documentId

138 

applicationName length has exceeded the maximum character limit allowed (10) 

146 

applicationName is missing

165 

The given profession is not registered to your company 

238

The company of the document is not the same as the current user's company

310

One or more input ChapterTags are invalid

311

ChapterTagId 1 (Generell brukerveiledning bolig) is not allowed to tag by professionals

316

You cannot do this operation for a closed project

329One or more input ApartmentTags are invalid

330

Document description exceeded the maximum character limit of 360

331

Document Title exceeded the maximum character limit of 260

333

OrderNo exceeded the maximum character limit of 50

335

Either DocumentType or ChapterTag is mandatory

342

One or more of the attached DeviceIds does not belong to the plant which is associated to the document

343

One or more of the attached RoomIds does not belong to the plant which is associated to the document

344

For a document to be tagged with a room or a device, the given document needs to be connected to a property plant

345

Please provide either a plant document, project document or a tenancy document.

347

You cannot enter more than 3 chapter tags

354

One or more of the attached DeviceIds does not belong to the project which is associated to the document

355

One or more of the attached RoomIds does not belong to the project which is associated to the document

356

One or more of the attached ApartmentTagIds does not belong to the project which is associated to the document

403One or more of the attached RoomIds are either invalid or does not belong to the Tenant
404Attached DeviceId does not belong to the tenant
411You need to have the Tenants Addon to perform this action
412The office space (tenant) no longer exists and this workspace has been deactivated.