Skip to content

The official GO SDK provided by Retarus to contact our messaging services. Resources

License

Notifications You must be signed in to change notification settings

retarus/retarus-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Retarus-Go:

The Official Golang Library for Retarus Messaging Services Retarus-Go allows you to easily integrate Retarus's suite of messaging services into your Golang applications. Whether you need to send SMS or Fax messages, this library has got you covered.

Table of Contents

Installation

To install the Retarus-Go library, run the following command:

go get github.com/retarus/retarus-go

Usage

Initialize the Client

Before making any requests, you'll need to initialize the client. Here's how you can do it, but it is the same for all services:

import "github.com/retarus/retarus-go"

// reads the credentials from system env variables.
config := retarus.fax.NewConfigFromEnv(Europe)
client := retarus.fax.NewClient(config)

As you'll observe, we employ the NewConfigFromEnv function. This approach utilizes the credentials specified in the operating system's environment variables, necessitating that these values be exported accordingly.

export retarus_username=value
export retarus_password=value
export retarus_cuno=yourCuno

Send a Fax

Here's a basic example to send a Fax:

job := fax.Job{
		Recipients: []fax.Recipient{
			{
				Number: "00498923422342", // number to send to
			},
		},
		Documents: []fax.Document{
			{
				Name:      "test.txt", // local document to send
				Data:      "dGVzdGZheAo=", // test fax
			},
		},
	}
jobID, err := client.Send(job)
if err != nil {
fmt.Println("Error: ", err)
}
fmt.Println("JobId: ", jobID)

Examples

For more comprehensive examples, please refer to the examples directory in the repository.

Supported Services

Retarus-Go currently supports the following services:

  • Fax
  • SMS

Regions

The library allows you to specify a datacenter region when configuring your service client. Supported regions are:

  • Europe
  • America
  • Switzerland
  • Singapore

Help and Support

For additional information or to get support, visit our Knowledge Center.

About

The official GO SDK provided by Retarus to contact our messaging services. Resources

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Languages