API Documentation

Lockr API V.1.0

Validate access token

URL:
http/lockr.com.au/Api/V1/ValidAccessToken

Method:
GET

URL Header:
Authorization: [API Token]

URL Params:
None

Data Params:
None

Success Response:
Code: 200
Content:{ “Content”: “Successful”,”ReasonPhrase”: “OK”,”RequestMessage”: “Successful”, “StatusCode”: 200,”Version”: “1.0”}

Error Response:
Code: 401
Content:{ “Content”: null,”ReasonPhrase”: “Unauthorized”,”RequestMessage”: “You must provide a valid authenticated access token”,”StatusCode”: 401,”Version”: “1.0”}

Sample Call:
$.ajax({
type: “GET”,
url: “http//lockr.com.au/Api/V1/ValidAccessToken”,
contentType: “application/json; charset=utf-8”,
headers: { “Authorization”: [API Token] },
dataType: “json”,
async: false,
success: function (response) {
console.log(response);
},
error: function (response, Error, ReasonPhrase) {
console.log(response);
}
});

Search User

URL:
http//lockr.com.au/Api/V1/SearchUser/{Search String}

Method:
POST

URL Header:
Authorization: [API Token]

URL Params:
Search:[Search string]

Data Params:
None

Success Response:
Code: 200
Content:{“Content”:null,”ReasonPhrase”:”OK”,”RequestMessage”:null,”StatusCode”:200,”Version”:”1
.0″},”UserList”:[{“FirstName”:””,”LastName”:””,”MiddleName”:””,”Phone”:””,”UserID”:0,”UserName”:””}]

OR

Code: 200
Content:{“Content”:null,”ReasonPhrase”:”OK”,”RequestMessage”:null,”StatusCode”:200,”Version”:”1
.0″},”UserList”:[]

Error Response:
Code: 401
Content:{ “Content”: null,”ReasonPhrase”: “Unauthorized”,”RequestMessage”: “You are not authorized to access”,”StatusCode”: 401,”Version”: “1.0”}

Sample Call:
$.ajax({
type: “POST”,
url: “http//lockr.com.au/Api/V1/SearchUser/{Search String}”,
contentType: “application/json; charset=utf-8”,
headers: { “Authorization”: [API Token] },
dataType: “json”,
async: false,
success: function (response) {
console.log(response);
},
error: function (response, Error, ReasonPhrase) {
console.log(response);
}
});

Create new user

URL:
http//lockr.com.au/Api/V1/NewUser

Method:
POST

URL Header:
Authorization: [API Token]

URL Params:
None

Data Params:
UserType=[user type“Personal” OR “Business”] UserName=[user name] FirstName=[user first name] MiddleName=[user middle name] LastName=[user Last name] Email=[user email address] Gender=[user gender “Male” OR “Female”] Password=[user password] Phone=[user phone number] Subscription=[Enter number of day]

Required:
UserType=[user type“Personal” OR “Business”] UserName=[Enter user name] Email=[Enter user email] Password=[Enter user password] Phone=[Enter user phone number] Subscription=[Enter Number of subscription days]

Success Response:
Code: 200
Content:{ “Content”: “true”,”ReasonPhrase”: “OK”,”RequestMessage”: “User successfully inserted”, “StatusCode”: 200,”Version”: “1.0”}

Error Response:
Code: 401
Content:{ “Content”: null,”ReasonPhrase”: “Unauthorized”,”RequestMessage”: “You must provide a valid authenticated access token”,”StatusCode”: 401,”Version”: “1.0”}

OR

Code: 401
Content:{ “Content”: null,”ReasonPhrase”: “InternalServerError”,”RequestMessage”: “Error”,”StatusCode”:500,”Version”: “1.0”}

OR

Code: 406
Content:{ “Content”: null,”ReasonPhrase”: “NotAcceptable”,”RequestMessage”: “field validation message”,”StatusCode”:406,”Version”: “1.0”}

Sample Call:
$.ajax({
type: “GET”,
url: “http//lockr.com.au/Api/V1/NewUser”,
contentType: “application/json; charset=utf-8”,
headers: { “Authorization”: [API Token] },
data: JSON.stringify([UserType:”Personal OR Business”,UserName:”Enter user name”,FirstName:”Enter first name”,MiddleName:”Enter user middle name”,LastName:”Enter user last name”,Email:”Enter user email address”,Gender:”Male OR Female”,Password:”user password”,Phone:”Enter user phone number”,Subscription:”user subscription days”]),
dataType: “json”,
async: false,
success: function (response) {
console.log(response);
},
error: function (response, Error, ReasonPhrase) {
console.log(response);
}
});

Upload user item

URL:
http//lockr.com.au/Api/V1/UploadUserItem

Method:
GET

URL Header:
Authorization: [API Token]

URL Params:
None

Data Params:
UserName=[Enter user name] BrandName=[Enter item brand name] ModelNumber=[Enter item model number] SerialNumber=[Enter item serial number] WarrantyPeriod=[Enter item warranty period] BeneficiaryName=[Enter item beneficiary name] PurchasePrice=[Enter item purchase price] ReplacementCost=[Enter item replacement cost] Notes=[Enter item notes]

Required:
BrandName=[Enter item brand name] PurchasePrice=[Enter item purchase price]

Success Response:
Code: 200
Content:{ “Content”: “Successful”,”ReasonPhrase”: “OK”,”RequestMessage”: “Successful”, “StatusCode”: 200,”Version”: “1.0”}

Error Response:
Code: 401
Content:{ “Content”: null,”ReasonPhrase”: “Unauthorized”,”RequestMessage”: “You must provide a valid authenticated access token”,”StatusCode”: 401,”Version”: “1.0”}

OR
Code: 401
Content:{ “Content”: null,”ReasonPhrase”: “InternalServerError”,”RequestMessage”: “Error”,”StatusCode”:500,”Version”: “1.0”}

OR
Code: 406
Content:{ “Content”: null,”ReasonPhrase”: “NotAcceptable”,”RequestMessage”: “field validation message”,”StatusCode”:406,”Version”: “1.0”}

Sample Call:
function AddUseritem() {
var model = new FormData();
var totalFiles = document.getElementById(“UploadAttachment”).files.length;
for (var i = 0; i < totalFiles; i++) {
var file = document.getElementById(“UploadAttachment”).files[i];
model.append(“UploadAttachment” + i, file);
}
model.append(‘UserName’, [“Enter user name”]);
model.append(‘BrandName’, [“Enter brand name”]);
model.append(‘ModelNumber’, [“Enter model number”]);
model.append(‘SerialNumber’, [“Enter serial number”]);
model.append(‘WarrantyPeriod’, [“Enter warranty period in year”]);
model.append(‘BeneficiaryName’, [“Enter beneficiary name”]);
model.append(‘PurchasePrice’, [“Enter purchase price “])
model.append(‘ReplacementCost’, [“Enter replacement cost”]);
model.append(‘Notes’, [“Enter notes”]);
$.ajax({
type: “POST”,
headers: { “Authorization”: [“Enter API token”] },
url: ‘http://lockr.com.au/Api/V1/UploadUserItem’,
type: “POST”,
data: model,
processData: false,
contentType: false,
success: function (response) {

},
error: function (x, y, z) {
}
});

}

Would you like to sign up for our Newsletter?
Register your interest below