Firmwares

Сервис Firmwares #

Сервис firmwares служит для централизованного управления (добавления, удаления) прошивок для приборов. К сервису обращаются через web интерфейс сайта продаж, и через web панель администрирования.

Авторизация в сервис firmwares #

  1. Для авторизации через логин и пароль используется метод signin. Детальнее метод описан в Авторизация пользователя

  2. Для авторизации по Токену используется метод authenticate, после того как пользователь прошел signin. Детальнее метод описан в Авторизация пользователя

Закрыте методы сервиса firmwares для сущности firmware #

/firmwares - Method “GET” //returns all firmwares #

RESPONSE:
success  
[{
  "id": "6669a29101e786fecc1d264d",          // unique identifier of firmware
  "product_id": "6284b98ceb776e0478c479d4",  // identifier of the product to which the item belongs
  "version": "1",                           // version of the firmware
  "description": "Example product description", // description of the firmware
  "title": "ThOR LTV v. 1.2.4.2404300",      // title of the firmware
  "usermode": 0,                            // user mode (0 - inactive, 1 - active)
  "expertmode": 0,                          // expert mode (0 - inactive, 1 - active)
  "available": 1,                           // availability of the firmware (0 - unavailable, 1 - available)
  "file_name": "/2024/06/12/template.bin",  // path to the firmware file
  "type": 1,                                // type of the firmware (e.g., 1 - for site, 2 - for app)
  "uploaded": 1718198969                    // upload time in Unix timestamp format
   },]

/firmwares/update - Method “PUT” //update firmware #

REQUEST:
 {"available": 1,                               // availability of the firmware (0 - unavailable, 1 - available)
  "description": "Example product description", // description of the firmware
  "expertmode": 1,                              // expert mode (0 - inactive, 1 - active)
  "file_name": "/2024/05/23/atn-lct-firmware-v1.2.4.2404300.bin", // path to the firmware file
  "id": "664f0c2001e786fecc1d25f5",             // unique identifier of the firmware
  "product_id": "62864861eb776e0468073b5b",     // identifier of the product to which the item belongs
  "title": "ThOR LTV v. 1.2.4.2404300",         // title of the firmware
  "type": 1,                                    // type of the firmware (e.g., 1 - for site, 2 - for app)
  "usermode": 1,                                // user mode (0 - inactive, 1 - active)
  "version": "1.2.4.2404300"                    // version of the firmware
}
RESPONSE:
success  
{ "id": "6669a29101e786fecc1d264d",          // unique identifier of firmware
  "product_id": "6284b98ceb776e0478c479d4",  // identifier of the product to which the item belongs
  "version": "1",                           // version of the item
  "description": "Example product description", // description of the firmware
  "title": "ThOR LTV v. 1.2.4.2404300",      // title of the firmware
  "usermode": 0,                            // user mode (0 - inactive, 1 - active)
  "expertmode": 0,                          // expert mode (0 - inactive, 1 - active)
  "available": 1,                           // availability of the firmware (0 - unavailable, 1 - available)
  "file_name": "/2024/06/12/template.png",  // path to the firmware file
  "type": 1,                                // type of the item (e.g., 1 - for site, 2 - for app)
  "uploaded": 1718198969                    // upload time in Unix timestamp format
   }
errors 
 database error - {"error": "Some error", "status":500}
 authenticate error - {"error": "Auth error", "status":401} 
 other errors- {"error": "Some error", "status":400}

/firmware - Method “POST” //create firmware #

REQUEST:
{  "title": "X-Sight LTV 1/345/67",              // title of the firmware
  "description": "Example product description", // description of the firmware
  "version": "1.23.545",                        // version of the firmware
  "product_id": "628646e8eb776e0468073b54",     // identifier of the product to which the item belongs
  "file_name": "template.png",                  // firmware file which uploading to service
  "available": 1,                               // availability of the firmware (0 - unavailable, 1 - available)
  "expertmode": 0,                              // expert mode (0 - inactive, 1 - active)
  "usermode": 1,                                // user mode (0 - inactive, 1 - active)
  "type": 1                                     // type of the firmware (e.g., 1 - for site, 2 - for app)
}
RESPONSE:
success  
{  "id": "667c12c05d7b418e954236ae",            // unique identifier of the firmware
  "product_id": "628646e8eb776e0468073b54",    // identifier of the product to which the item belongs
  "version": "1.23.545",                       // version of the firmware
  "description": "Example product description",// description of the firmware
  "title": "X-Sight LTV 1/345/67",             // title of the firmware
  "usermode": 1,                               // user mode (0 - inactive, 1 - active)
  "expertmode": 0,                             // expert mode (0 - inactive, 1 - active)
  "available": 1,                              // availability of the firmware (0 - unavailable, 1 - available)
  "file_name": "/2024/06/12/template.png",     // path to the firmware file
  "type": 1,                                   // type of the firmware (e.g., 1 - for site, 2 - for app)
  "uploaded": 1719407296                       // upload time in Unix timestamp format
}
errors 
 database error - {"error": "Some error", "status":500}
 authenticate error - {"error": "Auth error", "status":401} 
 other errors- {"error": "Some error", "status":400}

/firmware/{id} - Method “GET” // get firmware by id #

{id} - is the "id" field of firmare for example - "667c12c05d7b418e954236ae"
RESPONSE:
success  
{  "id": "667c12c05d7b418e954236ae",            // unique identifier of the firmware
  "product_id": "628646e8eb776e0468073b54",    // identifier of the product to which the item belongs
  "version": "1.23.545",                       // version of the firmware
  "description": "Example product description",// description of the firmware
  "title": "X-Sight LTV 1/345/67",             // title of the firmware
  "usermode": 1,                               // user mode (0 - inactive, 1 - active)
  "expertmode": 0,                             // expert mode (0 - inactive, 1 - active)
  "available": 1,                              // availability of the firmware (0 - unavailable, 1 - available)
  "file_name": "/2024/06/26/template.png", // path to the firmware file
  "type": 1,                                   // type of the firmware (e.g., 1 - for site, 2 - for app)
  "uploaded": 1719407296                       // upload time in Unix timestamp format
}
errors 
 database error - {"error": "Some error", "status":500}
 authenticate error - {"error": "Auth error", "status":401} 
 other errors- {"error": "Some error", "status":400}

/firmware/delete/{id} - Method “GET” // delete firmware by id #

{id} - is the "id" field of firmare for example - "667c12c05d7b418e954236ae"
RESPONSE:
success  
{  "id": "667c12c05d7b418e954236ae",            // unique identifier of the firmware
  "product_id": "628646e8eb776e0468073b54",    // identifier of the product to which the item belongs
  "version": "1.23.545",                       // version of the firmware
  "description": "Example product description",// description of the firmware
  "title": "X-Sight LTV 1/345/67",             // title of the firmware
  "usermode": 1,                               // user mode (0 - inactive, 1 - active)
  "expertmode": 0,                             // expert mode (0 - inactive, 1 - active)
  "available": 1,                              // availability of the firmware (0 - unavailable, 1 - available)
  "file_name": "/2024/06/26/template.png", // path to the firmware file
  "type": 1,                                   // type of the firmware (e.g., 1 - for site, 2 - for app)
  "uploaded": 1719407296                       // upload time in Unix timestamp format
}
errors 
 database error - {"error": "Some error", "status":500}
 authenticate error - {"error": "Auth error", "status":401} 
 other errors- {"error": "Some error", "status":400}

/updateavailable - Method “POST” //update available state #

REQUEST:
 {"id": "664f0c2001e786fecc1d25f5"}     // unique identifier of the firmware

RESPONSE:
success  
{ "id": "6669a29101e786fecc1d264d",  // unique identifier of firmware
  "product_id": "",  // identifier of the product to which the item belongs
  "version": "",     // version of the item
  "description": "", // description of the firmware
  "title": "",       // title of the firmware
  "usermode": 0,     // user mode (0 - inactive, 1 - active)
  "expertmode": 0,   // expert mode (0 - inactive, 1 - active)
  "available": 0,    // availability of the firmware (0 - unavailable, 1 - available)
  "file_name": "",   // path to the firmware file
  "type": 0,                                // type of the item (e.g., 1 - for site, 2 - for app)
  "uploaded": 0                    // upload time in Unix timestamp format
   }
errors 
 database error - {"error": "Some error", "status":500}
 authenticate error - {"error": "Auth error", "status":401} 
 other errors- {"error": "Some error", "status":400}

/firmware/upload/{id} - Method “POST” // upload firmware file #

{id} - is the "id" field of firmare for example - "667c12c05d7b418e954236ae"
REQUEST:
  file for upload to service
RESPONSE:
success  
{  Upload successful                  // upload successful 
}
errors 
 database error - {"error": "Some error", "status":500}
 authenticate error - {"error": "Auth error", "status":401} 
 other errors- {"error": "Some error", "status":400}

Закрыте методы сервиса firmwares для сущности product #

/products - Method “GET” //get list of products #

RESPONSE:
success  
[{
  "id": "6284b98ceb776e0478c479d4",       // unique identifier of the product
  "title": "Test-Xsight-Test",            // title of the product
  "sort_order": 1                         // sort order of the product in the list
 },]
errors 
 database error - {"error": "Some error", "status":500}
 authenticate error - {"error": "Auth error", "status":401} 
 other errors- {"error": "Some error", "status":400}

/products/update - Method “PUT” // update product #

REQUEST:
{  "id": "6284b98ceb776e0478c479d4",           // unique identifier of the product
  "sort_order": 1,                            // sort order of the product in the list
  "title": "Test-Xsight-Test"                 // title of the product
}
RESPONSE:
success  
{  "id": "6284b98ceb776e0478c479d4",           // unique identifier of the product
  "sort_order": 1,                            // sort order of the product in the list
  "title": "Test-Xsight-Test"                 // title of the product
}
errors 
 database error - {"error": "Some error", "status":500}
 authenticate error - {"error": "Auth error", "status":401} 
 other errors- {"error": "Some error", "status":400}

/product/{id} - Method “GET” // get product by id #

{id} - is the "id" field of firmare for example - "6284b98ceb776e0478c479d4"
RESPONSE:
success  
{  "id": "6284b98ceb776e0478c479d4",           // unique identifier of the product
  "title": "Test-Xsight-Test"                 // title of the product
  "sort_order": 1,                            // sort order of the product in the list
}
errors 
 database error - {"error": "Some error", "status":500}
 authenticate error - {"error": "Auth error", "status":401} 
 other errors- {"error": "Some error", "status":400}

/product/delete/{id} - Method “PUT” // delete product by id #

{id} - is the "id" field of firmare for example - "6284b98ceb776e0478c479d4"
RESPONSE:
success  
{  "id": "000000000000000000000000",           // unique identifier of the product
  "title": "",                                // title of the product
  "sort_order": 0                             // sort order of the product in the list
}
errors 
 database error - {"error": "Some error", "status":500}
 authenticate error - {"error": "Auth error", "status":401} 
 other errors- {"error": "Some error", "status":400}

Открытые методы сервиса firmwares #

/available - Method “GET” // get list with available firmwares #

RESPONSE:
success  
  [{"id": "62864e40eb776e0468073b5d",       // unique identifier of the firmware
    "version": "3.5.12.510",                // version of the firmware
    "description": "Example product description.", // description of the firmware
    "product_id": "6286468feb776e0468073b53", // identifier of the product to which the firmware belongs
    "file": "https://firmwares.od.atncorp.com/firmware/download/62864e40eb776e0468073b5d", // URL to the firmware file
    "product_title": "OTS 4T",              // title of the product
    "sort_order": 1                         // sort order of the firmware in the list
   },]
errors 
 database error - {"error": "Some error", "status":500}
 authenticate error - {"error": "Auth error", "status":401} 
 other errors- {"error": "Some error", "status":400}

/getusermode - Method “GET” // get list with userMode firmwares #

RESPONSE:
success  
[{  "version": "3.1.11.483",                // version of the firmware
   "title": "X-Sight 4K Series",           // title of the firmware
   "description": "Example product description.", // description of the firmware
   "product_id": "6284e53eeb776e9bd9d7cda8", // identifier of the product to which the firmware belongs
   "file": "http://localhost:8083/2022/05/18/xsight4k_3_1_11_483.elf", // URL to the firmware file
   "product_title": "X-Sight 4K Series",   // title of the product
   "id": "6284e53eeb776e9bd9d7cda8",       // unique identifier of the firmware
   "sort_order": 1                         // sort order of the firmware in the list
   },]
errors 
 database error - {"error": "Some error", "status":500}
 authenticate error - {"error": "Auth error", "status":401} 
 other errors- {"error": "Some error", "status":400}

/getexpertmode - Method “GET” // get list with expertMode firmwares #

RESPONSE:
success  
[{  "version": "3.1.11.483",                // version of the firmware
   "title": "X-Sight 4K Series",           // title of the firmware
   "description": "Example product description.", // description of the firmware
   "product_id": "6284e53eeb776e9bd9d7cda8", // identifier of the product to which the firmware belongs
   "file": "http://localhost:8083/2022/05/18/xsight4k_3_1_11_483.elf", // URL to the firmware file
   "product_title": "X-Sight 4K Series",   // title of the product
   "id": "6284e53eeb776e9bd9d7cda8",       // unique identifier of the firmware
   "sort_order": 1                         // sort order of the firmware in the list
   },]
errors 
 database error - {"error": "Some error", "status":500}
 authenticate error - {"error": "Auth error", "status":401} 
 other errors- {"error": "Some error", "status":400}

/getnextorder - Method “GET” // get list with sort by sort_order field #

RESPONSE:
success  
[{  "id": "6286487feb776e0468073b5c",       // unique identifier of the product
   "title": "TEW",                         // title of the product
   "sort_order": 14                        // sort order of the product in the list
   },]
errors 
 database error - {"error": "Some error", "status":500}
 authenticate error - {"error": "Auth error", "status":401} 
 other errors- {"error": "Some error", "status":400}

/firmware/download/{id} - Method “GET” // get list with expertMode firmwares #

{id} - is the "id" field of firmare for example - "6284b98ceb776e0478c479d4"
RESPONSE:
success  
 download file 
errors 
 database error - {"error": "Some error", "status":500}
 authenticate error - {"error": "Auth error", "status":401} 
 page not found - {"error": "Some error", "status":404}

сервис firmwares обменявается данными со следующими сервисами:

Права доступа к сервису firmwares #

  • ADMIN и SALES - Имеют полный доступ ко всем функциям сервиса firmwares.

  • ВСЕ (даже не зарегистрованные пользователи) - Могут получать доступ к данным о firmwares через открытые методы API.