/// <summary> /// Fetch a specific Interaction. /// </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> /// Fetch a specific Interaction. /// </summary> /// /// <param name="pathServiceSid"> The service_sid </param> /// <param name="pathSessionSid"> The session_sid </param> /// <param name="pathParticipantSid"> The participant_sid </param> /// <param name="body"> The body of the message. Up to 1600 characters long. </param> /// <param name="mediaUrl"> The url of an image or video. </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> /// Fetch a specific Interaction. /// </summary> /// /// <param name="pathServiceSid"> The service_sid </param> /// <param name="pathSessionSid"> The session_sid </param> /// <param name="pathParticipantSid"> The participant_sid </param> /// <param name="body"> The body of the message. Up to 1600 characters long. </param> /// <param name="mediaUrl"> The url of an image or video. </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.Preview, "/Proxy/Services/" + options.PathServiceSid + "/Sessions/" + options.PathSessionSid + "/Participants/" + options.PathParticipantSid + "/MessageInteractions", client.Region, postParams: options.GetParams() )); }
/// <summary> /// Fetch a specific Interaction. /// </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)); }