Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
213 changes: 108 additions & 105 deletions CallfireApiClient.nuspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?><package>
<metadata>
<id>CallfireApiClient</id>
<version>1.1.28</version>
<version>1.1.29</version>
<title>CallFire API v2 client</title>
<authors>
Vladimir Mikhailov
Expand All @@ -13,111 +13,114 @@
<iconUrl>https://www.callfire.com/favicon.ico</iconUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>C# client library for integration with Callfire REST API v2 services</description>
<releaseNotes>
Callfire API client Changelog
=============================
Version 1.1.28 - March 06 2019
- added date interval filtering parameters to broadcasts lookup

Version 1.1.27 - Feb 28 2019
- fixed isssue with Broadcast Status enum

Version 1.1.26 - Jan 17 2019
- updated RestSharp version to 106.6

Version 1.1.24 - Oct 17 2018
- removed potential security vulnerability connected with DotNetZip library

Version 1.1.23 - Sept 26 2018
- added findMedia API operation to sdk

Version 1.1.22 - Sept 04 2018
- updated version of RestSharp client to 106.3.0
- downgraded version of .NET framework to 4.6

Version 1.1.21 - August 10 2018
- added StrongNamer library to sign unsigned assembly in a nuget package

Version 1.1.20 - August 1 2018
- updated .NET framework target version to latest for support TLS 1.2 by default

Version 1.1.19 - Jun 13 2017
- added fromNumber to Recipient object for sending calls/texts
- added strictValidation flag for adding contacts to broadcast
- added useCustomFields to createContactList/addContactListContacts apis
- added media array parameter for TextRecipient
- added a way to upload files from byte array for media and campaign sounds api

Version 1.1.18 - May 29 2017
- upgraded dependencies

Version 1.1.17 - May 4 2017
- removed subscriptions api (not supported from v2 api client)
- fixed findWebhooks api to use enums instead strings
- trivial tests fixes

Version 1.1.16 - Mar 28 2017
- fixed DayOfWeek enum for scheduler

Version 1.1.15 - Jan 27 2017
- added dnc apis

Version 1.1.14 - Jan 17 2017
- added possibility to use client without config file

Version 1.1.13 - Dec 30 2016
- minor fixes for get contacts history api

Version 1.1.12 - Dec 28 2016
- updated CallRecord dto to include originateTime, answerTime, duration, callerName and switchId fields
- updated Webhook dto to include singleUse parameter
- minor extension of requests objects for upload and find sounds api, get contacts history api and find tollfree numbers api
- temporary turning dnc api off due to full remake of callfire dnc apis

Version 1.1.11 - Nov 18 2016
- added deleteCampaignSound api
- added getCreditsHistory api
- remove dnc lists api (not supported anymore)

Version 1.1.10 - Oct 26 2016
- added more parameters to call tracking config in Number Lease config object

Version 1.1.9 - Jul 11 2016
- added loading labels parameter in Number Lease objects

Version 1.1.8 - May 27 2016
- defaultLiveMessage, defaultMachineMessage, defaultLiveMessageSoundId, defaultMachineMessageSoundId, defaultVoice params added to send calls api
- added batch id filter parameter for get broadcast calls/texts
- added fields filter parameter for add sound via call, returns CampaignSound object
- added fields filter parameter for add sound via text-to-speech, returns CampaignSound object
- defaultMessage parameter added to send texts function
- added findWebhookResource and findWebhookResources methods to use new webhooks apis
- resumeNextDay parameter added to CallBroadcast object
- transferMessage, transferMessageSoundId, transferDigit, transferNumber params added to CallRecipient object for sending calls and texts
- added questionResponses parameter to CallRecord object
- added duplicate parameter to CampaignSound object
- get call recordings api functions implemented in CallsApi

Version 1.1.7 - Apr 18 2016
- migration to 4.5 net framework
- migration to gradle

Version 1.1.6 - Mar 25 2016
- added mono debug files generation on Windows platform
- removed get/update batch api calls from TextBroadcastsApi

Version 1.1.5 - Mar 14 2016
- added debug support for Mono platform
- fixed issue with uploading mp3 media

Version 1.1.4 - Mar 4 2016
- added proxy with basic authorization support, see out docs how to configure it.

Version 1.1.3 - Feb 16 2016
- added nuget symbolsource package to debug source code.
<releaseNotes>Callfire API client Changelog
=============================
Version 1.1.29 - May 29 2019
- dependecies upgraded (Nunit to v3)
- added allowedVersions for dependencies

Version 1.1.2 - Jan 27 2016
- added find by batchId parameter to FindCalls &amp; FindTexts requests.
Version 1.1.28 - March 06 2019
- added date interval filtering parameters to broadcasts lookup

Version 1.1.27 - Feb 28 2019
- fixed isssue with Broadcast Status enum

Version 1.1.26 - Jan 17 2019
- updated RestSharp version to 106.6

Version 1.1.24 - Oct 17 2018
- removed potential security vulnerability connected with DotNetZip library

Version 1.1.23 - Sept 26 2018
- added findMedia API operation to sdk

Version 1.1.22 - Sept 04 2018
- updated version of RestSharp client to 106.3.0
- downgraded version of .NET framework to 4.6

Version 1.1.21 - August 10 2018
- added StrongNamer library to sign unsigned assembly in a nuget package

Version 1.1.20 - August 1 2018
- updated .NET framework target version to latest for support TLS 1.2 by default

Version 1.1.19 - Jun 13 2017
- added fromNumber to Recipient object for sending calls/texts
- added strictValidation flag for adding contacts to broadcast
- added useCustomFields to createContactList/addContactListContacts apis
- added media array parameter for TextRecipient
- added a way to upload files from byte array for media and campaign sounds api

Version 1.1.18 - May 29 2017
- upgraded dependencies

Version 1.1.17 - May 4 2017
- removed subscriptions api (not supported from v2 api client)
- fixed findWebhooks api to use enums instead strings
- trivial tests fixes

Version 1.1.16 - Mar 28 2017
- fixed DayOfWeek enum for scheduler

Version 1.1.15 - Jan 27 2017
- added dnc apis

Version 1.1.14 - Jan 17 2017
- added possibility to use client without config file

Version 1.1.13 - Dec 30 2016
- minor fixes for get contacts history api

Version 1.1.12 - Dec 28 2016
- updated CallRecord dto to include originateTime, answerTime, duration, callerName and switchId fields
- updated Webhook dto to include singleUse parameter
- minor extension of requests objects for upload and find sounds api, get contacts history api and find tollfree numbers api
- temporary turning dnc api off due to full remake of callfire dnc apis

Version 1.1.11 - Nov 18 2016
- added deleteCampaignSound api
- added getCreditsHistory api
- remove dnc lists api (not supported anymore)

Version 1.1.10 - Oct 26 2016
- added more parameters to call tracking config in Number Lease config object

Version 1.1.9 - Jul 11 2016
- added loading labels parameter in Number Lease objects

Version 1.1.8 - May 27 2016
- defaultLiveMessage, defaultMachineMessage, defaultLiveMessageSoundId, defaultMachineMessageSoundId, defaultVoice params added to send calls api
- added batch id filter parameter for get broadcast calls/texts
- added fields filter parameter for add sound via call, returns CampaignSound object
- added fields filter parameter for add sound via text-to-speech, returns CampaignSound object
- defaultMessage parameter added to send texts function
- added findWebhookResource and findWebhookResources methods to use new webhooks apis
- resumeNextDay parameter added to CallBroadcast object
- transferMessage, transferMessageSoundId, transferDigit, transferNumber params added to CallRecipient object for sending calls and texts
- added questionResponses parameter to CallRecord object
- added duplicate parameter to CampaignSound object
- get call recordings api functions implemented in CallsApi

Version 1.1.7 - Apr 18 2016
- migration to 4.5 net framework
- migration to gradle

Version 1.1.6 - Mar 25 2016
- added mono debug files generation on Windows platform
- removed get/update batch api calls from TextBroadcastsApi

Version 1.1.5 - Mar 14 2016
- added debug support for Mono platform
- fixed issue with uploading mp3 media

Version 1.1.4 - Mar 4 2016
- added proxy with basic authorization support, see out docs how to configure it.

Version 1.1.3 - Feb 16 2016
- added nuget symbolsource package to debug source code.

Version 1.1.2 - Jan 27 2016
- added find by batchId parameter to FindCalls &amp; FindTexts requests.
- fixed NumberApi.findNumbersLocal and NumberApi.findNumbersTollfree methods to accept an updated server responses

Version 1.1.1 - Jan 25 2016
Expand Down
4 changes: 4 additions & 0 deletions Changelog.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
Callfire API client Changelog
=============================
Version 1.1.29 - May 29 2019
- dependecies upgraded (Nunit to v3)
- added allowedVersions for dependencies

Version 1.1.28 - March 06 2019
- added date interval filtering parameters to broadcasts lookup

Expand Down
4 changes: 2 additions & 2 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ C# client for Callfire platform API version 2. See link:https://developers.callf
* .NET 4.6+

.*Dependencies:*
* Newtonsoft.Json >= 7.0.1
* RestSharp >= 106.4.2
* Newtonsoft.Json >= 12.0.2
* RestSharp = 106.6.4 (RestSharp have a bug with serialization to camelCase json string, wait for fix https://github.com/restsharp/RestSharp/issues/1251 before upgrade to newer)

.*Table of contents*
* link:https://developers.callfire.com/callfire-api-client-csharp.html[Getting Started]
Expand Down
3 changes: 3 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ plugins {
}

archivesBaseName = 'callfire-api-client'
ext['nunitConsoleVersion'] = '3.6.1'
ext['buildReleaseConfiguration'] = "CallfireApiClient"
ext['buildReleaseConfiguration'] = "Release"
ext['buildDebugConfiguration'] = "Debug"
Expand Down Expand Up @@ -45,6 +46,7 @@ task msbuildDebug (type: com.ullink.Msbuild) {
msbuildDebug.dependsOn nunit

nunit {
nunitVersion = nunitConsoleVersion
testAssemblies = [ msbuild.projects['CallfireApiClient.Tests'].properties.TargetPath ]
}
nunit.dependsOn msbuild
Expand Down Expand Up @@ -162,6 +164,7 @@ task msbuildForIntegrationTests (type: com.ullink.Msbuild) {
msbuildForIntegrationTests.dependsOn prepareTestData

task integrationTests (type: com.ullink.gradle.nunit.NUnit) {
nunitVersion = nunitConsoleVersion
testAssemblies = [ msbuild.projects['CallfireApiClient.IntegrationTests'].properties.TargetPath ]
}
integrationTests.dependsOn msbuildForIntegrationTests
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System;
using NUnit.Framework;
using System;
using System.Configuration;

using System.IO;

namespace CallfireApiClient.IntegrationTests.Api
{
Expand Down Expand Up @@ -38,6 +39,11 @@ private void ReadAllSettings()
Console.WriteLine("Error reading app settings");
}
}

public static string GetFullPath(string path)
{
return Directory.GetParent(TestContext.CurrentContext.TestDirectory).Parent.FullName + path;
}
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public void GetCallRecording()
[Test]
public void GetCallRecordingInMp3Format()
{
string mp3FilePath = "Resources/File-examples/testDownloadRecordingById.mp3";
string mp3FilePath = GetFullPath("/Resources/File-examples/testDownloadRecordingById.mp3");
MemoryStream ms = (MemoryStream)Client.CallsApi.GetCallRecordingMp3(64837518003);
File.WriteAllBytes(mp3FilePath, ms.ToArray());
}
Expand Down Expand Up @@ -139,7 +139,7 @@ public void GetCallRecordingByName()
public void CallRecordingMp3ByName()
{
CallRecording rec = Client.CallsApi.GetCallRecording(18666772003);
string mp3FilePath = "Resources/File-examples/testDownloadRecordingByName.mp3";
string mp3FilePath = GetFullPath("/Resources/File-examples/testDownloadRecordingByName.mp3");
MemoryStream ms = (MemoryStream)Client.CallsApi.GetCallRecordingMp3ByName((long) rec.CallId, rec.Name);
File.WriteAllBytes(mp3FilePath, ms.ToArray());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ namespace CallfireApiClient.IntegrationTests.Api.CallsTexts
[TestFixture]
public class MediaApiIntegrationTest : AbstractIntegrationTest
{
private const string mp3FilePath = "Resources/File-examples/train1.mp3";
private const string wavFilePath = "Resources/File-examples/train1.wav";
private const string cfLogoFilePath = "Resources/File-examples/cf.png";
private const string ezLogoFilePath = "Resources/File-examples/ez.png";
private string mp3FilePath = GetFullPath("/Resources/File-examples/train1.mp3");
private string wavFilePath = GetFullPath("/Resources/File-examples/train1.wav");
private string cfLogoFilePath = GetFullPath("/Resources/File-examples/cf.png");
private string ezLogoFilePath = GetFullPath("/Resources/File-examples/ez.png");

[Test]
public void TestFind()
Expand Down Expand Up @@ -49,9 +49,10 @@ public void TestUpload()
[Test]
public void TestUploadWithFileData()
{
String soundName = "mp3_test_" + DateTime.Now.Millisecond.ToString();
ResourceId wavResourceId = Client.MediaApi.Upload(File.ReadAllBytes(wavFilePath), MediaType.WAV);
ResourceId mp3ResourceId = Client.MediaApi.Upload(File.ReadAllBytes(mp3FilePath), MediaType.MP3, soundName);
string mp3Name = "mp3_test_" + DateTime.Now.Millisecond.ToString();
string wavName = "wav_test_" + DateTime.Now.Millisecond.ToString();
ResourceId wavResourceId = Client.MediaApi.Upload(File.ReadAllBytes(wavFilePath), MediaType.WAV, wavName);
ResourceId mp3ResourceId = Client.MediaApi.Upload(File.ReadAllBytes(mp3FilePath), MediaType.MP3, mp3Name);
Assert.NotNull(mp3ResourceId.Id);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public void TestFind()
public void TestUploadSoundAndDeleteIt()
{
String soundName = "mp3_test_" + DateTime.Now.ToString();
string mp3FilePath = "Resources/File-examples/train1.mp3";
string mp3FilePath = GetFullPath("/Resources/File-examples/train1.mp3");
CampaignSound campaignSound = Client.CampaignSoundsApi.UploadAndGetSoundDetails(mp3FilePath, soundName);
Assert.NotNull(campaignSound.Id);

Expand All @@ -52,7 +52,7 @@ public void TestUploadSoundAndDeleteIt()
public void TestUploadSoundWithFileDataAndDeleteIt()
{
String soundName = "mp3_test_" + DateTime.Now.ToString();
string mp3FilePath = "Resources/File-examples/train1.mp3";
string mp3FilePath = GetFullPath("/Resources/File-examples/train1.mp3");
CampaignSound campaignSound = Client.CampaignSoundsApi.UploadAndGetSoundDetails(File.ReadAllBytes(mp3FilePath), soundName);
Assert.NotNull(campaignSound.Id);

Expand Down Expand Up @@ -88,8 +88,8 @@ public void TestUploadMp3WavFilesAndGetThem()
{
String soundName = "mp3_test_" + DateTime.Now.ToString();

string mp3FilePath = "Resources/File-examples/train1.mp3";
string wavFilePath = "Resources/File-examples/train1.wav";
string mp3FilePath = GetFullPath("/Resources/File-examples/train1.mp3");
string wavFilePath = GetFullPath("/Resources/File-examples/train1.wav");
ResourceId mp3ResourceId = Client.CampaignSoundsApi.Upload(mp3FilePath, soundName);
ResourceId wavResourceId = Client.CampaignSoundsApi.Upload(wavFilePath);

Expand All @@ -105,13 +105,13 @@ public void TestUploadMp3WavFilesAndGetThem()

// get mp3
MemoryStream ms = (MemoryStream)Client.CampaignSoundsApi.GetMp3(mp3ResourceId.Id);
string existingFilePath = Path.GetFullPath("Resources/File-examples/train1.mp3");
string existingFilePath = GetFullPath("/Resources/File-examples/train1.mp3");
string pathToSaveNewFile = existingFilePath.Replace("train.mp3", "mp3_sound.mp3");
File.WriteAllBytes(pathToSaveNewFile, ms.ToArray());

// get wav
ms = (MemoryStream)Client.CampaignSoundsApi.GetWav(wavResourceId.Id);
existingFilePath = Path.GetFullPath("Resources/File-examples/train1.wav");
existingFilePath = GetFullPath("/Resources/File-examples/train1.wav");
pathToSaveNewFile = existingFilePath.Replace("train.wav", "wav_sound.wav");
File.WriteAllBytes(pathToSaveNewFile, ms.ToArray());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ public void AddRecipientsAndAddRemoveBatches()
var texts = Client.TextBroadcastsApi.AddRecipients((long)id, recipients, null, true);
Console.WriteLine(texts);
Assert.AreEqual(2, texts.Count);
Assert.That(texts[0].Message, Is.StringStarting("test_msg"));
Assert.That(texts[0].Message, Does.StartWith("test_msg"));

// get batches
var getBatchesRequest = new GetByIdRequest { Id = id };
Expand Down
Loading