All Projects → minchao → go-mitake

minchao / go-mitake

Licence: MIT License
A Mitake SMS library for Golang

Programming Languages

go
31211 projects - #10 most used programming language
Makefile
30231 projects

Projects that are alternatives of or similar to go-mitake

actions-sms
Send an SMS through GitHub Actions
Stars: ✭ 108 (+620%)
Mutual labels:  sms
mobizon-node
Biblioteca NodeJS para trabalhar com os serviços Mobizon API
Stars: ✭ 17 (+13.33%)
Mutual labels:  sms
fake-sms-notifier
Fake SMS (as email during development) Notifier Bridge
Stars: ✭ 16 (+6.67%)
Mutual labels:  sms
ohd
Garage Door Monitor (OverHeadDoor) - Python3, Raspbian
Stars: ✭ 126 (+740%)
Mutual labels:  sms
sample-template-nodejs
A template repository serving as the base for new Twilio sample apps
Stars: ✭ 16 (+6.67%)
Mutual labels:  sms
smpp.net
Short Message Peer-to-Peer (SMPP) .NET library
Stars: ✭ 29 (+93.33%)
Mutual labels:  sms
security-code
A powerful security code input supports dynamic configuration of the number of input boxes.
Stars: ✭ 63 (+320%)
Mutual labels:  sms
sms
高可用短信微服务
Stars: ✭ 57 (+280%)
Mutual labels:  sms
aliyun-sms
阿里云 SMS 短信 Java SDK 封装
Stars: ✭ 67 (+346.67%)
Mutual labels:  sms
jasmin-web-panel
📨 Jasmin Web Panel for Jasmin SMS Gateway
Stars: ✭ 33 (+120%)
Mutual labels:  sms
ucp
UCP protocol in Go
Stars: ✭ 40 (+166.67%)
Mutual labels:  sms
totalvoice-php
Client em PHP para API da Totalvoice
Stars: ✭ 30 (+100%)
Mutual labels:  sms
laravel-sms-api
Laravel package to provide SMS API integration.
Stars: ✭ 84 (+460%)
Mutual labels:  sms
kavenegar-php
Kavenegar API Client Writen In PHP
Stars: ✭ 45 (+200%)
Mutual labels:  sms
SnorkTracker
GPS IoT tracker board for scanning gps and environment information and sending this to a MQTT server via GPRS.
Stars: ✭ 38 (+153.33%)
Mutual labels:  sms
helios
A Java-based Sega Mega Drive/Genesis emulator. And other systems too.
Stars: ✭ 14 (-6.67%)
Mutual labels:  sms
mimo-ce
MIMO Community Edition
Stars: ✭ 20 (+33.33%)
Mutual labels:  sms
sms
API server to send SMS using GSM modem. Written in Go
Stars: ✭ 26 (+73.33%)
Mutual labels:  sms
vonage-node-code-snippets
NodeJS code examples for using Nexmo
Stars: ✭ 46 (+206.67%)
Mutual labels:  sms
slack-texts
SMS notifications for Slack groups
Stars: ✭ 19 (+26.67%)
Mutual labels:  sms

go-mitake

GoDoc Build Status Go Report Card codecov

go-mitake is a Go client library for accessing the Mitake SMS API (Taiwan mobile phone number only).

Installation

go get -u github.com/minchao/go-mitake

Usage

import "github.com/minchao/go-mitake"

Construct a new Mitake SMS client, then use to access the Mitake API. For example:

client := mitake.NewClient("USERNAME", "PASSWORD", nil)

// Retrieving your account balance
balance, err := client.QueryAccountPoint()

Send an SMS:

message := mitake.Message{
    Dstaddr: "0987654321",
    Smbody:  "Message ...",
}

response, err := client.Send(message)

Send multiple SMS:

messages := []mitake.Message{
    {
        Dstaddr: "0987654321",
        Smbody:  "Message ...",
    },
    // ...
}

response, err := client.SendBatch(messages)

Send an long SMS:

message := mitake.Message{
    Dstaddr: "0987654321",
    Smbody:  "Long message ...",
}

response, err := client.SendLongMessage(message)

Query the status of messages:

response, err := client.QueryMessageStatus([]string{"MESSAGE_ID1", "MESSAGE_ID2"})

Use webhook to receive the delivery receipts of the messages:

http.HandleFunc("/callback", func(w http.ResponseWriter, r *http.Request) {
    receipt, err := mitake.ParseMessageReceipt(r)
    if err != nil {
        // Handle error...
        return
    }
    // Process message receipt...
})
// The callback URL port number must be standard 80 (HTTP) or 443 (HTTPS).
if err := http.ListenAndServe(":80", nil); err != nil {
    log.Printf("ListenAndServe error: %v", err)
}

License

See the LICENSE file for license rights and limitations (MIT).

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].