Git Product home page Git Product logo

nexmo-go's Introduction

Nexmo Client Library For Go

Go Report Card Build Status Coverage

This library is moving towards a full client implementation of the Nexmo APIs. The library is not currently officially supported by Nexmo, but the author, @judy2k works in Nexmo's Developer Relations team. The hope is that this library will become popular enough to justify becoming an officially supported Nexmo library.

The library currently has good coverage for the following APIs:

API Coverage
Voice (9/9)
SMS (1/4)
Insight (3/4)
Verify (4/4)
Application (5/5)

It currently has only a handful of Developer (5/15) endpoints implemented, and no webhook support.

Current API Coverage can be found in this spreadsheet

Installation

To install the package, use go get:

go get github.com/nexmo-community/nexmo-go

Or import the package into your project and then do go get ..

Usage

Usage looks a bit like this:

package main

import (
	"fmt"
	"net/http"

	"log"

	"github.com/nexmo-community/nexmo-go"
)

func main() {
	auth := nexmo.NewAuthSet()
	auth.SetAPISecret(API_KEY, API_SECRET)
	client := nexmo.NewClient(http.DefaultClient, auth)
	insight, _, err := client.Insight.GetBasicInsight(nexmo.BasicInsightRequest{
		Number: PHONE_NUMBER,
	})
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println("Country Name:", insight.CountryName)
	fmt.Println("Local Formatting:", insight.NationalFormatNumber)
	fmt.Println("International Formatting:", insight.InternationalFormatNumber)
}

More documentation will be coming as the API stabilises! Things are still in flux.

To Do

Lots has been done, but there's still lots left to do! If you'd like to help, please get in touch first! Progress is moving swiftly and I wouldn't want to waste your time!

Testing

There isn't any testing yet! A test harness is currently in the works, to allow some quality tests to be written. Every API call has been tested manually during development, so they do work, but there's more work to be done.

Error Handling

Error responses from Nexmo APIs are not currently dealt with very gracefully. Fortunately, much of the work can be done in one place (inside the custom fork of Sling - which is why I forked it). This comes directly after testing, so I can ensure that all the different error responses in different parts of the API are dealt with properly.

Remaining Endpoints

Coverage is actually really high. 90% of Voice, SMS, Insight, Verify & Application APIs are covered, with some of the Developer API as well.

Webhook Support

Support for webhook parsing and validation. Made easier because Golang has a widely-used request/response API!

nexmo-go's People

Contributors

judy2k avatar lornajane avatar uroshercog avatar

Watchers

James Cloos avatar  avatar

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.