amnimo API連携機能 API仕様 (1.7.0)

amnimo API連携機能のAPI仕様を記載したドキュメントです.

[APIの基本ガイド]

amnimoから提供されたclientId, secretKey, アカウントID, サブスクリプションIDをご用意ください.
各APIを呼び出すには, 事前に認証APIでclientIdとsecretKeyを使ってアクセストークンを発行してください.
以降は, 各APIのリクエストヘッダにアクセストークン, パスパラメータにアカウントIDまたはサブスクリプションIDを指定してリクエストします.

[API 呼び出し制限]

[1クライアントからのAPI制限(共通)]

  • レート: 5 [リクエスト/秒]
  • バースト: 20 [許容可能なリクエスト数]

レートは, 1秒間にサーバーが受け付け可能なリクエスト数です.
バーストは, サーバーが瞬間的に受け付け可能なリクエストの総数です.

瞬間的にレート制限を超過してもバースト制限内であればリクエストを受け付けます(トークンバケットアルゴリズム).
API制限を超えてリクエストするとサーバーはHTTPステータス429を返します.

[認証(/oauth2/token)の呼び出し制限]

  • クォータ: 1,000 [リクエスト/月]

2025年11月以降に発行されたClientIdについては、認証(/oauth2/token)の呼び出しが1,000回/月に制限されます.アクセストークンの有効期限内はトークンを再利用してください.


1. 認証

clientId, secretKeyを使って, 各APIを呼び出すためのアクセストークンを発行します.
発行したアクセストークンは, 各APIのリクエストヘッダの"Authorization"に指定してください.
有効期限内のアクセストークンは再利用するようにしてください.
有効期限を過ぎたアクセストークンでリクエストすると, サーバーはHTTPステータス403を返します.
有効期限を過ぎた場合は, 認証APIでアクセストークンを再発行してください.

アクセストークン取得

Sample curl command

curl -X POST 'https://api.amnimo.com/ex/oauth2/token' \
  -H 'Authorization: Basic {clientId:secretKeyをBase64エンコードした値}' \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  --data-urlencode 'grant_type=client_credentials'
header Parameters
Authorization
required
string
Example: Basic ZGpjOTh1M2ppZWRtaTI4M2V1OTI4OmFiY2RlZjAxMjM0NTY3ODkw

Basic <(clientId:secretKey)をBase64エンコード>を設定

Content-Type
required
string
Example: application/x-www-form-urlencoded

'application/x-www-form-urlencoded'(固定文字列)を設定

Request Body schema: application/x-www-form-urlencoded
required
grant_type
string

'client_credentials'(固定文字列)を指定

Responses

Request samples

Content type
application/x-www-form-urlencoded
grant_type=client_credentials

Response samples

Content type
application/json
{
  • "access_token": "eyJra1example",
  • "token_type": "Bearer",
  • "expires_in": 7200
}

2. テナント

アカウントIDを指定して, テナントの階層構造とサブスクリプションIDを取得します.
階層構造と各階層のテナントのサブスクリプションIDが必要な場合, 本APIをリクエストしてください.

テナントの階層構造を取得

Sample curl command

curl 'https://api.amnimo.com/ex/accounts/{accountId}/hierarchy' \
  -H 'Authorization: Bearer {認証APIで取得したアクセストークン}' \
path Parameters
accountId
required
string <uuid>

アカウントID

header Parameters
Authorization
required
string
Example: Bearer ZGpjOTh1M2ppZWRtaTI4M2V1OTI4OmFiY2RlZjAxMjM0NTY3ODkw

Bearer </oauth2/token で取得したaccess_token>を設定

Responses

Response samples

Content type
application/json
{
  • "accountName": "テナント1",
  • "accountId": "3d07c219-0a88-45be-9cfc-91e9d095a1e9",
  • "subscriptionName": "サブスクリプション1",
  • "subscriptionId": "d079718b-ff63-45dd-947b-4950c023750f",
  • "childAccounts": [
    ]
}

3. カメラ

サブスクリプションIDを指定して, テナントに登録されているカメラ情報を取得します.
テナントに登録されているカメラIDは, こちらから取得します.

カメラ一覧取得

Sample curl command 1: ページネーションによるカメラ一覧取得
ページネーションでカメラ一覧を取得するにはQuery Parametersに指定なし, またはpage, sizeのみを指定します

curl 'https://api.amnimo.com/ex/partitions/{subscriptionId}/cameras?page=3&size=250' \
  -H 'Authorization: Bearer {認証APIで取得したアクセストークン}' \

Sample curl command 2: カメラIDを指定した複数カメラ取得
複数カメラを取得するにはQuery ParametersにcameraIdのみを指定します

curl 'https://api.amnimo.com/ex/partitions/{subscriptionId}/cameras?cameraId={uuid1}&cameraId={uuid2}&cameraId={uuid3}' \
  -H 'Authorization: Bearer {認証APIで取得したアクセストークン}' \
path Parameters
subscriptionId
required
string <uuid>

サブスクリプションID

query Parameters
isUrl
boolean
Default: true
Example: isUrl=true

サムネイルのイメージファイルのPresigned URLの発行フラグ

  • true: サムネイルのイメージファイルのPresigned URLを返す
  • false: URLを返さない
expiration
number [ 1 .. 10080 ]
Default: 60
Example: expiration=60

Presigned URLの有効期限[分]
isUrlがtrueの場合のみ有効

page
integer >= 0
Default: 0

ページ番号

size
integer [ 1 .. 500 ]
Default: 500

ページサイズ

cameraId
string <uuid>

カメラID (同時指定上限数 10)
特定のカメラを同時取得する場合のみcameraIdをQuery Parametersに入力してください

header Parameters
Authorization
required
string
Example: Bearer ZGpjOTh1M2ppZWRtaTI4M2V1OTI4OmFiY2RlZjAxMjM0NTY3ODkw

Bearer </oauth2/token で取得したaccess_token>を設定

Responses

Response samples

Content type
application/json
Example
{}

カメラ単体取得

Sample curl command

curl 'https://api.amnimo.com/ex/partitions/{subscriptionId}/cameras/{cameraId}' \
  -H 'Authorization: Bearer {認証APIで取得したアクセストークン}' \
path Parameters
subscriptionId
required
string <uuid>

サブスクリプションID

cameraId
required
string <uuid>

カメラID

query Parameters
isUrl
boolean
Default: true
Example: isUrl=true

サムネイルのイメージファイルのPresigned URLの発行フラグ

  • true: サムネイルのイメージファイルのPresigned URLを返す
  • false: URLを返さない
expiration
number [ 1 .. 10080 ]
Default: 60
Example: expiration=60

Presigned URLの有効期限[分]
isUrlがtrueの場合のみ有効

header Parameters
Authorization
required
string
Example: Bearer ZGpjOTh1M2ppZWRtaTI4M2V1OTI4OmFiY2RlZjAxMjM0NTY3ODkw

Bearer </oauth2/token で取得したaccess_token>を設定

Responses

Response samples

Content type
application/json
{}

サムネイル取得

Sample curl command

curl 'https://api.amnimo.com/ex/partitions/{subscriptionId}/cameras/{cameraId}/thumbnails' \
  -H 'Authorization: Bearer {認証APIで取得したアクセストークン}' \
path Parameters
subscriptionId
required
string <uuid>

サブスクリプションID

cameraId
required
string <uuid>

カメラID

query Parameters
startTime
string
Example: startTime=2025-02-02T15:00:00.000Z

サムネイルを検索する範囲の開始時間(UTC)

endTime
string
Example: endTime=2025-02-16T15:00:00.000Z

サムネイルを検索する範囲の終了時間(UTC)

  • startTime, endTime両指定なし: 現在時間をendTimeとしてその時間から降順でサムネイルを検索する
  • endTimeのみ指定: endTimeの時間から降順でサムネイルを検索する
  • startTimeのみ指定: startTimeの時間から昇順でサムネイルを検索する
  • startTime, endTime両指定あり: startTimeとendTime間から降順でサムネイルを検索する
limit
number [ 1 .. 100 ]
Default: 1
Example: limit=1

取得するサムネイル点数

isUrl
boolean
Default: true
Example: isUrl=true

サムネイルのURLをレスポンスに含めるフラグ

  • true: サムネイルのイメージファイルのPresigned URLを返す
  • false: URLを返さない
expiration
number [ 1 .. 10080 ]
Default: 60
Example: expiration=60

Presigned URLの有効期限[分]
isUrlがtrueの場合のみ有効

header Parameters
Authorization
required
string
Example: Bearer ZGpjOTh1M2ppZWRtaTI4M2V1OTI4OmFiY2RlZjAxMjM0NTY3ODkw

Bearer </oauth2/token で取得したaccess_token>を設定

Responses

Response samples

Content type
application/json
Example
{
  • "total": 1,
  • "thumbnails": [
    ]
}

クラウド録画履歴取得

Sample curl command

curl 'https://api.amnimo.com/ex/partitions/{subscriptionId}/cameras/{cameraId}/history?startTime=2025-02-02T15:00:00.000Z&endTime=2025-02-16T16:00:00.000Z' \
  -H 'Authorization: Bearer {認証APIで取得したアクセストークン}' \
path Parameters
subscriptionId
required
string <uuid>

サブスクリプションID

cameraId
required
string <uuid>

カメラID

query Parameters
startTime
required
string
Example: startTime=2025-02-02T15:00:00.000Z

クラウド録画履歴を検索する範囲の開始日時

endTime
required
string
Example: endTime=2025-02-16T16:00:00.000Z

クラウド録画履歴を検索する範囲の終了日時

header Parameters
Authorization
required
string
Example: Bearer ZGpjOTh1M2ppZWRtaTI4M2V1OTI4OmFiY2RlZjAxMjM0NTY3ODkw

Bearer </oauth2/token で取得したaccess_token>を設定

Responses

Response samples

Content type
application/json
[
  • {
    }
]

4. 映像再生

サブスクリプションIDとカメラIDを指定して, テナントに登録されているカメラ映像を再生するためのHLS URLを取得します.
基本的な映像再生フローは次の通りです.

  1. カメラ一覧取得APIでサブスクリプションIDを指定して映像再生対象のカメラIDを取得します.
  2. 映像再生URL取得APIでサブスクリプションIDとカメラIDを指定して映像再生のためのHLS URLを取得します.
  3. レスポンスのHLS URLを専用のプレイヤーで指定すると映像を再生できます.

エッジデバイスがカメラ映像を保存している場合, 映像再生URL取得APIでライブ映像の再生をリクエストするとエッジデバイスがクラウドに現在時刻の映像データの送信を開始します.
映像データの送信は, 指定した上限時間を超えるまで, または映像再生停止APIをリクエストしてエッジデバイスがクラウドに映像データの送信を停止するまで継続します.

映像再生URL取得

Sample curl command

curl 'https://api.amnimo.com/ex/partitions/{subscriptionId}/cameras/{cameraId}/streams/hls/start?dt=live' \
  -H 'Authorization: Bearer {認証APIで取得したアクセストークン}' \
path Parameters
subscriptionId
required
string <uuid>

サブスクリプションID

cameraId
required
string <uuid>

カメラID

query Parameters
dt
required
string
Example: dt=live

ライブ映像を再生する場合は"live",
過去映像を再生する場合は再生開始時刻"yyyy-mm-ddTHH:MM:SS.SSSZ"(UTC)を設定

  • 過去映像の再生は, クラウドに録画データが保存されている場合のみ可能
  • クラウドの録画データの確認は, クラウド録画履歴取得APIを参照
retry
number [ 1 .. 100 ]
Default: 20
Example: retry=20

映像再生用のURLの取得のリトライ回数を設定
(クラウドビデオレコーダーでは指定不要)

keepAlivePeriod
number [ 10 .. 3600 ]
Default: 10
Example: keepAlivePeriod=10

エッジデバイスから映像データを送信する上限時間 [秒] を設定

header Parameters
Authorization
required
string
Example: Bearer ZGpjOTh1M2ppZWRtaTI4M2V1OTI4OmFiY2RlZjAxMjM0NTY3ODkw

Bearer </oauth2/token で取得したaccess_token>を設定

Responses

Response samples

Content type
application/json

映像再生の停止

エッジデバイスがカメラ映像を保存している場合に, カメラ映像のクラウドへのアップロードをします.

Sample curl command

curl 'https://api.amnimo.com/ex/partitions/{subscriptionId}/cameras/{cameraId}/streams/hls/stop?requestId=e006cedc-247a-49e1-a18f-d59bef27dbcb' \
  -H 'Authorization: Bearer {認証APIで取得したアクセストークン}'
path Parameters
subscriptionId
required
string <uuid>

サブスクリプションID

cameraId
required
string <uuid>

カメラID

query Parameters
requestId
required
string

</partitions/{subscriptionId}/cameras/{cameraId}/streams/hls/start で取得したリクエストID>を設定

header Parameters
Authorization
required
string
Example: Bearer ZGpjOTh1M2ppZWRtaTI4M2V1OTI4OmFiY2RlZjAxMjM0NTY3ODkw

Bearer </oauth2/token で取得したaccess_token>を設定

Responses

Response samples

Content type
application/json
{
  • "result": "string"
}

映像再生時間の延長

エッジデバイスがカメラ映像を保存している場合に, カメラ映像をクラウドにアップロードする時間をリクエストした時刻からkeepAlivePeriodの時間だけ延長します.

Sample curl command

curl 'https://api.amnimo.com/ex/partitions/{subscriptionId}/cameras/{cameraId}/streams/hls/update?requestId=e006cedc-247a-49e1-a18f-d59bef27dbcb' \
  -H 'Authorization: Bearer {認証APIで取得したアクセストークン}'
path Parameters
subscriptionId
required
string <uuid>

サブスクリプションID

cameraId
required
string <uuid>

カメラID

query Parameters
requestId
required
string

</partitions/{subscriptionId}/cameras/{cameraId}/streams/hls/start で取得したリクエストID>を設定

header Parameters
Authorization
required
string
Example: Bearer ZGpjOTh1M2ppZWRtaTI4M2V1OTI4OmFiY2RlZjAxMjM0NTY3ODkw

Bearer </oauth2/token で取得したaccess_token>を設定

Responses

Response samples

Content type
application/json
{
  • "result": "string"
}

5. メディア

サブスクリプションIDとカメラIDを指定して, テナントに登録されているカメラ映像のビデオクリップ・スナップショットを生成・取得・検索します.

  • ビデオクリップ: 生成APIで指定した時間のうち, 録画されている時間の映像を切り出した映像ファイルです.
  • スナップショット: 生成APIで指定した時間の画像ファイルです.

基本的なメディア取得のフローは次の通りです.

  1. カメラ一覧取得APIでサブスクリプションIDを指定しメディアを取得するカメラIDを取得します.
  2. ビデオクリップ・スナップショット生成APIでサブスクリプションIDとカメラIDを指定して, 必要な時間のビデオクリップ・スナップショット生成をリクエストします.
  3. ビデオクリップ・スナップショット取得APIでサブスクリプションIDと2.のレスポンスのメディアIDを指定してリクエストします.
  4. 3.のレスポンスで取得したメディアファイルのPresigned URLから, ビデオクリップ・スナップショットのファイルをダウンロードできます.
  • ビデオクリップ・スナップショットの生成にかかる時間は, 生成するファイルのサイズによって異なります.
    生成の進捗および結果は, ビデオクリップ・スナップショット取得APIのステータスで確認することができます.
  • カメラ映像をエッジデバイスに保存している場合, エッジデバイスがビデオクリップ・スナップショットを生成し, アップロードします.
  • カメラ映像が録画されていない時間を指定すると, ビデオクリップ・スナップショット生成APIのリクエストは成功しますが, 生成の結果は失敗となります.

ビデオクリップ・スナップショット生成

Sample curl command

curl -X POST 'https://api.amnimo.com/ex/partitions/{subscriptionId}/cameras/{cameraId}/media' \
  -H 'Authorization: Bearer {認証APIで取得したアクセストークン}' \
  -H 'Content-Type: application/json' \
  -d '{"category": "CLIP", "startTime": "2025-02-02T15:00:00.000Z", "endTime": "2025-02-02T15:30:00.000Z", "name": "media Name"}'
path Parameters
subscriptionId
required
string <uuid>

サブスクリプションID

cameraId
required
string <uuid>

カメラID

header Parameters
Authorization
required
string
Example: Bearer ZGpjOTh1M2ppZWRtaTI4M2V1OTI4OmFiY2RlZjAxMjM0NTY3ODkw

Bearer </oauth2/token で取得したaccess_token>を設定

Request Body schema: application/json
required
category
required
string
Enum: "CLIP" "SNAPSHOT"
  • CLIP: ビデオクリップ
  • SNAPSHOT: スナップショット
startTime
required
string

メディアの開始時刻 "yyyy-mm-ddTHH:MM:SS.SSSZ" (UTC)

  • ビデオクリップ・スナップショットどちらも開始時刻の指定必須
  • スナップショットは開始時刻に指定した時刻のイメージファイルを生成
endTime
string

メディアの終端時刻 "yyyy-mm-ddTHH:MM:SS.SSSZ" (UTC)

  • 終端時刻はビデオクリップでのみ必須
  • 終端時刻には開始時刻より新しい時刻を指定すること
  • ビデオクリップの最大時間長は1時間 (startTimeとendTimeの時間差は最大1時間)
name
string [ 1 .. 64 ] characters

メディア名

Responses

Request samples

Content type
application/json
{
  • "category": "CLIP",
  • "startTime": "2025-02-02T15:00:00.000Z",
  • "endTime": "2025-02-02T15:30:00.000Z",
  • "name": "media Name"
}

Response samples

Content type
application/json
{
  • "id": "b6f0907d-a2cc-4cb3-88e5-2a0982d2e948",
  • "cameraId": "cbc3283e-6217-4855-9934-148717cbeefe",
  • "pid": "058d15e1-c249-47bc-9c08-cb16c9e878c4",
  • "type": "IMAGE",
  • "source": "CLOUD",
  • "category": "CLIP",
  • "startTime": "2019-08-24T14:15:22Z",
  • "endTime": "2019-08-24T14:15:22Z",
  • "name": "media-testName",
  • "status": "COMPLETED",
  • "requestedDateTime": "2019-08-24T14:15:22Z",
  • "size": 2078322,
  • "meta": {
    }
}

カメラのビデオクリップ・スナップショット検索

Sample curl command

curl -X POST 'https://api.amnimo.com/ex/partitions/{subscriptionId}/cameras/{cameraId}/medias' \
  -H 'Authorization: Bearer {認証APIで取得したアクセストークン}' \
  -H 'Content-Type: application/json'\
  -d '{"pageNumber": 0, "pageSize": 100}'
path Parameters
subscriptionId
required
string <uuid>

サブスクリプションID

cameraId
required
string <uuid>

カメラID

header Parameters
Authorization
required
string
Example: Bearer ZGpjOTh1M2ppZWRtaTI4M2V1OTI4OmFiY2RlZjAxMjM0NTY3ODkw

Bearer </oauth2/token で取得したaccess_token>を設定

Request Body schema: application/json
required
categories
Array of strings

メディア検索対象のカテゴリー
指定しない場合, 全てのカテゴリーを検索対象とする

  • CLIP: ビデオクリップ
  • SNAPSHOT: スナップショット
pageNumber
required
integer <int32> >= 0

メディア検索のページ番号

pageSize
required
integer <int32> [ 1 .. 1000 ]

メディア検索のページのサイズ

sortDir
string
Default: "desc"
Enum: {"asc":"昇順"} {"desc":"降順"}

メディアのソート順 (生成をリクエストした時刻順)

  • asc: 昇順
  • desc 降順

Responses

Request samples

Content type
application/json
{
  • "categories": [
    ],
  • "pageNumber": 0,
  • "pageSize": 100,
  • "sortDir": "desc"
}

Response samples

Content type
application/json
[
  • {
    }
]

サブスクリプションのビデオクリップ・スナップショット検索

Sample curl command

curl -X POST 'https://api.amnimo.com/ex/partitions/{subscriptionId}/medias' \
  -H 'Authorization: Bearer {認証APIで取得したアクセストークン}' \
  -H 'Content-Type: application/json' \
  -d '{"pageNumber": 0, "pageSize": 100}'
path Parameters
subscriptionId
required
string <uuid>

サブスクリプションID

header Parameters
Authorization
required
string
Example: Bearer ZGpjOTh1M2ppZWRtaTI4M2V1OTI4OmFiY2RlZjAxMjM0NTY3ODkw

Bearer </oauth2/token で取得したaccess_token>を設定

Request Body schema: application/json
required
categories
Array of strings

メディア検索対象のカテゴリー
指定しない場合, 全てのカテゴリーを検索対象とする

  • CLIP: ビデオクリップ
  • SNAPSHOT: スナップショット
pageNumber
required
integer <int32> >= 0

メディア検索のページ番号

pageSize
required
integer <int32> [ 1 .. 1000 ]

メディア検索のページのサイズ

sortDir
string
Default: "desc"
Enum: "asc" "desc"

メディアのソート順 (生成をリクエストした時刻順)

  • asc: 昇順
  • desc 降順

Responses

Request samples

Content type
application/json
{
  • "categories": [
    ],
  • "pageNumber": 0,
  • "pageSize": 100,
  • "sortDir": "desc"
}

Response samples

Content type
application/json
[
  • {
    }
]

ビデオクリップ・スナップショット取得

Sample curl command

curl 'https://api.amnimo.com/ex/partitions/{subscriptionId}/medias/{mediaId}' \
  -H 'Authorization: Bearer {認証APIで取得したアクセストークン}' \
path Parameters
subscriptionId
required
string <uuid>

サブスクリプションID

mediaId
required
string

メディアID

query Parameters
expiration
number [ 1 .. 10080 ]
Default: 60
Example: expiration=60

Presigned URLの有効期限[分]

header Parameters
Authorization
required
string
Example: Bearer ZGpjOTh1M2ppZWRtaTI4M2V1OTI4OmFiY2RlZjAxMjM0NTY3ODkw

Bearer </oauth2/token で取得したaccess_token>を設定

Responses

Response samples

Content type
application/json
{
  • "id": "b6f0907d-a2cc-4cb3-88e5-2a0982d2e948",
  • "cameraId": "cbc3283e-6217-4855-9934-148717cbeefe",
  • "pid": "058d15e1-c249-47bc-9c08-cb16c9e878c4",
  • "type": "IMAGE",
  • "source": "CLOUD",
  • "category": "CLIP",
  • "startTime": "2019-08-24T14:15:22Z",
  • "endTime": "2019-08-24T14:15:22Z",
  • "name": "media-testName",
  • "status": "COMPLETED",
  • "requestedDateTime": "2019-08-24T14:15:22Z",
  • "size": 2078322,
  • "meta": {
    }
}

ビデオクリップ・スナップショット更新

Sample curl command

curl -X PUT 'https://api.amnimo.com/ex/partitions/{subscriptionId}/medias/{mediaId}' \
  -H 'Authorization: Bearer {認証APIで取得したアクセストークン}' \
  -H 'Content-Type: application/json' \
  -d '{"data": {"name": "update-media-name"}}'
path Parameters
subscriptionId
required
string <uuid>

サブスクリプションID

mediaId
required
string

メディアID

header Parameters
Authorization
required
string
Example: Bearer ZGpjOTh1M2ppZWRtaTI4M2V1OTI4OmFiY2RlZjAxMjM0NTY3ODkw

Bearer </oauth2/token で取得したaccess_token>を設定

Request Body schema: application/json
required
object

Responses

Request samples

Content type
application/json
{
  • "data": {
    }
}

Response samples

Content type
application/json
{
  • "id": "b6f0907d-a2cc-4cb3-88e5-2a0982d2e948",
  • "cameraId": "cbc3283e-6217-4855-9934-148717cbeefe",
  • "pid": "058d15e1-c249-47bc-9c08-cb16c9e878c4",
  • "type": "IMAGE",
  • "source": "CLOUD",
  • "category": "CLIP",
  • "startTime": "2019-08-24T14:15:22Z",
  • "endTime": "2019-08-24T14:15:22Z",
  • "name": "media-testName",
  • "status": "COMPLETED",
  • "requestedDateTime": "2019-08-24T14:15:22Z",
  • "size": 2078322,
  • "meta": {
    }
}

ビデオクリップ・スナップショット削除

Sample curl command

curl -X DELETE 'https://api.amnimo.com/ex/partitions/{subscriptionId}/medias/{mediaId}' \
  -H 'Authorization: Bearer {認証APIで取得したアクセストークン}' \
path Parameters
subscriptionId
required
string <uuid>

サブスクリプションID

mediaId
required
string

メディアID

header Parameters
Authorization
required
string
Example: Bearer ZGpjOTh1M2ppZWRtaTI4M2V1OTI4OmFiY2RlZjAxMjM0NTY3ODkw

Bearer </oauth2/token で取得したaccess_token>を設定

Responses

Response samples

Content type
application/json
[
  • {
    }
]

6. デバイス

サブスクリプションIDとデバイスIDを指定して, テナントに登録されているデバイスの外部機器情報の取得, デバイスのポートの取得・操作をします.

  • 外部機器一覧取得APIで, テナントに登録されているデバイスの外部機器情報の一覧を取得します.
    テナントに登録されていて, かつデバイスに外部機器が設定されているデバイスIDは, こちらから取得します.
  • 外部機器単体取得APIで, 指定したデバイスIDのデバイスの外部機器情報を取得します.
  • デバイスのポート状態取得APIで, 指定したデバイスIDのデバイスのポート状態を取得します.
    テナントに登録されているデバイスのポートIDは, こちらから取得します.
  • デバイスのポート操作APIで, 指定したデバイスIDのデバイスのポートのON/OFF操作を行うことができます.

外部機器一覧取得

Sample curl command

curl 'https://api.amnimo.com/ex/partitions/{subscriptionId}/devices/externalDevices?page=3&size=250' \
  -H 'Authorization: Bearer {認証APIで取得したアクセストークン}' \
path Parameters
subscriptionId
required
string <uuid>

サブスクリプションID

query Parameters
page
integer >= 0
Default: 0

ページ番号

size
integer >= 1
Default: 10

ページサイズ

header Parameters
Authorization
required
string
Example: Bearer ZGpjOTh1M2ppZWRtaTI4M2V1OTI4OmFiY2RlZjAxMjM0NTY3ODkw

Bearer </oauth2/token で取得したaccess_token>を設定

Responses

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "summary": {
    }
}

外部機器単体取得

Sample curl command

curl 'https://api.amnimo.com/ex/partitions/{subscriptionId}/devices/{deviceId}/externalDevices' \
  -H 'Authorization: Bearer {認証APIで取得したアクセストークン}' \
path Parameters
subscriptionId
required
string <uuid>

サブスクリプションID

deviceId
required
string <uuid>

デバイスID

header Parameters
Authorization
required
string
Example: Bearer ZGpjOTh1M2ppZWRtaTI4M2V1OTI4OmFiY2RlZjAxMjM0NTY3ODkw

Bearer </oauth2/token で取得したaccess_token>を設定

Responses

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "summary": {
    }
}

デバイスのポート状態取得

Sample curl command

curl 'https://api.amnimo.com/ex/partitions/{subscriptionId}/devices/{deviceId}/peripherals' \
  -H 'Authorization: Bearer {認証APIで取得したアクセストークン}' \
path Parameters
subscriptionId
required
string <uuid>

サブスクリプションID

deviceId
required
string <uuid>

デバイスID

header Parameters
Authorization
required
string
Example: Bearer ZGpjOTh1M2ppZWRtaTI4M2V1OTI4OmFiY2RlZjAxMjM0NTY3ODkw

Bearer </oauth2/token で取得したaccess_token>を設定

Responses

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "summary": {
    }
}

デバイスのポート操作

Sample curl command

curl -X POST 'https://api.amnimo.com/ex/partitions/{subscriptionId}/devices/{deviceId}/ports/{portId}' \
  -H 'Authorization: Bearer {認証APIで取得したアクセストークン}' \
  -H 'Content-Type: application/json' \
  -d '{"action": 1}' \
path Parameters
subscriptionId
required
string <uuid>

サブスクリプションID

deviceId
required
string <uuid>

デバイスID

portId
required
string

ポートID

header Parameters
Authorization
required
string
Example: Bearer ZGpjOTh1M2ppZWRtaTI4M2V1OTI4OmFiY2RlZjAxMjM0NTY3ODkw

Bearer </oauth2/token で取得したaccess_token>を設定

Request Body schema: application/json
action
required
integer

ポート操作アクション

  • 0: ポートOFF
  • 1: ポートON
  • 2: ポートのリセット
resetTimer
integer >= 1

※ポートのリセット時のみ設定必須
リセット時にポートをOFFにする時間[秒]

Responses

Request samples

Content type
application/json
{
  • "action": 1,
  • "resetTimer": 10
}

Response samples

Content type
application/json
{ }

A. 改定履歴

改定日 バージョン 改定内容
2026/02/27 1.7 外部機器一覧取得API, 外部機器単体取得API, ポート操作API, ポート状態取得APIを追加
映像再生APIの再生, 更新, 終了処理修正
2026/01/21 1.6.2 アクセストークンの有効期限を延長
2025/12/19 1.6.1 カメラ一覧, 単体取得APIのレスポンスにバージョン情報を追加
2025/11/19 1.6 カメラ一覧, 単体取得APIのレスポンスに録画状態を追加
カメラ一覧APIで複数カメラ対応
サムネイル取得API, クラウド録画履歴取得API正式化
2025/07/24 1.5 カメラ一覧取得APIにページネーションのパラメータ追加
2025/07/04 1.4 サムネイル取得API, クラウド録画履歴取得API ベータ版
2025/05/30 1.3 サンプルプログラムページ追加
curlサンプル表記修正
2025/04/21 1.2 メディアAPIを追加
2025/02/12 1.1 映像再生API IFの変更
2025/01/08 1.0 正式リリース 映像再生APIを追加
2023/09/26 --- ベータリリース 認証API, テナントAPI, カメラAPI

B. サンプルプログラム

こちらは, カメラ一覧取得, 映像再生用のURL取得のPythonのサンプルプログラムのページです.