Skip to content

Latest commit

 

History

History
506 lines (348 loc) · 20.3 KB

MessagesAPI.md

File metadata and controls

506 lines (348 loc) · 20.3 KB

\MessagesAPI

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

Method HTTP request Description
DeleteMessageById Delete /messages/{messageId} delete a message
GetMessageById Get /messages/{messageId} fetch a specific message
GetMessages Get /messages fetch all sent/received messages
SendMessages Post /messages send messages
UpdateMessageById Put /messages/{messageId} update a message
UpdateMessageTags Patch /messages/{messageId} update message tags

DeleteMessageById

DeleteMessageById(ctx, messageId).ContentLanguage(contentLanguage).Authorization(authorization).Accept(accept).AcceptCharset(acceptCharset).ContentType(contentType).TelstraApiVersion(telstraApiVersion).Execute()

delete a message

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
)

func main() {
    contentLanguage := "en-au" // string | 
    authorization := "Bearer <access_token>" // string | 
    accept := "application/json" // string | 
    acceptCharset := "utf-8" // string | 
    contentType := "application/json; charset=utf-8" // string | 
    messageId := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | When you sent the original message, this is the UUID that was returned in the call response. Use this ID to fetch, update or delete a message with the appropriate endpoints. 
    telstraApiVersion := "3.1.0" // string |  (optional)

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    r, err := apiClient.MessagesAPI.DeleteMessageById(context.Background(), messageId).ContentLanguage(contentLanguage).Authorization(authorization).Accept(accept).AcceptCharset(acceptCharset).ContentType(contentType).TelstraApiVersion(telstraApiVersion).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `MessagesAPI.DeleteMessageById``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
messageId string When you sent the original message, this is the UUID that was returned in the call response. Use this ID to fetch, update or delete a message with the appropriate endpoints.

Other Parameters

Other parameters are passed through a pointer to a apiDeleteMessageByIdRequest struct via the builder pattern

Name Type Description Notes
contentLanguage string
authorization string
accept string
acceptCharset string
contentType string

telstraApiVersion | string | |

Return type

(empty response body)

Authorization

bearer_auth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetMessageById

MessageGet GetMessageById(ctx, messageId).ContentLanguage(contentLanguage).Authorization(authorization).Accept(accept).AcceptCharset(acceptCharset).ContentType(contentType).TelstraApiVersion(telstraApiVersion).Execute()

fetch a specific message

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
)

func main() {
    contentLanguage := "en-au" // string | 
    authorization := "Bearer <access_token>" // string | 
    accept := "application/json" // string | 
    acceptCharset := "utf-8" // string | 
    contentType := "application/json; charset=utf-8" // string | 
    messageId := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | When you sent the original message, this is the UUID that was returned in the response. Use this ID to fetch, update or delete a message with the appropriate endpoints.   Incoming messages are also assigned a messageId. Use this ID with GET/ messages/{messageId} to fetch the message later. 
    telstraApiVersion := "3.1.0" // string |  (optional)

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.MessagesAPI.GetMessageById(context.Background(), messageId).ContentLanguage(contentLanguage).Authorization(authorization).Accept(accept).AcceptCharset(acceptCharset).ContentType(contentType).TelstraApiVersion(telstraApiVersion).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `MessagesAPI.GetMessageById``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `GetMessageById`: MessageGet
    fmt.Fprintf(os.Stdout, "Response from `MessagesAPI.GetMessageById`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
messageId string When you sent the original message, this is the UUID that was returned in the response. Use this ID to fetch, update or delete a message with the appropriate endpoints. Incoming messages are also assigned a messageId. Use this ID with GET/ messages/{messageId} to fetch the message later.

Other Parameters

Other parameters are passed through a pointer to a apiGetMessageByIdRequest struct via the builder pattern

Name Type Description Notes
contentLanguage string
authorization string
accept string
acceptCharset string
contentType string

telstraApiVersion | string | |

Return type

MessageGet

Authorization

bearer_auth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetMessages

GetMessages200Response GetMessages(ctx).ContentLanguage(contentLanguage).Authorization(authorization).Accept(accept).AcceptCharset(acceptCharset).ContentType(contentType).TelstraApiVersion(telstraApiVersion).Limit(limit).Offset(offset).Direction(direction).Status(status).Filter(filter).Execute()

fetch all sent/received messages

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
)

func main() {
    contentLanguage := "en-au" // string | 
    authorization := "Bearer <access_token>" // string | 
    accept := "application/json" // string | 
    acceptCharset := "utf-8" // string | 
    contentType := "application/json; charset=utf-8" // string | 
    telstraApiVersion := "3.1.0" // string |  (optional)
    limit := int32(56) // int32 | Tell us how many results you want us to return, up to a maximum of 50.  (optional) (default to 10)
    offset := int32(56) // int32 | Use the offset to navigate between the response results. An offset of 0 will display the first page of results, and so on.  (optional) (default to 0)
    direction := "direction_example" // string | Filter your messages by direction: * **outgoing** – messages sent from your account. * **incoming** – messages sent to your account.  (optional)
    status := "status_example" // string | Filter your messages by one of the statuses below:  * **queued** – messages queued for sending or still in transit. * **sent** – messages that have been sent from the server. * **delivered** – messages successful delivered to the recipient's device. Note that we will only be able to return this status if you set deliveryNotification to **true** (paid feature).  * **expired** – message that couldn't be sent within the **retryTimeout** timeframe.  (optional)
    filter := "filter_example" // string | Filter your 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.  (optional)

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.MessagesAPI.GetMessages(context.Background()).ContentLanguage(contentLanguage).Authorization(authorization).Accept(accept).AcceptCharset(acceptCharset).ContentType(contentType).TelstraApiVersion(telstraApiVersion).Limit(limit).Offset(offset).Direction(direction).Status(status).Filter(filter).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `MessagesAPI.GetMessages``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `GetMessages`: GetMessages200Response
    fmt.Fprintf(os.Stdout, "Response from `MessagesAPI.GetMessages`: %v\n", resp)
}

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiGetMessagesRequest struct via the builder pattern

Name Type Description Notes
contentLanguage string
authorization string
accept string
acceptCharset string
contentType string
telstraApiVersion string
limit int32 Tell us how many results you want us to return, up to a maximum of 50. [default to 10]
offset int32 Use the offset to navigate between the response results. An offset of 0 will display the first page of results, and so on. [default to 0]
direction string Filter your messages by direction: * outgoing – messages sent from your account. * incoming – messages sent to your account.
status string Filter your messages by one of the statuses below: * queued – messages queued for sending or still in transit. * sent – messages that have been sent from the server. * delivered – messages successful delivered to the recipient's device. Note that we will only be able to return this status if you set deliveryNotification to true (paid feature). * expired – message that couldn't be sent within the retryTimeout timeframe.
filter string Filter your 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.

Return type

GetMessages200Response

Authorization

bearer_auth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

SendMessages

MessageSent SendMessages(ctx).ContentLanguage(contentLanguage).Authorization(authorization).Accept(accept).AcceptCharset(acceptCharset).ContentType(contentType).SendMessagesRequest(sendMessagesRequest).TelstraApiVersion(telstraApiVersion).Execute()

send messages

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
)

func main() {
    contentLanguage := "en-au" // string | 
    authorization := "Bearer <access_token>" // string | 
    accept := "application/json" // string | 
    acceptCharset := "utf-8" // string | 
    contentType := "application/json; charset=utf-8" // string | 
    sendMessagesRequest := *openapiclient.NewSendMessagesRequest(openapiclient.sendMessages_request_to{ArrayOfString: new([]string)}, "From_example") // SendMessagesRequest | 
    telstraApiVersion := "3.1.0" // string |  (optional)

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.MessagesAPI.SendMessages(context.Background()).ContentLanguage(contentLanguage).Authorization(authorization).Accept(accept).AcceptCharset(acceptCharset).ContentType(contentType).SendMessagesRequest(sendMessagesRequest).TelstraApiVersion(telstraApiVersion).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `MessagesAPI.SendMessages``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `SendMessages`: MessageSent
    fmt.Fprintf(os.Stdout, "Response from `MessagesAPI.SendMessages`: %v\n", resp)
}

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiSendMessagesRequest struct via the builder pattern

Name Type Description Notes
contentLanguage string
authorization string
accept string
acceptCharset string
contentType string
sendMessagesRequest SendMessagesRequest
telstraApiVersion string

Return type

MessageSent

Authorization

bearer_auth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

UpdateMessageById

MessageUpdate UpdateMessageById(ctx, messageId).ContentLanguage(contentLanguage).Authorization(authorization).Accept(accept).AcceptCharset(acceptCharset).ContentType(contentType).UpdateMessageByIdRequest(updateMessageByIdRequest).TelstraApiVersion(telstraApiVersion).Execute()

update a message

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
)

func main() {
    contentLanguage := "en-au" // string | 
    authorization := "Bearer <access_token>" // string | 
    accept := "application/json" // string | 
    acceptCharset := "utf-8" // string | 
    contentType := "application/json; charset=utf-8" // string | 
    messageId := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | When you sent the original message, this is the UUID that was returned in the call response. Use this ID to fetch, update or delete a message with the appropriate endpoints. 
    updateMessageByIdRequest := *openapiclient.NewUpdateMessageByIdRequest("To_example", "From_example") // UpdateMessageByIdRequest | 
    telstraApiVersion := "3.1.0" // string |  (optional)

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.MessagesAPI.UpdateMessageById(context.Background(), messageId).ContentLanguage(contentLanguage).Authorization(authorization).Accept(accept).AcceptCharset(acceptCharset).ContentType(contentType).UpdateMessageByIdRequest(updateMessageByIdRequest).TelstraApiVersion(telstraApiVersion).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `MessagesAPI.UpdateMessageById``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `UpdateMessageById`: MessageUpdate
    fmt.Fprintf(os.Stdout, "Response from `MessagesAPI.UpdateMessageById`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
messageId string When you sent the original message, this is the UUID that was returned in the call response. Use this ID to fetch, update or delete a message with the appropriate endpoints.

Other Parameters

Other parameters are passed through a pointer to a apiUpdateMessageByIdRequest struct via the builder pattern

Name Type Description Notes
contentLanguage string
authorization string
accept string
acceptCharset string
contentType string

updateMessageByIdRequest | UpdateMessageByIdRequest | | telstraApiVersion | string | |

Return type

MessageUpdate

Authorization

bearer_auth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

UpdateMessageTags

UpdateMessageTags(ctx, messageId).ContentLanguage(contentLanguage).Authorization(authorization).Accept(accept).AcceptCharset(acceptCharset).ContentType(contentType).UpdateMessageTagsRequest(updateMessageTagsRequest).TelstraApiVersion(telstraApiVersion).Execute()

update message tags

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
)

func main() {
    contentLanguage := "en-au" // string | 
    authorization := "Bearer <access_token>" // string | 
    accept := "application/json" // string | 
    acceptCharset := "utf-8" // string | 
    contentType := "application/json; charset=utf-8" // string | 
    messageId := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | When you sent the original message, this is the UUID that was returned in the call response. Use this ID to fetch, update or delete a message with the appropriate endpoints. 
    updateMessageTagsRequest := *openapiclient.NewUpdateMessageTagsRequest([]string{"Tags_example"}) // UpdateMessageTagsRequest | 
    telstraApiVersion := "3.1.0" // string |  (optional)

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    r, err := apiClient.MessagesAPI.UpdateMessageTags(context.Background(), messageId).ContentLanguage(contentLanguage).Authorization(authorization).Accept(accept).AcceptCharset(acceptCharset).ContentType(contentType).UpdateMessageTagsRequest(updateMessageTagsRequest).TelstraApiVersion(telstraApiVersion).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `MessagesAPI.UpdateMessageTags``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
messageId string When you sent the original message, this is the UUID that was returned in the call response. Use this ID to fetch, update or delete a message with the appropriate endpoints.

Other Parameters

Other parameters are passed through a pointer to a apiUpdateMessageTagsRequest struct via the builder pattern

Name Type Description Notes
contentLanguage string
authorization string
accept string
acceptCharset string
contentType string

updateMessageTagsRequest | UpdateMessageTagsRequest | | telstraApiVersion | string | |

Return type

(empty response body)

Authorization

bearer_auth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]