# サブスクリプションの作成 データコレクターのセットアップと構成が完了したら、コロケーションデータをデータコレクターにストリーミングするためのサブスクリプションを作成します。 > **メモ** > > 組織で使用できる通信チャネルタイプは1つのみです。たとえば、AWS IoTコアチャネルでサブスクリプションを作成する場合、別のチャネルタイプを使用して別のサブスクリプションを作成することはできません。 > > 1つのサブスクリプションで使用できるチャンネルは1つのみです。 ## 前提条件[​](#前提条件 "への直接リンク前提条件") * サブスクリプション管理APIを呼び出す前に、「コレク[タとの統合」を](https://docs.equinix.com/ja/smart-view/sv-api/integrating-with-collector.md)参照して、データの宛先を設定および構成してください。 * ユーザー認証情報、クライアントID、およびクライアントシークレットを送信してOauth2認証を行います。Equinix APIへのリクエストを認証する方法の詳細については、[API認証を](https://docs.equinix.com/ja/equinix-api/api-authentication.md)参照してください。 ## AWS IoTコア[​](#aws-iotコア "への直接リンクAWS IoTコア") Amazon IoT Coreにデータを送信するサブスクリプションを作成するには、エンドポイントにリクエストを[`/smartview/v2/streaming/subscriptions`](https://docs.equinix.com/ja/api-catalog/smartviewv2/streaming-subscription-api/createsubscription.md)送信します。`POST`リクエストの本文で、AS`AWS_IOT_CORE`とそのURLをで指定します。`channelType``awsIotCoreChannelConfiguration` オブジェクトで受信するデータを指定します。`messageType` サンプルcURLリクエスト: ``` curl -X  POST 'https://api.equinix.com/smartview/v2/streaming/subscriptions' -H 'content-type: application/json' -H 'authorization: Bearer ' -d '{     "messageType": {         "asset": [],         "environmental": [             {                 "accountNumber": "116710",                 "ibx": [                     "LD9"                 ],                 "level": [                     "CAGE"                 ]             }         ],         "power": [],         "meteredPower": [],         "systemAlert": [],         "customAlert": []     },     "channel": {         "channelType": "AWS_IOT_CORE",         "awsIotCoreChannelConfiguration": {             "url": "https://.amazonaws.com"         }     } }'  ``` で使用可能なオプションの完全なリストについては、[APIリファレンスを](https://docs.equinix.com/ja/api-catalog/smartviewv2/streaming-subscription-api/createsubscription.md)`messageType`参照してください。 ## ウェブフック[​](#ウェブフック "への直接リンクウェブフック") Webhookにデータを送信するサブスクリプションを作成するには、エンドポイントにリクエストを[`/smartview/v2/streaming/subscriptions`](https://docs.equinix.com/ja/api-catalog/smartviewv2/streaming-subscription-api/createsubscription.md)送信します。`POST`リクエストの本文で、AS`WEBHOOK`とその構成をで指定します。`channelType``webhookChannelConfiguration` オブジェクトで受信するデータを指定します。`messageType` サンプルcURLリクエスト: ``` curl -X  POST 'https://api.equinix.com/smartview/v2/streaming/subscriptions' -H 'content-type: application/json' -H 'authorization: Bearer ' -d '{     "messageType": {         "asset": [],         "environmental": [             {                 "accountNumber": "116710",                 "ibx": [                     "LD9"                 ],                 "level": [                     "CAGE"                 ]             }         ],         "power": [],         "meteredPower": [],         "systemAlert": [],         "customAlert": []     },     "channel": {         "channelType": "WEBHOOK",         "webhookChannelConfiguration": { "sslCertificate": "ZkFzZLY1IGRpY31kZXI=...", "url": "https://.com", "numberOfRetries": 1, "numberOfConcurrentCalls": 20, "batchSize": 5 },     } }'  ``` のWebhook設定オプションと使用可能なオプションのリストについては、[APIリファレンスを](https://docs.equinix.com/ja/api-catalog/smartviewv2/streaming-subscription-api/createsubscription.md)`messageType`参照してください。 ## Equinix Rest API[​](#equinix-rest-api "への直接リンクEquinix Rest API") サブスクリプションを作成してEquinix APIからデータを利用できるようにするには、エンドポイントにリクエストを[`/smartview/v2/streaming/subscriptions`](https://docs.equinix.com/ja/api-catalog/smartviewv2/streaming-subscription-api/createsubscription.md)送信します。`POST`リクエストの本文で、ASを指定します。`channelType``REST` オブジェクトで受信するデータを指定します。`messageType` サンプルcURLリクエスト: ``` curl -X  POST 'https://api.equinix.com/smartview/v2/streaming/subscriptions' -H 'content-type: application/json' -H 'authorization: Bearer ' -d '{     "messageType": {         "asset": [],         "environmental": [             {                 "accountNumber": "116710",                 "ibx": [                     "LD9"                 ],                 "level": [                     "CAGE"                 ]             }         ],         "power": [],         "meteredPower": [],         "systemAlert": [],         "customAlert": []     },     channel": { "channelType": "REST", "restChannelConfiguration": { } } }'  ``` で使用可能なオプションの完全なリストについては、[APIリファレンスを](https://docs.equinix.com/ja/api-catalog/smartviewv2/streaming-subscription-api/createsubscription.md)`messageType`参照してください。 回答例 ``` HTTP/1.1 201 Created Location: /smartview/v2/streaming/subscriptions/0f6bdb36-e130-4924-b038-ee1785fad999 ``` `Location`応答のヘッダーには、リアルタイムフィードの利用に必要なサブスクリプションIDが含まれています。