Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Added Example CSV JSON payload section.
Created date作成日Updated date更新日Affects version影響を受けるバージョンFix version修正バージョン

 

 

Management PortalN/A

Table of Contents

This page will cover basics on how to utilize Management Portal APIs when exporting reports from the system.

More detailed examples and full descriptions for all available endpoint and their respective parameters can be found from API Guide available within the "Support"-tab in Management Portal.

Below table describes currently available report export endpoints and their differences on a higher level and allows user to choose the best option for the requirements.

この記事では、システムからレポートをエクスポートする際に、Management Portal APIを使用する基本的な方法について説明します。

利用可能なすべてのエンドポイントと対応する各パラメータに関する詳細な例と説明は、Management Portalの「サポート」タブ内にあるAPIガイドを参照してください。

次の表は、現在利用可能なレポートエクスポートのエンドポイントとその違いを上位のレベルで説明し、要件に最適なオプションを選択できるようにしたものです。

Export reportsExport reports Export reports

エンドポイントメソッドリクエストフォーマット1つのリクエストで複数レポートがエクスポート可能レポートのフィルター機能が利用可能説明
単一のレポートのエクスポートEndpointMethodRequest FormatAllows exporting reports for multiple devices in a single requestAllows filtering for reportsDescription/report/export/{uuid}GETN/A(error)(error)

Export a single report with its UUID.

単一のレポートをそのUUIDでエクスポートします。

レポートのエクスポート (GET)/report/export?@imei={imei}GETN/A(tick)(tick)

Export past month's reports with optional IMEI filtering.

オプションのIMEIフィルターを使用して、過去1か月のレポートをエクスポートします。

レポートのエクスポート (POST)/report/exportPOSTapplication/json(tick)(tick)Export reports with more advanced filters/options provided in the request body.

Export Report

The most simple form of exporting an individual report, requires the report UUID to be provided as part of the endpoint.

リクエスト本文 (body) で指定されたフィルタ/オプションを使用してレポートをエクスポートします。

単一のレポートのエクスポート

個々のレポートをエクスポートする最もシンプルな形式を使用する場合、エンドポイントの中にレポートUUIDを指定する必要があります。

次の例では、{UUID}を有効なレポートUUIDに、{API_KEY}をAPIキーのキー文字列に置き換えてください。まだAPIキーをお持ちでない場合は、APIキーの記事を参照してください。In the following examples replace {UUID} with a valid report UUID and {API_KEY} with the key string of your API key. If you don't have an API key yet, see more details from API Keys documentation.

Code Block
titleExample curl requestcurlのリクエスト例
curl -X "GET" \
  "https://api.eu-west-1.blancco.cloud/v1/report/export/{UUID}" \
  -H "accept: */*" \
  -H "X-BLANCCO-API-KEY: {API_KEY}"

By default the report is exported in XML format. Also PDF and JSON are supported, the format can be changed by defining デフォルトでは、レポートはXML形式でエクスポートされます。PDFとJSONもサポートされており、UUIDの後にリクエストURLの一部として "?format=" parameter as part of the request URL after the UUID. Supported values for the format parameter are XML, JSON and PDF.パラメータを指定することで形式を変更することができます。formatパラメータでサポートされている値は、XML、JSON、PDFです。 

Code Block
titleExample curl request in PDF formatPDF形式のcurlリクエスト例
curl -X "GET" \
  "https://api.eu-west-1.blancco.cloud/v1/report/export/{UUID}?format=PDF" \
  -H "accept: */*" \
  -H "X-BLANCCO-API-KEY: {API_KEY}"

...

レポートのエクスポート (GET)

Export past month's reports with optional IMEI filtering. If the report is not created during the past month it will not be included in the results.

オプションのIMEIフィルターを使用して、過去1か月のレポートをエクスポートします。過去1ヶ月の間にレポートが作成されていない場合、レポートは結果に含まれません。

次の例では、{IMEI}をデバイスの有効なIMEIに、In the following examples replace {IMEI} with a valid device IMEI and {API_KEY} with the key string of your API key. If you don't have an API key yet, see more details from API Keys documentation.をAPIキーのキー文字列に置き換えます。まだAPIキーをお持ちでない場合は、APIキーの記事を参照してください。

Code Block
titleExample curl requestcurlのリクエスト例
curl -X "GET" \
  "https://api.eu-west-1.blancco.cloud/v1/report/export?@imei={IMEI}" \
  -H "accept: */*" \
  -H "X-BLANCCO-API-KEY: {API_KEY}"

...

レポートのエクスポート (POST)

Export reports with the options provided in the request body. Allows user to define more defined search criteria and only return matching reports.

Supported report fields

リクエスト本文で指定されたオプションを使用してレポートをエクスポートします。より明確な検索条件を指定して、一致するレポートのみを返すことができます。

サポートされるレポートのフィールド

フィールド名XMLフィールドパス名前Field nameXML field pathName
IMEIblancco_hardware_report.system.imei@imei
System Serialblancco_hardware_report.system.serial@system_serial 
Erasure Stateblancco_erasure_report.erasures.erasure.state@erasure_state 
Custom fielduser_data.fields.{CUSTOM_FIELD_NAME}@custom-{CUSTOM_FIELD_NAME}

Additionally multiple other parameters can be defined to further limit the returned results and the output format.

Additional parameters

他にも複数のパラメータを指定して返される結果を絞り込み、出力形式を指定することもできます。

追加パラメータ

パラメータ説明
date

エクスポートするレポートの日付範囲。このオブジェクトは、次の有効な名前を持つプロパティで構成されます:lte

ParameterDescription
date

Date range for the exported reports. This object consists of properties with the following valid names: lte (less than or equal), lt 以下)、lt (less than, 未満), eq 、eq (equal, 等しい) , gt 、gt (greater than, 超過) , and gte 、gte (greater than or equal, 以上) .

If this isn't defined, the default is to export reports from the past month.

定義されていない場合、デフォルトでは過去1か月のレポートがエクスポートされます。

例えば、2021年1月のすべてのレポートをエクスポートするには、次のように指定しますFor example, in order to export all reports from January 2021, you'd use the following: {"gte". "2021-01-01T00:00:00Z", "lt": "2021-02-01T00:00:00Z"}.

In order to disable date filtering, use an empty object. Default range of past month is derived by decreasing the "number" of the month. E.g. if the current date at the time the export is executed is 2021dateのフィルター機能を無効にするには、空のオブジェクトを使用します。過去1ヶ月のデフォルトの範囲は、月の 「数値」を減らすことで導き出されます。例えば、エクスポートが実行時の現在の日時が2021-03-01T07:00:00Z, then that becomes the end of the date range and start would be 202100Zであれば、それが日付範囲の終了日時になり、開始は2021-02-01T07:00:00Z.00Zになります。

format

Format of the exported report. If omitted, default format for ERASURE reports is エクスポートされるレポートの形式。省略した場合、消去レポートのデフォルトの形式は"XML".です。

Valid values有効な値:"CSV", "JSON", and 、および"XML".

container

Container in which all individual reports are wrapped in.

すべての個別レポートが含まれるコンテナの形式。

有効な値Valid values: "NONE " and および "ZIP" (default).(デフォルト)。

With "NONE", the reports are wrapped into a single document of the same format as the reports themselves. For example, if format is を指定すると、レポートはレポート自体と同じ形式の単一のファイルにまとめられます。例えば、formatが"XML" and container is でcontainerが"NONE", a single XML document is returned that contains all individual XML reports. When container is の場合、個々のXMLレポートをすべて含む1つのXMLファイルが返されます。containerが"ZIP", all reports have their own file within the returned ZIP file.の場合、返されたZIPファイル内にはすべての個別のファイルが含まれます。

Code Block
titleExample JSON paylodペイロードの例
{
  "filter": {
    "date": {
      "gte": "2023-01-01T00:00:00Z"
    },
    "fields": [
      {
        "name": "@imei",
        "like": "{IMEI}"
      },
      {
        "name": "@custom-my custom field",
        "like": "{CUSTOM_FIELD_VALUE}"
      }
    ]
  },
  "format": "XML",
  "container": "ZIP"
}

Example Request

This example request would export XML format reports for IMEI 123456789012345 created after 1st of January 2023. The exported reports will be returned in a zip folder (each report in its own separate file).

Code Block
titleCSVエクスポート用JSONペイロードの例
{
    "filter": {
       "date":{
       },
       "fields": [
        {
            "name": "@erasure_state",
            "like": "Successful"
        }
        ]
      },
    "csv":{
        "columns": ["blancco_erasure_report.erasures.erasure.timestamp","blancco_erasure_report.erasures.erasure.state","blancco_hardware_report.system.manufacturer","blancco_hardware_report.system.model"]
      },
    "format": "CSV",
    "container": "NONE"
}

リクエストの例

このリクエスト例では、2023年1月1日以降に作成されたIMEI 123456789012345のXML形式のレポートをエクスポートします。エクスポートされたレポートはzipフォルダで返されます (各レポートは個別ファイル) 。

例の中のIMEI 123456789012345と{API_KEY}をそれぞれ有効なIMEIとAPIキーのキー文字列に置き換えて利用してください。まだAPIキーをお持ちでない場合は、APIキーの記事を参照してください。In the following example replace IMEI with a valid IMEI and {API_KEY} with the key string of your API key. If you don't have an API key yet, see more details from API Keys documentation.

Code Block
curl -X 'POST' \
  'https://api.eu-west-1.blancco.cloud/v1/report/export' \
  -H 'accept: */*' \
  -H 'X-BLANCCO-API-KEY: {API_KEY}' \
  -H 'Content-Type: application/json' \
  -d '{
  "filter": {
    "date": {
      "gte": "2023-01-01T00:00:00Z"
    },
    "fields": [
      {
        "name": "@imei",
        "like": "123456789012345"
      },
      {
        "name": "@custom-my custom field",
        "like": "my custom field value"
      }
    ]
  },
  "format": "XML",
  "container": "ZIP"
}'

...