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
19 changes: 17 additions & 2 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.7</version>
<version>1.1.8</version>
<title>CallFire API v2 client</title>
<authors>
Vladimir Mikhailov
Expand All @@ -15,9 +15,22 @@
<description>C# client library for integration with Callfire REST API v2 services</description>
<releaseNotes>Callfire API client Changelog
=============================
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
- migration to gradle

Version 1.1.6 - Mar 25 2016
- added mono debug files generation on Windows platform
Expand Down Expand Up @@ -60,5 +73,7 @@ Version 1.0.0 - Dec 29 2015
<file src="src/CallfireApiClient/bin/Debug/callfire-api-client.dll" target="lib"/>
<file src="src/CallfireApiClient/bin/Release/callfire-api-client.dll.config" target="lib"/>
<file src="src/CallfireApiClient/bin/Release/callfire-api-client.xml" target="lib"/>
<file src="src/CallfireApiClient/bin/Debug/callfire-api-client.pdb" target="lib"/>
<file src="src/CallfireApiClient/bin/Debug/callfire-api-client.dll.mdb" target="lib"/>
</files>
</package>
15 changes: 14 additions & 1 deletion Changelog.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,21 @@
Callfire API client Changelog
=============================
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
- migration to gradle

Version 1.1.6 - Mar 25 2016
- added mono debug files generation on Windows platform
Expand Down
80 changes: 78 additions & 2 deletions docs/api/callstexts/CallsApi.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,15 @@ Example how to use the /calls API to quickly send individual calls via default c
[source,csharp]
CallfireClient Client = new CallfireClient("api_login", "api_password");
//Only "recipients" param required
var recipient1 = new CallRecipient { ContactId = 463633187003, LiveMessage = "testMessage" };
var recipient2 = new CallRecipient { ContactId = 463633187003, LiveMessage = "testMessage" };
var recipient1 = new CallRecipient { ContactId = 463633187003, LiveMessage = "testMessage", TransferDigit = "1", TransferMessage = "transferTestMessage", TransferNumber = "14246525473" };
var recipient2 = new CallRecipient { ContactId = 463633187003, LiveMessage = "testMessage", TransferDigit = "1", TransferMessageSoundId = 1, TransferNumber = "14246525473" };
r1.setTransferMessage("transferTestMessage");
//or you can use transfer sound id
r1.setTransferMessageSoundId(1123123L);
r1.setTransferNumber("14246525473");
r1.setTransferDigit("1");


var recipients = new List<CallRecipient> { recipient1, recipient2 };
IList<Call> calls = Client.CallsApi.Send(recipients, null, "items(id,fromNumber,state)");
Console.WriteLine("Calls: " + calls);
Expand All @@ -42,6 +49,35 @@ In case you want to send call via existing campaign provide campaign id as secon
IList<Call> calls = Client.CallsApi.Send(recipients, 60000000003);
Console.WriteLine("Calls: " + calls);

Also you can send call with some default parameters which will be used in case when recipient doesn't have that info specified,
see example below:
[source,csharp]
CallfireClient Client = new CallfireClient("api_login", "api_password");
//Only "recipients" param required
var recipient1 = new CallRecipient { ContactId = 463633187003, LiveMessage = "testMessage" };
var recipient2 = new CallRecipient { ContactId = 463633187003, LiveMessage = "testMessage" };
var recipients = new List<CallRecipient> { recipient1, recipient2 };
var request = new SendCallsRequest
{
Recipients = recipients,
CampaignId = 7373471003,
Fields = "items(id, fromNumber, state, campaignId)",
DefaultLiveMessage = "DefaultLiveMessage",
DefaultMachineMessage = "DefaultMachineMessage",
DefaultVoice = CallfireApiClient.Api.Campaigns.Model.Voice.FRENCHCANADIAN1
};
IList<Call> calls = Client.CallsApi.Send(request);
request = new SendCallsRequest
{
Recipients = recipients,
CampaignId = 7373471003,
Fields = "items(id, fromNumber, state, campaignId)",
DefaultLiveMessageSoundId = 1,
DefaultMachineMessageSoundId = 1,
DefaultVoice = CallfireApiClient.Api.Campaigns.Model.Voice.FRENCHCANADIAN1
};
calls = Client.CallsApi.Send(request);

=== Get call
'''
Example how to return a single Call instance for a given call id.
Expand All @@ -50,3 +86,43 @@ Example how to return a single Call instance for a given call id.
CallfireClient Client = new CallfireClient("api_login", "api_password");
Call call = Client.CallsApi.Get(617067920003, "id,toNumber,state");
Console.WriteLine("Call: " + call);

=== Get call recordings
'''
Example how to return call recordings for a given call id.
[source,csharp]
//Only "id" param required
CallfireClient Client = new CallfireClient("api_login", "api_password");
IList<CallRecording> recs = Client.CallsApi.GetCallRecordings(1234, "items(callId)");

=== Get call recording by name and call id
'''
Example how to return call recording for a given call by recording name.
[source,csharp]
//"id" and "name" params are required
CallfireClient Client = new CallfireClient("api_login", "api_password");
CallRecording recording = Client.CallsApi.GetCallRecordingByName(1234, "testName", "callId");

=== Get mp3 call recording by name and call id
'''
Example how to return mp3 call recording for a given call by recording name.
[source,csharp]
//"id" and "name" params are required
CallfireClient Client = new CallfireClient("api_login", "api_password");
MemoryStream ms = (MemoryStream)Client.CallsApi.GetCallRecordingMp3ByName(1234, "testName");

=== Get call recording by id
'''
Example how to return call recording for a given recording id.
[source,csharp]
//Only "id" param required
CallfireClient Client = new CallfireClient("api_login", "api_password");
CallRecording rec = Client.CallsApi.GetCallRecording(1234, "campaignId");

=== Get mp3 call recording by id
'''
Example how to return mp3 call recording for a given recording id.
[source,csharp]
//Only "id" param required
CallfireClient Client = new CallfireClient("api_login", "api_password");
MemoryStream ms = (MemoryStream)Client.CallsApi.GetCallRecordingMp3(1234);
17 changes: 17 additions & 0 deletions docs/api/callstexts/TextsApi.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,23 @@ Example how to use the /texts API to quickly send individual texts via existing

In case you want to send text via default campaign use *Send(List<TextRecipient> recipients, long? campaignId)* method.

In case you want to send text with default text which will be used in case when recipient doesn't have that info specified,
see example below:
[source,csharp]
CallfireClient Client = new CallfireClient("api_login", "api_password");
//Only "recipients" param required
var recipient1 = new TextRecipient { Message = "msg", PhoneNumber = "12132212384" };
var recipient2 = new TextRecipient { Message = "msg", PhoneNumber = "12132212384" };
var recipients = new List<TextRecipient> { recipient1, recipient2 };
var request = new SendTextsRequest
{
Recipients = recipients,
CampaignId = 7415135003,
DefaultMessage = "DefaultLiveMessage",
Fields = "items(id,fromNumber,state)"
};
IList<Text> texts = Client.TextsApi.Send(request);

=== Get text
'''
Example how to return a single Text instance for a given text id.
Expand Down
11 changes: 10 additions & 1 deletion docs/api/campaigns/CallBroadcastsApi.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ Create a call broadcast campaign using the Call Broadcast API. Send a CallBroadc
{
new Recipient { PhoneNumber = "12132212384" },
new Recipient { PhoneNumber = "12132212385" }
}
},
ResumeNextDay = true

};
// create broadcast with 'start' argument = true to start campaign immediately
var id = client.CallBroadcastsApi.Create(broadcast, true);
Expand Down Expand Up @@ -94,6 +96,13 @@ Get calls associated with call broadcast ordered by date.
var calls = client.CallBroadcastsApi.GetCalls(request);
Console.WriteLine(calls);

If you want to get calls filtered by batch id please use code like:
[source,csharp]
var client = new CallfireClient("api_login", "api_password");
var request = new GetBroadcastCallsTextsRequest { Id = 1234, batchId = 12345 };
var calls = client.CallBroadcastsApi.GetCalls(getCallsRequest);
Console.WriteLine(calls);

=== Get broadcast stats
Get broadcast statistics.
[source,csharp]
Expand Down
26 changes: 25 additions & 1 deletion docs/api/campaigns/CampaignSoundsApi.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,17 @@ Use this API to create a sound via phone call. Supply the required phone number
};
ResourceId resourceId = Client.CampaignSoundsApi.RecordViaPhone(callCreateSound);
Console.WriteLine("Sound id: " + resourceId.Id);


If you want to see created sound details please use code like:
[source,csharp]
CallfireClient Client = new CallfireClient("api_login", "api_password");
CallCreateSound callCreateSound = new CallCreateSound
{
Name = "call_in_sound_" + new DateTime().Millisecond,
ToNumber = "12132212384"
};
CampaignSound sound = Client.CampaignSoundsApi.RecordViaPhoneAndGetSoundDetails(callCreateSound, "id,name");

=== Add sound via text-to-speech
'''
Use this API to create a sound file via a supplied string of text. Send the required text in the
Expand All @@ -62,3 +72,17 @@ Use this API to create a sound file via a supplied string of text. Send the requ
ResourceId resourceId = Client.CampaignSoundsApi.CreateFromTts(tts);
CampaignSound campaignSound = Client.CampaignSoundsApi.Get(resourceId.Id);
Console.WriteLine("Campaign sound: " + campaignSound);

If you want to see created sound details please use code like:
[source,csharp]
CallfireClient Client = new CallfireClient("api_login", "api_password");
TextToSpeech tts = new TextToSpeech { Message = "this is TTS message from csharp client" };
CampaignSound sound = Client.CampaignSoundsApi.CreateFromTtsAndGetSoundDetails(tts, "id,name");

=== Upload sound file
'''
Upload mp3 or wav sound file.
[source,csharp]
CallfireClient Client = new CallfireClient("api_login", "api_password");
string mp3FilePath = "Resources/File-examples/train.mp3";
CampaignSound mp3Resource = Client.CampaignSoundsApi.UploadAndGetSoundDetails(mp3FilePath, "fileName");
9 changes: 8 additions & 1 deletion docs/api/campaigns/TextBroadcastsApi.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ Example how to create text broadcast and then start it. Broadcast will send mess
{
new TextRecipient { PhoneNumber = "12132212384" },
new TextRecipient { PhoneNumber = "12132212385" }
}
},
ResumeNextDay = true
};
// create broadcast
var id = client.TextBroadcastsApi.Create(broadcast, true);
Expand Down Expand Up @@ -87,6 +88,12 @@ This operation will enable the user to page through all of the texts for a parti
var texts = client.TextBroadcastsApi.GetTexts(request);
Console.WriteLine(texts);

If you want to get texts filtered by batch id please use code like:
[source,csharp]
var client = new CallfireClient("api_login", "api_password");
var request = new GetBroadcastCallsTextsRequest { Id = 123, batchId = 1234 };
var texts = client.TextBroadcastsApi.GetTexts(request);

=== Get broadcast stats
Get broadcast statistics.
[source,csharp]
Expand Down
20 changes: 17 additions & 3 deletions docs/api/webhooks/WebhooksApi.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Search for webhooks on name, resource, event, callback URL, or whether they are
{
Limit = 5,
Enabled = true,
Resource = Webhook.ResourceType.TEXT_BROADCAST
Name = "test_name"
};
Page<Webhook> webhooks = Client.WebhooksApi.Find(findRequest);
Console.WriteLine(webhooks);
Expand All @@ -33,7 +33,7 @@ Example how to create a webhook for voice campaign. Callfire will query your cal
var webhook = new Webhook
{
Name = "new webhook",
Resource = ResourceType.VOICE_BROADCAST,
Resource = ResourceType.TEXT_BROADCAST,
Events = new HashSet<ResourceEvent> { ResourceEvent.STARTED, ResourceEvent.FINISHED },
Callback = "https://yoursite.com/callback"
};
Expand All @@ -49,7 +49,7 @@ Example how to update the information in a currently existing webhook. Most fiel
{
Id = 12345678,
Name = "new webhook",
Resource = ResourceType.VOICE_BROADCAST,
Resource = ResourceType.TEXT_BROADCAST,
Events = new HashSet<ResourceEvent> { ResourceEvent.STARTED, ResourceEvent.FINISHED },
Callback = "https://yoursite.com/callback"
};
Expand All @@ -61,3 +61,17 @@ Example how to delete a webhook. Will be removed permenantly.
[source,csharp]
CallfireClient Client = new CallfireClient("api_login", "api_password");
Client.WebhooksApi.Delete(12345678);

=== Find webhook resources
'''
Example how to find webhook resources.
[source,csharp]
CallfireClient Client = new CallfireClient("api_login", "api_password");
var resources = Client.WebhooksApi.FindWebhookResources("items(resource)");

=== Find webhook resource
'''
Example how to find webhook resource.
[source,csharp]
CallfireClient Client = new CallfireClient("api_login", "api_password");
var resource = Client.WebhooksApi.FindWebhookResource(ResourceType.CALL_BROADCAST, "resource");
15 changes: 15 additions & 0 deletions src/CallfireApiClient.Tests/Api/CallsTexts/CallRecording.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
using System.Collections.Generic;
using CallfireApiClient.Api.Campaigns.Model;

namespace CallfireApiClient.Tests.Api.CallsTexts
{
internal class CallRecording<T>
{
private IList<CallRecording> callRecordings;

public CallRecording(IList<CallRecording> callRecordings)
{
this.callRecordings = callRecordings;
}
}
}
Loading