/// <summary> /// Create a new Message to a Participant /// </summary> /// /// <param name="options"> Create MessageInteraction parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> A single instance of MessageInteraction </returns> public static MessageInteractionResource Create(CreateMessageInteractionOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = client.Request(BuildCreateRequest(options, client)); return(FromJson(response.Content)); }
/// <summary> /// Create a new Message to a Participant /// </summary> /// /// <param name="pathServiceSid"> Service Sid. </param> /// <param name="pathSessionSid"> Session Sid. </param> /// <param name="pathParticipantSid"> Participant Sid. </param> /// <param name="body"> The body </param> /// <param name="mediaUrl"> The media_url </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> Task that resolves to A single instance of MessageInteraction </returns> public static async System.Threading.Tasks.Task <MessageInteractionResource> CreateAsync(string pathServiceSid, string pathSessionSid, string pathParticipantSid, string body = null, List <Uri> mediaUrl = null, ITwilioRestClient client = null) { var options = new CreateMessageInteractionOptions(pathServiceSid, pathSessionSid, pathParticipantSid) { Body = body, MediaUrl = mediaUrl }; return(await CreateAsync(options, client)); }
/// <summary> /// Create a new Message to a Participant /// </summary> /// /// <param name="pathServiceSid"> Service Sid. </param> /// <param name="pathSessionSid"> Session Sid. </param> /// <param name="pathParticipantSid"> Participant Sid. </param> /// <param name="body"> The body </param> /// <param name="mediaUrl"> The media_url </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> A single instance of MessageInteraction </returns> public static MessageInteractionResource Create(string pathServiceSid, string pathSessionSid, string pathParticipantSid, string body = null, List <Uri> mediaUrl = null, ITwilioRestClient client = null) { var options = new CreateMessageInteractionOptions(pathServiceSid, pathSessionSid, pathParticipantSid) { Body = body, MediaUrl = mediaUrl }; return(Create(options, client)); }
private static Request BuildCreateRequest(CreateMessageInteractionOptions options, ITwilioRestClient client) { return(new Request( HttpMethod.Post, Rest.Domain.Proxy, "/v1/Services/" + options.PathServiceSid + "/Sessions/" + options.PathSessionSid + "/Participants/" + options.PathParticipantSid + "/MessageInteractions", postParams: options.GetParams() )); }
/// <summary> /// Create a new Message to a Participant /// </summary> /// /// <param name="options"> Create MessageInteraction parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> Task that resolves to A single instance of MessageInteraction </returns> public static async System.Threading.Tasks.Task <MessageInteractionResource> CreateAsync(CreateMessageInteractionOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client)); return(FromJson(response.Content)); }