Dela via


Communication Services - Link Notification Hub

Länkmeddelandehubb
Länkar en Azure Notification Hub till den här kommunikationstjänsten.

POST https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Communication/communicationServices/{communicationServiceName}/linkNotificationHub?api-version=2023-03-31

URI-parametrar

Name I Obligatorisk Typ Description
communicationServiceName
path True

string

Namnet på CommunicationService-resursen.

Reguljärt uttrycksmönster: ^[-\w]+$

resourceGroupName
path True

string

Namnet på resursgruppen. Namnet är skiftlägesokänsligt.

subscriptionId
path True

string

uuid

ID för målprenumerationen. Värdet måste vara ett UUID.

api-version
query True

string

Den API-version som ska användas för den här åtgärden.

Begärandetext

Name Obligatorisk Typ Description
connectionString True

string

Anslutningssträng för meddelandehubben

resourceId True

string

Resurs-ID för meddelandehubben

Svar

Name Typ Description
200 OK

LinkedNotificationHub

Åtgärden lyckades. Meddelandehubben har länkats.

Other Status Codes

ErrorResponse

Felsvar som beskriver varför åtgärden misslyckades.

Exempel

Exempelbegäran

POST https://management.azure.com/subscriptions/11112222-3333-4444-5555-666677778888/resourceGroups/MyResourceGroup/providers/Microsoft.Communication/communicationServices/MyCommunicationResource/linkNotificationHub?api-version=2023-03-31

{
  "resourceId": "/subscriptions/11112222-3333-4444-5555-666677778888/resourceGroups/MyOtherResourceGroup/providers/Microsoft.NotificationHubs/namespaces/MyNamespace/notificationHubs/MyHub",
  "connectionString": "Endpoint=sb://MyNamespace.servicebus.windows.net/;SharedAccessKey=abcd1234"
}

Exempelsvar

{
  "resourceId": "/subscriptions/11112222-3333-4444-5555-666677778888/resourceGroups/MyOtherResourceGroup/providers/Microsoft.NotificationHubs/namespaces/MyNamespace/notificationHubs/MyHub"
}
{
  "error": {
    "code": "WrongSubscription",
    "message": "The notification hub must be in the same subscription as the communication service"
  }
}

Definitioner

Name Description
ErrorAdditionalInfo

Ytterligare information om resurshanteringsfelet.

ErrorDetail

Felinformationen.

ErrorResponse

Felsvar

LinkedNotificationHub

En meddelandehubb som har länkats till kommunikationstjänsten

LinkNotificationHubParameters

Beskrivning av en Azure Notification Hub som länkar till kommunikationstjänsten

ErrorAdditionalInfo

Ytterligare information om resurshanteringsfelet.

Name Typ Description
info

object

Ytterligare information.

type

string

Den ytterligare informationstypen.

ErrorDetail

Felinformationen.

Name Typ Description
additionalInfo

ErrorAdditionalInfo[]

Ytterligare information om felet.

code

string

Felkoden.

details

ErrorDetail[]

Felinformationen.

message

string

Felmeddelandet.

target

string

Felmålet.

ErrorResponse

Felsvar

Name Typ Description
error

ErrorDetail

Felobjektet.

LinkedNotificationHub

En meddelandehubb som har länkats till kommunikationstjänsten

Name Typ Description
resourceId

string

Resurs-ID för meddelandehubben

LinkNotificationHubParameters

Beskrivning av en Azure Notification Hub som länkar till kommunikationstjänsten

Name Typ Description
connectionString

string

Anslutningssträng för meddelandehubben

resourceId

string

Resurs-ID för meddelandehubben