sipgate

package
v0.0.0-...-65fcbcb Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 20, 2022 License: BSD-2-Clause Imports: 6 Imported by: 2

README

Sipgate REST API v2

To configure the Sipgate provider, you need to specify the SMS ID which will be used to lookup SMS sender name and number. If you do not know the SMS ID, you can find it out via the Sipgate API.

First, obtain your user ID:

$ curl -X GET --user <username>:<password> https://api.sipgate.com/v2/authorization/userinfo

The relevant user ID is in the form "wNNN" where "NNN" are numerical digits. If your user is not the main account owner, it may be in the "sub" attribute of the response.

Next, get a list of SMS IDs, replacing the <wNNN> with your user ID.

$ curl -X GET --user <username>:<password> https://api.sipgate.com/v2/<wNNN>/sms

The response should contain an array of one or more items, with IDs in the form "sNNN", where the "NNN" are numerical digits (often the same as the "wNNN" user ID).

Use the "sNNN" SMS ID as the "from" attribute in the "receivers" section of the configuration file.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Username string `yaml:"username"`
	Password string `yaml:"password"`
}

Config is the configuration struct for Sipgate provider.

type Sipgate

type Sipgate struct {
	Config
}

Sipgate contains the necessary values for the Sipgate provider.

func NewSipgate

func NewSipgate(config Config) *Sipgate

NewSipgate creates and returns a new Sipgate struct.

func (*Sipgate) Send

func (c *Sipgate) Send(message sachet.Message) error

Send sends SMS to user registered in configuration.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL