Endpoint
You can query the ToDos via the following endpoint:
https://[subdomain].manageworkonline.com/awt/api/todos
Methods
GET
/todos
Retreive all ToDos
Example Url
https://[subdomain].manageworkonline.com/awt/api/todos
Response
{
Success: bool,
ErrorMessage: string,
Data: Array<object>
}
GET
/todos/[id]
Retreive single ToDo
Example Url
https://[subdomain].manageworkonline.com/awt/api/todos/[id]
Response
{
Success: bool,
ErrorMessage: string,
Data: object
}
Schema
ToDo Schema Definition:
Field | Data Type | Nullable |
---|---|---|
Id | int | YES |
JobId | int | YES |
Description | string | NO |
FloorId | int | NO |
RoomId | int | NO |
ElementId | int | NO |
LocationDescription | string | NO |
PropertyId | int | NO |
ToDoReference | string | NO |
DateOfCompletion | DateTime | YES |
IsCompleted | boolean | NO |
Field1 | string | NO |
InspectedBy | string | NO |
Uprn | string | NO |
PhotoId | int | YES |
DrawingId | int | YES |
CreatedBy | string | NO |
ModifiedBy | string | NO |
DateOfModification | DateTime | YES |
DateOfCreation | DateTime | YES |
DateOfRecorded | DateTime | YES |
Field2 | string | NO |
IsApproved | boolean | NO |
JSON Example
{
"Id": 19,
"JobId": 110,
"Description": "careful with how fragile the garage is ",
"FloorId": 86,
"RoomId": 90,
"ElementId": 92,
"LocationDescription": "garage doors",
"PropertyId": 17,
"ToDoReference": "17abc31161-NOA-2016-9-22",
"DateOfCompletion": null,
"IsCompleted": false,
"Field1": null,
"InspectedBy": null,
"Uprn": "17abc",
"PhotoId": null,
"DrawingId": null,
"CreatedBy": "DefaultUser DefaultUser",
"ModifiedBy": null,
"DateOfModification": null,
"DateOfCreation": "/Date(1474557227633+0100)/",
"DateOfRecorded": "/Date(1474498800000+0100)/",
"Field2": null,
"IsApproved": true
}
Request Example
function getToDos(){
var success = function(loginResponse) {
if(loginResponse.Success){
$.ajax({
type: "GET",
url: 'https://[subdomain].manageworkonline.com/awt/api/todos',
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.