97.Service API - htangsmart/FitCloudPro-SDK-Android GitHub Wiki
The interface data format of this document adopts the HTTP POST request method, and the returned data format is unified as JSON.
An example of the returned data is as follows.
Basic data type:
{
"errorCode": 0,
"errorMsg": "Error message",
"data": 1
}
Object data type:
{
"errorCode":0,
"errorMsg":"Error message",
"data":{
"id":1,
"name":"Test name"
}
}
Array/List data type:
{
"errorCode":0,
"errorMsg":"Error message",
"data":[
{
"id":1,
"name":"Test name"
},
{
"id":2,
"name":"Test name"
}
]
}
When errorCode is 0, it indicates success. When not 0, it means failure.
The baseUrl is http://fitcloud.hetangsmart.com
Method:/public/checkVersion/v2
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
| hardwareInfo | String | YES | FcDeviceInfo.toString() |
| uiVersion | String | NO | Device UI version |
Return values:
| JSON Field | Type | Description |
|---|---|---|
| errorCode | int | |
| errorMsg | String | |
| data | String | JSON object string of VersionBean
|
data class VersionBean(
/**
* New version of hardwareInfo
* Only return if the server has a new version, otherwise return null
*/
val hardwareInfo: String?,
/**
* Update information
*/
val hardwareRemark: String?,
/**
* Download url
*/
val hardwareUrl: String?,
/**
* Hardware upgrade type
*/
val hardwareType: String?,
/**
* [hardwareUrl] file size(unit bytes)。
*/
val hardwareSize: Long = 0,
/**
* Whether to force upgrade
*/
@Json(name = "forceUpgrade")
val isHardwareForce: Boolean = false,
/**
* UI version that can be overwritten
*/
val uiVersionScope: String? = null,
/**
* Firmware version that can be overwritten
*/
val appNumScope: String? = null
)
Method:/public/dial/list
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
| hardwareInfo | String | YES | FcDeviceInfo.toString() |
| lcd | int | YES | FcDialPushInfo.lcd |
| toolVersion | String | YES | FcDialPushInfo.toolVersion |
Return values:
| JSON Field | Type | Description |
|---|---|---|
| errorCode | int | |
| errorMsg | String | |
| data | String | JSON array string of DialPacket
|
data class DialPacket(
val dialNum: Int,
val lcd: Int,
val toolVersion: String,
val binVersion: Int,
/**
* Dial image url
*/
val imgUrl: String? = null,
/**
* Image url of dial with device casing
*/
val deviceImgUrl: String? = null,
/**
* Bin file download url
*/
val binUrl: String,
/**
* Dial name
*/
val name: String? = null,
/**
* File size of [binUrl]
*/
val binSize: Long = 0,
/**
* Download count
*/
val downloadCount: Int = 0
)
Method:/public/dial/get
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
| data | String | YES | JSON array string of dial number. For example [1,2,3,4] |
Return values:
| JSON Field | Type | Description |
|---|---|---|
| errorCode | int | |
| errorMsg | String | |
| data | String | JSON array string of DialPacketComplexBean
|
data class DialPacketComplexBean(
val dialNum: Int,
val lcd: Int,
val toolVersion: String,
val binVersion: Int,
/**
* Dial image url
*/
val imgUrl: String? = null,
/**
* Image url of dial with device casing
*/
val deviceImgUrl: String? = null,
/**
* Bin file download url
*/
val binUrl: String,
/**
* Dial name
*/
val name: String? = null,
/**
* File size of [binUrl]
*/
val binSize: Long = 0,
/**
* Download count
*/
val downloadCount: Int = 0,
/**
* 0 No components,1 Has components
*/
val hasComponent: Int = 0,
/**
* Component preview background image
*/
val previewImgUrl: String? = null,
/**
* Components
*/
val components: List<Component>? = null
)
Method:/public/dial/custom
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
| lcd | int | YES | FcDialPushInfo.lcd |
| toolVersion | String | YES | FcDialPushInfo.toolVersion |
Return values:
| JSON Field | Type | Description |
|---|---|---|
| errorCode | int | |
| errorMsg | String | |
| data | String | JSON array string of DialCustomStyleBean
|
data class DialCustomStyleBean(
/**
* Bin file download url
*/
val binUrl: String,
/**
* Style name
*/
val styleName: String,
/**
* File size of [binUrl]
*/
val binSize: Long = 0
)
Method:/public/dial/customgui
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
| lcd | int | YES | FcDialPushInfo.lcd |
| toolVersion | String | YES | FcDialPushInfo.toolVersion |
Return values:
| JSON Field | Type | Description |
|---|---|---|
| errorCode | int | |
| errorMsg | String | |
| data | String | JSON array string of DialPacketComplexBean
|
Method:/public/sportbin/list
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
| hardwareInfo | String | YES | FcDeviceInfo.toString() |
Return values:
| JSON Field | Type | Description |
|---|---|---|
| errorCode | int | |
| errorMsg | String | |
| data | String | JSON array string of SportPacket
|
data class SportPacket(
val sportUiType: Int,
val iconUrl: String? = null,
val binUrl: String,
val sportUiName: String, //Chinese name
val sportUiNameCn: String,//English name
val createTime: Long = 0,
val binSize: Long = 0
)
Method:/public/game/list
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
| hardwareInfo | String | YES | FcDeviceInfo.toString() |
| lang | String | YES | Language type, cn or en
|
Return values:
| JSON Field | Type | Description |
|---|---|---|
| errorCode | int | |
| errorMsg | String | |
| data | String | JSON array string of GamePacket
|
data class GamePacket(
/**
* Game type
*/
val type: Int,
/**
* Game name (according to the lang parameter, return Chinese or English)
*/
val name: String,
/**
* Game guide (according to the lang parameter, return Chinese or English)
*/
val description: String? = null,
val downloadCount: Int = 0,
/**
* Game icon
*/
val imgUrl: String? = null,
/**
* Game skins
*/
val gameSkins: List<GameSkin>? = null,
)
data class GameSkin(
/**
* Skin number
*/
val skinNum: Int,
/**
* Skin bin file url
*/
val binUrl: String,
/**
* Skin bin file size
*/
val binSize: Long = 0,
/**
* Skin image
*/
val imgUrl: String? = null,
)