Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Added a missing exception code

Note

  • This is an upgraded version of the SendDocumentsToProject method with more metadata. Use this method as the previous is now obsolete.

  • SendDocumentsToProjectInput 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. 

...

The mandatory fields in DocumentInput are: FileName, DocumentTypeId, Url/Data, Title, ChapterTagIds, ProfessionId (this should be -1 which indicates "undefined" or provide a valid profession ID for the company).


Request - sample input

<SendDocumentsToProject2>
  <MethodParameters>
    <UserAuthentication>
      <UserName>username</UserName>
      <Password>password</Password>
      <AnyAttr attr0="XmlAttributeArray" isNull="false">
        <XmlAttributeArray0>System.Xml.XmlAttribute</XmlAttributeArray0>
      </AnyAttr>
    </UserAuthentication>
    <input>
      <Documents attr0="DocumentInputArray" isNull="false">
        <DocumentInputArray0>
          <FileName>title.pdf</FileName>
          <DocumentTypeId>2</DocumentTypeId>
          <Url>http://gahp.net/wp-content/uploads/2017/09/sample.pdf</Url>
          <Title>docName</Title>
          <Description isNull="false" />
          <OrderNumber>34324232</OrderNumber>
          <Data isNull="false" />
          <IsVisibleInBoligmappa>False</IsVisibleInBoligmappa>
          <ProfessionId>1</ProfessionId>
          <BuildingId>0</BuildingId>
          <RoomIds isNull="true" />
          <DeviceId>0</DeviceId>
          <ChapterTagIds isNull="true" />
          <ApartmentTagIds isNull="true" />
        </DocumentInputArray0>
      </Documents>
      <ProjectId>1226</ProjectId>
      <ProjectCode isNull="false" />
    </input>
    <applicationName>test</applicationName>
  </MethodParameters>
</SendDocumentsToProject2>


Response

TypeDescription
SendDocumentsToProjectOutputSendDocumentsToProject output model

...

ParameterTypeDescription
StatusList<DocumentUploadStatus>Document Response model list

Response - sample output

<SendDocumentsToProject2>
  <MethodParameters>
    <SendDocumentsToProjectOutput>
      <Status attr0="DocumentUploadStatusArray" isNull="false">
        <DocumentUploadStatusArray0>
          <DocumentTitle>docName</DocumentTitle>
          <DocumentId>57466</DocumentId>
          <UploadStatusCode>1</UploadStatusCode>
          <ErrorCode>0</ErrorCode>
        </DocumentUploadStatusArray0>
      </Status>
    </SendDocumentsToProjectOutput>
  </MethodParameters>
</SendDocumentsToProject2>

Exceptions

Error CodeDescription

110

Input parameters contain null or invalid data

112There is no document to upload
113One or more mandatory fields have not been provided 
114File name contains invalid charactor(s)
115Given ProfessionId(s) are not valid
116Invalid DocumentTypeId
123An exception occurred while processing your request
126File extension is not specified or file extension is not valid
133Url or Data must be provided to create a document file
136Invalid document Url
138applicationName length has exceeded the maximum character limit allowed (10)
146The applicationName is not set
15364 bit encoded data decoding has failed

165

The given profession is not registered to your company

167

You are not authorized to use this method

227The project does not exist or the company is not connected to the given project or your license does not authorize you to access this project
229BuildingId of the document should be either 0 or match with the building   attached to the project
235One of more of the attached BuildingIds does not belong to the property attached to the given project
252 No input is provided to ProjectId or ProjectCode. Need atleast one of them 
253 Ambiguous inputs. Make sure the ProjectCode and ProjectId refer to the same project 
254 Invalid ProjectCode 
273Project does not exist
299The given project is closed
310One or more input ChapterTags are invalid
311Professionals are not allowed to tag ChapterTagId 1 (Generell brukerveiledning bolig) 
317One or more of the attached RoomIds does not belong to the project
318Attached DeviceId does not belongs to the project
329One or more input ApartmentTags are invalid
330Document Description has exceeded the maximum character limit of 360
331Document Title has exceeded the maximum character limit of 260
332Document FileName has exceeded the maximum character limit of 260
333OrderNo has exceeded the maximum character limit of 50
335Either DocumentType or ChapterTag is mandatory

...