### Sample GET Request for Participants Source: https://learn.microsoft.com/en-us/rest/api/communication/rooms/participants/list An example of a GET request to list participants in a room. This includes a sample endpoint and room ID. ```http GET https://contoso.communication.azure.com//rooms/99199690362660524/participants?api-version=2025-03-13 ``` -------------------------------- ### Sample GET Request for Job Source: https://learn.microsoft.com/en-us/rest/api/communication/jobrouter/job-router-operations/get-job?view=rest-communication-jobrouter-2023-11-01 An example of a GET request to retrieve a job. This includes a sample endpoint and a specific job ID. ```http GET https://contoso.westus.communications.azure.com/routing/jobs/8780b28c-7079-4de1-9143-4d369289e958?api-version=2023-11-01 ``` -------------------------------- ### Sample Request to List Distribution Policies Source: https://learn.microsoft.com/en-us/rest/api/communication/jobrouter/job-router-administration-operations/list-distribution-policies?view=rest-communication-jobrouter-2023-11-01 This is a sample HTTP GET request to list distribution policies, including an example of setting the maximum page size. ```http GET https://contoso.westus.communications.azure.com/routing/distributionPolicies?api-version=2023-11-01&maxpagesize=2 ``` -------------------------------- ### Sample Request (HTTP) Source: https://learn.microsoft.com/en-us/rest/api/communication/resourcemanager/sender-usernames/list-by-domains This is a concrete example of an HTTP GET request to list sender usernames. It uses sample values for subscription ID, resource group, email service, and domain. ```http GET https://management.azure.com/subscriptions/11112222-3333-4444-5555-666677778888/resourceGroups/contosoResourceGroup/providers/Microsoft.Communication/emailServices/contosoEmailService/domains/contoso.com/senderUsernames?api-version=2026-03-18 ``` -------------------------------- ### Sample Request to Get Distribution Policy Source: https://learn.microsoft.com/en-us/rest/api/communication/jobrouter/job-router-administration-operations/get-distribution-policy?view=rest-communication-jobrouter-2023-11-01 An example of an HTTP GET request to retrieve a distribution policy named 'MainDistributionPolicy'. ```http GET https://contoso.westus.communications.azure.com/routing/distributionPolicies/MainDistributionPolicy?api-version=2023-11-01 ``` -------------------------------- ### Get Communication Service Resource (Go) Source: https://learn.microsoft.com/en-us/rest/api/communication/resourcemanager/communication-service/get?view=rest-communication-resourcemanager-2020-08-20 This Go code sample shows how to get a Communication Service resource. It uses `azidentity` for authentication and `armcommunication` for the client. Ensure you have the necessary Azure SDK packages installed. ```go package armcommunication_test import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/communication/armcommunication" ) // Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/communication/resource-manager/Microsoft.Communication/stable/2020-08-20/examples/get.json func ExampleServiceClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() client, err := armcommunication.NewServiceClient("12345", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := client.Get(ctx, "MyResourceGroup", "MyCommunicationResource", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // TODO: use response item _ = res } ``` -------------------------------- ### Start Media Streaming Request (HTTP) Source: https://learn.microsoft.com/en-us/rest/api/communication/callautomation/call-media/start-media-streaming?view=rest-communication-callautomation-2026-03-12 This is an example of an HTTP POST request to start media streaming for a call connection. It includes the call connection ID and the API version. An empty JSON object is sent as the request body. ```http POST https://contoso.communications.azure.com/calling/callConnections/18dea47f-b081-4107-9a5c-4300819d2c6c:startMediaStreaming?api-version=2026-03-12 {} ``` -------------------------------- ### Sample Request for Available Countries Source: https://learn.microsoft.com/en-us/rest/api/communication/phonenumbers/phone-numbers/list-available-countries An example HTTP GET request to list available countries. Replace '{endpoint}' with your actual Communication Services resource endpoint. ```http GET https://resourcename.communication.azure.com//availablePhoneNumbers/countries?api-version=2025-06-01 ``` -------------------------------- ### Sample Response for Get Worker (200 OK) Source: https://learn.microsoft.com/en-us/rest/api/communication/jobrouter/job-router-operations/get-worker?view=rest-communication-jobrouter-2023-11-01 Example JSON response when a worker is successfully retrieved. This includes worker state, assigned queues, capacity, and channel information. ```json { "id": "DefaultWorker", "state": "active", "queues": [ "MainQueue", "SecondaryQueue" ], "capacity": 100, "labels": {}, "tags": {}, "channels": [ { "channelId": "CustomChatChannel", "capacityCostPerJob": 10, "maxNumberOfJobs": 4 }, { "channelId": "CustomVoiceChannel", "capacityCostPerJob": 100, "maxNumberOfJobs": 1 } ], "offers": [], "assignedJobs": [], "loadRatio": 0, "availableForOffers": true, "etag": "etag" } ``` -------------------------------- ### Get Communication Service Resource (Go) Source: https://learn.microsoft.com/en-us/rest/api/communication/resourcemanager/communication-service/get This Go code sample shows how to retrieve a Communication Service resource using the Azure SDK for Go. It utilizes `azidentity` for authentication and `armcommunication` for interacting with the service. Ensure you have the necessary SDKs installed. ```go package armcommunication_test import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/communication/armcommunication" ) // Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/communication/resource-manager/Microsoft.Communication/stable/2020-08-20/examples/get.json func ExampleServiceClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() client, err := armcommunication.NewServiceClient("12345", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := client.Get(ctx, "MyResourceGroup", "MyCommunicationResource", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // TODO: use response item _ = res } ``` -------------------------------- ### List by subscription Source: https://learn.microsoft.com/en-us/rest/api/communication/resourcemanager/communication-services/list-by-subscription This sample demonstrates how to handle requests to list all resources in a subscription using the Azure SDK for JavaScript. ```APIDOC ## GET /subscriptions/{subscriptionId}/providers/Microsoft.Communication/communicationServices ### Description Handles requests to list all resources in a subscription. ### Method GET ### Endpoint https://management.azure.com/subscriptions/{subscriptionId}/providers/Microsoft.Communication/communicationServices?api-version=2026-03-18 ### Parameters #### Path Parameters - **subscriptionId** (string (uuid)) - Required - The ID of the target subscription. The value must be an UUID. #### Query Parameters - **api-version** (string) - Required - The API version to use for this operation. Must be at least 1 character long. ### Responses #### Success Response (200 OK) - **CommunicationServiceResourceList** - Azure operation completed successfully. #### Error Response - **ErrorResponse** - An unexpected error response. ### Security #### azure_auth - Type: oauth2 - Flow: implicit - Authorization URL: https://login.microsoftonline.com/common/oauth2/authorize - **Scopes**: - user_impersonation: impersonate your user account ``` -------------------------------- ### Sample Get Reservation Request Source: https://learn.microsoft.com/en-us/rest/api/communication/phonenumbers/phone-numbers/get-reservation?view=rest-communication-phonenumbers-2025-06-01 Example of an HTTP GET request to retrieve a specific phone number reservation. ```HTTP GET https://resourcename.communication.azure.com/availablePhoneNumbers/reservations/65c18c7f-8074-4efb-a572-e0df127a9964?api-version=2025-06-01 ``` -------------------------------- ### Connect to a Call Request Source: https://learn.microsoft.com/en-us/rest/api/communication/callautomation/connect/connect?view=rest-communication-callautomation-2026-03-12 This sample demonstrates how to construct a POST request to connect to a call. It includes configurations for callback URI, call locator, call intelligence, media streaming, and transcription. ```json POST {endpoint}/calling/callConnections:connect?api-version=2026-03-12 { "callbackUri": "https://contoso.communications.azure.com/callback", "callLocator": { "roomId": "99434917639286209", "kind": "roomCallLocator" }, "callIntelligenceOptions": { "cognitiveServicesEndpoint": "https://cognitiveservice.com" }, "mediaStreamingOptions": { "transportUrl": "wss://contosowebsocketserver.com/", "transportType": "websocket", "contentType": "audio", "audioChannelType": "mixed", "startMediaStreaming": true, "enableBidirectional": true, "audioFormat": "pcm16KMono" }, "transcriptionOptions": { "transportUrl": "wss://contosowebsocketserver.com/", "transportType": "websocket", "locale": "en-ca", "speechModelEndpointId": "afa0669c-a01e-4693-ae3a-93baf40f26d6", "startTranscription": true, "enableIntermediateResults": true } } ``` -------------------------------- ### List all rooms (Sample Request) Source: https://learn.microsoft.com/en-us/rest/api/communication/rooms/rooms/list This sample shows a complete HTTP GET request to list rooms, including the base URL and API version. ```http GET https://contoso.communication.azure.com//rooms?api-version=2025-03-13 ``` -------------------------------- ### Sample Get Room Request Source: https://learn.microsoft.com/en-us/rest/api/communication/rooms/rooms/get-room?view=rest-communication-rooms-2022-02-01-preview An example of an HTTP GET request to retrieve a specific meeting room. This includes the endpoint and room ID. ```HTTP GET https://contoso.communication.azure.com//rooms/99117812428622880?api-version=2022-02-01 ``` -------------------------------- ### Sample Response for Job Creation (200 OK) Source: https://learn.microsoft.com/en-us/rest/api/communication/jobrouter/job-router-operations/upsert-job?view=rest-communication-jobrouter-2023-11-01 This is a sample JSON response for a successful job creation or update operation, indicating the job is queued. ```json { "id": "JobId", "channelReference": "1d5896f3-8b54-40be-82d3-910323f5e2af", "status": "queued", "enqueuedAt": "2021-09-30T23:59:04.5311999+00:00", "channelId": "CustomChatChannel", "classificationPolicyId": null, "queueId": "MainQueue", "priority": 5, "dispositionCode": null, "requestedWorkerSelectors": [ { "key": "Sales", "labelOperator": "equal", "value": true, "expiresAfterSeconds": null } ], "attachedWorkerSelectors": [], "labels": {}, "assignments": {}, "notes": [], "matchingMode": { "kind": "queueAndMatch" }, "etag": "etag" } ``` -------------------------------- ### Sample Request to Get Queue Statistics Source: https://learn.microsoft.com/en-us/rest/api/communication/jobrouter/job-router-operations/get-queue-statistics?view=rest-communication-jobrouter-2023-11-01 An example of an HTTP GET request to retrieve statistics for the 'MainQueue'. Ensure your endpoint URL is correct. ```http GET https://contoso.westus.communications.azure.com/routing/queues/MainQueue/statistics?api-version=2023-11-01 ``` -------------------------------- ### Sample Request to Get Exception Policy Source: https://learn.microsoft.com/en-us/rest/api/communication/jobrouter/job-router-administration-operations/get-exception-policy?view=rest-communication-jobrouter-2023-11-01 An example of a GET request to retrieve a specific exception policy. This uses a sample endpoint and policy ID. ```http GET https://contoso.westus.communications.azure.com/routing/exceptionPolicies/MainExceptionPolicy?api-version=2023-11-01 ``` -------------------------------- ### List all rooms (Sample Response) Source: https://learn.microsoft.com/en-us/rest/api/communication/rooms/rooms/list This is a sample JSON response for a successful request to list rooms. It includes a collection of room objects and a potential next link for pagination. ```json { "value": [ { "id": "999058871389949120", "createdAt": "2025-06-06T05:55:41Z", "validFrom": "2025-06-07T07:55:41Z", "validUntil": "2025-06-08T15:55:41Z", "pstnDialOutEnabled": true }, { "id": "99199690362660524", "createdAt": "2025-06-06T05:55:41Z", "validFrom": "2025-06-07T07:55:41Z", "validUntil": "2025-06-08T15:55:41Z", "pstnDialOutEnabled": false } ], "nextLink": "string" } ``` -------------------------------- ### Get Queue by ID - Sample Request Source: https://learn.microsoft.com/en-us/rest/api/communication/jobrouter/job-router-administration-operations/get-queue?view=rest-communication-jobrouter-2023-11-01 Example of an HTTP GET request to retrieve a queue named 'MainQueue' from a specific Communication resource endpoint. ```http GET https://contoso.westus.communications.azure.com/routing/queues/MainQueue?api-version=2023-11-01 ``` -------------------------------- ### List Communication Services by Subscription (Go) Source: https://learn.microsoft.com/en-us/rest/api/communication/resourcemanager/communication-service/list-by-subscription?view=rest-communication-resourcemanager-2020-08-20 This Go code sample shows how to list Communication Services using the Azure SDK. It utilizes DefaultAzureCredential for authentication and iterates through the results. ```Go package armcommunication_test import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/communication/armcommunication" ) // Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/communication/resource-manager/Microsoft.Communication/stable/2020-08-20/examples/listBySubscription.json func ExampleServiceClient_NewListBySubscriptionPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() client, err := armcommunication.NewServiceClient("12345", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := client.NewListBySubscriptionPager(nil) for pager.More() { nextResult, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) } for _, v := range nextResult.Value { // TODO: use page item _ = v } } } ``` -------------------------------- ### Sample Request to Get a Chat Message Source: https://learn.microsoft.com/en-us/rest/api/communication/chat/chat-thread/get-chat-message?view=rest-communication-chat-2025-03-15 An example of an HTTP GET request to retrieve a chat message. Ensure your endpoint and IDs are correctly formatted. ```http GET https://contoso.westus.communications.azure.com/chat/threads/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/messages/1591768249318?api-version=2025-03-15 ``` -------------------------------- ### Sample Get Chat Thread Request Source: https://learn.microsoft.com/en-us/rest/api/communication/chat/chat/get-chat-thread?view=rest-communication-chat-2021-01-27-preview An example of a GET request to retrieve a chat thread, including the endpoint and a specific chat thread ID. ```http GET https://contoso.westus.communications.azure.com/chat/threads/19:uni01_zbnh3nt2dfuffezc3sox7dog7wfhk6y5qe2rwlnfhlhdzirihdpq@thread.v2?api-version=2021-01-27-preview4 ``` -------------------------------- ### List Communication Services by Subscription (Java) Source: https://learn.microsoft.com/en-us/rest/api/communication/resourcemanager/communication-service/list-by-subscription?view=rest-communication-resourcemanager-2020-08-20 This Java code sample demonstrates how to list Communication Services using the Azure SDK. Ensure you have the CommunicationManager initialized. ```Java import com.azure.core.util.Context; /** Samples for CommunicationService List. */ public final class Main { /* * x-ms-original-file: specification/communication/resource-manager/Microsoft.Communication/stable/2020-08-20/examples/listBySubscription.json */ /** * Sample code: List by subscription. * * @param manager Entry point to CommunicationManager. */ public static void listBySubscription(com.azure.resourcemanager.communication.CommunicationManager manager) { manager.communicationServices().list(Context.NONE); } } ``` -------------------------------- ### Sample Response for Registering Worker (200 OK) Source: https://learn.microsoft.com/en-us/rest/api/communication/jobrouter/job-router-operations/upsert-worker?view=rest-communication-jobrouter-2023-11-01 This sample response confirms a worker has been registered and is now active, with 'availableForOffers' set to true. ```json { "id": "WorkerId", "state": "active", "queues": [ "MainQueue" ], "capacity": 10, "labels": {}, "tags": {}, "channels": [ { "channelId": "CustomChatChannel", "capacityCostPerJob": 11, "maxNumberOfJobs": 4 }, { "channelId": "CustomVoiceChannel", "capacityCostPerJob": 10, "maxNumberOfJobs": 1 } ], "offers": [], "assignedJobs": [], "loadRatio": 0, "availableForOffers": true, "etag": "etag" } ``` -------------------------------- ### Sample GET Request for Operation Status Source: https://learn.microsoft.com/en-us/rest/api/communication/resourcemanager/operation-statuses/get?view=rest-communication-resourcemanager-2020-08-20-preview An example of a GET request to check the status of a specific operation. Ensure the `api-version` matches the API version you are using. ```http GET https://management.azure.com/providers/Microsoft.Communication/locations/westus2/operationStatuses/db5f291f-284d-46e9-9152-d5c83f7c14b8?api-version=2020-08-20-preview ``` -------------------------------- ### Sample Request to Get Email Send Status Source: https://learn.microsoft.com/en-us/rest/api/communication/email/email/get-send-status?view=rest-communication-email-2021-10-01-preview An example of a GET request to the email send status endpoint. This includes a sample endpoint and message ID. ```http GET https://contoso.westus.communications.azure.com/emails/F9168C5E-CEB2-4faa-B6BF-329BF39FA1E4/status?api-version=2021-10-01-preview ``` -------------------------------- ### List Communication Service Keys (Go) Source: https://learn.microsoft.com/en-us/rest/api/communication/resourcemanager/communication-service/list-keys?view=rest-communication-resourcemanager-2020-08-20 This Go code sample shows how to retrieve access keys for an Azure Communication Service. It uses `azidentity` for authentication and `armcommunication` for interacting with the service. Ensure you have the necessary SDKs installed. ```go package armcommunication_test import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/communication/armcommunication" ) // Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/communication/resource-manager/Microsoft.Communication/stable/2020-08-20/examples/listKeys.json func ExampleServiceClient_ListKeys() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() client, err := armcommunication.NewServiceClient("12345", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := client.ListKeys(ctx, "MyResourceGroup", "MyCommunicationResource", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // TODO: use response item _ = res } ``` -------------------------------- ### Get Identity Sample Request Source: https://learn.microsoft.com/en-us/rest/api/communication/identity/communication-identity/get?view=rest-communication-identity-2025-03-02-preview An example of an HTTP GET request to retrieve a specific communication identity. Ensure you replace the placeholder endpoint and ID with your actual values. ```http GET https://my-resource.communication.azure.com/identities/8:acs:2dee53b4-368b-45b4-ab52-8493fb117652_00000005-14a2-493b-8a72-5a3a0d000081?api-version=2025-03-02-preview ``` -------------------------------- ### CallMedia_StartTranscription Sample Request Source: https://learn.microsoft.com/en-us/rest/api/communication/callautomation/call-media/start-transcription This sample demonstrates a complete HTTP request to start transcription. It includes the endpoint, call connection ID, API version, and an empty JSON body. The response indicates the request was accepted. ```HTTP POST https://contoso.communications.azure.com/calling/callConnections/18dea47f-b081-4107-9a5c-4300819d2c6c:startTranscription?api-version=2026-03-12 {} ``` -------------------------------- ### List Communication Service Keys (Go) Source: https://learn.microsoft.com/en-us/rest/api/communication/resourcemanager/communication-service/list-keys This Go code sample shows how to retrieve the access keys for an Azure Communication Service. It uses `azidentity` for authentication and the `armcommunication` package. ```go package armcommunication_test import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/communication/armcommunication" ) // Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/communication/resource-manager/Microsoft.Communication/stable/2020-08-20/examples/listKeys.json func ExampleServiceClient_ListKeys() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() client, err := armcommunication.NewServiceClient("12345", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := client.ListKeys(ctx, "MyResourceGroup", "MyCommunicationResource", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // TODO: use response item _ = res } ``` -------------------------------- ### Sample Request to Get Chat Thread Source: https://learn.microsoft.com/en-us/rest/api/communication/chat/chat-thread/get-chat-thread-properties This is an example of a GET request to retrieve chat thread properties. Replace placeholders with your actual endpoint and chat thread ID. ```http GET https://contoso.westus.communications.azure.com/chat/threads/19:uni01_zbnh3nt2dfuffezc3sox7dog7wfhk6y5qe2rwlnfhlhdzirihdpq@thread.v2?api-version=2025-03-15 ``` -------------------------------- ### Get SmtpUsernameResource Sample Request (HTTP) Source: https://learn.microsoft.com/en-us/rest/api/communication/resourcemanager/smtp-usernames/get?view=rest-communication-resourcemanager-2026-03-18 A sample HTTP GET request demonstrating how to retrieve an SmtpUsername resource. This example uses specific placeholder values for demonstration purposes. ```http GET https://management.azure.com/subscriptions/11112222-3333-4444-5555-666677778888/resourceGroups/contosoResourceGroup/providers/Microsoft.Communication/communicationServices/contosoACSService/smtpUsernames/smtpusername1?api-version=2026-03-18 ``` -------------------------------- ### Start Call Recording Request Source: https://learn.microsoft.com/en-us/rest/api/communication/callautomation/call-recording/start-recording Use this HTTP POST request to start recording a call. Ensure the `recordingStateCallbackUri` is set to receive notifications and configure `externalStorage` for saving recordings. ```HTTP POST https://contoso.communications.azure.com/calling/recordings?api-version=2026-03-12 { "recordingStateCallbackUri": "https://contoso.communications.azure.com/callback", "recordingContentType": null, "recordingChannelType": null, "recordingFormatType": null, "pauseOnStart": true, "externalStorage": { "recordingStorageKind": "azureBlobStorage", "recordingDestinationContainerUrl": "https://contoso.blob.core.windows.net/recordings" }, "callLocator": { "serverCallId": "aHR0cHM6Ly9za3lwZS5uZXQvYXBpL3YyL2NwL3NreXBlLm5ldC9jb252LzFQd3ZKMTcxZFI/aT0wJmU9NzU3NzA4NzU3OQ==", "kind": "serverCallLocator" } } ``` -------------------------------- ### Sample Get Participants Request Source: https://learn.microsoft.com/en-us/rest/api/communication/callautomation/call-connection/get-participants?view=rest-communication-callautomation-2026-03-12 An example of an HTTP GET request to retrieve participants from a specific call connection. This includes the endpoint, call connection ID, and API version. ```http GET https://contoso.communications.azure.com/calling/callConnections/18dea47f-b081-4107-9a5c-4300819d2c6c/participants?api-version=2026-03-12 ``` -------------------------------- ### Sample request to get a list of templates Source: https://learn.microsoft.com/en-us/rest/api/communication/advancedmessaging/template-operations/list-templates This is a sample HTTP GET request to list templates for a specific channel. Replace the placeholder values with your actual resource endpoint and channel ID. ```http GET https://my-resource.communication.azure.com/messages/channels/0f0eb78e-a576-1dfc-b414-0f0756de3338/templates?api-version=2024-08-30 ``` -------------------------------- ### Create or update resource with PublicNetworkAccess Source: https://learn.microsoft.com/en-us/rest/api/communication/resourcemanager/communication-services/create-or-update This example illustrates creating or updating a CommunicationService and configuring public network access. You can set it to 'Enabled', 'Disabled', or 'SecuredByPerimeter' to control network access. ```JSON { "location": "global", "properties": { "publicNetworkAccess": "Enabled" } } ``` -------------------------------- ### Sample Request to Get Chat Image Source: https://learn.microsoft.com/en-us/rest/api/communication/chat/chat-thread/get-chat-image?view=rest-communication-chat-2025-11-15-preview Example of an HTTP GET request to retrieve an image from a chat thread. Ensure you have the correct endpoint, thread ID, image ID, and view type. ```http GET https://contoso.westus.communications.azure.com/chat/threads/19:34adfa4f-cedf-4dc0-ba29-b6d1a69ab345@thread.v2/images/0-eus-d2-fb42e272282ebb6ef76a3aedd1974433/view/original?api-version=2025-11-15-preview ``` -------------------------------- ### Get Sender Username Resource Example Source: https://learn.microsoft.com/en-us/rest/api/communication/resourcemanager/sender-usernames/get?view=rest-communication-resourcemanager-2026-03-18 Demonstrates how to get a valid sender username for a domains resource using the Azure SDK for JavaScript. Ensure you have authenticated and provided the necessary subscription and resource identifiers. ```JavaScript const { CommunicationServiceManagementClient } = require("@azure/arm-communication"); const { DefaultAzureCredential } = require("@azure/identity"); /** * This sample demonstrates how to get a valid sender username for a domains resource. * * @summary get a valid sender username for a domains resource. * x-ms-original-file: 2026-03-18/senderUsernames/get.json */ async function getSenderUsernamesResource() { const credential = new DefaultAzureCredential(); const subscriptionId = "11112222-3333-4444-5555-666677778888"; const client = new CommunicationServiceManagementClient(credential, subscriptionId); const result = await client.senderUsernames.get( "contosoResourceGroup", "contosoEmailService", "contoso.com", "contosoNewsAlerts", ); console.log(result); } ``` -------------------------------- ### Sample response for listing templates Source: https://learn.microsoft.com/en-us/rest/api/communication/advancedmessaging/template-operations/list-templates This is a sample JSON response when successfully retrieving a list of templates. It includes the template details and a `nextLink` for pagination if more results are available. ```json { "value": [ { "name": "sample_shipping_confirmation", "language": "en_US", "status": "approved", "kind": "whatsApp", "content": [ { "type": "BODY", "text": "Your package has been shipped. It will be delivered in {{1}} business days." }, { "type": "FOOTER", "text": "This message is from an unverified business." } ] } ], "nextLink": null } ``` -------------------------------- ### Create or update resource Source: https://learn.microsoft.com/en-us/rest/api/communication/resourcemanager/communication-services/create-or-update?view=rest-communication-resourcemanager-2026-03-18 This example demonstrates the basic structure for creating or updating a CommunicationService resource. Ensure all required fields like location and data location are provided. ```JSON { "location": "global", "properties": { "dataLocation": "United States", "disableLocalAuth": false, "linkedDomains": [], "publicNetworkAccess": "Enabled" } } ``` -------------------------------- ### Sample HTTP Request for Get Search Result Source: https://learn.microsoft.com/en-us/rest/api/communication/phonenumbers/phone-numbers/get-search-result An example of an HTTP GET request to fetch a phone number search result. Ensure you use your actual resource endpoint and a valid search ID. ```http GET https://resourcename.communication.azure.com//availablePhoneNumbers/searchResults/378ddf60-81be-452a-ba4f-613198ea6c28?api-version=2025-06-01 ``` -------------------------------- ### Sample Request to Get Participants with Max Page Size Source: https://learn.microsoft.com/en-us/rest/api/communication/chat/chat-thread/list-chat-participants Example HTTP GET request demonstrating how to fetch chat thread participants with a specified maximum page size. This helps in paginating through the results. ```http GET https://contoso.westus.communications.azure.com/chat/threads/19:f2167429acf6482880c6b7790a9086c1@thread.v2/participants?maxPageSize=2&api-version=2025-03-15 ``` -------------------------------- ### Create Exception Policy Sample Request Source: https://learn.microsoft.com/en-us/rest/api/communication/jobrouter/job-router-administration-operations/upsert-exception-policy?view=rest-communication-jobrouter-2023-11-01 This sample demonstrates how to construct a PATCH request to create a new exception policy named 'Main'. It includes a rule for when the wait time is exceeded, triggering a reclassification action. ```HTTP PATCH https://contoso.westus.communications.azure.com/routing/exceptionPolicies/cf1cda69-6f41-45ac-b252-213293f1b1cb?api-version=2023-11-01 { "name": "Main", "exceptionRules": [ { "id": "MaxWaitTimeExceeded", "actions": [ { "kind": "reclassify", "classificationPolicyId": "Main", "labelsToUpsert": { "escalated": true } } ], "trigger": { "kind": "waitTime", "thresholdSeconds": 20 } } ] } ``` -------------------------------- ### Sample Request for GetDeliveryReport Source: https://learn.microsoft.com/en-us/rest/api/communication/sms/delivery-reports/get An example HTTP GET request to retrieve a delivery report for a message with ID 'abc123-message-id'. ```http GET {endpoint}/deliveryReports/abc123-message-id?api-version=2026-01-23 ``` -------------------------------- ### Create a Queue Response (200 OK) Source: https://learn.microsoft.com/en-us/rest/api/communication/jobrouter/job-router-administration-operations/upsert-queue?view=rest-communication-jobrouter-2023-11-01 This is a sample successful response when a queue is created or updated. It returns the queue details including its ID, name, and associated policies. ```json { "id": "246d5a06-c04a-4b6b-8a34-02bbd9fdad68", "name": "Main", "distributionPolicyId": "MainDistributionPolicy", "labels": {}, "exceptionPolicyId": "MainExceptionPolicy", "etag": "etag" } ```