Endpoint
You can query the Documents via the following endpoint:
https://[subdomain].manageworkonline.com/awt/api/documents/[type]
The following type parameters are available:
- Reports
- Photo
- MainPhoto
- Certificate
- Drawing
- Others
- MainDrawing
- ToDoPhoto
- ToDoDrawing
Methods
GET
/documents/[type]
Retreive all Documents of Type
Example Url
https://[subdomain].manageworkonline.com/awt/api/documents/[type]
Url Parameters
[type : enum]
* Reports
* Photo
* MainPhoto
* Certificate
* Drawing
* Others
* MainDrawing
* ToDoPhoto
* ToDoDrawing
Response
{
Success: bool,
ErrorMessage: string,
Data: Array<object>
}
GET
/documents/[type]/[id]
Retreive single Document
Example Url
https://[subdomain].manageworkonline.com/awt/api/documents/[type]/[id]
Url Parameters
[type : enum]
* Reports
* Photo
* MainPhoto
* Certificate
* Drawing
* Others
* MainDrawing
* ToDoPhoto
* ToDoDrawing
Response
File
Schema
Document Schema Definition:
Field | Data Type | Nullable |
---|---|---|
Id | int | NO |
Reference | string | NO |
Description | string | NO |
JobId | int | YES |
PropertyId | int | NO |
Uprn | string | NO |
CreatedBy | string | NO |
ModifiedBy | string | NO |
DateOfModification | DateTime | YES |
DateOfCreation | DateTime | YES |
IsApproved | boolean | NO |
JSON Example
{
"Id": 528,
"Reference": "400abc-2016-11-28-8ba0b",
"Description": "old-house-photo",
"JobId": 156,
"PropertyId": 400,
"Uprn": "400abc",
"CreatedBy": "tomas tomas",
"ModifiedBy": null,
"DateOfModification": null,
"DateOfCreation": "/Date(1480329768330+0000)/",
"IsApproved": true
}
Request Example
function getDocuemnts(){
var success = function(loginResponse) {
if(loginResponse.Success){
$.ajax({
type: "GET",
url: 'https://[subdomain].manageworkonline.com/awt/api/documents/photo',
crossDomain: true,
xhrFields: { withCredentials: true },
success: function(response){
if(response.Success){
alert(response.Data.length);
}
},
dataType: "json"
});
}
};
window.login(success);
}
Post your comment on this topic.