Service REST API

URL : inforvation.systems

Login

POST : https://inforvation.systems/login
{"Content-Type":"application/json"},
{"user":"USERNAME"},
{"pass":"PASSWORD"}
{"authorization":"JWT {TOKEN}"}
{
  "status": true,
  "key": {KEY}
}
var obj = new Object();
obj.user = "USERNAME";
obj.pass = "PASSWORD";

$.ajax({
  type: "POST",
  url:  "https://inforvation.systems/login",
  data: JSON.stringify(obj),
  contentType: "application/json; charset=utf-8",
  dataType: "json",
  success: function (data,textStatus,request) {      
    if (data.key) {
      var TOKEN = request.getResponseHeader('authorization');
      //get token form header (authorization) for request service API
    }
    else {
      //do something when false
    }
  },
  failure: function (errMsg) {
    alert(errMsg);
  }
});

mongodb-rest

get

GET : https://inforvation.systems/mongodb/{DB_NAME}/{COLLECTION_NAME}/data/{KEY}
{"Content-Type":"application/json"},
{"Authorization":"JWT token"}
[{
    "_id": "_id1",
    "column_name1": "value1",
    "column_name2": "value2",
    "column_name3": "value3"
},{
    "_id": "_id2",
    "column_name1": "value1",
    "column_name2": "value2",
    "column_name3": "value3"
}]
$.ajax({
  type: "GET",
  url:  "https://inforvation.systems/cores/role_db/data/bomb",
  contentType: "application/json; charset=utf-8",
  dataType: "json",
   success: function (data) {
    //do someting
  },
  failure: function (errMsg) {
    alert(errMsg);
  }
});

insert/update

POST : https://inforvation.systems/mongodb/{DB_NAME}/{COLLECTION_NAME}/data/
POST : https://inforvation.systems/mongodb/{DB_NAME}/{COLLECTION_NAME}/data/{KEY}
{"Content-Type":"application/json"},
{"Authorization":"JWT token"}
{"$set":{"column_name1":"value1"}}
{
  "_id": "{KEY}",
  "column_name1": "value1",
  "column_name2": "value2",
  "column_name3": "value3"
}
{
  "ok": true,
  "key": {KEY}
}
var obj = new Object();
obj._id = {KEY}, //<-- ***important when insert exits or update***
obj.column_name2 = "value1";
obj.column_name3 = "value2";
obj.column_name4 = "value3";

$.ajax({
  type: "POST",
  url:  "https://inforvation.systems/cores/role_db/data/bomb",
  data: JSON.stringify(obj),
  contentType: "application/json; charset=utf-8",
  dataType: "json",
  success: function (data,textStatus,request) {      
    if (data.key) {
      //do something
    }
    else {
      //do something
    }
  },
  failure: function (errMsg) {
    alert(errMsg);
  }
});

delete

DELETE : https://inforvation.systems/mongodb/{DB_NAME}/{COLLECTION_NAME}/data/{KEY}
{"Content-Type":"application/json"},
{"Authorization":"JWT token"}
{
  "ok": true,
  "key": {KEY}
}
$.ajax({
  type: "DELETE",
  url:  "https://inforvation.systems/cores/role_db/data/bomb",
  contentType: "application/json; charset=utf-8",
  dataType: "json",
  success: function (data) {      
    if (data.key) {
      //do something
    }
    else {
      //do something
    }
  },
  failure: function (errMsg) {
    alert(errMsg);
  }
});

query

POST : https://inforvation.systems/mongodb/{DB_NAME}/{COLLECTION_NAME}/query
{"Content-Type":"application/json"},
{"Authorization":"JWT token"}
{
"query":{
  "column_name1":{"$eq":"value1"},
  "column_name2":{"$eq":"value2"},
  "column_name3":"value3",
  "column_name4": "value4"
},
"projection":{
  "column_name1":1,
  "column_name2":1
},
"limit":1
}
[{
    "_id": "_id1",
    "column_name1": "value1",
    "column_name2": "value2",
    "column_name3": "value3"
},{
    "_id": "_id2",
    "column_name1": "value1",
    "column_name2": "value2",
    "column_name3": "value3"
}]
var data = {
    "query":{
      "_id": "bomb"
    },
    "projection":{
        "column_name1":1,
        "column_name2":1
    },
    "limit":1
}

$.ajax({
  type: "POST",
  url:  "https://inforvation.systems/cores/role_db/query",
  contentType: "application/json; charset=utf-8",
  dataType: "json",
  data: JSON.stringify(data),
  success: function (data,textStatus,request) {     
    //do something
  },
  failure: function (errMsg) {
    alert(errMsg);
  }
});

Server Time

get server time

GET : https://inforvation.systems/servertime
{"Content-Type":"application/json"},
{"Authorization":"JWT token"}
1515696948941
$.ajax({
  type: "GET",
  url:  "https://inforvation.systems/servertime",
  contentType: "application/json; charset=utf-8",
  dataType: "json",
   success: function (data) {
    //do someting
  },
  failure: function (errMsg) {
    alert(errMsg);
  }
});

Blob Storage

get image

GET : https://inforvation.systems/download/{STORAGE_ACCOUNT}/{CONTAINER_NAME}/{FILE_NAME}
{"Content-Type":"application/json"},
{"Authorization":"JWT token"}

$.ajax({
  type: "GET",
  url:  "https://inforvation.systems/servertime",
  contentType: "application/json; charset=utf-8",
  dataType: "json",
   success: function (data) {
    //do someting
  },
  failure: function (errMsg) {
    alert(errMsg);
  }
});

Systems Architechture

License

kphongph@gmail.com, theerawutt53@gmail.com Computer Engineering Naresuan University