Skip to Content Information Center
Lexmark Cloud Services

Lexmark Cloud Services

Интеграция Cloud Fleet Management со сторонним программным обеспечением

Интерфейс API в качестве средства интеграции предоставляет конечные точки для упрощения интеграции со сторонним программным обеспечением. Для интеграции Lexmark Cloud Fleet Management со своей системой используйте следующие методы и ключи.

Получение данных счетчиков для ресурсов

Это обращение позволяет получить данные счетчиков, например показатели, для ресурсов организации и ее дочерних организаций. Организация определяется по токену, указанному в заголовке «Авторизация», который необходимо получить из обращения Получение токена.

Примечание:  В связи с внедрением конечных точек интерфейса API версии 1.0 эта конечная точка теперь исключена.

МетодURL-адрес

GET

<INTEGRATION_SERVICE_URL>/assets/inventory/counters

Заголовки
КлючЗначениеОписание

Авторизация

Носитель <TOKEN>

Обращение «Получение токена» возвращает токен.

    Текст

  • Нет.

Схема возвращения

{
    "type": "array",
    "items": {
        "type": "object",
        "required": [ "serialNumber", "dateCollected", "counters" ],
        "properties": {
            "serialNumber": { "type": "string" },
            "dateCollected": { "type": "integer" },
            "counters": { 
                "type": "object",
                "properties": {
                    "lifetimeCount": { "type": "integer" },
                    "colorPrintSideCount": { "type": "integer" },
                    "colorPrintSheetCount": { "type": "integer" },
                    "monoPrintSideCount": { "type": "integer" },
                    "monoPrintSheetCount": { "type": "integer" },
                    "printSideCount": { "type": "integer" },
                    "printSheetCount": { "type": "integer" },
                    "colorCopySideCount": { "type": "integer" },
                    "colorCopySheetCount": { "type": "integer" },
                    "monoCopySideCount": { "type": "integer" },
                    "monoCopySheetCount": { "type": "integer" },
                    "copySideCount": { "type": "integer" },
                    "copySheetCount": { "type": "integer" },
                    "colorFaxSideCount": { "type": "integer" },
                    "colorFaxSheetCount": { "type": "integer" },
                    "monoFaxSideCount": { "type": "integer" },
                    "monoFaxSheetCount": { "type": "integer" },
                    "faxSideCount": { "type": "integer" },
                    "faxSheetCount": { "type": "integer" },
                    "colorSideCount": { "type": "integer" },
                    "colorSheetCount": { "type": "integer" },
                    "monoSideCount": { "type": "integer" },
                    "monoSheetCount": { "type": "integer" },
                    "totalSideCount": { "type": "integer" },
                    "totalSheetCount": { "type": "integer" },
                    "largeSideCount": { "type": "integer" },
                    "largeSheetCount": { "type": "integer" },
                    "duplexSideCount": { "type": "integer" },
                    "duplexSheetCount": { "type": "integer" },
                    "coverageTierBusinessSideCount": { "type": "integer" },
                    "coverageTierBusinessSheetCount": { "type": "integer" },
                    "coverageTierGraphicsSideCount": { "type": "integer" },
                    "coverageTierGraphicsSheetCount": { "type": "integer" },
                    "coverageTierHighlightSideCount": { "type": "integer" },
                    "coverageTierHighlightSheetCount": { "type": "integer" },
                },
            },
        },
    },
    "minItems": 0
}

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

[
  {
    "serialNumber": "14",
    "dateCollected": 1557259523000,
    "counters": {
      "monoPrintSideCount": 262,
      "printSideCount": 262,
      "printSheetCount": 262,
      "monoCopySideCount": 40,
      "copySideCount": 40,
      "copySheetCount": 40,
      "monoFaxSideCount": 0,
      "faxSideCount": 0,
      "faxSheetCount": 0,
      "monoSideCount": 302,
      "totalSideCount": 302,
      "totalSheetCount": 302,
      "duplexSheetCount": 0
    }
  },
  {
    "serialNumber": "29",
    "dateCollected": 1557259523000,
    "counters": {
      "lifetimeCount": 139,
      "monoPrintSideCount": 139,
      "printSideCount": 139,
      "printSheetCount": 136,
      "copySideCount": 0,
      "monoSideCount": 139,
      "totalSideCount": 139,
      "totalSheetCount": 136,
      "duplexSheetCount": 3
    }
  },
  {
    "serialNumber": "36",
    "dateCollected": null,
    "counters": {
    }
  }
]

Получение токена

Это обращение генерирует токен, который подходит для использования с обращением Получение данных счетчиков для ресурсов.

МетодURL-адрес

POST

<IDP_URL>oauth/token

Примечание:  <IDP_URL> — это либо https://idp.eu.iss.lexmark.com для организации в центре обработки данных в ЕС, либо https://idp.us.iss.lexmark.com/ для организации в центре обработки данных в США.

Заголовки
КлючЗначение

Тип содержимого

application/json

Текст

{
    "grant_type": "client_credentials",
		 "client_id": "<CLIENT_ID>",
		 "client_secret": "<CLIENT_SECRET>"
}

Схема возвращения

{
    "properties" : {
        "access_token": {"type": "string"},
        "token_type": {"type": "string"},
        "expires_in": {"type": "integer"},
        "created_at": {"type": "integer"}
    },
    "required": ["access_token", "token_type", "expires_in", "created_at"]
}

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

{
    "access_token": "abcd1234",
    "token_type": "bearer",
    "expires_in": 7200,
    "created_at": 1572633120
}
Помогла ли вам эта статья?
Top