/// <summary>
 /// PUT /v1/calls/{uuid}/talk - send a synthesized speech message to an active Call
 /// </summary>
 /// <param name="id">id of call</param>
 /// <param name="cmd">Command to execute against call</param>
 /// <param name="creds">(Optional) Overridden credentials for only this request</param>
 /// <exception cref="NexmoHttpRequestException">thrown if an error is encountered when talking to the API</exception>
 public CallCommandResponse StartTalk(string id, TalkCommand cmd, Credentials creds = null)
 {
     return(ApiRequest.DoRequestWithJsonContent <CallCommandResponse>(
                PUT,
                ApiRequest.GetBaseUri(ApiRequest.UriType.Api, $"{CALLS_ENDPOINT}/{id}/talk"),
                cmd,
                ApiRequest.AuthType.Bearer,
                creds ?? Credentials
                ));
 }
Esempio n. 2
0
 /// <summary>
 /// PUT /v1/calls/{uuid}/talk - send a synthesized speech message to an active Call
 /// </summary>
 /// <param name="id">id of call</param>
 /// <param name="cmd">Command to execute against call</param>
 /// <param name="creds">(Optional) Overridden credentials for only this request</param>
 public static CallCommandResponse BeginTalk(string id, TalkCommand cmd, Credentials creds = null)
 {
     return(ApiRequest.DoRequestWithJsonContent <CallCommandResponse>("PUT", ApiRequest.GetBaseUriFor(typeof(Call), $"/v1/calls/{id}/talk"), cmd, ApiRequest.AuthType.Bearer, creds));
 }
Esempio n. 3
0
        /// <summary>
        /// PUT /v1/calls/{uuid}/talk - send a synthesized speech message to an active Call
        /// </summary>
        public static CallCommandResponse BeginTalk(string id, TalkCommand cmd)
        {
            var response = VersionedApiRequest.DoRequest("PUT", ApiRequest.GetBaseUriFor(typeof(Call), $"/v1/calls/{id}/talk"), cmd);

            return(JsonConvert.DeserializeObject <CallCommandResponse>(response.JsonResponse));
        }