/// <summary> /// Make a phone call Make a phone call. See Calls for more details and how to setup caller id's. Note: This API is for users with Account Owner scope access token. Users with Extension User scope token should invoke the Calls API with the following definition: POST https://api.phone.com/v4/accounts/:account_id/extensions/:extension_id/calls /// </summary> /// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception> /// <param name="accountId">Account ID</param> /// <param name="data">Call data (optional)</param> /// <returns>Task of CallFull</returns> public async System.Threading.Tasks.Task <CallFull> CreateAccountCallAsync(int?accountId, CreateCallParams data = null) { ApiResponse <CallFull> localVarResponse = await CreateAccountCallAsyncWithHttpInfo(accountId, data); return(localVarResponse.Data); }
/// <summary> /// Make a phone call Make a phone call. See Calls for more details and how to setup caller id's. Note: This API is for users with Account Owner scope access token. Users with Extension User scope token should invoke the Calls API with the following definition: POST https://api.phone.com/v4/accounts/:account_id/extensions/:extension_id/calls /// </summary> /// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception> /// <param name="accountId">Account ID</param> /// <param name="data">Call data (optional)</param> /// <returns>Task of ApiResponse (CallFull)</returns> public async System.Threading.Tasks.Task <ApiResponse <CallFull> > CreateAccountCallAsyncWithHttpInfo(int?accountId, CreateCallParams data = null) { // verify the required parameter 'accountId' is set if (accountId == null) { throw new ApiException(400, "Missing required parameter 'accountId' when calling CallsApi->CreateAccountCall"); } var localVarPath = "/accounts/{account_id}/calls"; var localVarPathParams = new Dictionary <String, String>(); var localVarQueryParams = new Dictionary <String, String>(); var localVarHeaderParams = new Dictionary <String, String>(Configuration.DefaultHeader); var localVarFormParams = new Dictionary <String, String>(); var localVarFileParams = new Dictionary <String, FileParameter>(); Object localVarPostBody = null; // to determine the Content-Type header String[] localVarHttpContentTypes = new String[] { "application/json" }; String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null) { localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); } if (accountId != null) { localVarPathParams.Add("account_id", Configuration.ApiClient.ParameterToString(accountId)); // path parameter } if (data != null && data.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(data); // http body (model) parameter } else { localVarPostBody = data; // byte array } // authentication (apiKey) required if (!String.IsNullOrEmpty(Configuration.GetApiKeyWithPrefix("Authorization"))) { localVarHeaderParams["Authorization"] = Configuration.GetApiKeyWithPrefix("Authorization"); } // make the HTTP request IRestResponse localVarResponse = (IRestResponse)await Configuration.ApiClient.CallApiAsync(localVarPath, Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType); int localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { Exception exception = ExceptionFactory("CreateAccountCall", localVarResponse); if (exception != null) { throw exception; } } return(new ApiResponse <CallFull>(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), (CallFull)Configuration.ApiClient.Deserialize(localVarResponse, typeof(CallFull)))); }
/// <summary> /// Make a phone call Make a phone call. See Calls for more details and how to setup caller id's. Note: This API is for users with Account Owner scope access token. Users with Extension User scope token should invoke the Calls API with the following definition: POST https://api.phone.com/v4/accounts/:account_id/extensions/:extension_id/calls /// </summary> /// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception> /// <param name="accountId">Account ID</param> /// <param name="data">Call data (optional)</param> /// <returns>CallFull</returns> public CallFull CreateAccountCall(int?accountId, CreateCallParams data = null) { ApiResponse <CallFull> localVarResponse = CreateAccountCallWithHttpInfo(accountId, data); return(localVarResponse.Data); }