Zenvia API (2.0)
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: [email protected]
Connect with me at LinkedIn.
- Send single SMS
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.
$ go get github.com/booscaaa/zenvia-go-sdk
The access api_token can be found into Zenvia account
{
"zenvia": {
"api_token": "api token"
}
}
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
}
go run main.go
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: [email protected]
Connect with me at LinkedIn
Thank you!
This project is licensed under the MIT License - see the LICENSE.md file for details