Categorygithub.com/telstra/MessagingAPI-SDK-Go/v3
modulepackage
3.4.13
Repository: https://github.com/telstra/messagingapi-sdk-go.git
Documentation: pkg.go.dev

# README

Go API client for TelstraMessaging V3

Send and receive SMS & MMS programmatically, leveraging Australia's leading mobile network. With Telstra's Messaging API, we take out the complexity to allow seamless messaging integration into your app, with just a few lines of code. Our REST API is enterprise grade, allowing you to communicate with engaging SMS & MMS messaging in your web and mobile apps in near real-time on a global scale.

Installation

Install the following dependencies:

go get github.com/stretchr/testify/assert
go get golang.org/x/oauth2
go get golang.org/x/net/context
go get github.com/telstra/MessagingAPI-SDK-Go/v3

Put the package under your project folder and add the following in import:

import TelstraMessaging "github.com/telstra/MessagingAPI-SDK-Go/v3"
                         

To use a proxy, set the environment variable HTTP_PROXY:

os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port")

Documentation for API Endpoints

All URIs are relative to https://products.api.telstra.com/messaging/v3

ClassMethodHTTP requestDescription
AuthenticationAPIAuthTokenPost /oauth/tokenGenerate an access token
FreeTrialNumbersAPICreateTrialNumbersPost /free-trial-numberscreate free trial number list
FreeTrialNumbersAPIGetTrialNumbersGet /free-trial-numbersget all free trial numbers
HealthCheckAPIHealthCheckGet /health-checkhealth check
LogsAPIGetLogsGet /logsget logs
MessagesAPIDeleteMessageByIdDelete /messages/{messageId}delete a message
MessagesAPIGetMessageByIdGet /messages/{messageId}fetch a specific message
MessagesAPIGetMessagesGet /messagesfetch all sent/received messages
MessagesAPISendMessagesPost /messagessend messages
MessagesAPIUpdateMessageByIdPut /messages/{messageId}update a message
MessagesAPIUpdateMessageTagsPatch /messages/{messageId}update message tags
ReportsAPIGetReportGet /reports/{reportId}fetch a specific report
ReportsAPIGetReportsGet /reportsfetch all reports
ReportsAPIMessagesReportPost /reports/messagessubmit a request for a messages report
VirtualNumbersAPIAssignNumberPost /virtual-numbersassign a virtual number
VirtualNumbersAPIDeleteNumberDelete /virtual-numbers/{virtual-number}delete a virtual number
VirtualNumbersAPIGetNumbersGet /virtual-numbersfetch all virtual numbers
VirtualNumbersAPIGetRecipientOptoutsGet /virtual-numbers/{virtual-number}/optoutsGet recipient optouts list
VirtualNumbersAPIGetVirtualNumberGet /virtual-numbers/{virtual-number}fetch a virtual number
VirtualNumbersAPIUpdateNumberPut /virtual-numbers/{virtual-number}update a virtual number

Documentation For Models

Documentation For Authorization

Authentication schemes defined for the API:

bearer_auth

  • Type: OAuth
  • Flow: application
  • Authorization URL:
  • Scopes:
    • free-trial-numbers:read: read information for free trial numbers
    • free-trial-numbers:write: write information for free trial numbers
    • messages:read: read information for messages
    • messages:write: write information for messages
    • reports:read: read information for reports
    • reports:write: write information for reports
    • virtual-numbers:read: read information for virtual-numbers
    • virtual-numbers:write: write information for virtual numbers

Recommendation

It's recommended to create an instance of ApiClient per thread in a multithreaded environment to avoid any potential issues.

Author

Documentation for Authorization

Authentication schemes defined for the API:

bearer_auth

  • Type: OAuth
  • Flow: application
  • Authorization URL:
  • Scopes:
    • free-trial-numbers:read: read information for free trial numbers
    • free-trial-numbers:write: write information for free trial numbers
    • messages:read: read information for messages
    • messages:write: write information for messages
    • reports:read: read information for reports
    • reports:write: write information for reports
    • virtual-numbers:read: read information for virtual-numbers
    • virtual-numbers:write: write information for virtual numbers
import (
	"context"
	"fmt"
	"testing"

	"github.com/stretchr/testify/assert"
	msg_sdk "github.com/telstra/MessagingAPI-SDK-Go/v3"
)

configuration := msg_sdk.NewConfiguration()
apiClient := msg_sdk.NewAPIClient(configuration)

clientId := "YOUR CLIENT ID"
clientSecret := "YOUR CLIENT SECRET"

authApi := apiClient.AuthenticationAPI.AuthToken(context.Background(), clientId, clientSecret)
oauthResult, resp, err := authApi.AuthToken()

Recommendation

It's recommended to create an instance of ApiClient per thread in a multithreaded environment to avoid any potential issues.

Author

Free Trial

Telstra offers a free trial for the messaging API to help you evaluate whether it meets your needs. There are some restrictions that apply compared to the full API, including a maximum number of messages that can be sent and requiring the registration of a limited number of destinations before a message can be sent to that destination. For more information, please see here: https://dev.telstra.com/docs/messaging-api/apiReference/apiReferenceOverviewEndpoints?version=3.x#FreeTrial.

Registering Free Trial Numbers

:information_source: Only required for the free trial accounts

Register destinations for the free trial. For more information, please see here: https://dev.telstra.com/docs/messaging-api/apiReference/apiReferenceOverviewEndpoints?version=3.x#RegisteraFreeTrialNumber.

The function freeTrialNumbers.create can be used to register destinations.

It takes an object with following properties as argument:

  • freeTrialNumbers: A list of destinations, expected to be phone numbers of the form 04XXXXXXXX.

It returns the list of phone numbers that have been registered.

For example:


import (
	"context"
	"fmt"
	"testing"

	"github.com/stretchr/testify/assert"
	msg_sdk "github.com/telstra/MessagingAPI-SDK-Go/v3"
)

configuration := msg_sdk.NewConfiguration()
apiClient := msg_sdk.NewAPIClient(configuration)

clientId := "YOUR CLIENT ID"
clientSecret := "YOUR CLIENT SECRET"
authorization, _ := msg_sdk.GetAuthorization(apiClient, clientId, clientSecret)

trialNumbers := []string{"0400000001", "0400000002"}
createTrialNumbersRequestFreeTrialNumbers := msg_sdk.ArrayOfStringAsCreateTrialNumbersRequestFreeTrialNumbers(&trialNumbers)
createTrialNumbersRequest := msg_sdk.NewCreateTrialNumbersRequest(createTrialNumbersRequestFreeTrialNumbers)

trialNumbersApi := apiClient.FreeTrialNumbersAPI.CreateTrialNumbers(context.Background(), authorization)
resp, httpRes, err := trialNumbersApi.CreateTrialNumbers(*createTrialNumbersRequest)
	

Fetch all Free Trial Numbers

:information_source: Only required for the free trial

Fetch the Free Trial Number(s) currently assigned to your account. For more information, please see here: https://dev.telstra.com/docs/messaging-api/apiReference/apiReferenceOverviewEndpoints?version=3.x#FetchyourFreeTrialNumbers.

The function freeTrialNumbers.getAll can be used to retrieve registered destinations.

It takes no arguments.

It returns the list of phone numbers that have been registered.

For example:


import (
	"context"
	"fmt"
	"testing"

	"github.com/stretchr/testify/assert"
	msg_sdk "github.com/telstra/MessagingAPI-SDK-Go/v3"
)

configuration := msg_sdk.NewConfiguration()
apiClient := msg_sdk.NewAPIClient(configuration)

clientId := "YOUR CLIENT ID"
clientSecret := "YOUR CLIENT SECRET"
authorization, _ := msg_sdk.GetAuthorization(apiClient, clientId, clientSecret)	

trialNumbersApi := apiClient.FreeTrialNumbersAPI.GetTrialNumbers(context.Background(), authorization)
resp, httpRes, err := trialNumbersApi.GetTrialNumbers()


Virtual Number

Gives you a dedicated mobile number tied to an application which enables you to receive replies from your customers. For more information, please see here: https://dev.telstra.com/docs/messaging-api/apiReference/apiReferenceOverviewEndpoints?version=3.x#VirtualNumbers.

Assign Virtual Number

When a recipient receives your message, you can choose whether they'll see a Virtual Number or senderName (paid plans only) in the from field. If you want to use a Virtual Number, use this function to assign one. For more information, please see here: https://dev.telstra.com/docs/messaging-api/apiReference/apiReferenceOverviewEndpoints?version=3.x#AssignaVirtualNumber.

The function virtualNumbers.assign can be used to create a subscription.

It takes a object with following properties as argument:

  • replyCallbackUrl (optional): The URL that replies to the Virtual Number will be posted to.
  • tags (optional): Create your own tags and use them to fetch, sort and report on your Virtual Numbers through our other endpoints. You can assign up to 10 tags per number.

It returns an object with the following properties:

  • virtualNumber: The Virtual Number assigned to your account.
  • lastUse: The last time the Virtual Number was used to send a message.
  • replyCallbackUrl: The URL that replies to the Virtual Number will be posted to.
  • tags: Any customisable tags assigned to the Virtual Number.

For example:


import (
	"context"
	"fmt"
	"testing"

	"github.com/stretchr/testify/assert"
	msg_sdk "github.com/telstra/MessagingAPI-SDK-Go/v3"
)

configuration := msg_sdk.NewConfiguration()
apiClient := msg_sdk.NewAPIClient(configuration)

clientId := "YOUR CLIENT ID"
clientSecret := "YOUR CLIENT SECRET"
authorization, _ := msg_sdk.GetAuthorization(apiClient, clientId, clientSecret)	
	
tags := []string{
	"reprehenderit",
	"Excepteur non labore",
	"labore in consequat culpa",
	"qui voluptate",
	"n",
	"incididunt aliqua tempor",
	"incididunt dolor Lorem",
	"adipisicing aliquip elit eiusm",
	"consequat id sunt enim",
	"co",
}

assignNumberRequest := msg_sdk.NewAssignNumberRequest()
assignNumberRequest.SetReplyCallbackUrl("http://www.example.com")
assignNumberRequest.SetTags(tags)

vnApi := apiClient.VirtualNumbersAPI.AssignNumber(context.Background(), authorization)
resp, httpRes, err := vnApi.AssignNumber(*assignNumberRequest)

Fetch a Virtual Number

Fetch the tags, replyCallbackUrl and lastUse date for a Virtual Number. For more information, please see here: https://dev.telstra.com/docs/messaging-api/apiReference/apiReferenceOverviewEndpoints?version=3.x#FetchaVirtualNumber.

The function virtualNumbers.get can be used to get the details of a Virtual Number.

It takes the following arguments:

  • virtualNumber: The Virtual Number assigned to your account.

It returns an object with the following properties:

  • virtualNumber: The Virtual Number assigned to your account.
  • lastUse: The last time the Virtual Number was used to send a message.
  • replyCallbackUrl: The URL that replies to the Virtual Number will be posted to.
  • tags: Any customisable tags assigned to the Virtual Number.

For example:


import (
	"context"
	"fmt"
	"testing"

	"github.com/stretchr/testify/assert"
	msg_sdk "github.com/telstra/MessagingAPI-SDK-Go/v3"
)

configuration := msg_sdk.NewConfiguration()
apiClient := msg_sdk.NewAPIClient(configuration)

clientId := "YOUR CLIENT ID"
clientSecret := "YOUR CLIENT SECRET"
authorization, _ := msg_sdk.GetAuthorization(apiClient, clientId, clientSecret)	

vnApi := apiClient.VirtualNumbersAPI.GetVirtualNumber(context.Background(), virtualNumber, authorization)
resp, httpRes, err := vnApi.GetVirtualNumber()

Fetch all Virtual Numbers

Fetch all Virtual Numbers currently assigned to your account. For more information, please see here: https://dev.telstra.com/docs/messaging-api/apiReference/apiReferenceOverviewEndpoints?version=3.x#FetchallVirtualNumbers.

The function virtualNumbers.getAll can be used to get the all virtual numbers associated to your account.

It takes an object with following prperties as argument:

  • limit (optional): Tell us how many results you want us to return, up to a maximum of 50.
  • offset (optional): Use the offset to navigate between the response results. An offset of 0 will display the first page of results, and so on.
  • filter (optional): Filter your Virtual Numbers by tag or by number.

It returns an object with the following properties:

  • virtualNumbers: A list of Virtual Numbers assigned to your account.
  • paging: Paging information.

For example:


import (
	"context"
	"fmt"
	"testing"

	"github.com/stretchr/testify/assert"
	msg_sdk "github.com/telstra/MessagingAPI-SDK-Go/v3"
)

configuration := msg_sdk.NewConfiguration()
apiClient := msg_sdk.NewAPIClient(configuration)

clientId := "YOUR CLIENT ID"
clientSecret := "YOUR CLIENT SECRET"
authorization, _ := msg_sdk.GetAuthorization(apiClient, clientId, clientSecret)	
	
vnApi := apiClient.VirtualNumbersAPI.GetNumbers(context.Background(), authorization)
resp, httpRes, err := vnApi.GetNumbers()

Update a Virtual Number

Update a virtual number attributes. For more information, please see here: https://dev.telstra.com/docs/messaging-api/apiReference/apiReferenceOverviewEndpoints?version=3.x#UpdateaVirtualNumber.

The function virtualNumbers.update can be used to update a virtual number.

It takes an object with following properties as argument:

  • virtualNumber: The Virtual Number assigned to your account.
  • updateData (optional):
    • reply_callback_url (optional): The URL that replies to the Virtual Number will be posted to.
    • tags (optional): Create your own tags and use them to fetch, sort and report on your Virtual Numbers through our other endpoints. You can assign up to 10 tags per number.

It returns an object with the following properties:

  • virtualNumber: The Virtual Number assigned to your account.
  • lastUse: The last time the Virtual Number was used to send a message.
  • replyCallbackUrl: The URL that replies to the Virtual Number will be posted to.
  • tags: Any customisable tags assigned to the Virtual Number.

For example:


import (
	"context"
	"fmt"
	"testing"

	"github.com/stretchr/testify/assert"
	msg_sdk "github.com/telstra/MessagingAPI-SDK-Go/v3"
)

configuration := msg_sdk.NewConfiguration()
apiClient := msg_sdk.NewAPIClient(configuration)

clientId := "YOUR CLIENT ID"
clientSecret := "YOUR CLIENT SECRET"
authorization, _ := msg_sdk.GetAuthorization(apiClient, clientId, clientSecret)	

updateNumberRequest := msg_sdk.NewUpdateNumberRequest()
updateNumberRequest.SetReplyCallbackUrl("http://www.example.com")
tags := []string{
	"minim qui",
	"commodo",
	"nostrud laborum minim",
	"nulla proident ut voluptat",
	"et consectetur dolor",
	"est amet cillum",
	"exercitation",
	"non occaecat cupidatat Duis",
	"adipisicing",
	"ea aliqua incididunt",
}
updateNumberRequest.SetTags(tags)

vnApi := apiClient.VirtualNumbersAPI.UpdateNumber(context.Background(), virtualNumber, authorization)
resp, httpRes, err := vnApi.UpdateNumber(*updateNumberRequest)

Delete Virtual Number

Delete the a virtual number. For more information, please see here: https://dev.telstra.com/docs/messaging-api/apiReference/apiReferenceOverviewEndpoints?version=3.x#DeleteaVirtualNumber.

The function virtualNumbers.get can be used to unassign a Virtual Number.

It takes the following arguments:

  • virtualNumber: The Virtual Number assigned to your account.

It returns nothing.

For example:


import (
	"context"
	"fmt"
	"testing"

	"github.com/stretchr/testify/assert"
	msg_sdk "github.com/telstra/MessagingAPI-SDK-Go/v3"
)

configuration := msg_sdk.NewConfiguration()
apiClient := msg_sdk.NewAPIClient(configuration)

clientId := "YOUR CLIENT ID"
clientSecret := "YOUR CLIENT SECRET"
authorization, _ := msg_sdk.GetAuthorization(apiClient, clientId, clientSecret)	

vnApi := apiClient.VirtualNumbersAPI.DeleteNumber(context.Background(), virtualNumber, authorization)
httpRes, err := vnApi.DeleteNumber()

Fetch all Recipient Optouts list

Fetch any mobile number(s) that have opted out of receiving messages from a Virtual Number assigned to your account. For more information, please see here: https://dev.telstra.com/docs/messaging-api/apiReference/apiReferenceOverviewEndpoints?version=3.x#Fetchallrecipientoptoutslist.

The function telstra.messaging.virtual_number.get_optouts can be used to get the list of mobile numbers that have opted out of receiving messages from a virtual number associated to your account. It takes the following arguments:

  • virtual_number: The Virtual Number assigned to your account.
  • limit: Tell us how many results you want us to return, up to a maximum of 50.
  • offset: Use the offset to navigate between the response results. An offset of 0 will display the first page of results, and so on.

Raises telstra.messaging.exceptions.VirtualNumbersError if anything goes wrong.

It returns an object with the following properties:

  • recipient_optouts: A list of recipient optouts.
  • paging: Paging information.

For example:


import (
	"context"
	"fmt"
	"testing"

	"github.com/stretchr/testify/assert"
	msg_sdk "github.com/telstra/MessagingAPI-SDK-Go/v3"
)

configuration := msg_sdk.NewConfiguration()
apiClient := msg_sdk.NewAPIClient(configuration)

clientId := "YOUR CLIENT ID"
clientSecret := "YOUR CLIENT SECRET"
authorization, _ := msg_sdk.GetAuthorization(apiClient, clientId, clientSecret)	

vnApi := apiClient.VirtualNumbersAPI.GetRecipientOptouts(context.Background(), virtualNumber, authorization)
resp, httpRes, err := vnApi.GetRecipientOptouts()

Message

Send and receive messages. For more information, please see here: https://dev.telstra.com/docs/messaging-api/apiReference/apiReferenceOverviewEndpoints?version=3.x#Messages.

Send Message

Send a message to a mobile number, or to multiple mobile numbers. For more information, please see here: https://dev.telstra.com/docs/messaging-api/apiReference/apiReferenceOverviewEndpoints?version=3.x#SendanSMSorMMS.

The function messages.send can be used to send a message.

It takes an object with following properties as argument:

  • to: The destination address, expected to be a phone number of the form +614XXXXXXXX or 04XXXXXXXX.
  • from: This will be either one of your Virtual Numbers or your senderName.
  • messageContent (Either one of messageContent or multimedia is required): The content of the message.
  • multimedia (Either one of messageContent or multimedia is required): MMS multimedia content.
  • retryTimeout (optional): How many minutes you asked the server to keep trying to send the message.
  • scheduleSend (optional): The time (in Central Standard Time) the message is scheduled to send.
  • deliveryNotification (optional): If set to true, you will receive a notification to the statusCallbackUrl when your SMS or MMS is delivered (paid feature).
  • statusCallbackUrl (optional): The URL the API will call when the status of the message changes.
  • tags (optional): Any customisable tags assigned to the message.

The type TMultimediacan be used to build an mms payload. It has following properties:

  • type: The content type of the attachment, for example <TMultimediaContentType.IMAGE_GIF>.
  • fileName (optional): Optional field, for example image.png.
  • payload: The payload of an mms encoded as base64.

It returns an object with the following properties:

  • messageId: Use this UUID with our other endpoints to fetch, update or delete the message.
  • status: The status will be either queued, sent, delivered or expired.
  • to: The recipient's mobile number(s).
  • from: This will be either one of your Virtual Numbers or your senderName.
  • messageContent: The content of the message.
  • multimedia: The multimedia content of the message (MMS only).
  • retryTimeout: How many minutes you asked the server to keep trying to send the message.
  • scheduleSend: The time (in Central Standard Time) a message is scheduled to send.
  • deliveryNotification: If set to true, you will receive a notification to the statusCallbackUrl when your SMS or MMS is delivered (paid feature).
  • statusCallbackUrl: The URL the API will call when the status of the message changes.
  • tags: Any customisable tags assigned to the message.

For example:


import (
	"context"
	"fmt"
	"testing"
	"time"

	"github.com/stretchr/testify/assert"
	msg_sdk "github.com/telstra/MessagingAPI-SDK-Go/v3"
)

configuration := msg_sdk.NewConfiguration()
apiClient := msg_sdk.NewAPIClient(configuration)

clientId := "YOUR CLIENT ID"
clientSecret := "YOUR CLIENT SECRET"
authorization, _ := msg_sdk.GetAuthorization(apiClient, clientId, clientSecret)	

sendMessagesSlice := []string{"0400000001", "0400000002"}
sendMessagesRequestTo := msg_sdk.SendMessagesRequestTo{
	ArrayOfString: &sendMessagesSlice,
	String:        new(string),
}

sendMessagesFrom := "0428180739"
sendMessagesRequest := msg_sdk.NewSendMessagesRequest(sendMessagesRequestTo, sendMessagesFrom)
setMessageContent := "Hello customer, this is from CBA to confirme your offer!"
sendMessagesRequest.SetMessageContent(setMessageContent)
sendMessagesRequest.SetDeliveryNotification(false)
sendMessagesRequest.SetRetryTimeout(10)
sendMessagesRequest.SetStatusCallbackUrl("http://www.example.com")

tags := []string{
	"ip",
	"deserunt exercitation",
	"id mollit magna proident ipsum",
	"consequat proident",
	"u",
	"nulla ve",
	"deserunt proident",
	"deserunt nulla id esse",
	"laboris velit",
	"pr",
}

sendMessagesRequest.SetScheduleSend(time.Now().AddDate(0, 0, 5).UTC())

sendMessagesRequest.SetTags(tags)

messagesApi := apiClient.MessagesAPI.SendMessages(context.Background(), authorization)
resp, httpRes, err := messagesApi.SendMessages(*sendMessagesRequest)

Get a Message

Use the messageId to fetch a message that's been sent from/to your account within the last 30 days. For more information, please see here: https://dev.telstra.com/docs/messaging-api/apiReference/apiReferenceOverviewEndpoints?version=3.x#Fetchamessage.

The function messages.get can be used to retrieve the a message.

It takes the following arguments:

  • messageId: Unique identifier for the message.

It returns an object with the following properties:

  • messageId: Use this UUID with our other endpoints to fetch, update or delete the message.
  • status: The status will be either queued, sent, delivered or expired.
  • createTimestamp: The time you submitted the message to the queue for sending.
  • sentTimestamp: The time the message was sent from the server.
  • receivedTimestamp: The time the message was received by the recipient's device.
  • to: The recipient's mobile number(s).
  • from: This will be either one of your Virtual Numbers or your senderName.
  • messageContent: The content of the message.
  • multimedia: The multimedia content of the message (MMS only).
  • direction: Direction of the message (outgoing or incoming).
  • retryTimeout: How many minutes you asked the server to keep trying to send the message.
  • scheduleSend: The time (in Central Standard Time) the message is scheduled to send.
  • deliveryNotification: If set to true, you will receive a notification to the statusCallbackUrl when your SMS or MMS is delivered (paid feature).
  • statusCallbackUrl: The URL the API will call when the status of the message changes.
  • queuePriority: The priority assigned to the message.
  • tags: Any customisable tags assigned to the message.

For example:


import (
	"context"
	"fmt"
	"testing"
	"time"

	"github.com/stretchr/testify/assert"
	msg_sdk "github.com/telstra/MessagingAPI-SDK-Go/v3"
)

configuration := msg_sdk.NewConfiguration()
apiClient := msg_sdk.NewAPIClient(configuration)

clientId := "YOUR CLIENT ID"
clientSecret := "YOUR CLIENT SECRET"
authorization, _ := msg_sdk.GetAuthorization(apiClient, clientId, clientSecret)	

messagesApi := apiClient.MessagesAPI.GetMessageById(context.Background(), messageId, authorization)
resp, httpRes, err := messagesApi.GetMessageById()

Get all Messages

Fetch messages that have been sent from/to your account in the last 30 days. For more information, please see here: https://dev.telstra.com/docs/messaging-api/apiReference/apiReferenceOverviewEndpoints?version=3.x#Fetchallsent/receivedmessages.

The function messages.getAll can be used to fetch all messages.

It takes an object with following properties as argument:

  • limit (optional): Tell us how many results you want us to return, up to a maximum of 50.
  • offset (optional): Use the offset to navigate between the response results. An offset of 0 will display the first page of results, and so on.
  • filter (optional): Filter your Virtual Numbers by tag or by number.

It returns an object with the following properties:

  • messages: List of all messages.
  • paging: Paging information.

For example:


import (
	"context"
	"fmt"
	"testing"
	"time"

	"github.com/stretchr/testify/assert"
	msg_sdk "github.com/telstra/MessagingAPI-SDK-Go/v3"
)

configuration := msg_sdk.NewConfiguration()
apiClient := msg_sdk.NewAPIClient(configuration)

clientId := "YOUR CLIENT ID"
clientSecret := "YOUR CLIENT SECRET"
authorization, _ := msg_sdk.GetAuthorization(apiClient, clientId, clientSecret)	

messagesApi := apiClient.MessagesAPI.GetMessages(context.Background(), authorization)
reverse := true
messagesApi.Reverse(reverse)
startTime := time.Now().AddDate(0, 0, -5).UTC()
messagesApi.StartTime(startTime)
endTime := time.Now().AddDate(0, 0, -1).UTC()
messagesApi.EndTime(endTime)

resp, httpRes, err := messagesApi.GetMessages()
		

Update a Message

Update a message that's scheduled for sending, you can change any of the below parameters, as long as the message hasn't been sent yet. For more information, please see here: https://dev.telstra.com/docs/messaging-api/apiReference/apiReferenceOverviewEndpoints?version=3.x#Updateamessage.

The function messages.send can be used to send a message.

It takes an object with following properties as argument:

  • messageId: Use this UUID with our other endpoints to fetch, update or delete the message.
  • to: The destination address, expected to be a phone number of the form +614XXXXXXXX or 04XXXXXXXX.
  • from: This will be either one of your Virtual Numbers or your senderName.
  • messageContent (Either one of messageContent or multimedia is required): The content of the message.
  • multimedia (Either one of messageContent or multimedia is required): MMS multimedia content.
  • retryTimeout (optional): How many minutes you asked the server to keep trying to send the message.
  • scheduleSend (optional): The time (in Central Standard Time) the message is scheduled to send.
  • deliveryNotification (optional): If set to true, you will receive a notification to the statusCallbackUrl when your SMS or MMS is delivered (paid feature).
  • statusCallbackUrl (optional): The URL the API will call when the status of the message changes.
  • tags (optional): Any customisable tags assigned to the message.

The type TMultimediacan be used to build an mms payload. It has following properties:

  • type: The content type of the attachment, for example <TMultimediaContentType.IMAGE_GIF>.
  • fileName (optional): Optional field, for example image.png.
  • payload: The payload of an mms encoded as base64.

The dataclass telstra.messaging.message.Multimedia can be used to build a mms payload. It takes the following arguments:

  • type: The content type of the attachment, for example image/png.
  • filename (optional): Optional field, for example image.png.
  • payload: The payload of an mms encoded as base64.

It returns an object with the following properties:

  • messageId: Use this UUID with our other endpoints to fetch, update or delete the message.
  • status: The status will be either queued, sent, delivered or expired.
  • to: The recipient's mobile number(s).
  • from: This will be either one of your Virtual Numbers or your senderName.
  • messageContent: The content of the message.
  • multimedia: The multimedia content of the message (MMS only).
  • retryTimeout: How many minutes you asked the server to keep trying to send the message.
  • scheduleSend: The time (in Central Standard Time) a message is scheduled to send.
  • deliveryNotification: If set to true, you will receive a notification to the statusCallbackUrl when your SMS or MMS is delivered (paid feature).
  • statusCallbackUrl: The URL the API will call when the status of the message changes.
  • tags: Any customisable tags assigned to the message.

For example:


import (
	"context"
	"fmt"
	"testing"
	"time"

	"github.com/stretchr/testify/assert"
	msg_sdk "github.com/telstra/MessagingAPI-SDK-Go/v3"
)	
	
configuration := msg_sdk.NewConfiguration()
apiClient := msg_sdk.NewAPIClient(configuration)

clientId := "YOUR CLIENT ID"
clientSecret := "YOUR CLIENT SECRET"
authorization, _ := msg_sdk.GetAuthorization(apiClient, clientId, clientSecret)	

updateMessageByIdRequest := msg_sdk.NewUpdateMessageByIdRequest("0400000001", "0428180739")

setMessageContent := "Ut veniam in ipsum exercitation"
updateMessageByIdRequest.SetMessageContent(setMessageContent)
updateMessageByIdRequest.SetDeliveryNotification(false)
updateMessageByIdRequest.SetRetryTimeout(10)
updateMessageByIdRequest.SetStatusCallbackUrl("http://www.example.com")

tags := []string{
	"ip",
	"deserunt exercitation",
	"id mollit magna proident ipsum",
	"consequat proident",
	"u",
	"nulla ve",
	"deserunt proident",
	"deserunt nulla id esse",
	"laboris velit",
	"pr",
}
updateMessageByIdRequest.SetTags(tags)

messagesApi := apiClient.MessagesAPI.UpdateMessageById(context.Background(), messageId, authorization)
resp, httpRes, err := messagesApi.UpdateMessageById(*updateMessageByIdRequest)	

Update Message Tags

Update message tags, you can update them even after your message has been delivered. For more information, please see here: https://dev.telstra.com/docs/messaging-api/apiReference/apiReferenceOverviewEndpoints?version=3.x#Updatemessagetags.

The function messages.updateTags can be used to update message tags.

It takes the following arguments:

  • messageId: Unique identifier for the message.
  • tags (optional): Any customisable tags assigned to the message.

It returns nothing.

For example:


import (
	"context"
	"fmt"
	"testing"
	"time"

	"github.com/stretchr/testify/assert"
	msg_sdk "github.com/telstra/MessagingAPI-SDK-Go/v3"
)

configuration := msg_sdk.NewConfiguration()
apiClient := msg_sdk.NewAPIClient(configuration)

clientId := "YOUR CLIENT ID"
clientSecret := "YOUR CLIENT SECRET"
authorization, _ := msg_sdk.GetAuthorization(apiClient, clientId, clientSecret)	

tags := []string{"marketing", "SMS"}
updateMessageTagsRequest := msg_sdk.NewUpdateMessageTagsRequest(tags)

messagesApi := apiClient.MessagesAPI.UpdateMessageTags(context.Background(), messageId, authorization)
httpRes, err := messagesApi.UpdateMessageTags(*updateMessageTagsRequest)

Delete a Message

Delete a scheduled message, but hasn't yet sent. For more information, please see here: https://dev.telstra.com/docs/messaging-api/apiReference/apiReferenceOverviewEndpoints?version=3.x#Deleteamessage.

The function messages.delete can be used to delete a message.

It takes the following arguments:

  • messageId: Unique identifier for the message.

It returns nothing.

For example:


import (
	"context"
	"fmt"
	"testing"
	"time"

	"github.com/stretchr/testify/assert"
	msg_sdk "github.com/telstra/MessagingAPI-SDK-Go/v3"
)

configuration := msg_sdk.NewConfiguration()
apiClient := msg_sdk.NewAPIClient(configuration)

clientId := "YOUR CLIENT ID"
clientSecret := "YOUR CLIENT SECRET"
authorization, _ := msg_sdk.GetAuthorization(apiClient, clientId, clientSecret)	

messagesApi := apiClient.MessagesAPI.DeleteMessageById(context.Background(), messageId, authorization)
httpRes, err := messagesApi.DeleteMessageById()


Reports

Create and fetch reports. For more information, please see here: https://dev.telstra.com/content/messaging-api-v3#tag/reports.

Request a Messages Report

Request a CSV report of messages (both incoming and outgoing) that have been sent to/from your account within the last three months. For more information, please see here: https://dev.telstra.com/docs/messaging-api/apiReference/apiReferenceOverviewEndpoints?version=3.x#Submitarequestforamessagesreport.

The function reports.create can be used to create a report.

It takes the following arguments:

  • startDate: Set the time period you want to generate a report for by typing the start date (inclusive) here. Note that we only retain data for three months, so please ensure your startDate is not more than three months old. Use ISO format(yyyy-mm-dd), e.g. "2019-08-24".
  • endDate: Type the end date (inclusive) of your reporting period here. Your endDate must be a date in the past, and less than three months from your startDate. Use ISO format(yyyy-mm-dd), e.g. "2019-08-24".
  • reportCallbackUrl (optional): The callbackUrl where notification is sent when report is ready for download.
  • filter (optional): Filter report messages by: tag - use one of the tags assigned to your message(s) number - either the Virtual Number used to send the message, or the Recipient Number the message was sent to.

It returns an object with the following properties:

  • reportId: Use this UUID with our other endpoints to fetch the report.
  • reportCallbackUrl: If you provided a reportCallbackUrl in your request, it will be returned here.
  • reportStatus: The status of the report. It will be either:
    • queued – the report is in the queue for generation.
    • completed – the report is ready for download.
    • failed – the report failed to generate, please try again.

For example:


import (
	"context"
	"fmt"
	"testing"
	"time"

	"github.com/stretchr/testify/assert"
	msg_sdk "github.com/telstra/MessagingAPI-SDK-Go/v3"
)

configuration := msg_sdk.NewConfiguration()
apiClient := msg_sdk.NewAPIClient(configuration)

clientId := "YOUR CLIENT ID"
clientSecret := "YOUR CLIENT SECRET"
authorization, _ := msg_sdk.GetAuthorization(apiClient, clientId, clientSecret)	

now := time.Now()
threeDaysAgo := now.AddDate(0, 0, -3)
oneDayAgo := now.AddDate(0, 0, -1)
threeDaysAgoFormatted := threeDaysAgo.Format("2006-01-02")
oneDayAgoFormatted := oneDayAgo.Format("2006-01-02")
messageReportRequest := msg_sdk.NewMessagesReportRequest(threeDaysAgoFormatted, oneDayAgoFormatted)

reportsApi := apiClient.ReportsAPI.MessagesReport(context.Background(), authorization)
resp, httpRes, err := reportsApi.MessagesReport(*messageReportRequest)

Fetch a specific report

Use the report_id to fetch a download link for a report generated. For more information, please see here: https://dev.telstra.com/docs/messaging-api/apiReference/apiReferenceOverviewEndpoints?version=3.x#FetchaReport.

The function reports.get can be used to retrieve the a report download link. It takes the following arguments:

  • reportId: Unique identifier for the report.

It returns an object with the following properties:

  • reportId: Use this UUID with our other endpoints to fetch the report.
  • reportStatus: The status of the report.
  • reportUrl: Download link to download the CSV file.

For example:


import (
	"context"
	"fmt"
	"testing"
	"time"

	"github.com/stretchr/testify/assert"
	msg_sdk "github.com/telstra/MessagingAPI-SDK-Go/v3"
)

configuration := msg_sdk.NewConfiguration()
apiClient := msg_sdk.NewAPIClient(configuration)

clientId := "YOUR CLIENT ID"
clientSecret := "YOUR CLIENT SECRET"
authorization, _ := msg_sdk.GetAuthorization(apiClient, clientId, clientSecret)	

reportId := "c22d2050-eb37-11ee-ad5e-3d9263246ccb"
reportsApi := apiClient.ReportsAPI.GetReport(context.Background(), reportId, authorization)
resp, httpRes, err := reportsApi.GetReport()

Fetch all reports

Fetch details of all reports recently generated for your account. Use it to check the status of a report, plus fetch the report ID, status, report type and expiry date. For more information, please see here: https://dev.telstra.com/docs/messaging-api/apiReference/apiReferenceOverviewEndpoints?version=3.x#Fetchallreports.

The function reports.getAll can be used to fetch all reports.

It doesn't take any arguments.

It returns a list of objects with the following properties:

  • reportId: Use this UUID with our other endpoints to fetch the report.
  • reportStatus: The status of the report.
  • reportType: The type of report generated.
  • reportExpiry: The expiry date of your report. After this date, you will be unable to download your report.

For example:


import (
	"context"
	"fmt"
	"testing"
	"time"

	"github.com/stretchr/testify/assert"
	msg_sdk "github.com/telstra/MessagingAPI-SDK-Go/v3"
)	

configuration := msg_sdk.NewConfiguration()
apiClient := msg_sdk.NewAPIClient(configuration)

clientId := "YOUR CLIENT ID"
clientSecret := "YOUR CLIENT SECRET"
authorization, _ := msg_sdk.GetAuthorization(apiClient, clientId, clientSecret)	

reportsApi := apiClient.ReportsAPI.GetReports(context.Background(), authorization)
resp, httpRes, err := reportsApi.GetReports()

Health Check

Get operational status of the messaging service

Check the operational status of the messaging service. For more information, please see here: https://dev.telstra.com/docs/messaging-api/apiReference/apiReferenceOverviewEndpoints?version=3.x#HealthCheck.

The function healthCheck.get can be used to get the status.

It takes no arguments.

It returns an object with following properties:

  • status: Denotes the status of the services Up/Down.

For example:


import (
	"context"
	"fmt"
	"testing"

	"github.com/stretchr/testify/assert"
	msg_sdk "github.com/telstra/MessagingAPI-SDK-Go/v3"
)

configuration := msg_sdk.NewConfiguration()
apiClient := msg_sdk.NewAPIClient(configuration)

clientId := "YOUR CLIENT ID"
clientSecret := "YOUR CLIENT SECRET"
authorization, _ := msg_sdk.GetAuthorization(apiClient, clientId, clientSecret)	

healthCheckApi := apiClient.HealthCheckAPI.HealthCheck(context.Background(), authorization)
resp, httpRes, err := healthCheckApi.HealthCheck()

# Functions

[]stringAsCreateTrialNumbersRequestFreeTrialNumbers is a convenience function that returns []string wrapped in CreateTrialNumbersRequestFreeTrialNumbers.
[]stringAsMessageSentMessageId is a convenience function that returns []string wrapped in MessageSentMessageId.
[]stringAsMessageSentTo is a convenience function that returns []string wrapped in MessageSentTo.
[]stringAsSendMessagesRequestTo is a convenience function that returns []string wrapped in SendMessagesRequestTo.
CacheExpires helper function to determine remaining time before repeating a request.
No description provided by the author
IsNil checks if an input is nil.
No description provided by the author
NewAPIResponse returns a new APIResponse object.
NewAPIResponseWithError returns a new APIResponse object with the provided error message.
NewAssignNumberRequest instantiates a new AssignNumberRequest object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewAssignNumberRequestWithDefaults instantiates a new AssignNumberRequest object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
NewAuthToken400Response instantiates a new AuthToken400Response object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewAuthToken400ResponseWithDefaults instantiates a new AuthToken400Response object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
NewConfiguration returns a new Configuration object.
NewCreateTrialNumbersRequest instantiates a new CreateTrialNumbersRequest object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewCreateTrialNumbersRequestWithDefaults instantiates a new CreateTrialNumbersRequest object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
NewError instantiates a new Error object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewErrors instantiates a new Errors object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewErrorsWithDefaults instantiates a new Errors object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
NewErrorWithDefaults instantiates a new Error object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
NewFreeTrialNumbers instantiates a new FreeTrialNumbers object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewFreeTrialNumbersWithDefaults instantiates a new FreeTrialNumbers object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
NewGetLogs200Response instantiates a new GetLogs200Response object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewGetLogs200ResponseWithDefaults instantiates a new GetLogs200Response object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
NewGetMessages200Response instantiates a new GetMessages200Response object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewGetMessages200ResponsePaging instantiates a new GetMessages200ResponsePaging object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewGetMessages200ResponsePagingWithDefaults instantiates a new GetMessages200ResponsePaging object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
NewGetMessages200ResponseWithDefaults instantiates a new GetMessages200Response object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
NewGetNumbers200Response instantiates a new GetNumbers200Response object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewGetNumbers200ResponseWithDefaults instantiates a new GetNumbers200Response object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
NewGetRecipientOptouts200Response instantiates a new GetRecipientOptouts200Response object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewGetRecipientOptouts200ResponseWithDefaults instantiates a new GetRecipientOptouts200Response object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
NewGetReport200Response instantiates a new GetReport200Response object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewGetReport200ResponseWithDefaults instantiates a new GetReport200Response object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
NewGetReports200Response instantiates a new GetReports200Response object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewGetReports200ResponseReportsInner instantiates a new GetReports200ResponseReportsInner object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewGetReports200ResponseReportsInnerWithDefaults instantiates a new GetReports200ResponseReportsInner object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
NewGetReports200ResponseWithDefaults instantiates a new GetReports200Response object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
NewHealthCheck200Response instantiates a new HealthCheck200Response object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewHealthCheck200ResponseWithDefaults instantiates a new HealthCheck200Response object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
NewLog instantiates a new Log object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewLogWithDefaults instantiates a new Log object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
NewMessageGet instantiates a new MessageGet object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewMessageGetWithDefaults instantiates a new MessageGet object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
NewMessageSent instantiates a new MessageSent object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewMessageSentWithDefaults instantiates a new MessageSent object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
NewMessagesReport201Response instantiates a new MessagesReport201Response object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewMessagesReport201ResponseWithDefaults instantiates a new MessagesReport201Response object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
NewMessagesReportRequest instantiates a new MessagesReportRequest object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewMessagesReportRequestWithDefaults instantiates a new MessagesReportRequest object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
NewMessageUpdate instantiates a new MessageUpdate object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewMessageUpdateWithDefaults instantiates a new MessageUpdate object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
NewMultimedia instantiates a new Multimedia object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewMultimediaGet instantiates a new MultimediaGet object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewMultimediaGetWithDefaults instantiates a new MultimediaGet object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
NewMultimediaWithDefaults instantiates a new Multimedia object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
NewOAuth instantiates a new OAuth object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewOAuthWithDefaults instantiates a new OAuth object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
NewRecipientOptout instantiates a new RecipientOptout object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewRecipientOptoutWithDefaults instantiates a new RecipientOptout object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
NewSendMessagesRequest instantiates a new SendMessagesRequest object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewSendMessagesRequestWithDefaults instantiates a new SendMessagesRequest object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
NewUpdateMessageByIdRequest instantiates a new UpdateMessageByIdRequest object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewUpdateMessageByIdRequestWithDefaults instantiates a new UpdateMessageByIdRequest object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
NewUpdateMessageTagsRequest instantiates a new UpdateMessageTagsRequest object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewUpdateMessageTagsRequestWithDefaults instantiates a new UpdateMessageTagsRequest object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
NewUpdateNumberRequest instantiates a new UpdateNumberRequest object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewUpdateNumberRequestWithDefaults instantiates a new UpdateNumberRequest object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
NewVirtualNumber instantiates a new VirtualNumber object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewVirtualNumberWithDefaults instantiates a new VirtualNumber object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
PtrBool is a helper routine that returns a pointer to given boolean value.
PtrFloat32 is a helper routine that returns a pointer to given float value.
PtrFloat64 is a helper routine that returns a pointer to given float value.
PtrInt is a helper routine that returns a pointer to given integer value.
PtrInt32 is a helper routine that returns a pointer to given integer value.
PtrInt64 is a helper routine that returns a pointer to given integer value.
PtrString is a helper routine that returns a pointer to given string value.
PtrTime is helper routine that returns a pointer to given Time value.
No description provided by the author
stringAsCreateTrialNumbersRequestFreeTrialNumbers is a convenience function that returns string wrapped in CreateTrialNumbersRequestFreeTrialNumbers.
stringAsMessageSentMessageId is a convenience function that returns string wrapped in MessageSentMessageId.
stringAsMessageSentTo is a convenience function that returns string wrapped in MessageSentTo.
stringAsSendMessagesRequestTo is a convenience function that returns string wrapped in SendMessagesRequestTo.

# Variables

ContextOAuth2 takes an oauth2.TokenSource as authentication for the request.
ContextOperationServerIndices uses a server configuration from the index mapping.
ContextOperationServerVariables overrides a server configuration variables using operation specific values.
ContextServerIndex uses a server configuration from the index.
ContextServerVariables overrides a server configuration variables.

# Structs

No description provided by the author
No description provided by the author
APIClient manages communication with the Messaging API v3.4.3 API v3.1.0 In most cases there should be only one, shared, APIClient.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
APIKey provides API key based authentication to a request passed via context using ContextAPIKey.
No description provided by the author
APIResponse stores the API response returned by the server.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
AssignNumberRequest struct for AssignNumberRequest.
AuthToken400Response OAuth Error Responses.
BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth.
Configuration stores the configuration of the API client.
CreateTrialNumbersRequest struct for CreateTrialNumbersRequest.
CreateTrialNumbersRequestFreeTrialNumbers - These are the mobile numbers you want to message during your Free Trial.
Error struct for Error.
Errors struct for Errors.
FreeTrialNumbers struct for FreeTrialNumbers.
GenericOpenAPIError Provides access to the body, error and model on returned errors.
GetLogs200Response struct for GetLogs200Response.
GetMessages200Response struct for GetMessages200Response.
GetMessages200ResponsePaging struct for GetMessages200ResponsePaging.
GetNumbers200Response struct for GetNumbers200Response.
GetRecipientOptouts200Response struct for GetRecipientOptouts200Response.
GetReport200Response struct for GetReport200Response.
GetReports200Response struct for GetReports200Response.
GetReports200ResponseReportsInner struct for GetReports200ResponseReportsInner.
HealthCheck200Response struct for HealthCheck200Response.
Log struct for Log.
MessageGet struct for MessageGet.
MessageSent struct for MessageSent.
MessageSentMessageId - Use this UUID with our other endpoints to fetch, update or delete the message.
MessageSentTo - The recipient's mobile number(s).
MessagesReport201Response struct for MessagesReport201Response.
MessagesReportRequest struct for MessagesReportRequest.
MessageUpdate struct for MessageUpdate.
Multimedia struct for Multimedia.
MultimediaGet struct for MultimediaGet.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
OAuth struct for OAuth.
RecipientOptout struct for RecipientOptout.
No description provided by the author
SendMessagesRequest struct for SendMessagesRequest.
SendMessagesRequestTo - This is the mobile number you want to send your message to.
ServerConfiguration stores the information about a server.
ServerVariable stores the information about a server variable.
UpdateMessageByIdRequest struct for UpdateMessageByIdRequest.
UpdateMessageTagsRequest struct for UpdateMessageTagsRequest.
UpdateNumberRequest struct for UpdateNumberRequest.
VirtualNumber struct for VirtualNumber.

# Interfaces

No description provided by the author

# Type aliases

AuthenticationAPIService AuthenticationAPI service.
FreeTrialNumbersAPIService FreeTrialNumbersAPI service.
HealthCheckAPIService HealthCheckAPI service.
LogsAPIService LogsAPI service.
MessagesAPIService MessagesAPI service.
ReportsAPIService ReportsAPI service.
ServerConfigurations stores multiple ServerConfiguration items.
VirtualNumbersAPIService VirtualNumbersAPI service.