Beispiel #1
0
        /// <summary>
        /// Brands a Call without actually placing it. Useful for cases when the Customer wants to initiate the call themselves
        /// right after calling this endpoint. This can be used also through a TwiML using `<Brand callerId="+1500123"
        /// callReason="This is the call reason" callSid="CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa">+1500456</Brand>`, and right after
        /// doing `<Dial callerId="+1500123">+1500456</Dial>`
        /// </summary>
        /// <param name="options"> Create BrandedCall parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of BrandedCall </returns>
        public static BrandedCallResource Create(CreateBrandedCallOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildCreateRequest(options, client));

            return(FromJson(response.Content));
        }
 private static Request BuildCreateRequest(CreateBrandedCallOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Post,
                Rest.Domain.Preview,
                "/TrustedComms/Business/BrandedCalls",
                postParams: options.GetParams()
                ));
 }
        /// <summary>
        /// Brands a Call without actually placing it. Useful for cases when the Customer wants to initiate the call themselves
        /// right after calling this endpoint. This can be used also through a TwiML using `<Brand callerId="+1500123"
        /// callReason="This is the call reason">+1500456</Brand>`, and right after doing `<Dial
        /// callerId="+1500123">+1500456</Dial>`
        /// </summary>
        /// <param name="from"> Twilio number from which to brand the call </param>
        /// <param name="to"> The terminating Phone Number </param>
        /// <param name="reason"> The business reason for this phone call </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of BrandedCall </returns>
        public static async System.Threading.Tasks.Task <BrandedCallResource> CreateAsync(string from,
                                                                                          string to,
                                                                                          string reason,
                                                                                          ITwilioRestClient client = null)
        {
            var options = new CreateBrandedCallOptions(from, to, reason);

            return(await CreateAsync(options, client));
        }
Beispiel #4
0
        /// <summary>
        /// Brands a Call without actually placing it. Useful for cases when the Customer wants to initiate the call themselves
        /// right after calling this endpoint. This can be used also through a TwiML using `<Brand callerId="+1500123"
        /// callReason="This is the call reason" callSid="CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa">+1500456</Brand>`, and right after
        /// doing `<Dial callerId="+1500123">+1500456</Dial>`
        /// </summary>
        /// <param name="from"> Twilio number from which to brand the call </param>
        /// <param name="to"> The terminating Phone Number </param>
        /// <param name="reason"> The business reason for this phone call </param>
        /// <param name="callSid"> The Call sid this Branded Call should link to </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of BrandedCall </returns>
        public static BrandedCallResource Create(string from,
                                                 string to,
                                                 string reason,
                                                 string callSid           = null,
                                                 ITwilioRestClient client = null)
        {
            var options = new CreateBrandedCallOptions(from, to, reason)
            {
                CallSid = callSid
            };

            return(Create(options, client));
        }
Beispiel #5
0
        /// <summary>
        /// Brands a Call without actually placing it. Useful for cases when the Customer wants to initiate the call themselves
        /// right after calling this endpoint. This can be used also through a TwiML using `<Brand callerId="+1500123"
        /// callReason="This is the call reason" callSid="CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa">+1500456</Brand>`, and right after
        /// doing `<Dial callerId="+1500123">+1500456</Dial>`
        /// </summary>
        /// <param name="options"> Create BrandedCall parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of BrandedCall </returns>
        public static async System.Threading.Tasks.Task <BrandedCallResource> CreateAsync(CreateBrandedCallOptions options,
                                                                                          ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildCreateRequest(options, client));

            return(FromJson(response.Content));
        }