# Gestion des abonnements Vous pouvez gérer vos abonnements en utilisant les points de terminaison API suivants. ## Conditions préalables[​](#conditions-préalables "Lien direct vers Conditions préalables") * Envoyez vos informations d’identification utilisateur, votre identifiant client et votre secret client pour l’authentification OAuth2. Pour plus d'informations sur la manière d'authentifier vos demandes auprès du Equinix API, reportez-vous à la section [authentification API](https://docs.equinix.com/fr-CA/equinix-api/api-authentication.md). ## Obtenez vos abonnements[​](#obtenez-vos-abonnements "Lien direct vers Obtenez vos abonnements") Pour renvoyer une liste de tous vos abonnements de streaming, envoyez une `GET` demande au [`/smartview/v2/streaming/subscriptions`](https://docs.equinix.com/fr-CA/api-catalog/smartviewv2/streaming-subscription-api/getallsubscriptions.md)terminal. Exemple de requête cURL: ``` curl -X GET 'https://api.equinix.com/smartview/v2/streaming/subscriptions' -H 'authorization: Bearer ' ``` Exemple de réponse: ``` [ { "id": "606349eca6171829c70d8777", "status": "PENDING", "messageType": { "asset": [ { "accountNumber": "135888", "ibx": [ "DE2" ], "assetClassification": [ "MECHANICAL" ], "assetId": [ "string" ] } ], "environmental": [ { "accountNumber": "135888", "ibx": [ "DE2" ], "level": [ "ZONE" ] } ], "power": [ { "accountNumber": "135888", "ibx": [ "DE2" ] } ], "meteredPower": [ { "accountNumber": "135888", "ibx": [ "DE2" ] } ], "systemAlert": [ { "accountNumber": "135888", "ibx": [ "DE2" ] } ], "customAlert": [ { "accountNumber": "135888", "ibx": [ "DE2" ], "user": "abc" } ] }, "channel": { "channelType": "AWS_IOT_CORE", "awsIotCoreChannelConfiguration": { "url": "https://b4c3mzxe8syvhd-ats.iot.us-west-2.amazonaws.com" } }, "orgId": "123", "createdBy": "abc", "createdDateTime": "2019-08-24T14:15:22Z", "updatedBy": "abc", "updatedDateTime": "2019-08-24T14:15:22Z" } ] ``` ## Obtenez les détails des abonnements[​](#obtenez-les-détails-des-abonnements "Lien direct vers Obtenez les détails des abonnements") Pour obtenir les détails d'un abonnement spécifié, envoyez une `GET` demande au [`/smartview/v2/streaming/subscriptions/{id}`](https://docs.equinix.com/fr-CA/api-catalog/smartviewv2/streaming-subscription-api/getsubscriptionbyid.md)point final. Exemple de requête cURL: ``` curl -X GET 'https://api.equinix.com/smartview/v2/streaming/subscriptions/606349eca6171829c70d8777' -H 'authorization: Bearer ' ``` Exemple de réponse: ``` { "id": "606349eca6171829c70d8777", "status": "ACTIVE", "messageType": { "asset": [ { "accountNumber": "135888", "ibx": [ "DE2" ], "assetClassification": [ "MECHANICAL" ], "assetId": [ "string" ] } ], "environmental": [ { "accountNumber": "135888", "ibx": [ "DE2" ], "level": [ "ZONE" ] } ], "power": [ { "accountNumber": "135888", "ibx": [ "DE2" ] } ], "meteredPower": [ { "accountNumber": "135888", "ibx": [ "DE2" ] } ], "systemAlert": [ { "accountNumber": "135888", "ibx": [ "DE2" ] } ], "customAlert": [ { "accountNumber": "135888", "ibx": [ "DE2" ], "user": "abc" } ] }, "channel": { "channelType": "AWS_IOT_CORE", "awsIotCoreChannelConfiguration": { "url": "https://b4c3mzxe8syvhd-ats.iot.us-west-2.amazonaws.com" } }, "orgId": "123", "createdBy": "abc", "createdDateTime": "2019-08-24T14:15:22Z", "updatedBy": "abc", "updatedDateTime": "2019-08-24T14:15:22Z" } ``` ## Mettre à jour un abonnement[​](#mettre-à-jour-un-abonnement "Lien direct vers Mettre à jour un abonnement") Pour modifier un abonnement, envoyez `PUT`une demande au [`/smartview/v2/streaming/subscriptions/{id}`](https://docs.equinix.com/fr-CA/api-catalog/smartviewv2/streaming-subscription-api/updatesubscription.md)point final. Le nouveau corps de la demande remplace la configuration d'abonnement actuelle. Exemple de requête cURL: ``` curl -X PUT 'https://api.equinix.com/smartview/v2/streaming/subscriptions/{id}' -H 'authorization: Bearer ' -d '{ "messageType": { "asset": [ { "accountNumber": "135888", "ibx": [ "DE2" ], "assetClassification": [ "MECHANICAL" ], "assetId": [ "string" ] } ], "environmental": [ { "accountNumber": "135888", "ibx": [ "DE2" ], "level": [ "ZONE" ] } ], "power": [ { "accountNumber": "135888", "ibx": [ "DE2" ] } ], "meteredPower": [ { "accountNumber": "135888", "ibx": [ "DE2" ] } ], "systemAlert": [ { "accountNumber": "135888", "ibx": [ "DE2" ] } ], "customAlert": [ { "accountNumber": "135888", "ibx": [ "DE2" ], "user": "abc" } ] }, "channel": { "channelType": "AWS_IOT_CORE", "awsIotCoreChannelConfiguration": { "url": "https://b4c3mzxe8syvhd-ats.iot.us-west-2.amazonaws.com" } } }' ``` ## Supprimer un abonnement[​](#supprimer-un-abonnement "Lien direct vers Supprimer un abonnement") Pour supprimer un abonnement, envoyez `DELETE`une demande au [`/smartview/v2/streaming/subscriptions/{id}`](https://docs.equinix.com/fr-CA/api-catalog/smartviewv2/streaming-subscription-api/deletesubscriptionbyid.md)point final. Les événements ne seront plus disponibles pour l'abonnement une fois qu'une demande de suppression sera reçue. Exemple de requête cURL: ``` curl -X DELETE 'https://api.equinix.com/smartview/v2/streaming/subscriptions/606349eca6171829c70d8777' -H 'authorization: Bearer ' ```