中文简体    English


IVYIOT Cloud Platform WebService API


Version history:

Revision date version Modified by desc
2019-12-14 V1.0 Yang Zhaoyan Documents published online

1 Introduction

WebService API: Supports get and post calls. All requests return data in json format.

2.IVY Cloud Platform API General Example and Description

2.1 General examples

WebServiceAPI example:

  • https://{HOST}/gateway?service=xxx.xxx?parm1=xxx&parm2=xxx

Note:

  • 1.HOST refers to the domain name, and the test environment domain name is sandboxt-ivyiot.io;
  • 2.Service=xxx.xx, the interface name is specified here;
  • 3.The methods are mainly divided into GET and POST methods;

Returns the result:

{
    "errorCode":"",
    "failureDetails":"",
    "data":""/*if exist*/
}
  • a) errorCode is the error code. When an empty string is returned, it
    indicates success. For other values, refer to the corresponding API
    status code table.

  • b) failureDetails is the error description. When the
    error code is not empty, this field explains the meaning of the error
    code.

  • c) data: return data, when there is return data, the data is in
    this parameter, the specific data data structure see the specific Api
    interface

2.2 Api related configuration information

2.2.1 Api domain name

Test environment:

  • sandboxt-api.ivyiot.io (overseas)
  • sandboxt-api.ivyiot.cn (China Mainland)

Prd environment:

  • api.myfoscam.com(overseas)
  • api.myfoscam.cn (domestic)

2.2.2 Important parameters ( important )

Cloud platform internal application identity information

  • clientId: oemkey
  • clientSecret: 397ff5985bb7437198a9ef51b4815caf

User identity parameters (obtained through the password authorization
login interface)

  • openId: user identity Id
  • accessToken: user identity

2.3 Common Error Codes ( Important )

2.3.1 System error code

System-level error codes, all interface calls may throw such error codes;

Code value desc Causes and solutions
FC_SERVICE_NOT_IMPLEMENT (009999) The api does not exist or is not implemented Check the spelling of the api, pay attention to the capitalization and the presence of spaces
FC_INVALID_PARAMETER (000006) Request parameter error Whether the request parameters are complete, whether the parm is spelled correctly, and whether the http method is selected correctly (get or post)
FC_SYSTEM_ERROR (000099) system error Caused by server internal errors and service restart, check api calls or try again later

2.3.2 authentication error

The interface that needs to verify identity, the identity information is
incorrect or the identity information expires will throw the following
error

Code value desc Causes and solutions
FC_AUTH_APPKEY_NOT_EXISTS (030010) AppKey does not exist Check if the AppKey input is correct
FC_AUTH_APPSECRET_NOT_MATCH (030020) AppSecrect does not match Check if AppSecrect input is correct
FC_AUTH_OPENID_NOT_EXISTS (030030) openId does not exist Check if openId input is correct
FC_AUTH_TOKEN_NOT_EXISTS (030091) token does not exist Check if the input of openId and accessToken are correct
FC_AUTH_OPENID_NOT_MATCH (030031) openId does not match Check if openId input is correct
FC_AUTH_ACCESSTOKEN_NOT_MATCH (030040) accessToken does not match Check if accessToken is correct
FC_AUTH_ACCESSTOKEN_EXPIRED (030041) accessToken expired re-register

3.Foscam Cloud Platform API List

3.1 Equipment Management

3.1.1 Add Device

Interface description:

  • Add device

Request URL:

  • https://{HOST}/gateway?service=user_ipc_setting_v2_0.addOemDevice

Request method:

  • POST

Request header:

name necessary type desc
Content-Type Yes String Content-Type: application / x-www-form-urlencoded

Request parameters:

parm type necessary desc length
clientId String required appKey 40
openId String required openId (user logo) 40
accessToken String required accessToken 40
macAddr String required Device Mac address (unique identification) 20
deviceName String required User-set device name 50
username String required Device user name set by the user 64
password String required Device password set by the user ( please encrypt ) 160
hasusertag int required Whether to support push: 0 not supported, 2 supported 1
supportStore int required Support cloud storage: 0 not supported, 1 supported 1
supportRichMedia int required Support for rich media (pictures, etc.) push: 0 not supported, 1 supported 1
productName String required Model name 50
oemCode String required Oem number 20
Return example:
{
    "errorCode":"",
    "failureDetails":""
}

Return parameter description:

parm desc
errorCode error type, see return code
failureDetails wrong description

Error code description:

**Basic return code **Description
FC_SERVICE_NOT_IMPLEMENT (009999) The api does not exist or is not implemented
FC_INVALID_PARAMETER (000006) Request parameter error
FC_SYSTEM_ERROR (000099) system error
**Business return code **Description
FC_AUTH_APPKEY_NOT_EXISTS (030010) AppKey does not exist
FC_AUTH_APPSECRET_NOT_MATCH (030020) AppSecrect does not match
FC_AUTH_OPENID_NOT_EXISTS (030030) openId does not exist
FC_AUTH_TOKEN_NOT_EXISTS (030091) token does not exist
FC_AUTH_OPENID_NOT_MATCH (030031) openId does not match
FC_AUTH_ACCESSTOKEN_NOT_MATCH (030040) accessToken does not match
FC_AUTH_ACCESSTOKEN_EXPIRED (030041) accessToken expired
FC_ACCOUNT_USER_IPC_SETTING_ALREADY_EXISTS (020040) user ipcsetting already exists (device has been added)
FC_ACCOUNT_THE_IPC_HAS_BEEN_ADDED_BY_OTHERS (020042) the ipc has been added by others
### 3.1.2 Delete device

Interface description:

  • Delete user device

Request URL:

  • https://{HOST}/gateway?service=user_ipc_setting_v2_0.delOemDeviceByMac

Request method:

  • POST

Request header:

name necessary type desc
Content-Type Yes String Content-Type: application / x-www-form-urlencoded

Request parameters:

parm type necessary desc length
clientId String required appKey 40
openId String required openId (user logo) 40
accessToken String required accessToken 40
macAddr String required Device Mac 20

Return example:

{
    "errorCode":"",
    "failureDetails":""
}

Return parameter description:

parm desc
errorCode error type, see return code
failureDetails wrong description

Error code description:

**Basic return code **Description
FC_SERVICE_NOT_IMPLEMENT (009999) The api does not exist or is not implemented
FC_INVALID_PARAMETER (000006) Request parameter error
FC_SYSTEM_ERROR (000099) system error
**Business return code **Description
FC_AUTH_APPKEY_NOT_EXISTS (030010) AppKey does not exist
FC_AUTH_APPSECRET_NOT_MATCH (030020) AppSecrect does not match
FC_AUTH_OPENID_NOT_EXISTS (030030) openId does not exist
FC_AUTH_TOKEN_NOT_EXISTS (030091) token does not exist
FC_AUTH_OPENID_NOT_MATCH (030031) openId does not match
FC_AUTH_ACCESSTOKEN_NOT_MATCH (030040) accessToken does not match
FC_AUTH_ACCESSTOKEN_EXPIRED (030041) accessToken expired
FC_ACCOUNT_USER_IPC_SETTING_NOT_EXISTS (020041) user ipcsetting not exists

3.1.3 Modify Device

Interface description:

  • Modify device

Request URL:

  • https://{HOST}/gateway?service=user_ipc_setting_v2_0.updateOemDevice

Request method:

  • POST

Request header:

name necessary type desc
Content-Type Yes String Content-Type: application / x-www-form-urlencoded

Request parameters:

parm type necessary desc length
clientId String required appKey 40
openId String required openId (user logo) 40
accessToken String required accessToken 40
macAddr String required Device Mac address (unique identification) 20
deviceName String Optional User-set device name 50
username String Optional Device user name set by the user 64
password String Optional Device password set by the user ( please encrypt ) 160
hasusertag int Optional Whether to support push: 0 not supported, 2 supported 1
supportStore int Optional Support cloud storage: 0 not supported, 1 supported 1
supportRichMedia int Optional Supports rich media (picture) push: 0 not supported, 1 supported 1
productName String Optional Model name 50

Return example:

{
    "errorCode":"",
    "failureDetails":""
}

Return parameter description:

parm desc
errorCode error type, see return code
failureDetails wrong description

Error code description:

**Basic return code **Description
FC_SERVICE_NOT_IMPLEMENT (009999) The api does not exist or is not implemented
FC_INVALID_PARAMETER (000006) Request parameter error
FC_SYSTEM_ERROR (000099) system error
**Business return code **Description
FC_AUTH_APPKEY_NOT_EXISTS (030010) AppKey does not exist
FC_AUTH_APPSECRET_NOT_MATCH (030020) AppSecrect does not match
FC_AUTH_OPENID_NOT_EXISTS (030030) openId does not exist
FC_AUTH_TOKEN_NOT_EXISTS (030091) token does not exist
FC_AUTH_OPENID_NOT_MATCH (030031) openId does not match
FC_AUTH_ACCESSTOKEN_NOT_MATCH (030040) accessToken does not match
FC_AUTH_ACCESSTOKEN_EXPIRED (030041) accessToken expired
FC_ACCOUNT_USER_IPC_SETTING_NOT_EXISTS (020041) user ipcsetting not exists

3.1.4 Querying User Equipment

Interface description:

  • Query information about the device to which the user belongs

Request URL:

  • https://{HOST}/gateway?service=user_ipc_setting_v2_0.getOemDeviceByUser

Request method:

  • GET

Request header:

  • None |

Request parameters:

parm type necessary desc length
clientId String required appKey 40
openId String required openId (user logo) 40
accessToken String required accessToken 40
Return example:
{
    "errorCode":"",
    "data":[
        {
            "userId":622258,
            "macAddr":"macAddr",
            "deviceName":"deviceName",
            "productName":"productName",
            "username":"asd",
            "password":"password",
            "hasusertag":1,
            "supportStore":1,
            "supportRichMedia":1,
            "oemCode":"7128"
        },
        {
            "userId":622258,
            "macAddr":"macAddr3",
            "deviceName":"deviceName1",
            "productName":"productName",
            "username":"username1",
            "password":"password1",
            "hasusertag":1,
            "supportStore":0,
            "supportRichMedia":0,
            "oemCode":"7128"
        }
    ]
}

Return parameter description:

parm desc
errorCode error type, see return code
failureDetails wrong description
macAddr Device Mac Address
userId User id
username Device user name set by the user
password User-set device password
deviceName Device name
productName Model name
hasusertag Push support parameters, 0 does not support push, 1 write failed (supported) 2 write succeeded (supported)
supportStore Support cloud storage, 0 not supported, 1 supported
supportRichMedia Supports rich media push, 0 is not supported, 1 is supported
oemCode Oem code of device manufacturer

Error code description:

Basic return code Description
FC_SERVICE_NOT_IMPLEMENT (009999) The api does not exist or is not implemented
FC_INVALID_PARAMETER (000006) Request parameter error
FC_SYSTEM_ERROR (000099) system error
Business return code Description
FC_AUTH_APPKEY_NOT_EXISTS (030010) AppKey does not exist
FC_AUTH_APPSECRET_NOT_MATCH (030020) AppSecrect does not match
FC_AUTH_OPENID_NOT_EXISTS (030030) openId does not exist
FC_AUTH_TOKEN_NOT_EXISTS (030091) token does not exist
FC_AUTH_OPENID_NOT_MATCH (030031) openId does not match
FC_AUTH_ACCESSTOKEN_NOT_MATCH (030040) accessToken does not match
FC_AUTH_ACCESSTOKEN_EXPIRED (030041) accessToken expired

3.1.5 Query Device Based on Mac

Interface description:

  • Query device information by mac address

Request URL:

  • https://{HOST}/gateway?service=user_ipc_setting_v2_0.getOemDeviceByUserAndMac

Request method:

  • GET

Request header:

  • None |

Request parameters:

parm type necessary desc length
clientId String required appKey 40
openId String required openId (user logo) 40
accessToken String required accessToken 40
macAddr String required Device Mac address (unique identification) 20

Return example:

{
    "errorCode":"",
    "data":{
        "userId":622258,
        "macAddr":"macAddr",
        "deviceName":"deviceName",
        "productName":"productName",
        "username":"asd",
        "password":"password",
        "hasusertag":1,
        "supportStore":1,
        "supportRichMedia":1,
        "oemCode":"7128"
    }
}

Return parameter description:

parm desc
errorCode error type, see return code
failureDetails wrong description
macAddr Device Mac Address
userId User id
username Device user name set by the user
password User-set device password
deviceName Device name
productName Model name
hasusertag Push support parameters, 0 does not support push, 1 write failed (supported) 2 write succeeded (supported)
supportStore Support cloud storage, 0 not supported, 1 supported
supportRichMedia Supports rich media push, 0 is not supported, 1 is supported
oemCode Oem code of device manufacturer

Error code description:

Basic return code Description
FC_SERVICE_NOT_IMPLEMENT (009999) The api does not exist or is not implemented
FC_INVALID_PARAMETER (000006) Request parameter error
FC_SYSTEM_ERROR (000099) system error
Business return code Description
FC_AUTH_APPKEY_NOT_EXISTS (030010) AppKey does not exist
FC_AUTH_APPSECRET_NOT_MATCH (030020) AppSecrect does not match
FC_AUTH_OPENID_NOT_EXISTS (030030) openId does not exist
FC_AUTH_TOKEN_NOT_EXISTS (030091) token does not exist
FC_AUTH_OPENID_NOT_MATCH (030031) openId does not match
FC_AUTH_ACCESSTOKEN_NOT_MATCH (030040) accessToken does not match
FC_AUTH_ACCESSTOKEN_EXPIRED (030041) accessToken expired
FC_ACCOUNT_USER_IPC_SETTING_NOT_EXISTS (020041) user ipcsetting not exists

3.1.6 Unbinding Device Interface

Interface description:

  • Unbundling the device through mac and signing

Request URL:

  • https://{HOST}/gateway?service=user_ipc_setting_v2_0.delOemDeviceForce

Request method:

  • POST

Request header:

  • None

Request parameters:

parm type necessary desc
mac String required Device mac address
timeStamp String required unix timestamp
oemCode String required oemCode
sign String required Check signing, Md5 (mac + timeStamp + delKey), where delKey is one and only one key for each oem manufacturer

Return example:

{
    "errorCode":""
}

Return parameter description:

parm desc
errorCode error type, see return code

Error code description:

Basic return code Description
FC_SERVICE_NOT_IMPLEMENT (009999) The api does not exist or is not implemented
FC_INVALID_PARAMETER (000006) Request parameter error
FC_SYSTEM_ERROR (000099) system error

3.2 Service activation and authorization

3.2.1 Query the user does not activate the authorization record

Interface description:

  • Query all inactive authorization records of the user

Request URL:

  • https://{HOST}/gateway?service=permission.query_user_not_active

Request method:

  • GET

Request header:

  • no

Request parameters:

parm type necessary desc length
clientId String required appKey 40
openId String required openId (user logo) 40
accessToken String required accessToken 40
supportBpi int required Whether to support Bpi: 0 not supported 1 supported 1

Return example:

{
    "errorCode":"",
    "data":[
        {
            "grantId":222222,
            "ipcMac":"ipcMac",
            "permissionCode":"permissionCode",
            "permissionName":"permissionName",
            "permissionType":1,
            "permissionValue":0,
            "grantStatus":1,
            "userTag":"userTag",
            "streamId":"streamId",
            "belongServer":"belongServer",
            "initTime":1565847960000,
            "channelCount":0
        },
        {
            "grantId":111111,
            "ipcMac":"ipcMac",
            "permissionCode":"permissionCode",
            "permissionName":"permissionName",
            "permissionType":1,
            "permissionValue":0,
            "grantStatus":1,
            "userTag":"userTag",
            "belongServer":"belongServer",
            "initTime":1565847960000,
            "channelCount":0
        }
    ],
    "sysDate":1576289329443
}

Return parameter description:

parm desc
errorCode Error code, null value on success
failureDetails Cause of failure
data Return json object
data.grantId Authorization record id
data.ipcMac Device mac
data.permissionCode Permission code
data.permissionName Authority name
data.permissionType 1, service authorization type, 1 paid, 2 free, 3 free
data.permissionValue No processing required
data.grantStatus Privilege status, 1, Privilege status, for payment completion, waiting for service activation, the service needs to activate the device first; .3 for authorization success
data.usreTag User corresponding service tag
data.streamId Cloud Storage Stream ID
data.belongServer Basic service code
data.initTime Service purchase time
sysDate System time, seconds from 1970 to the present

Error code description:

Basic return code Description
FC_SERVICE_NOT_IMPLEMENT (009999) The api does not exist or is not implemented
FC_INVALID_PARAMETER (000006) Request parameter error
FC_SYSTEM_ERROR (000099) system error

3.2.2 Activation permissions

Interface description:

  • Activate device individual permissions

Request URL:

  • https://{HOST}/gateway?service=permission.active

Request method:

  • POST

Request header:

name necessary type desc
Content-Type Yes String Content-Type: application / x-www-form-urlencoded

Request parameters:

parm type necessary desc length
clientId String required appKey 40
openId String required openId (user logo) 40
accessToken String required accessToken 40
grantId long required Record number authorized by the inquiry order is not authorized to activate the interface records obtained 20
ipcMac String required Device mac address 20
exceptionInfo String Optional Exception information 1024
appClientVersion String Optional APP version information 50

Return example:

{
    "errorCode":"",
    "failureDetails":""
}

Return parameter description:

parm desc
errorCode Error code, null value on success
failureDetails Cause of failure

Error code description:

Basic return code Description
FC_SERVICE_NOT_IMPLEMENT (009999) The api does not exist or is not implemented
FC_INVALID_PARAMETER (000006) Request parameter error
FC_SYSTEM_ERROR (000099) system error
Business return code Description
PERMISSION_GRANTID_RECORD_NOT_EXISTS (883202) Authorization record does not exist
PERMISSION_GRANTID_RECORD_NOT_MATCH_IPCMAC (883204) Authorization record does not match IPC
PERMISSION_GRANT_STATUS_CANNOT_ACTIVE (883203) The authorization record status is incorrect and activation is not allowed

3.2.3 Obtaining Current Service Information of User Equipment

Interface description:

  • Get user device current service information

Request URL:

  • https://{HOST}/gateway?service=fcmall.get_current_service

Request method:

  • GET

Request header:

  • no

Request parameters:

parm type necessary desc length
clientId String required appKey 40
openId String required openId (user logo) 40
accessToken String required accessToken 40
macAddr String required Device Mac address (unique identification) 20

Return example:

{
    "errorCode":"",
    "data":{
        "userId":111111,
        "macAddr":"macAddr",
        "name":"3 days per year",
        "description":"3 Day Cloud Storage",
        "startTime":1521093393000,
        "endTime":1552629393000,
        "validity":"12 Months",
        "status":3,
        "flag":1
    }
}

Return parameter description:

parm desc
userId User id
macAddr Device mac
name service name
desc Service description
startTime Service start time [may be empty]
endTime Service end time [may be empty]
validity Service time
status Service status: 0 no service 1 authorization failed
flag Logo: 1 paid package 2 8 hours free service
errorCode error code
failureDetails Cause of failure

Error code description:

Basic return code Description
FC_SERVICE_NOT_IMPLEMENT (009999) The api does not exist or is not implemented
FC_INVALID_PARAMETER (000006) Request parameter error
FC_SYSTEM_ERROR (000099) system error

3.2.4 Query the valid authorization records of all users’ devices

Interface description:

  • Query valid authorization records of all devices of the user

Request URL:

  • https://{HOST}/gateway?service=permission.query_user_ipcs_valid

Request method:

  • GET

Request header:

  • no

Request parameters:

parm type necessary desc length
clientId String required appKey 40
openId String required openId (user logo) 40
accessToken String required accessToken 40

Return example:

{
    "errorCode":"",
    "data":[
        {
            "grantId":222222,
            "ipcMac":"ipcMac",
            "permissionCode":"permissionCode",
            "permissionName":"permissionName",
            "permissionType":1,
            "permissionValue":0,
            "grantStatus":1,
            "userTag":"userTag",
            "streamId":"streamId",
            "belongServer":"belongServer",
            "initTime":1565847960000,
            "channelCount":0
        },
        {
            "grantId":111111,
            "ipcMac":"ipcMac",
            "permissionCode":"permissionCode",
            "permissionName":"permissionName",
            "permissionType":1,
            "permissionValue":0,
            "grantStatus":1,
            "userTag":"userTag",
            "belongServer":"belongServer",
            "initTime":1565847960000,
            "channelCount":0
        }
    ],
    "sysDate":1576289329443
}

Return parameter description:

parm desc
errorCode Error code, null value on success
failureDetails Cause of failure
data Return json object
data.grantId Authorization record id
data.ipcMac Device mac
data.permissionCode Permission code
data.permissionName Authority name
data.permissionType 1, service authorization type, 1 paid, 2 free, 3 free
data.permissionValue No processing required
data.grantStatus Privilege status, 1, Privilege status, for payment completion, waiting for service activation, the service needs to activate the device first; .3 for authorization success
data.usreTag User corresponding service tag
data.streamId Cloud Storage Stream ID
data.belongServer Basic service code
data.initTime Service purchase time
sysDate System time, seconds from 1970 to the present

Error code description:

Basic return code Description
FC_SERVICE_NOT_IMPLEMENT (009999) The api does not exist or is not implemented
FC_INVALID_PARAMETER (000006) Request parameter error
FC_SYSTEM_ERROR (000099) system error

3.3 Cloud storage and live streaming

3.3.1 Basic subservice information query

Interface description:

  • Query user sub-service information, the data returned by a user is
    fixed, and the user only needs to query once

Request URL:

  • https://{HOST}/gateway?service=center.getServerInfo

Request method:

  • GET

Request header:

  • no

Request parameters:

parm type necessary desc length
clientId String required appKey 40
openId String required openId (user logo) 40
accessToken String required accessToken 40
oemCode String required oem manufacturer information 20

Return example:

{
    "errorCode":"",
    "data":{
        "userId":111111,
        "subtoken":"subtoken",
        "area":"NA",
        "tag":"tag",
        "storeTag":"storeTag",
        "alexaTag":"alexaTag",
        "sendMsgUrl":"sendMsgUrl",
        "sendMsgUrlSecure":"sendMsgUrlSecure",
        "url":"url",
        "storeUrl":"storeUrl",
        "alexaUrl":"alexaUrl",
        "channelCount":0
    }
}

Return parameter description:

parm desc
errorCode Error code, null value on success
failureDetails Cause of failure
data Return json object
data.userId User id
data.subtoken User token
data.url Push business query service address
data.sendMsgUrl Push to receive message service http address
data.sendMsgUrlSecure Push receive message service https address
data.storeUrl Cloud storage access service address
data.alexaUrl Alexa basic service access address
data.tag User push tag
data.storeTag User cloud storage tag
data.alexaTag User Alexa tag
data.area User area

Error code description:

Basic return code Description
FC_SERVICE_NOT_IMPLEMENT (009999) The api does not exist or is not implemented
FC_INVALID_PARAMETER (000006) Request parameter error
FC_SYSTEM_ERROR (000099) system error
Business return code Description
FC_SYSTEM_ADDRESS_CHANGE, 000077) Indicates that the address of the dispatch center has changed, and a new service address will be returned.The field is server_url
FC_SYSTEM_UPGRADE (000066)) Means that the system will be polled regularly during system upgrade (once every 5 minutes)

3.3.2 APP Query List of Existing Recording Dates

Interface description:

  • The App queries the time when the device has recorded, where HOST
    is the storeUrl address in the result of the basic subservice
    information query interface
    ;

Request URL:

  • https://{HOST}/stream?service=record.date.query

Request method:

  • GET

Request header:

  • no

Request parameters:

parm type necessary desc length
devId String required Device mac
sessionToken String required userToken (subtoken + timestamp) for MD5 encoding
timestamp String required Timestamp, must be greater than the current time

Return example:

{
    "dateList":[
        "20190330T190000",
        "20190331T210000",
        "20190331T190000",
        "20190330T220000",
        "20190331T000000",
        "20190401T180000",
        "20190401T000000"
    ],
    "errorCode":"",
    "failureDetails":""
}

Return parameter description:

parm desc
errorCode Error code, null value on success
failureDetails Cause of failure
dataList Date list

3.3.3 APP Get Recording Time

Interface description:

  • The App obtains the start and end time of all video clips in the
    time period by the start and end time, where HOST is the storeUrl
    address in the result of the basic subservice information query
    interface
    ;

Request URL:

  • https://{HOST}/stream?service=record.query

Request method:

  • GET

Request header:

  • no

Request parameters:

parm type necessary desc
devId String required Device mac
sessionToken String required userToken [ph_user_dispatch_info.subtoken] + timestamp for MD5 encoding
recordEt String required Query recording end time
recordSt String required Query recording start time
timestamp String required Timestamp, must be greater than the current time
version String required version number

Return example:

{
    "errorCode":"",
    "failureDetails":"",
    "recordList":[
        [
            "1554160661",
            "1554160702",
            "2"
        ],
        [
            "1554160794",
            "1554160913",
            "2"
        ],
        [
            "1554161090",
            "1554161145",
            "2"
        ],
        [
            "1554161801",
            "1554161851",
            "2"
        ],
        [
            "1554162015",
            "1554162054",
            "2"
        ],
        [
            "1554162067",
            "1554162129",
            "2"
        ]
    ]
}

Return parameter description:

parm desc
errorCode Error code, null value on success
failureDetails Cause of failure
recordList Video list

Error code description:

Basic return code Description
FC_SERVICE_NOT_IMPLEMENT (009999) The api does not exist or is not implemented
FC_INVALID_PARAMETER (000006) Request parameter error
FC_SYSTEM_ERROR (000099) system error

3.3.4 App Get Play Video Address

Interface description:

  • App obtains the recording address, where HOST is the storeUrl
    address in the result of the basic subservice information query
    interface
    ;

Request URL:

  • https://{HOST}/stream?service=record.play

Request method:

  • GET

Request header:

  • no

Request parameters:

parm type necessary desc
devId String required Device mac
sessionToken String required userToken [ph_user_dispatch_info.subtoken] + timestamp for MD5 encoding
recordSt String required Query recording start time
timestamp String required Timestamp, must be greater than the current time
version String required version number

Return example:

{
    "errorCode":"",
    "failureDetails":"",
    "recordUrl":"http://plb-test.myfoscam.com:8100/hls/362d96836ef005eee0460033724fd26c6164406E4B7E409D8E/2019/03/12/718a9039b6b56451_155341.m3u8?timerange=1552377221-1552377230&expires=1552381960&urlVersion=&sign=544ff805a697a373f65c603987db2404&storageType=BPI&oemCode=",
    "secureUrl":"https://plb-test.myfoscam.com:443/hls/362d96836ef005eee0460033724fd26c6164406E4B7E409D8E/2019/03/12/718a9039b6b56451_155341.m3u8?timerange=1552377221-1552377230&expires=1552381960&urlVersion=&sign=544ff805a697a373f65c603987db2404&storageType=BPI&oemCode=&se=1"
}

Return parameter description:

parm desc
errorCode Error code, null value on success
failureDetails Cause of failure

Error code description:

Basic return code Description
FC_SERVICE_NOT_IMPLEMENT (009999) The api does not exist or is not implemented
FC_INVALID_PARAMETER (000006) Request parameter error
FC_SYSTEM_ERROR (000099) system error

3.4 Tool interface

3.4.1 Server time query

Interface description:

  • Love for server time query

Request URL:

  • https://{HOST}/gateway?service=cloud_system.current_time

Request method:

  • GET

Request header:

  • no

Request parameters:

  • no

Return example:

{
    "errorCode":"",
    "data":1576481002262
}

Return parameter description:

parm desc
errorCode Error code, null value on success
failureDetails Cause of failure
data Server time [ms]

Error code description:

Basic return code Description
FC_SERVICE_NOT_IMPLEMENT (009999) The api does not exist or is not implemented
FC_INVALID_PARAMETER (000006) Request parameter error
FC_SYSTEM_ERROR (000099) system error

3.5 Firmware Upgrade

3.5.1 Obtain the latest firmware (IPC) based on the model name

Interface description:

  • Get the latest firmware based on the model name

Request URL:

  • https://{HOST}/gateway?service=firmware.latest

Request method:

  • GET

Request header:

  • no

Request parameters:

parm type necessary desc
clientId String required appKey
openId String required openId (user logo)
accessToken String required accessToken
macAddr String Required Device mac
machineTypeName String Required Model name, length (0, 50)
sysVersion1 int Required System firmware version 1
sysVersion3 int Required System firmware version 3
sysVersion4 int Required System firmware version 4
appVersion1 int Required Application firmware version 1
appVersion3 int Required Application firmware version 3
appVersion4 int Required Application firmware version 4
patchVersion int Optional Patch version number
oemCode String Optional oem manufacturer number

Return example:

{
    "errorCode":"",
    "firmwareList":[
        {
            "id":135,
            "name":"FosIPC_J_app_ver2.x.2.77MZS4010",
            "desc":"{"zh":"FosIPC_J_app_ver2.x.2.77MZS4010"}",
            "uploadUtilName":"aws-s3",
            "backupUploadUtilName":"local-disk",
            "path":"/firmware/test/FosIPC_J_app_ver2.x.2.77MZS4010--1576569091241.bin",
            "downloadUri":"http://test-download.myfoscam.com:9001/firmware/test/FosIPC_J_app_ver2.x.2.77MZS4010--1576569091241.bin",
            "backupUri":"http://test-download.myfoscam.com:9001/firmware/test/FosIPC_J_app_ver2.x.2.77MZS4010--1576569091241.bin",
            "md5":"24AD9165B11ECB633901BC7F3B412D7F",
            "type":2,
            "interim":false,
            "version1":2,
            "version2":"x",
            "version3":2,
            "version4":77,
            "patchVersion":0,
            "createTime":1576569118000,
            "seqNo":4,
            "newest":true,
            "active":true,
            "remind":1,
            "remindActive":false,
            "firmwarePlatform":"Mstar",
            "productTypeId":1,
            "winPluginId":176,
            "macOsPluginId":177
        }
    ],
    "remind":1
}

Return parameter description:

parm desc
errorCode Error code, null value on success
failureDetails Cause of failure
firmwareList Firmware upgrade target
firmwareList.id Firmware unique primary key flag
firmwareList.desc Firmware description json object, support multiple languages, zh Chinese, en English
firmwareList.downloadUri Firmware download address
firmwareList.md5 Firmware MD5 value
firmwareList.type Firmware type
firmwareList.version1 Firmware version first
firmwareList.version2 Firmware version 2nd
firmwareList.version3 Firmware version 3rd
firmwareList.version4 4th in firmware version
firmwareList.patchVersion Firmware patch version
firmwareList.createTime Firmware creation time

Error code description:

Basic return code Description
FC_AUTH_APPKEY_NOT_EXISTS (030010) appkey not exists
FC_AUTH_APPSECRET_NOT_MATCH (030020) appsecret not match appkey
FC_AUTH_OPENID_NOT_EXISTS (030030) openid not exists
FC_AUTH_OPENID_NOT_MATCH (030031) openid not match appkey
FC_AUTH_ACCESSTOKEN_NOT_MATCH (030040) accesstoken not match openid
FC_AUTH_ACCESSTOKEN_EXPIRED (030041) accesstoken expired
FC_PARAMETER_EMPTY (000005) Parameter is empty
FC_INVALID_PARAMETER (000006) Invalid parameter
FC_SQLEXCEPTION (003301) SQL exception
FC_SYSTEM_ERROR (000099) system error
**Business return code **Description
PT_FIRMWARE_VERSION_INVALID, 010026) Invalid version number
PT_FIRMWARE_LINK_NOT_EXISTS, 010120) This model does not have a firmware upgrade chain
(PT_FIRMWARE_NOT_SUPPORT_UPGRADE, 010121) Does not support smart upgrade
文档更新时间: 2020-06-30 20:00   作者:admin