Exemple #1
0
        /// <summary>
        /// Start subscribing to delivery status notifications over OneAPI for all your sent SMS </summary>
        /// <param name="subscribeToDeliveryNotificationsRequest"> (mandatory) contains delivery notifications subscription data </param>
        /// <returns> string - Subscription Id  </returns>
        public string SubscribeToDeliveryStatusNotifications(SubscribeToDeliveryNotificationsRequest subscribeToDeliveryNotificationsRequest)
        {
            StringBuilder urlBuilder = (new StringBuilder(SMS_MESSAGING_OUTBOUND_URL_BASE)).Append("/");

            if (null != subscribeToDeliveryNotificationsRequest.SenderAddress)
            {
                urlBuilder.Append(HttpUtility.UrlEncode(subscribeToDeliveryNotificationsRequest.SenderAddress)).Append("/");
            }
            urlBuilder.Append("subscriptions");

            RequestData requestData = new RequestData(urlBuilder.ToString(), Method.POST, "deliveryReceiptSubscription", subscribeToDeliveryNotificationsRequest);
            DeliveryReceiptSubscription reliveryReceiptSubscription = ExecuteMethod <DeliveryReceiptSubscription>(requestData);

            return(GetIdFromResourceUrl(reliveryReceiptSubscription.ResourceURL));
        }
        /// <summary>
        /// Start subscribing to delivery status notifications over OneAPI for all your sent SMS </summary>
        /// <param name="subscribeToDeliveryNotificationsRequest"> (mandatory) contains delivery notifications subscription data </param>
        /// <returns> string - Subscription Id  </returns>
        public string SubscribeToDeliveryStatusNotifications(SubscribeToDeliveryNotificationsRequest subscribeToDeliveryNotificationsRequest)
        {
            StringBuilder urlBuilder = (new StringBuilder(SMS_MESSAGING_OUTBOUND_URL_BASE)).Append("/");

            if (null != subscribeToDeliveryNotificationsRequest.SenderAddress)
            {
                urlBuilder.Append(HttpUtility.UrlEncode(subscribeToDeliveryNotificationsRequest.SenderAddress)).Append("/");
            }
            urlBuilder.Append("subscriptions");

            RequestData requestData = new RequestData(urlBuilder.ToString(), Method.POST, "deliveryReceiptSubscription", subscribeToDeliveryNotificationsRequest);
            DeliveryReceiptSubscription reliveryReceiptSubscription = ExecuteMethod<DeliveryReceiptSubscription>(requestData);
            return GetIdFromResourceUrl(reliveryReceiptSubscription.ResourceURL);
        }