public void FindCalls() { string expectedJson = GetJsonPayload("/callstexts/callsApi/response/findCalls.json"); var restRequest = MockRestResponse(expectedJson); var request = new FindCallsRequest { States = new List <StateType> { StateType.CALLBACK, StateType.DISABLED }, Id = new List <long> { 1, 2, 3 }, Limit = 5, Offset = 0, BatchId = 1001 }; Page <Call> calls = Client.CallsApi.Find(request); Assert.That(Serializer.Serialize(calls), Is.EqualTo(expectedJson)); Assert.AreEqual(Method.GET, restRequest.Value.Method); Assert.That(restRequest.Value.Parameters, Has.Some.Matches <Parameter>(p => p.Name.Equals("limit") && p.Value.Equals("5"))); Assert.That(restRequest.Value.Parameters, Has.Some.Matches <Parameter>(p => p.Name.Equals("offset") && p.Value.Equals("0"))); Assert.That(restRequest.Value.Parameters, Has.Some.Matches <Parameter>(p => p.Name.Equals("batchId") && p.Value.Equals("1001"))); Assert.That(restRequest.Value.Parameters, Has.Some.Matches <Parameter>(p => p.Name.Equals("id") && p.Value.Equals("1"))); Assert.That(restRequest.Value.Parameters, Has.Some.Matches <Parameter>(p => p.Name.Equals("id") && p.Value.Equals("2"))); Assert.That(restRequest.Value.Parameters, Has.Some.Matches <Parameter>(p => p.Name.Equals("id") && p.Value.Equals("3"))); Assert.That(restRequest.Value.Parameters, Has.Some.Matches <Parameter>(p => p.Name.Equals("states") && p.Value.Equals("CALLBACK"))); Assert.That(restRequest.Value.Parameters, Has.Some.Matches <Parameter>(p => p.Name.Equals("states") && p.Value.Equals("DISABLED"))); }
public static void Main(string[] args) { var client = new CallfireClient("api_login", "api_password"); var request = new FindCallsRequest { Id = new List <long> { 11646003, 12646003, 13776003 }, CampaignId = 449060003, BatchId = 447060003, FromNumber = "12135551126", ToNumber = "12136666123", Label = "my label", States = new List <StateType> { StateType.FINISHED, StateType.READY, StateType.INVALID }, Results = new List <Call.CallResult> { Call.CallResult.LA }, Inbound = true, IntervalBegin = new DateTime(2016, 9, 13, 15, 50, 17), IntervalEnd = new DateTime(2016, 9, 13, 15, 50, 17), Offset = 0, Limit = 10, Fields = "items(id,fromNumber,toNumber,modified,finalCallResult)" }; Page <Call> calls = client.CallsApi.Find(request); // check Call.records.questionResponses for stored data }
public void FindCalls() { var request = new FindCallsRequest { IntervalBegin = DateTime.UtcNow.AddMonths(-10), IntervalEnd = DateTime.UtcNow, Limit = 1 }; Page <Call> calls = Client.CallsApi.Find(request); Console.WriteLine("Calls: " + calls); Assert.AreEqual(1, calls.Items.Count); }
public static void Main(string[] args) { var client = new CallfireClient("api_login", "api_password"); var request = new FindCallsRequest { CampaignId = 10, Label = "reminders", IntervalBegin = new DateTime(2015, 11, 30, 22, 0, 0), IntervalEnd = new DateTime(2016, 12, 09, 22, 0, 0), Limit = 10 }; Page <Call> calls = client.CallsApi.Find(request); // check Call.records.questionResponses for stored data }
public void FindCalls() { var request = new FindCallsRequest { States = { StateType.FINISHED, StateType.READY }, IntervalBegin = DateTime.UtcNow.AddMonths(-2), IntervalEnd = DateTime.UtcNow, Limit = 3 }; Page <Call> calls = Client.CallsApi.Find(request); Console.WriteLine("Calls: " + calls); Assert.AreEqual(3, calls.Items.Count); }
/// <summary> /// Finds all calls sent or received by the user, filtered by different properties, broadcast id, /// toNumber, fromNumber, label, state, etc.Use "campaignId=0" parameter to query /// for all calls sent through the POST /calls API {@link CallsApi#send(List)}. /// </summary> /// <param name="request">request object with different fields to filter</param> /// <returns>paged list with call objects</returns> /// <exception cref="BadRequestException"> in case HTTP response code is 400 - Bad request, the request was formatted improperly.</exception> /// <exception cref="UnauthorizedException"> in case HTTP response code is 401 - Unauthorized, API Key missing or invalid.</exception> /// <exception cref="AccessForbiddenException"> in case HTTP response code is 403 - Forbidden, insufficient permissions.</exception> /// <exception cref="ResourceNotFoundException"> in case HTTP response code is 404 - NOT FOUND, the resource requested does not exist.</exception> /// <exception cref="InternalServerErrorException"> in case HTTP response code is 500 - Internal Server Error.</exception> /// <exception cref="CallfireApiException"> in case HTTP response code is something different from codes listed above.</exception> /// <exception cref="CallfireClientException"> in case error has occurred in client.</exception> public Page <Call> Find(FindCallsRequest request) { return(Client.Get <Page <Call> >(CALLS_PATH, request)); }