Save Learning Code

Last Updated on : 2023-06-20 14:54:02download

Save the remote control code learned by the device and generate a DIY remote control.

API address

POST: /v2.0/infrareds/{infrared_id}/learning-codes

Request parameter

Parameter nameTypeINRequiredDescription
infrared_idStringuritrueThe device ID.

Description of body

Parameter nameTypeINRequiredDescription
category_idInteger falseThe ID of a specified category.
brand_idInteger falseThe ID of a specified brand.
brand_nameString falseThe name of a specified brand.
remote_nameString falseThe name of a specified remote control.
codesList falseThe list.

Description of codes

Parameter nameTypeINRequiredDescription
category_idInteger falseThe ID of a specified category.
key_nameString falseThe name of a specified key.
keyString trueThe key of a specified infrared code. It is used to distinguish the keys when there are multiple learning keys.
codeString trueThe infrared code.
idLong falseThe key ID.

Return parameter

Parameter nameTypeDescription
resultStringThe ID of a specified remote control.

Request example

POST: /v2.0/infrareds/vdevo15345926009****/learning-codes
{
  "category_id": 1,
  "remote_name": "test",
  "codes": [
    {
      "code": "c42230112602f401260226022602260226022602260226022602260226027206260226022602720626027206260272062602720626027206260272065802f401260272062602260226027206260226022602260226024006260226022602260226022602260272062602260226027206260272062602260258024006260272062602720626024c9af6226608260220bf",
      "key": "test"
    }
  ]
}

Return example

{
    "result": "d5s65ca55",
    "t": 1631089922125,
    "success": true
}

Error code

For more information, see error code.