Endpoint

You can query the Samples via the following endpoint:

https://[subdomain].manageworkonline.com/awt/api/samples

Methods

GET
/samples
Retreive all Samples

Example Url

https://[subdomain].manageworkonline.com/awt/api/samples

Response

{
   Success: bool,
   ErrorMessage: string,
   Data: Array<object>
}

GET
/samples/[id]
Retreive single Sample

Example Url

https://[subdomain].manageworkonline.com/awt/api/samples/[id]

Response

{
   Success: bool,
   ErrorMessage: string,
   Data: object
}

Schema

Sample Schema Definition:

Field Data Type Nullable
Id int NO
InspectionId int YES
SampleNumber string NO
AnalysisDate DateTime YES
SampleReference string NO
AnalysedBy string NO
PropertyId int YES
Uprn string NO
RefferedSample string NO
CreatedBy string NO
ModifiedBy string NO
DateOfModification DateTime YES
DateOfCreation DateTime YES

JSON Example

{
    "Id": 3,
    "InspectionId": 47,
    "SampleNumber": "451351243",
    "AnalysisDate": "/Date(1473116400000+0100)/",
    "SampleReference": "1231431",
    "AnalysedBy": "default user",
    "PropertyId": 19,
    "Uprn": "19abc",
    "RefferedSample": null,
    "CreatedBy": "DIEU66",
    "ModifiedBy": null,
    "DateOfModification": null,
    "DateOfCreation": "/Date(1473175161273+0100)/"
}

Request Example

function getSamples(){
   var success = function(loginResponse) {
      if(loginResponse.Success){
         $.ajax({
            type: "GET",
            url: 'https://[subdomain].manageworkonline.com/awt/api/samples',
            crossDomain: true,
            xhrFields: { withCredentials: true },
            success: function(response){
               if(response.Success){
                  alert(response.Data.length);
               }
            },
            dataType: "json"
         });
      }
   };
   window.login(success);
}

Feedback

Was this helpful?

Yes No
You indicated this topic was not helpful to you ...
Could you please leave a comment telling us why? Thank you!
Thanks for your feedback.

Post your comment on this topic.

Please do not use this for support questions.
For customer support, please contact us here.

Post Comment