Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ammario/nexmo
Golang Nexmo API
https://github.com/ammario/nexmo
Last synced: 25 days ago
JSON representation
Golang Nexmo API
- Host: GitHub
- URL: https://github.com/ammario/nexmo
- Owner: ammario
- License: mit
- Created: 2017-05-21T00:43:06.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-05-21T09:36:25.000Z (over 7 years ago)
- Last Synced: 2024-06-20T03:51:27.090Z (5 months ago)
- Language: Go
- Size: 6.84 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# nexmo
An idiomatic Go [nexmo](https://nexmo.com) library[![GoDoc](https://godoc.org/github.com/ammario?status.svg)](https://godoc.org/github.com/ammario/nexmo)
**Table of Contents**
- [Install](#install)
- [Status](#status)
- [Examples](#examples)
- [Create a new client](#create-a-new-client)
- [Get country number is in](#get-country-number-is-in)
- [Send an SMS](#send-an-sms)
- [Testing](#testing)# Install
```go get -u github.com/ammario/nexmo```
# Status
Currently these APIs are supported:
- SMS
- Number InsightTODO:
- Developer API
- Voice API# Examples
## Create a new client
```go
client := nexmo.New(os.Getenv("API_KEY"), os.Getenv("API_SECRET"))
```## Get country number is in
```go
resp, err := client.NumberInsightBasic("2562893333")
if err != nil {
panic(err)
}
fmt.Printf("Country: %v\n", resp.CountryName)
```## Send an SMS
```go
_, err := client.SMS("your number here", "2562893333")
if err != nil {
panic(err)
}
```# Testing
Nexmo doesn't provide a sandbox at the time of writing so tests only cover free endpoints.