haxpax / gosms

:mailbox_closed: Your own local SMS gateway in Go
GNU General Public License v2.0
1.45k stars 154 forks source link

Examples? #16

Closed ambiflextrous closed 6 years ago

ambiflextrous commented 6 years ago

How to I actually use this? Need examples.

Omie commented 6 years ago

Hey, sorry, we are quite caught up to maintain this project. Please let me know if you have any specific question, would try my best to help you out.

ambiflextrous commented 6 years ago

I want to know how to send a simple text message to a number just for testing.

package main
import "github.comhaxpax/gosms"

func main(){
// code to send message
msg := {
"messages": [
    {
      "uuid": "id number of huawei modem",
      "mobile": "phone number",
      "body": "Hey! Just playing around with gosms.",
      "status": 1
    },
  ]
}

Is this how you use it??

ambiflextrous commented 6 years ago

I'm a golang newbie

Omie commented 6 years ago

Hi before getting in code etc, have you set it up using external dongle device and SIM card with active SMS plan? Once you are setup with device and a SIM card, you can either use API interface to enqueue a message using given API endpoint.

ambiflextrous commented 6 years ago

Yes I've set up an external dongle device and SIM card with active SMS plan. I'm having trouble with the API part, I guess I need to read more about how to use external libraries in golang.