POST api/devices/add/{id}
Add smart Devices like gps,smartwatch,fitness band,scale etc
Request Information
URI Parameters
Name | Description | Type | Additional information |
---|---|---|---|
id |
object representing logged in user id |
integer |
Required |
Body Parameters
object representing the details that need to add new device to Lifetrons account.
AddSmartDeviceReqName | Description | Type | Additional information |
---|---|---|---|
device_name |
name of device, name of person or other |
string |
Required String length: inclusive between 0 and 35 |
device_id |
DeviceId/Imei of device |
string |
Required |
device_type_id |
device type id like gps,smart watch,fitness band,scale etc. |
integer |
Required |
category |
different types of products category name |
string |
Required |
model |
selected smart device model name |
string |
Required |
Request Formats
application/json, text/json
Sample:
{ "device_name": "sample string 1", "device_id": "sample string 2", "device_type_id": 3, "category": "sample string 4", "model": "sample string 5" }
application/xml, text/xml
Sample:
<AddSmartDeviceReq xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/LifetronsPhoneApi.Domain.RequestAgg"> <category>sample string 4</category> <device_id>sample string 2</device_id> <device_name>sample string 1</device_name> <device_type_id>3</device_type_id> <model>sample string 5</model> </AddSmartDeviceReq>
application/x-www-form-urlencoded
Sample:
Sample not available.
Response Information
Resource Description
On success, returns Lifetrons response codes On failure, return Lifetrons responses codes.
DeviceDataRespName | Description | Type | Additional information |
---|---|---|---|
device |
device id for any request or response |
Lifetrons_device |
None. |
resp_code |
Lifetrons response code |
string |
None. |
resp_msg |
Lifetrons response message |
string |
None. |
Response Formats
application/json, text/json
Sample:
{ "device": { "Lifetrons_device_id": "sample string 1", "device_id": "sample string 2" }, "resp_code": "sample string 1", "resp_msg": "sample string 2" }
application/xml, text/xml
Sample:
<device_data_resp xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/LifetronsPhoneApi.Domain.ResponseAgg"> <resp_code xmlns="http://schemas.datacontract.org/2004/07/LifetronsPhoneApi.Models">sample string 1</resp_code> <resp_msg xmlns="http://schemas.datacontract.org/2004/07/LifetronsPhoneApi.Models">sample string 2</resp_msg> <device xmlns:d2p1="http://schemas.datacontract.org/2004/07/LifetronsPhoneApi.Domain.DeviceAgg"> <d2p1:Lifetrons_device_id>sample string 1</d2p1:Lifetrons_device_id> <d2p1:device_id>sample string 2</d2p1:device_id> </device> </device_data_resp>