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)
- Host: GitHub
- URL: https://github.com/booscaaa/zenvia-go-sdk
- Owner: booscaaa
- License: mit
- Created: 2021-11-05T18:00:46.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2021-11-05T18:32:52.000Z (over 4 years ago)
- Last Synced: 2024-06-20T17:48:40.761Z (about 2 years ago)
- Topics: bot, message, sms, zenvia
- Language: Go
- Homepage: https://www.zenvia.com/
- Size: 8.79 KB
- Stars: 5
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Zenvia API - Golang SDK
Zenvia API (2.0)
## 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