FreeClimb is a cloud-based application programming interface (API) that puts the power of the Vail platform in your hands. FreeClimb simplifies the process of creating applications that can use a full range of telephony features without requiring specialized or on-site telephony equipment. Using the FreeClimb REST API to write applications is easy! You have the option to use the language of your choice or hit the API directly. Your application can execute a command by issuing a RESTful request to the FreeClimb API. The base URL to send HTTP requests to the FreeClimb REST API is: /apiserver. FreeClimb authenticates and processes your request.
This C# SDK is automatically generated by the OpenAPI Generator project:
- API version: 1.0.0
- SDK version: 5.1.0
- Generator version: 7.9.0
- Build package: org.openapitools.codegen.languages.CSharpClientCodegen For more information, please visit https://www.freeclimb.com/support/
- RestSharp - 112.0.0 or later
- Json.NET - 13.0.2 or later
- JsonSubTypes - 1.8.0 or later
- System.ComponentModel.Annotations - 5.0.0 or later
The DLLs included in the package may not be the latest version. We recommend using NuGet to obtain the latest version of the packages:
Install-Package RestSharp
Install-Package Newtonsoft.Json
Install-Package JsonSubTypes
Install-Package System.ComponentModel.Annotations
NOTE: RestSharp versions greater than 105.1.0 have a bug which causes file uploads to fail. See RestSharp#742. NOTE: RestSharp for .Net Core creates a new socket for each api call, which can lead to a socket exhaustion problem. See RestSharp#1406.
Run the following command to generate the DLL
- [Mac/Linux]
/bin/sh build.sh
- [Windows]
build.bat
Then include the DLL (under the bin
folder) in the C# project, and use the namespaces:
using freeclimb.Api;
using freeclimb.Client;
using freeclimb.Model;
A .nuspec
is included with the project. You can follow the Nuget quickstart to create and publish packages.
This .nuspec
uses placeholders from the .csproj
, so build the .csproj
directly:
nuget pack -Build -OutputDirectory out freeclimb.csproj
Then, publish to a local feed or other host and consume the new package via Nuget as usual.
To use the API client with a HTTP proxy, setup a System.Net.WebProxy
Configuration c = new Configuration();
System.Net.WebProxy webProxy = new System.Net.WebProxy("http://myProxyUrl:80/");
webProxy.Credentials = System.Net.CredentialCache.DefaultCredentials;
c.Proxy = webProxy;
using System.Collections.Generic;
using System.Diagnostics;
using freeclimb.Api;
using freeclimb.Client;
using freeclimb.Model;
namespace Example
{
public class Example
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "https://www.freeclimb.com/apiserver";
// Configure HTTP basic authorization: fc
config.Username = "YOUR_ACCOUNT_ID";
config.Password = "YOUR_API_KEY";
var apiInstance = new DefaultApi(config);
var buyIncomingNumberRequest = new BuyIncomingNumberRequest(); // BuyIncomingNumberRequest | Incoming Number transaction details
try
{
// Buy a Phone Number
IncomingNumberResult result = apiInstance.BuyAPhoneNumber(buyIncomingNumberRequest);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling DefaultApi.BuyAPhoneNumber: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
All URIs are relative to https://www.freeclimb.com/apiserver
Class | Method | HTTP request | Description |
---|---|---|---|
DefaultApi | BuyAPhoneNumber | POST /Accounts/{accountId}/IncomingPhoneNumbers | Buy a Phone Number |
DefaultApi | CreateAConference | POST /Accounts/{accountId}/Conferences | Create a Conference |
DefaultApi | CreateAQueue | POST /Accounts/{accountId}/Queues | Create a Queue |
DefaultApi | CreateAnApplication | POST /Accounts/{accountId}/Applications | Create an application |
DefaultApi | CreateKnowledgeBaseCompletion | POST /Accounts/{accountId}/KnowledgeBases/{knowledgeBaseId}/Completion | Query the knowledge base |
DefaultApi | DeleteARecording | DELETE /Accounts/{accountId}/Recordings/{recordingId} | Delete a Recording |
DefaultApi | DeleteAnApplication | DELETE /Accounts/{accountId}/Applications/{applicationId} | Delete an application |
DefaultApi | DeleteAnIncomingNumber | DELETE /Accounts/{accountId}/IncomingPhoneNumbers/{phoneNumberId} | Delete an Incoming Number |
DefaultApi | DequeueAMember | POST /Accounts/{accountId}/Queues/{queueId}/Members/{callId} | Dequeue a Member |
DefaultApi | DequeueHeadMember | POST /Accounts/{accountId}/Queues/{queueId}/Members/Front | Dequeue Head Member |
DefaultApi | DownloadARecordingFile | GET /Accounts/{accountId}/Recordings/{recordingId}/Download | Download a Recording File |
DefaultApi | FilterLogs | POST /Accounts/{accountId}/Logs | Filter Logs |
DefaultApi | GetACall | GET /Accounts/{accountId}/Calls/{callId} | Get a Call |
DefaultApi | GetAConference | GET /Accounts/{accountId}/Conferences/{conferenceId} | Get a Conference |
DefaultApi | GetAMember | GET /Accounts/{accountId}/Queues/{queueId}/Members/{callId} | Get a Member |
DefaultApi | GetAParticipant | GET /Accounts/{accountId}/Conferences/{conferenceId}/Participants/{callId} | Get a Participant |
DefaultApi | GetAQueue | GET /Accounts/{accountId}/Queues/{queueId} | Get a Queue |
DefaultApi | GetARecording | GET /Accounts/{accountId}/Recordings/{recordingId} | Get a Recording |
DefaultApi | GetAnAccount | GET /Accounts/{accountId} | Get an Account |
DefaultApi | GetAnApplication | GET /Accounts/{accountId}/Applications/{applicationId} | Get an Application |
DefaultApi | GetAnIncomingNumber | GET /Accounts/{accountId}/IncomingPhoneNumbers/{phoneNumberId} | Get an Incoming Number |
DefaultApi | GetAnSmsMessage | GET /Accounts/{accountId}/Messages/{messageId} | Get an SMS Message |
DefaultApi | GetHeadMember | GET /Accounts/{accountId}/Queues/{queueId}/Members/Front | Get Head Member |
DefaultApi | GetTenDLCSmsBrand | GET /Accounts/{accountId}/Messages/10DLC/Brands/{brandId} | Get a 10DLC SMS Brand |
DefaultApi | GetTenDLCSmsBrands | GET /Accounts/{accountId}/Messages/10DLC/Brands | Get list of SMS 10DLC Brands |
DefaultApi | GetTenDLCSmsCampaign | GET /Accounts/{accountId}/Messages/10DLC/Campaigns/{campaignId} | Get a 10DLC SMS Campaign |
DefaultApi | GetTenDLCSmsCampaigns | GET /Accounts/{accountId}/Messages/10DLC/Campaigns | Get list of SMS 10DLC Campaigns |
DefaultApi | GetTenDLCSmsPartnerCampaign | GET /Accounts/{accountId}/Messages/10DLC/PartnerCampaigns/{campaignId} | Get a 10DLC SMS Partner Campaign |
DefaultApi | GetTenDLCSmsPartnerCampaigns | GET /Accounts/{accountId}/Messages/10DLC/PartnerCampaigns | Get list of SMS 10DLC Partner Campaigns |
DefaultApi | GetTollFreeSmsCampaign | GET /Accounts/{accountId}/Messages/TollFree/Campaigns/{campaignId} | Get a TollFree SMS Campaign |
DefaultApi | GetTollFreeSmsCampaigns | GET /Accounts/{accountId}/Messages/TollFree/Campaigns | Get list of TollFree Campaigns |
DefaultApi | ListActiveQueues | GET /Accounts/{accountId}/Queues | List Active Queues |
DefaultApi | ListAllAccountLogs | GET /Accounts/{accountId}/Logs | List All Account Logs |
DefaultApi | ListApplications | GET /Accounts/{accountId}/Applications | List applications |
DefaultApi | ListAvailableNumbers | GET /AvailablePhoneNumbers | List available numbers |
DefaultApi | ListCallLogs | GET /Accounts/{accountId}/Calls/{callId}/Logs | List Call Logs |
DefaultApi | ListCallRecordings | GET /Accounts/{accountId}/Calls/{callId}/Recordings | List Call Recordings |
DefaultApi | ListCalls | GET /Accounts/{accountId}/Calls | List Calls |
DefaultApi | ListConferenceRecordings | GET /Accounts/{accountId}/Conferences/{conferenceId}/Recordings | List Conference Recordings |
DefaultApi | ListConferences | GET /Accounts/{accountId}/Conferences | List Conferences |
DefaultApi | ListIncomingNumbers | GET /Accounts/{accountId}/IncomingPhoneNumbers | List Incoming Numbers |
DefaultApi | ListMembers | GET /Accounts/{accountId}/Queues/{queueId}/Members | List Members |
DefaultApi | ListParticipants | GET /Accounts/{accountId}/Conferences/{conferenceId}/Participants | List Participants |
DefaultApi | ListRecordings | GET /Accounts/{accountId}/Recordings | List Recordings |
DefaultApi | ListSmsMessages | GET /Accounts/{accountId}/Messages | List SMS Messages |
DefaultApi | MakeACall | POST /Accounts/{accountId}/Calls | Make a Call |
DefaultApi | MakeAWebrtcJwt | POST /Accounts/{accountId}/Calls/WebRTC/Token | Make a JWT for WebRTC calling |
DefaultApi | RemoveAParticipant | DELETE /Accounts/{accountId}/Conferences/{conferenceId}/Participants/{callId} | Remove a Participant |
DefaultApi | SendAnSmsMessage | POST /Accounts/{accountId}/Messages | Send an SMS Message |
DefaultApi | StreamARecordingFile | GET /Accounts/{accountId}/Recordings/{recordingId}/Stream | Stream a Recording File |
DefaultApi | UpdateAConference | POST /Accounts/{accountId}/Conferences/{conferenceId} | Update a Conference |
DefaultApi | UpdateALiveCall | POST /Accounts/{accountId}/Calls/{callId} | Update a Live Call |
DefaultApi | UpdateAParticipant | POST /Accounts/{accountId}/Conferences/{conferenceId}/Participants/{callId} | Update a Participant |
DefaultApi | UpdateAQueue | POST /Accounts/{accountId}/Queues/{queueId} | Update a Queue |
DefaultApi | UpdateAnAccount | POST /Accounts/{accountId} | Manage an account |
DefaultApi | UpdateAnApplication | POST /Accounts/{accountId}/Applications/{applicationId} | Update an application |
DefaultApi | UpdateAnIncomingNumber | POST /Accounts/{accountId}/IncomingPhoneNumbers/{phoneNumberId} | Update an Incoming Number |
- Model.AccountRequest
- Model.AccountResult
- Model.AccountStatus
- Model.AccountType
- Model.AddToConference
- Model.AddToConferenceNotificationWebhook
- Model.AddToQueueNotificationWebhook
- Model.AnsweredBy
- Model.ApplicationList
- Model.ApplicationRequest
- Model.ApplicationResult
- Model.AvailableNumber
- Model.AvailableNumberList
- Model.BargeInReason
- Model.BuyIncomingNumberRequest
- Model.CallControlWebhook
- Model.CallDirection
- Model.CallEndedReason
- Model.CallList
- Model.CallResult
- Model.CallStatus
- Model.CallStatusWebhook
- Model.Capabilities
- Model.CompletionRequest
- Model.CompletionResult
- Model.CompletionResultStatus
- Model.ConferenceList
- Model.ConferenceParticipantList
- Model.ConferenceParticipantResult
- Model.ConferenceRecordingStatusWebhook
- Model.ConferenceResult
- Model.ConferenceStatus
- Model.ConferenceStatusWebhook
- Model.CreateConference
- Model.CreateConferenceRequest
- Model.CreateConferenceWebhook
- Model.CreateWebRTCToken
- Model.Dequeue
- Model.DequeueWebhook
- Model.Enqueue
- Model.FilterLogsRequest
- Model.GetDigits
- Model.GetDigitsReason
- Model.GetDigitsWebhook
- Model.GetSpeech
- Model.GetSpeechReason
- Model.GetSpeechWebhook
- Model.GrammarFileBuiltIn
- Model.GrammarType
- Model.Hangup
- Model.IfMachine
- Model.InboundCallWebhook
- Model.IncomingNumberList
- Model.IncomingNumberRequest
- Model.IncomingNumberResult
- Model.Language
- Model.LeaveConferenceWebhook
- Model.LogLevel
- Model.LogList
- Model.LogResult
- Model.MachineDetectedWebhook
- Model.MachineType
- Model.MakeCallRequest
- Model.MessageDeliveryWebhook
- Model.MessageDirection
- Model.MessageRequest
- Model.MessageResult
- Model.MessageStatus
- Model.MessageStatusWebhook
- Model.MessagesList
- Model.MutableResourceModel
- Model.OutDial
- Model.OutDialApiConnectWebhook
- Model.OutDialConnectWebhook
- Model.OutDialStartWebhook
- Model.PaginationModel
- Model.Park
- Model.Pause
- Model.PerclCommand
- Model.PerclScript
- Model.Play
- Model.PlayBeep
- Model.PlayEarlyMedia
- Model.QueueList
- Model.QueueMember
- Model.QueueMemberList
- Model.QueueRequest
- Model.QueueResult
- Model.QueueResultStatus
- Model.QueueWaitWebhook
- Model.RecordUtterance
- Model.RecordUtteranceTermReason
- Model.RecordWebhook
- Model.RecordingList
- Model.RecordingResult
- Model.Redirect
- Model.RedirectWebhook
- Model.Reject
- Model.RemoveFromConference
- Model.RemoveFromQueueNotificationWebhook
- Model.RequestType
- Model.SMSTenDLCBrand
- Model.SMSTenDLCBrandAltBusinessIdType
- Model.SMSTenDLCBrandEntityType
- Model.SMSTenDLCBrandIdentityStatus
- Model.SMSTenDLCBrandRelationship
- Model.SMSTenDLCBrandStockExchange
- Model.SMSTenDLCBrandsListResult
- Model.SMSTenDLCCampaign
- Model.SMSTenDLCCampaignStatus
- Model.SMSTenDLCCampaignsListResult
- Model.SMSTenDLCPartnerCampaign
- Model.SMSTenDLCPartnerCampaignBrand
- Model.SMSTenDLCPartnerCampaignStatus
- Model.SMSTenDLCPartnerCampaignsListResult
- Model.SMSTollFreeCampaign
- Model.SMSTollFreeCampaignRegistrationStatus
- Model.SMSTollFreeCampaignsListResult
- Model.Say
- Model.SendDigits
- Model.SetDTMFPassThrough
- Model.SetListen
- Model.SetTalk
- Model.Sms
- Model.StartRecordCall
- Model.TFN
- Model.TFNCampaign
- Model.TerminateConference
- Model.TranscribeReason
- Model.TranscribeTermReason
- Model.TranscribeUtterance
- Model.TranscribeUtteranceRecord
- Model.TranscribeWebhook
- Model.Unpark
- Model.UpdateCallRequest
- Model.UpdateCallRequestStatus
- Model.UpdateConferenceParticipantRequest
- Model.UpdateConferenceRequest
- Model.UpdateConferenceRequestStatus
- Model.Webhook
Authentication schemes defined for the API:
- Type: HTTP basic authentication
-
To deserialize (turn value into enum), every enum class has a {classname}ValueConverter class that allows for deserialization into the enum class.
For example
using freeclimb.Enums; namespace Example { public class DeserializeEnumExample { public static void Main() { AccountStatus accountStatus = AccountStatusValueConverter.FromString("active"); Assert.IsType<AccountStatus>(accountStatus); } } }
-
To serialize an enum to a value, simply use
nameof
with your enum instanceFor example
using freeclimb.Enums; namespace Example { public class SerializeEnumExample { public static void Main() { AccountStatus accountStatus = AccountStatus.ACTIVE; string statusValue = nameof(accountStatus); Assert.Equal("active", statusValue); } } }
The Performance Command Language (PerCL) defines a set of instructions, written in JSON format, that express telephony actions to be performed in response to an event on the FreeClimb platform. FreeClimb communicates with the application server when events associated with the application occur, so the webserver can instruct FreeClimb how to handle such events using PerCL scripts. PerCL commands are a part of the model schema and can be serialized into JSON like so:
using freeclimb.Model;
namespace Example
{
public class UsingPerclExample
{
public static void Main()
{
CreateConference create = new CreateConference("", false, PlayBeep.ALWAYS, false, "", "");
List<PerclCommand> commands = new List<PerclCommand>();
commands.Add(create);
PerclScript script = new PerclScript(commands);
string expectedJSONString = "[{\"CreateConference\":{\"actionUrl\":\"\",\"alias\":false,\"playBeep\":\"always\",\"record\":false,\"statusCallbackUrl\":\"\",\"waitUrl\":\"\"}}]";
Assert.Equal(expectedJSONString, script.ToJson());
}
}
}
-
To verify the request signature, we will need to use the verifyRequestSignature method within the Request Verifier class
RequestVerifier.verifyRequestSignature(requestBody, requestHeader, signingSecret, tolerance)
This is a method that you can call directly from the request verifier class, it will throw exceptions depending on whether all parts of the request signature is valid otherwise it will throw a specific error message depending on which request signature part is causing issues
This method requires a requestBody of type string, a requestHeader of type string, a signingSecret of type string, and a tolerance value of type int
Example code down below
using freeclimb.Utils; using System; namespace Example { public class verifySignatureRequestExample { public static void Main() { string requestBody = "{\"accountId\":\"AC1334ffb694cd8d969f51cddf5f7c9b478546d50c\",\"callId\":\"CAccb0b00506553cda09b51c5477f672a49e0b2213\",\"callStatus\":\"ringing\",\"conferenceId\":null,\"direction\":\"inbound\",\"from\":\"+13121000109\",\"parentCallId\":null,\"queueId\":null,\"requestType\":\"inboundCall\",\"to\":\"+13121000096\"}"; string signingSecret = "sigsec_ead6d3b6904196c60835d039e91b3341c77a7793"; string requestHeader = "t=1679944186,v1=c3957749baf61df4b1506802579cc69a74c77a1ae21447b930e5a704f9ec4120,v1=1ba18712726898fbbe48cd862dd096a709f7ad761a5bab14bda9ac24d963a6a8"; int tolerance = 5 * 60; RequestVerifier.verifyRequestSignature(requestBody, requestHeader, signingSecret, tolerance) } } }