API - Список изображений/en — различия между версиями

Материал из WebHMI Wiki
Перейти к: навигация, поиск
(Новая страница: «To obtain information about a particular image, you must perform a GET request on a URL like this: '''http://192.168.1.1/api/images/1' ''. Here "1" is the ID of t…»)
Строка 1: Строка 1:
 
<languages/>
 
<languages/>
To get a list of all images, you must perform a GET request on the URL like this: '''http://192.168.1.1/api/graphs'''.
+
To get a list of all images, you must perform a GET request on the URL like this: '''http://192.168.1.1/api/images'''.
  
 
To obtain information about a particular image, you must perform a GET request on a URL like this: '''http://192.168.1.1/api/images/1' ''. Here "1" is the ID of the desired connection.
 
To obtain information about a particular image, you must perform a GET request on a URL like this: '''http://192.168.1.1/api/images/1' ''. Here "1" is the ID of the desired connection.

Версия 09:15, 16 апреля 2018

Другие языки:
English • ‎русский

To get a list of all images, you must perform a GET request on the URL like this: http://192.168.1.1/api/images.

To obtain information about a particular image, you must perform a GET request on a URL like this: 'http://192.168.1.1/api/images/1' . Here "1" is the ID of the desired connection.

В заголовках запроса необходимо передать API key. Например:

X-WH-APIKEY: F3C74230818DA487BB2017CE5D0290F4DABCAFD7

Также в заголовках необходимо указать желаемый формат обмена данными. Сейчас поддерживатеся работа только с форматом JSON.

Accept: application/json
Content-Type: application/json


Пример запроса списка всех изображений:

URL: http://192.168.1.1/api/images
Method: GET

Заголовки:

Accept: application/json
Content-Type: application/json
Accept-Encoding: gzip, deflate, sdch
X-WH-APIKEY: F3C74230818DA487BB2017CE5D0290F4DABCAFD7

Пример ответа:

[
  {
    "id": "1",
    "title": "Фон"
  },
  {
    "id": "2",
    "title": "Пламя"
  }
]


Пример запроса информации о изображений номер 2:

URL: http://192.168.1.1/api/images/2
Method: GET

Заголовки:

Accept: application/json
Content-Type: application/json
Accept-Encoding: gzip, deflate, sdch
X-WH-APIKEY: F3C74230818DA487BB2017CE5D0290F4DABCAFD7

Пример ответа:

{
  "id": "2",
  "title": "Пламя"
}


Атрибуты изображения:

idintУникальный идентификатор изображения
titlestringНазвание изображения