Giter Club home page Giter Club logo

apiclient-dotnet's Introduction

Voximplant API client library

Version 2.8.0

Prerequisites

In order to use Voximplant SDK for the .NET, you need the following:

  1. A developer account. If you don't have one, sign up here.
  2. A private API key. There are 2 options to obtain it:
    1. Either generate it in the Voximplant Control panel
    2. Or call the CreateKey HTTP API method with the specified authentication parameters. You'll receive a response with the result field in it. Save the result value in a file (since we don't store the keys, save it securely on your side).

Getting started

  • The best way to start is to use NuGet to add the SDK to your Solution:

    nuget install Voximplant.API
  • Next, specify the path to the JSON service account file either with the ClientConfig file or using the environment.

    ClientConfig:

    var config = new ClientConfiguration
    {
        KeyFile = "/path/to/credentials.json"
    };
    var api = new VoximplantAPI(config);

    Environment:

    export VOXIMPLANT_CREDENTIALS=/path/to/credentials.json

Example

This example shows how you can use the API client.

using System;
using Voximplant.API;

namespace example
{
    class Program
    {
        private static void Main(string[] args)
        {
            try {
                var voximplant = new VoximplantAPI();
                
                var result = voximplant.GetSubscriptionPrice().Result;
                
                Console.WriteLine($"Response: {result.ToString()}");
            } catch (Exception e) {
                Console.WriteLine($"Error: {e.Message}");
            }
        }
    }
}

apiclient-dotnet's People

Contributors

akvakh avatar nikolasmelui avatar niveuseverto avatar yuliagrigorieva avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

nikolasmelui

apiclient-dotnet's Issues

No HttpClient pooling

In generic method, that process all requests i see incorrect using HttpClient

private async Task<TResponse> PerformRequest<TResponse>(
{
      using (HttpClient client = new HttpClient())
      {
           ....
      }
}

It can cause break host application, that use this API (read this)

How to solve it?

  1. Use HttpClientFactory and deprecate unsupported platforms
  2. Expose factory method and deletegate HttpClient creating on the developer side

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.