https://github.com/android-sms-gateway/client-go
A Go client library for sending and managing SMS messages via the SMS Gateway for Android™ API.
https://github.com/android-sms-gateway/client-go
android android-app android-development android-sms api-client communication go-client go-sdk golang http-client message-service messaging-api mobile-messaging rest-api sms-api sms-gateway sms-integration sms-library sms-service telecommunications
Last synced: 23 days ago
JSON representation
A Go client library for sending and managing SMS messages via the SMS Gateway for Android™ API.
- Host: GitHub
- URL: https://github.com/android-sms-gateway/client-go
- Owner: android-sms-gateway
- License: apache-2.0
- Created: 2024-05-28T02:13:46.000Z (11 months ago)
- Default Branch: master
- Last Pushed: 2025-03-26T07:11:24.000Z (about 1 month ago)
- Last Synced: 2025-03-26T08:24:03.369Z (about 1 month ago)
- Topics: android, android-app, android-development, android-sms, api-client, communication, go-client, go-sdk, golang, http-client, message-service, messaging-api, mobile-messaging, rest-api, sms-api, sms-gateway, sms-integration, sms-library, sms-service, telecommunications
- Language: Go
- Homepage: https://sms-gate.app
- Size: 30.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# SMS Gateway for Android™ Go API Client
[](https://goreportcard.com/report/github.com/android-sms-gateway/client-go)
[](https://godoc.org/github.com/android-sms-gateway/client-go)
[](https://codecov.io/gh/android-sms-gateway/client-go)

[](https://github.com/android-sms-gateway/client-go/blob/master/LICENSE)
[](https://github.com/android-sms-gateway/client-go/releases)
[](https://github.com/android-sms-gateway/client-go/stargazers)

[](https://github.com/android-sms-gateway/client-go/issues)This is a Go client library for interfacing with the [SMS Gateway for Android API](https://sms-gate.app).
## Features
- Send SMS messages with a simple method call.
- Check the state of sent messages.
- Webhooks management.
- Customizable base URL for use with local, cloud or private servers.## Prerequisites
Before you begin, ensure you have met the following requirements:
- You have a basic understanding of Go.
- You have Go installed on your local machine.## Installation
To install the SMS Gateway API Client in the existing project, run this command in your terminal:
```bash
go get github.com/android-sms-gateway/client-go
```## Usage
Here's how to get started with the SMS Gateway API Client:
1. Import the `github.com/android-sms-gateway/client-go/smsgateway` package.
2. Create a new client with configuration with `smsgateway.NewClient` method.
3. Use the `Send` method to send an SMS message.
4. Use the `GetState` method to check the status of a sent message.```go
package mainimport (
"context"
"log"
"os""github.com/android-sms-gateway/client-go/smsgateway"
)func main() {
// Create a client with configuration from environment variables.
client := smsgateway.NewClient(smsgateway.Config{
User: os.Getenv("ASG_USERNAME"),
Password: os.Getenv("ASG_PASSWORD"),
})// Create a message to send.
message := smsgateway.Message{
Message: "Hello, doctors!",
PhoneNumbers: []string{
"+19162255887",
"+19162255888",
},
}// Send the message and get the response.
status, err := client.Send(context.Background(), message)
if err != nil {
log.Fatalf("failed to send message: %v", err)
}log.Printf("Send message response: %+v", status)
// Get the state of the message and print the response.
status, err = client.GetState(context.Background(), status.ID)
if err != nil {
log.Fatalf("failed to get state: %v", err)
}log.Printf("Get state response: %+v", status)
}
```## API Reference
For more information on the API endpoints and data structures, please consult the [SMS Gateway for Android API documentation](https://docs.sms-gate.app/integration/api/).
# Contributing
Contributions are welcome! Please submit a pull request or create an issue for anything you'd like to add or change.
# License
This library is open-sourced software licensed under the [Apache-2.0 license](LICENSE).