intistelecom

package module
v0.0.0-...-9173138 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2023 License: MIT Imports: 10 Imported by: 0

README

Intistele.com

With the intistele.com, you can access and organise SMS mailouts from your own software via API
Environment variables:

INTISTELECOM_USERNAME - Your Username

INTISTELECOM_API_KEY - Your API key

Quickstart
package main

import sms "github.com/pixel365/go-intistelecom"

func main() {
	msg := sms.MessageBody{
		Destination:    "17779990011",
		Originator:     "test",
		Text:           "some text",
		TimeToSend:     "",
		CallbackURL:    "https://some-callback-url.com",
		ValidityPeriod: 0,
		UseLocaltime:   false,
	}
	sms.Send(&msg)
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CancelMessage

func CancelMessage(messageId string) (bool, error)

func DeleteOriginator

func DeleteOriginator(originator string) (bool, error)

func DeleteTemplate

func DeleteTemplate(id int32) (bool, error)

Types

type Balance

type Balance struct {
	Currency string  `json:"currency"`
	Amount   float32 `json:"amount"`
}

func GetBalance

func GetBalance() (Balance, error)

type BaseOriginator

type BaseOriginator struct {
	Originator string `json:"originator"`
	Default    bool   `json:"default"`
}

type BaseTemplate

type BaseTemplate struct {
	Template string `json:"template"`
	Title    string `json:"title"`
	Id       int32  `json:"id"`
}

type Client

type Client struct {
	*http.Client
	JSONEncoder JSONMarshal
	JSONDecoder JSONUnmarshal
	BaseUrl     string
	UserName    string
	ApiKey      string
	// contains filtered or unexported fields
}

func NewClient

func NewClient() *Client

func (*Client) Authorization

func (c *Client) Authorization() string

func (*Client) Delete

func (c *Client) Delete(path string) ([]byte, error)

func (*Client) Get

func (c *Client) Get(path string) ([]byte, error)

func (*Client) Post

func (c *Client) Post(path string, payload io.Reader) ([]byte, error)

func (*Client) Put

func (c *Client) Put(path string, payload io.Reader) ([]byte, error)

type Error

type Error struct {
	Errors    []string `json:"errors"`
	TimeStamp string   `json:"timestamp"`
}

type JSONMarshal

type JSONMarshal func(v interface{}) ([]byte, error)

type JSONUnmarshal

type JSONUnmarshal func(data []byte, v interface{}) error

type MessageBody

type MessageBody struct {
	Destination    string `json:"destination"`
	Originator     string `json:"originator"`
	Text           string `json:"text"`
	TimeToSend     string `json:"time_to_send"`
	CallbackURL    string `json:"callback_url"`
	ValidityPeriod int32  `json:"validity_period"`
	UseLocaltime   bool   `json:"use_localtime"`
}

type MessageDetails

type MessageDetails struct {
	MessageId        string  `json:"message_id"`
	PartId           string  `json:"part_id"`
	State            string  `json:"state"`
	Sender           string  `json:"sender"`
	Network          string  `json:"network"`
	Dcs              string  `json:"dcs"`
	ErrorDescription string  `json:"error_description"`
	TimeChangeState  string  `json:"time_change_state"`
	Cost             float32 `json:"cost"`
	ErrorId          int32   `json:"error_id"`
	Ported           bool    `json:"ported"`
}

func MessagePartStatus

func MessagePartStatus(partId string) ([]MessageDetails, error)

func MessageStatus

func MessageStatus(messageId string) ([]MessageDetails, error)

type MessageId

type MessageId struct {
	Id string `json:"message_id"`
}

func Batch

func Batch(messages *[]MessageBody) ([]MessageId, error)

func Send

func Send(message *MessageBody) (MessageId, error)

type Originator

type Originator struct {
	CreatedAt  string `json:"created_at"`
	LastUsedAt string `json:"last_used_at"`
	Originator string `json:"originator"`
	State      string `json:"state"`
	Id         int32  `json:"id"`
	Default    bool   `json:"default"`
}

func CreateOriginator

func CreateOriginator(originator *BaseOriginator) (Originator, error)

func Originators

func Originators() ([]Originator, error)

func SetDefaultOriginator

func SetDefaultOriginator(originator string) (Originator, error)

type Routing

type Routing struct {
	Currency string  `json:"currency"`
	Mcc      string  `json:"mcc"`
	Mnc      string  `json:"mnc"`
	Price    float32 `json:"price"`
}

func Cost

func Cost(phoneNumber string) (Routing, error)

type Template

type Template struct {
	CreatedAt string `json:"created_at"`
	UpdatedAt string `json:"updated_at,omitempty"`
	Template  string `json:"template"`
	Title     string `json:"title"`
	Id        int32  `json:"id"`
}

func CreateTemplate

func CreateTemplate(template *BaseTemplate) (Template, error)

func EditTemplate

func EditTemplate(template *BaseTemplate) (Template, error)

func Templates

func Templates() ([]Template, error)

type User

type User struct {
	UserName string `json:"username"`
	Id       int32  `json:"id"`
}

func GetMe

func GetMe() (User, error)

Jump to

Keyboard shortcuts

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