Skip to content
This repository contains the open source C# client for MessageBird's REST API.
C#
Branch: master
Clone or download
epels Merge pull request #66 from codefrenzy/fix-voice-call-flow-deserializ…
…ation

Fix voice call flow deserialization and other unrelated clean-up
Latest commit 114428b Dec 6, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.nuget Download NuGet binary if needed Aug 17, 2018
Examples Renaming VoiceCallFlow to CallFlow so that in future we can split the… Dec 6, 2019
MessageBird Updating the version to 2.0.0.0 due to breaking client changes Dec 6, 2019
NuGet Merge remote-tracking branch 'origin/master' into users/deluxz/target… Sep 19, 2018
Tests/UnitTests/MessageBirdUnitTests Renaming VoiceCallFlow to CallFlow so that in future we can split the… Dec 6, 2019
.gitattributes Fix eol and make default EOL=crlf through gitattributes Jan 2, 2015
.gitignore Download NuGet binary if needed Aug 17, 2018
.travis.yml add key Aug 26, 2019
LICENSE Add license Aug 4, 2014
README.md Downgrading the MessageBird project back down to .NET Framework 4.0 Dec 5, 2019
csharp-rest-client.sln

README.md

MessageBird's REST API for C#

This repository contains the open source C# client for MessageBird's REST API. Documentation can be found at: https://developers.messagebird.com.

Build status NuGet version (MessageBird)

Requirements

  • Sign up for a free MessageBird account
  • Create a new access_key in the developers sections
  • MessageBird API client for C# requires .NET Framework >= 4 or .NET Standard >= 2.0
  • It has a dependency on JSON.NET >= 4.5.6

Installation

JSON.NET

The MessageBird project depends on JSON.NET, which can be installed using the NuGet package manager. For more information on how to achieve this, see 'Managing NuGet packages using the dialog'.

Usage

We have put some self-explanatory examples in the Examples project, but here is a quick breakdown on how it works. First, you need to set up a MessageBird.Client. Be sure to replace YOUR_ACCESS_KEY with something real.

using System;
using MessageBird;
using MessageBird.Objects;

class Example
{
  static void Main(string[] args)
  {
    Client client = Client.CreateDefault("YOUR_ACCESS_KEY");
  }
}

That's easy enough. Now we can query the server for information. Lets use getting your balance overview as an example:

// Get your balance
Balance balance = client.Balance();

Error handling

In case of an error the client throws an ErrorException. The ErrorException objects contains either:

  • an array of Error objects that encapsulates the errors in the response (see errors for more info),
  • a best effort description when no error information from the endpoint is available.

See the provided examples on how to access error information from the ErrorException.

Conversations WhatsApp Sandbox

To use the whatsapp sandbox you need to add Client.Features.EnableWhatsAppSandboxConversations to the list of features you want enabled. Don't forget to replace YOUR_ACCESS_KEY with your actual access key.

using System;
using MessageBird;
using MessageBird.Objects;

class Example
{
  static void Main(string[] args)
  {
    Client client = Client.CreateDefault("YOUR_ACCESS_KEY",features: new Client.Features[] { Client.Features.EnableWhatsAppSandboxConversations });
  }
}

Documentation

Complete documentation, instructions, and examples are available at: https://developers.messagebird.com

License

The MessageBird REST Client for C# is licensed under The ISC License. Copyright (c) 2014, Remco Vermeulen

You can’t perform that action at this time.