Hi Guys,
I'm using the RestClient to set up a subscription for a WebHook, but I'm just getting a 400 Bad Request exception when call the method to create the subscription. The url I'm using is valid (I've replaced it with a placeholder in the following code for obvious reasons)
Working with a dev sandbox account. Can successfully get an access token and extension list
too so I know that part's working fine.
The iis logs of the WebHook location show it's never hit as part of this process either.
If anyone has any suggestions I'd love to hear them - Thanks ... here's the code ...
GetExtensionListResponse extensionList = await rc.Restapi().Account().Extension().List();
List<string> eventFilters = new List<string>();
foreach (GetExtensionInfoResponse infoResponse in extensionList.records)
{
eventFilters.Add($"/restapi/v1.0/account/~/extension/{infoResponse.id}/incoming-call-pickup");
Console.WriteLine($"Extension number / ID : {infoResponse.extensionNumber} / {infoResponse.id}");
}
try
{
SubscriptionInfo subscriptionInfo = await rc.Restapi().Subscription().Post(new CreateSubscriptionRequest()
{
eventFilters = eventFilters.ToArray(),
deliveryMode = new NotificationDeliveryModeRequest()
{
transportType = "WebHook",