SendDocumentsToProject2 - New
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.
Description
This method is used to submit document(s) to projects. Once a company is added to a project, all users of that company can send documents to the project using this method. The uploaded documents are shared with limited access to all companies that are connected to the project. (A user does not have edit/delete access to the documents uploaded by other companies. However complete access is given to any user for documents uploaded by their company. Only the project owner of a company is allowed to copy documents to property/building plants.)
It is possible to tag documents with related devices, rooms, buildings and chapters.
Request
Parameter | Type | Mandatory/Optional | Maximum character length/limit | Description |
---|---|---|---|---|
input | SendDocumentsToProjectInput | Mandatory | Not relevant | SendDocumentsToProject input model |
applicationName | string | Mandatory | Should be less than or equal to 10 characters | The name of the integration partner |
SendDocumentsToProjectInput
Parameter | Type | Mandatory/Optional | Description |
---|---|---|---|
Documents | List<DocumentInput> | Mandatory | List of documents to be uploaded |
ProjectId | long | Mandatory/Optional | Id of the project to where the documents should be uploaded |
ProjectCode | string | Mandatory/Optional | The code of the project E.g. ABC0001-A1 |
Note
It is mandatory to provide either the ProjectCode or ProjectId. First preference is always given to the ProjectId, if both the ProjectCode and ProjectId are provided.
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
Type | Description |
---|---|
SendDocumentsToProjectOutput | SendDocumentsToProject output model |
SendDocumentsToProjectOutput
Parameter | Type | Description |
---|---|---|
Status | List<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 Code | Description |
---|---|
110 | Input parameters contain null or invalid data |
112 | There is no document to upload |
113 | One or more mandatory fields have not been provided |
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 or file extension is not valid |
133 | Url or Data must be provided to create a document file |
136 | Invalid document Url |
138 | applicationName length has exceeded the maximum character limit allowed (10) |
146 | The applicationName is not set |
153 | 64 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 |
227 | The 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 |
229 | BuildingId of the document should be either 0 or match with the building attached to the project |
235 | One 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 |
273 | Project does not exist |
299 | The given project is closed |
310 | One or more input ChapterTags are invalid |
311 | Professionals are not allowed to tag ChapterTagId 1 (Generell brukerveiledning bolig) |
317 | One or more of the attached RoomIds does not belong to the project |
318 | Attached DeviceId does not belongs to the project |
329 | One or more input ApartmentTags are invalid |
330 | Document Description has exceeded the maximum character limit of 360 |
331 | Document Title has exceeded the maximum character limit of 260 |
332 | Document FileName has exceeded the maximum character limit of 260 |
333 | OrderNo has exceeded the maximum character limit of 50 |
335 | Either DocumentType or ChapterTag is mandatory |