An open API service indexing awesome lists of open source software.

https://github.com/booscaaa/zenvia-go-sdk

SDK to provide access to Zenvia API (2.0)
https://github.com/booscaaa/zenvia-go-sdk

bot message sms zenvia

Last synced: 6 months ago
JSON representation

SDK to provide access to Zenvia API (2.0)

Awesome Lists containing this project

README

          


Zenvia API - Golang SDK


Zenvia API (2.0)



Reference
Release
Software License
Test status
Coverage


## Why?

This project is part of my personal portfolio, so, I'll be happy if you could provide me any feedback about the project, code, structure or anything that you can report that could make me a better developer!

Email-me: boscardinvinicius@gmail.com

Connect with me at [LinkedIn](https://www.linkedin.com/in/booscaaa/).


## Functionalities

- Send single SMS


## Getting Started

### Prerequisites

To run this project in the development mode, you'll need to have a basic environment to run:

- A Golang SDK, that can be found [here](https://golang.org/).


### Installing

```bash
$ go get github.com/booscaaa/zenvia-go-sdk
```


### Create a config.json file inside your project like this

**The access api_token can be found into Zenvia account**

```json
{
"zenvia": {
"api_token": "api token"
}
}
```




### Create main.go file

```go
package main

import (
"fmt"

"github.com/booscaaa/zenvia-go-sdk/zenvia"
"github.com/spf13/viper"
)

func init() {
viper.SetConfigFile(`config.json`)
err := viper.ReadInConfig()
if err != nil {
panic(err)
}
}

func main() {
// Get configuration variavables
authToken := viper.GetString("zenvia.auth_token")

// Configure Sandbox access into Zenvia api

zenviaAccess := zenvia.ZenviaConfig().
ApiToken(authToken).
Sandbox()

zenviaSdk := zenvia.Instance(zenviaAccess)

// From and To with this format: PREFIX DDD NUMBER WITHOUT MASK
zenviaSdk.SendSingleSMS("5554999999999", "5554999999999", "Message")

//see more examples into examples folder
}
```

# Running local

```bash
go run main.go
```






## Api application built With

- [Viper](https://github.com/spf13/viper)






## Contributing

You can send how many PR's do you want, I'll be glad to analyze and accept them! And if you have any question about the project...

Email-me: boscardinvinicius@gmail.com

Connect with me at [LinkedIn](https://www.linkedin.com/in/booscaaa/)

Thank you!

## License

This project is licensed under the MIT License - see the [LICENSE.md](https://github.com/booscaaa/zenvia-go-sdk/blob/master/LICENSE) file for details