---
# System prepended metadata

title: CMS API Details

---

# CMS API Details
#### Note: Windows API URL IP need to set to router

### **Device API**
##### Get Device Info
```   |
Get Device Info
Type: GET 
Parameter: None
URL: http://127.0.0.1:8882/device/deviceInfo
Response:
{
    "deviceName": "WA21312345",
    "diskTotal": "474 GB",
    "fwVersion": "V0.0.1CBA",
    "mac": "d4:3b:04:2f:cc:9e",
    "modelName": "Latitude 5490",
    "nickName": "d43b042fcc9e",
    "serverIP": "10.10.80.69"
}

```
-----------------
### **RealTimestatus**

##### RealTime deviceInfo response to Server
```
Type: PUT
Parameter: Request.Body
{
    "nickName" : d43b042fcc9e",
    "serverIP" : "10.10.80.69",
    "fwVersion": "V0.0.1CBA",
    "cpuUsage": "24%",
    "diskFree": "106 GB",
    "diskTotal": "474 GB",
    "memoryUsage": "67%",
    "modelName": "Latitude 5490"
}
URL: https://10.10.80.69:1212/cms/device-info/status/<deviceName>

```
----------------
## **Mission API**
```
Mission Type : deviceInfo, reboot, shutdown, fwUpdate, appUpdate, appDelete

NOTE: One mission can run at a time unless mission complpeted successfully

* Response when recived request for seconf mission (In this case privious mission is in progress)

{"type" :mission_type, "result" : "fail", "message":"mission fail"}
```
#### Mission/DeviceInfo
##### Update DeviceInfo(IP, nickname)
```
Type: POST
Parameter: request.body
    {
    "type": "deviceInfo",
	"data":{
		"serverIP" : "10.10.80.111",
        "nickName" : "TEST_Machine"
	}
    }
URL: http://127.0.0.1:8882/mission
Response:
{
    "message": "Update DeviceInfo STARTED",
    "result": "recevied",
    "type": "deviceInfo"
}
```
Once Update DeviceInfo Completed response to Server
```
{
"mission": "deviceInfo", 
"result": "pass/fail", 
"message": "mission update DeviceInfo completed in total time 247.1934928894043", 
"data": []
}
```
-----------------

##### Reboot Device
```
Type: POST
Parameter: request.body
    {
    "type": "reboot",
	"data":{}
    }
URL: http://127.0.0.1:8882/mission
Response:
{
    "message": "Reboot Device STARTED",
    "result": "recevied",
    "type": "reboot"
}
```
Once Reboot Completed response to server 
```
{
    "mission" : reboot,
    "result": "pass/fail",
    "message": "Mission reboot completed."
}
```
----
##### Shtdown Device
```
Type: POST
Parameter: request.body
    {
    "type": "shutdown",
	"data":{}
    }
URL: http://127.0.0.1:8882/mission
Response:
{
    "message": "Shutdown Device STARTED",
    "result": "recevied",
    "type": "shutdown"
}
```
Once Sutdown device process starts API will not give response to server 


----

##### Firmware Update
```
Type: POST
Parameter: request.body
    {
        "type": "fwUpdate",
	"data":{
		"links":["https://test.com.tw/file1"],
                "files":["file1"]
	}
    }
URL: http://127.0.0.1:8882/mission
Response:
{
    "message": "Firmware Update STARTED",
    "result": "recevied",
    "type": "fwUpdate"
}
```
Once firmware update Completed response to server 
```
{
    "mission" : fwUpdate,
    "result": "pass/fail",
    "message": "Mission fwUpdate completed."
}
```
-----

##### App Update / Download APP
```
Type: POST
Parameter: request.body
    {
        "type": "appUpdate",
	"data":{
		"links":["https://web.whatsapp.com/desktop/windows/release/x64/WhatsAppSetup.exe","https://web.whatsapp.com/desktop/windows/release/x64/WhatsAppSetup.exe","https://web.whatsapp.com/desktop/windows/release/x64/WhatsAppSetup.exe"],
                "files":["WhatsAppSetup.exe","WhatsAppSetup1.exe","WhatsAppSetup2.exe"]
	}
    }
URL: http://127.0.0.1:8882/mission
Response:
{
    "message": "Donwload STARTED",
    "result": "recevied",
    "type": "appUpdate"
}
```
Once Download completed response to server
```
{
"mission": "appUpdate", 
"result": "fail/PASS", 
"message": "mission completed in total time 247.1934928894043", 
"data": [
{"file": "WhatsAppSetup.exe", "result": true}, {"file": "WhatsAppSetup1.exe", "result": false}, {"file": "WhatsAppSetup2.exe", "result": true}
]
}
```
-----

##### App Delete / Delete application
```
Type: POST
Parameter: request.body
    {
        "type": "appDelete",
	"data":{
            "files":["WhatsAppSetup111.exe","WhatsAppSetup222.exe","WhatsAppSetup333.exe"]
	}
    }
URL: http://127.0.0.1:8882/mission
{
    "message": "Delete app process started",
    "result": "recevied",
    "type": "appDelete"
}
```
Once AppDetele mission completed response to server
```
{
 "mission": "appDelete", 
 "result": "fail/PASS", 
 "message": "mission appDelete completed in time 0.03590726852416992", 
 "data": [
    {"file": "WhatsAppSetup111.exe", "result": true}, 
    {"file": "WhatsAppSetup211.exe", "result": false}, 
    {"file": "WhatsAppSetup312.exe", "result": true}
]}
```
-----