In this article
Add a New Subscription Connection
Use this endpoint to add a new subscription connection to the subscription service.
Upon creation, the listed subscriber will be granted owner permissions to the created connection. If the requester is a different principal than the subscriber, the requester will be granted admin privileges.
URL
https://api.digitalvault.cloud/subscriptionconnection
Method
POST
Request Header Parameters
| Property | Description | |
|---|---|---|
| Authentication | Bearer {access_token} required |
Retrieve access token |
Request Body Params
| Property | Description |
|---|---|
| subscriber | Principal to list as subscriber in prefixed-principal notation |
| Connection | JObject representing the connection to send notification to |
Connection
| Property | Description |
|---|---|
| type | Connection type. Currently, only “AzureEventHubSend” is supported |
| id | For Device, {{DEVICE_ID}}. For Timeseries, {{TIMESERIES_ID}}:{{METRIC_NAME}} |
Response Body Parameters
| Name | Description |
|---|---|
| id | For the connection object |
| subscriber | Principal to list as subscriber in prefixed-principal notation |
| Connection | JObject representing the connection to send notification to |
Errors
| Error | Description |
|---|---|
| 401 | Unauthorized |
| 403 | Forbiden. Possible causes: * You do not have access to this endpoint (scope) |
| 409 | Subscriber is already registered to this connection |
| 504 | Timeout while attempting to write connection to storage repository |
Example
Request
POST https://api.digitalvault.cloud/subscriptionconnection
{
"subscriber": "sub:app:testApp1",
"connection":
{
"type": "AzureEventHubSend",
"config": {
"connectionString": "azure_eventhub_sendpolicy_connection_string"
}
}
}
Response
{
"id": "platform_assigned_id",
"subscriber": "sub:app:testApp1",
"connection":
{
"type": "AzureEventHubSend",
"config": {
"connectionString": "azure_eventhub_sendpolicy_connection_string"
}
}
}
SubscriptionConnection Type Requirements
Currently, the only supported type is AzureEventHubSend
Config Requirements per Type
- AzureEventHubSend
connectionString– The azure event hub connection string for the desired event hub’s send policy
Notes
SubscriptionConnection Type Requirements
Currently, the only supported type is AzureEventHubSend
Config Requirements per Type
- AzureEventHubSend
connectionString– The azure event hub connection string for the desired event hub’s send policy
- Use the following formats to define the subscriber:
- User = ‘sub:user:{{USERID}}’
- Application: ‘sub:app:{{APPID}}’