### Create Installed Add-On Source: https://github.com/twilio/twilio-go/blob/main/rest/marketplace/v1/README.md Installs a new add-on for the account. ```APIDOC ## POST /v1/InstalledAddOns ### Description Installs a new add-on for the account. ### Method POST ### Endpoint /v1/InstalledAddOns ``` -------------------------------- ### Install twilio-go with Go Modules Source: https://github.com/twilio/twilio-go/blob/main/README.md Use this command to install the twilio-go library in your Go project. Ensure you have a go.mod file initialized. ```shell go get github.com/twilio/twilio-go ``` -------------------------------- ### Install Dependencies for Go API Client Source: https://github.com/twilio/twilio-go/blob/main/rest/accounts/v1/README.md Installs necessary testing and networking libraries for the Go API client. Ensure these are added to your project's dependencies. ```shell go get github.com/stretchr/testify/assert go get golang.org/x/net/context ``` -------------------------------- ### List Installed Add-Ons Source: https://github.com/twilio/twilio-go/blob/main/rest/marketplace/v1/README.md Retrieves a list of all installed add-ons for the account. ```APIDOC ## GET /v1/InstalledAddOns ### Description Retrieves a list of all installed add-ons for the account. ### Method GET ### Endpoint /v1/InstalledAddOns ``` -------------------------------- ### ListAvailableAddOn Source: https://github.com/twilio/twilio-go/blob/main/rest/marketplace/v1/docs/AvailableAddOnsApi.md Retrieves a list of all available add-ons that can be installed. ```APIDOC ## ListAvailableAddOn ### Description Retrieve a list of Add-ons currently available to be installed. ### Method GET ### Endpoint /v1/AvailableAddOns ### Parameters #### Query Parameters - **PageSize** (int) - Optional - How many resources to return in each list page. The default is 50, and the maximum is 1000. - **Limit** (int) - Optional - Max number of records to return. ### Response #### Success Response (200) - **[]MarketplaceV1AvailableAddOn** - A list of available add-ons. ### Request Example ```json { "example": "request body" } ``` ### Response Example ```json { "example": "response body" } ``` ``` -------------------------------- ### Fetch Installed Add-On Source: https://github.com/twilio/twilio-go/blob/main/rest/marketplace/v1/README.md Retrieves details for a specific installed add-on. ```APIDOC ## GET /v1/InstalledAddOns/{Sid} ### Description Retrieves details for a specific installed add-on. ### Method GET ### Endpoint /v1/InstalledAddOns/{Sid} ``` -------------------------------- ### FetchInstalledAddOnExtension Source: https://github.com/twilio/twilio-go/blob/main/rest/marketplace/v1/docs/InstalledAddOnsExtensionsApi.md Fetches a specific extension for an installed add-on. ```APIDOC ## GET /v1/InstalledAddOns/{InstalledAddOnSid}/Extensions/{Sid} ### Description Fetch an instance of an Extension for the Installed Add-on. ### Method GET ### Endpoint /v1/InstalledAddOns/{InstalledAddOnSid}/Extensions/{Sid} ### Parameters #### Path Parameters - **InstalledAddOnSid** (string) - Required - The SID of the InstalledAddOn resource with the extension to fetch. - **Sid** (string) - Required - The SID of the InstalledAddOn Extension resource to fetch. ### Response #### Success Response (200) - **MarketplaceV1InstalledAddOnExtension** - Details of the installed add-on extension. ``` -------------------------------- ### ListInstalledAddOnExtension Source: https://github.com/twilio/twilio-go/blob/main/rest/marketplace/v1/docs/InstalledAddOnsExtensionsApi.md Retrieves a list of extensions for a given installed add-on. ```APIDOC ## GET /v1/InstalledAddOns/{InstalledAddOnSid}/Extensions ### Description Retrieve a list of Extensions for the Installed Add-on. ### Method GET ### Endpoint /v1/InstalledAddOns/{InstalledAddOnSid}/Extensions ### Parameters #### Path Parameters - **InstalledAddOnSid** (string) - Required - The SID of the InstalledAddOn resource with the extensions to read. #### Query Parameters - **PageSize** (int) - Optional - How many resources to return in each list page. The default is 50, and the maximum is 1000. - **Limit** (int) - Optional - Max number of records to return. ### Response #### Success Response (200) - **[]MarketplaceV1InstalledAddOnExtension** - A list of installed add-on extensions. ``` -------------------------------- ### InstalledAddOn Properties Source: https://github.com/twilio/twilio-go/blob/main/rest/marketplace/v1/docs/MarketplaceV1InstalledAddOn.md The following properties are available for an installed Add-on resource: ```APIDOC ## InstalledAddOn Properties ### Sid - **Type**: Pointer to string - **Description**: The unique string that we created to identify the InstalledAddOn resource. This Sid can also be found in the Console on that specific Add-ons page as the 'Available Add-on Sid'. ### AccountSid - **Type**: Pointer to string - **Description**: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the InstalledAddOn resource. ### FriendlyName - **Type**: Pointer to string - **Description**: The string that you assigned to describe the resource. ### Description - **Type**: Pointer to string - **Description**: A short description of the Add-on's functionality. ### Configuration - **Type**: Pointer to map[string]interface{} - **Description**: The JSON object that represents the current configuration of installed Add-on. ### UniqueName - **Type**: Pointer to string - **Description**: An application-defined string that uniquely identifies the resource. ### DateCreated - **Type**: Pointer to time.Time - **Description**: The date and time in GMT when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. ### DateUpdated - **Type**: Pointer to time.Time - **Description**: The date and time in GMT when the resource was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. ### Url - **Type**: Pointer to string - **Description**: The absolute URL of the resource. ### Links - **Type**: Pointer to map[string]interface{} - **Description**: The URLs of related resources. ``` -------------------------------- ### ListInstalledAddOnResponse Structure Source: https://github.com/twilio/twilio-go/blob/main/rest/marketplace/v1/docs/ListInstalledAddOnResponse.md The ListInstalledAddOnResponse object contains a list of installed add-ons and metadata for pagination. ```APIDOC ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **InstalledAddOns** | [**[]MarketplaceV1InstalledAddOn**](MarketplaceV1InstalledAddOn.md) | |[optional] **Meta** | [**ListAvailableAddOnResponseMeta**](ListAvailableAddOnResponseMeta.md) | |[optional] ``` -------------------------------- ### FetchInstalledAddOn Source: https://github.com/twilio/twilio-go/blob/main/rest/marketplace/v1/docs/InstalledAddOnsApi.md Retrieves the details of a specific Add-on installation for your Twilio account. ```APIDOC ## FetchInstalledAddOn ### Description Fetch an instance of an Add-on currently installed on this Account. ### Method GET ### Endpoint /v1/InstalledAddOns/{Sid} ### Parameters #### Path Parameters - **Sid** (string) - Required - The SID of the InstalledAddOn resource to fetch. ### Response #### Success Response (200) - **MarketplaceV1InstalledAddOn** (object) - Details of the fetched installed Add-on. ### Authorization accountSid_authToken ### HTTP request headers - Content-Type: Not defined - Accept: application/json ``` -------------------------------- ### Fetch Message with Metadata Source: https://github.com/twilio/twilio-go/blob/main/advanced-examples/response-metadata.md This example shows how to fetch a specific message by its SID and retrieve metadata from the API response. ```APIDOC ## Fetch Message with Metadata ### Description Fetches a specific message using its SID and retrieves metadata from the API response. ### Method `client.Api.FetchMessageWithMetadata` ### Parameters - `sid` (string): The unique identifier of the message to fetch. - `params` (*api.FetchMessageParams): Parameters for fetching the message, including 'AccountSid'. ### Request Example ```go params := &api.FetchMessageParams{} params.SetPathAccountSid("ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxx") resp, err := client.Api.FetchMessageWithMetadata("SMxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", params) ``` ### Response #### Success Response - `StatusCode` (int): The HTTP status code of the response. - `Headers` (map[string]interface{}): A map of response headers. - `Resource` (*api.ApiV2010Message): The fetched message resource. ``` -------------------------------- ### Validate Twilio Requests with Go Source: https://github.com/twilio/twilio-go/blob/main/README.md Use the `client.NewRequestValidator` to validate incoming GET and POST requests from Twilio. Ensure your Auth Token is securely managed, for example, via environment variables. ```go package main import ( "fmt" "os" "github.com/twilio/twilio-go/client" ) func main() { // You can find your Auth Token at twilio.com/console // For this example: authToken := "12345" authToken := os.Getenv("TWILIO_AUTH_TOKEN") requestValidator := client.NewRequestValidator(authToken) // Twilio's request URL url := "https://mycompany.com/myapp.php?foo=1&bar=2" // Post variables in Twilio's request params := map[string]string{ "CallSid": "CA1234567890ABCDE", "Caller": "+12349013030", "Digits": "1234", "From": "+12349013030", "To": "+18005551212", } // X-Twilio-Signature header attached to the request signature := "0/KCTR6DLpKmkAf8muzZqo1nDgQ=" // Validate GET request fmt.Println(requestValidator.Validate(url, params, signature)) // Example of the POST request Body := []byte(`{"property": "value", "boolean": true}`) theUrl := "https://mycompany.com/myapp.php?bodySHA256=0a1ff7634d9ab3b95db5c9a2dfe9416e41502b283a80c7cf19632632f96e6620" theSignature := "y77kIzt2vzLz71DgmJGsen2scGs=" // Validate POST request fmt.Println(requestValidator.ValidateBody(theUrl, Body, theSignature)) } ``` -------------------------------- ### Initialize Go Project with Go Modules Source: https://github.com/twilio/twilio-go/blob/main/README.md Run this command in a new directory to create a go.mod file for managing project dependencies. ```shell go mod init twilio-example ``` -------------------------------- ### Update Installed Add-on Source: https://github.com/twilio/twilio-go/blob/main/rest/marketplace/v1/docs/InstalledAddOnsApi.md Updates an existing add-on installation for the specified account. This is useful for modifying the configuration or unique name of an installed add-on. ```APIDOC ## UpdateInstalledAddOn ### Description Updates an Add-on installation for the Account specified. ### Method POST ### Endpoint /InstalledAddOns/{Sid} ### Parameters #### Path Parameters - **Sid** (string) - Required - The SID of the InstalledAddOn resource to update. #### Request Body - **Configuration** (interface{}) - Optional - Valid JSON object that conform to the configuration schema exposed by the associated AvailableAddOn resource. This is only required by Add-ons that need to be configured - **UniqueName** (string) - Optional - An application-defined string that uniquely identifies the resource. This value must be unique within the Account. ### Response #### Success Response (200) - **MarketplaceV1InstalledAddOn** (MarketplaceV1InstalledAddOn) - Description of the updated installed add-on resource. ### Request Example ```json { "Configuration": {}, "UniqueName": "my-unique-add-on-name" } ``` ### Response Example ```json { "sid": "XExxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "account_sid": "ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "friendly_name": "My Add-on", "description": "A description of the add-on", " சேலஞ்ச்_url": "https://marketplace.twilio.com/api/v1/AvailableAddOns/XBxxxx/ চ্যালেন্জ", "configuration": {}, "unique_name": "my-unique-add-on-name", "status": "active", "date_created": "2023-01-01T12:00:00Z", "date_updated": "2023-01-01T12:00:00Z", "url": "https://marketplace.twilio.com/api/v1/InstalledAddOns/XExxxx" } ``` ``` -------------------------------- ### HTTP Basic Authentication Example (Go) Source: https://github.com/twilio/twilio-go/blob/main/rest/accounts/v1/README.md Demonstrates how to set up HTTP basic authentication for API requests using the Twilio Go SDK. This is typically used for authenticating with the Twilio API. ```golang auth := context.WithValue(context.Background(), sw.ContextBasicAuth, sw.BasicAuth{ UserName: "username", Password: "password", }) r, err := client.Service.Operation(auth, args) ``` -------------------------------- ### Update Installed Add-On Source: https://github.com/twilio/twilio-go/blob/main/rest/marketplace/v1/README.md Updates an existing installed add-on. ```APIDOC ## POST /v1/InstalledAddOns/{Sid} ### Description Updates an existing installed add-on. ### Method POST ### Endpoint /v1/InstalledAddOns/{Sid} ``` -------------------------------- ### Update Installed Add-On Extension Source: https://github.com/twilio/twilio-go/blob/main/rest/marketplace/v1/README.md Updates an extension for an installed add-on. ```APIDOC ## POST /v1/InstalledAddOns/{InstalledAddOnSid}/Extensions/{Sid} ### Description Updates an extension for an installed add-on. ### Method POST ### Endpoint /v1/InstalledAddOns/{InstalledAddOnSid}/Extensions/{Sid} ``` -------------------------------- ### FetchCommand Source: https://github.com/twilio/twilio-go/blob/main/rest/wireless/v1/docs/CommandsApi.md Fetch a Command instance from your account. ```APIDOC ## FetchCommand ### Description Fetch a Command instance from your account. ### Method GET ### Endpoint /v1/Commands/{Sid} ### Parameters #### Path Parameters - **Sid** (string) - Required - The SID of the Command resource to fetch. #### Query Parameters This endpoint does not need any query parameter. #### Request Body This endpoint does not accept a request body. ### Response #### Success Response (200) - **sid** (string) - The unique string that identifies this resource. - **account_sid** (string) - The SID of the Account associated with the resource. - **sim_sid** (string) - The SID of the Sim resource that this Command belongs to. - **date_created** (string) - The ISO 8601 date and time in GMT when the resource was created. - **date_updated** (string) - The ISO 8601 date and time in GMT when the resource was updated. - **body** (string) - The message body of the Command. Plain text or Base64 encoded binary. - **direction** (string) - The direction of the command. `toSim` or `fromSim`. - **status** (string) - The status of the Command resource. - **callback_method** (string) - The HTTP method we use to call `callback_url`. - **callback_url** (string) - The URL we call using the `callback_url` when the Command has finished sending. - **command_mode** (string) - - **include_sid** (string) - Whether to include the SID of the command in the message body. - **delivery_receipt_requested** (bool) - Whether to request delivery receipt from the recipient. - **url** (string) - The URL of the resource, relative to `https://wireless.twilio.com`. ### Authorization [accountSid_authToken](../README.md#accountSid_authToken) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json ``` -------------------------------- ### Build twilio-go Project Source: https://github.com/twilio/twilio-go/blob/main/README.md Build the twilio-go library by running the `go build ./...` command from the project's root directory. ```shell go build ./... ``` -------------------------------- ### List Installed Add-On Extensions Source: https://github.com/twilio/twilio-go/blob/main/rest/marketplace/v1/README.md Retrieves a list of extensions for a specific installed add-on. ```APIDOC ## GET /v1/InstalledAddOns/{InstalledAddOnSid}/Extensions ### Description Retrieves a list of extensions for a specific installed add-on. ### Method GET ### Endpoint /v1/InstalledAddOns/{InstalledAddOnSid}/Extensions ``` -------------------------------- ### HTTP Basic Authentication Source: https://github.com/twilio/twilio-go/blob/main/rest/api/v2010/README.md Demonstrates how to set up HTTP basic authentication using your account SID and auth token for API requests. ```APIDOC ## HTTP Basic Authentication ### Description This section describes how to use HTTP basic authentication with the Twilio Go client. It involves providing your account SID and auth token to authenticate your requests. ### Method HTTP basic authentication ### Example ```golang auth := context.WithValue(context.Background(), sw.ContextBasicAuth, sw.BasicAuth{ UserName: "username", Password: "password", }) r, err := client.Service.Operation(auth, args) ``` ``` -------------------------------- ### Fetch Installed Add-On Extension Source: https://github.com/twilio/twilio-go/blob/main/rest/marketplace/v1/README.md Retrieves details for a specific extension of an installed add-on. ```APIDOC ## GET /v1/InstalledAddOns/{InstalledAddOnSid}/Extensions/{Sid} ### Description Retrieves details for a specific extension of an installed add-on. ### Method GET ### Endpoint /v1/InstalledAddOns/{InstalledAddOnSid}/Extensions/{Sid} ``` -------------------------------- ### UpdateInstalledAddOn Source: https://github.com/twilio/twilio-go/blob/main/rest/marketplace/v1/docs/InstalledAddOnsApi.md Updates an existing Add-on installation for your Twilio account. This is typically used to update the configuration of an installed add-on. ```APIDOC ## UpdateInstalledAddOn ### Description Update an existing Add-on installation for your Twilio account. ### Method POST ### Endpoint /v1/InstalledAddOns/{Sid} ### Parameters #### Path Parameters - **Sid** (string) - Required - The SID of the InstalledAddOn resource to update. #### Request Body - **Configuration** (object) - Required - The JSON object that represents the updated configuration of the Add-on. ### Response #### Success Response (200) - **MarketplaceV1InstalledAddOn** (object) - Details of the updated installed Add-on. ### Authorization accountSid_authToken ### HTTP request headers - Content-Type: application/x-www-form-urlencoded - Accept: application/json ``` -------------------------------- ### Create Content with Twilio Go Source: https://github.com/twilio/twilio-go/blob/main/advanced-examples/content.md This snippet shows how to create content using the Twilio Go SDK. It requires TWILIO_ACCOUNT_SID and TWILIO_AUTH_TOKEN environment variables to be set. ```go package main import ( "encoding/json" "fmt" "os" "github.com/twilio/twilio-go" content "github.com/twilio/twilio-go/rest/content/v1" ) func createContent(client *twilio.RestClient) { twilioText := &content.TwilioText{Body: "Hello World"} contentType := &content.Types{TwilioText: twilioText} createContentRequest := &content.ContentCreateRequest{Language: "en", Types: *contentType} params := &content.CreateContentParams{} params.SetContentCreateRequest(*createContentRequest) resp, err := client.ContentV1.CreateContent(params) if err != nil { fmt.Println("Error creating content: " + err.Error()) } else { response, _ := json.Marshal(*resp) fmt.Println("Response: " + string(response)) } } func main() { accountSid := os.Getenv("TWILIO_ACCOUNT_SID") authToken := os.Getenv("TWILIO_AUTH_TOKEN") client := twilio.NewRestClientWithParams(twilio.ClientParams{ Username: accountSid, Password: authToken, }) createContent(client) } ``` -------------------------------- ### HTTP Basic Authentication Source: https://github.com/twilio/twilio-go/blob/main/rest/knowledge/v2/README.md Demonstrates how to configure HTTP basic authentication using a Go context for API requests. ```APIDOC ## HTTP Basic Authentication ### Description This section details how to set up basic authentication for API calls using HTTP credentials. ### Method HTTP basic authentication ### Example ```golang auth := context.WithValue(context.Background(), sw.ContextBasicAuth, sw.BasicAuth{ UserName: "username", Password: "password", }) r, err := client.Service.Operation(auth, args) ``` ``` -------------------------------- ### CreateInstalledAddOn Source: https://github.com/twilio/twilio-go/blob/main/rest/marketplace/v1/docs/InstalledAddOnsApi.md Installs a new Add-on for the specified Twilio account. Requires accepting terms of service and optionally configuring the add-on. ```APIDOC ## CreateInstalledAddOn ### Description Install an Add-on for the Account specified. ### Method POST ### Endpoint /v1/InstalledAddOns ### Parameters #### Path Parameters This endpoint does not need any path parameter. #### Request Body - **AvailableAddOnSid** (string) - Required - The SID of the AvaliableAddOn to install. - **AcceptTermsOfService** (boolean) - Required - Whether the Terms of Service were accepted. - **Configuration** (object) - Optional - The JSON object that represents the configuration of the new Add-on being installed. - **UniqueName** (string) - Optional - An application-defined string that uniquely identifies the resource. This value must be unique within the Account. ### Response #### Success Response (201) - **MarketplaceV1InstalledAddOn** (object) - Details of the newly installed Add-on. ### Authorization accountSid_authToken ### HTTP request headers - Content-Type: application/x-www-form-urlencoded - Accept: application/json ``` -------------------------------- ### FetchOperation Source: https://github.com/twilio/twilio-go/blob/main/rest/knowledge/v2/README.md Get Operation Status. ```APIDOC ## GET /v2/ControlPlane/Operations/{operationId} ### Description Get Operation Status. ### Method GET ### Endpoint /v2/ControlPlane/Operations/{operationId} ### Parameters #### Path Parameters - **operationId** (string) - Required - The Operation ID ``` -------------------------------- ### HTTP Basic Authentication Source: https://github.com/twilio/twilio-go/blob/main/rest/assistants/v1/README.md This section describes how to use HTTP basic authentication with the Assistants API. It includes an example of how to set up the authentication context in Go. ```APIDOC ## accountSid_authToken ### Description HTTP basic authentication using account SID and auth token. ### Method HTTP basic authentication ### Example ```golang auth := context.WithValue(context.Background(), sw.ContextBasicAuth, sw.BasicAuth{ UserName: "username", Password: "password", }) r, err := client.Service.Operation(auth, args) ``` ``` -------------------------------- ### FetchIpCommand Source: https://github.com/twilio/twilio-go/blob/main/rest/supersim/v1/docs/IpCommandsApi.md Fetch an IP Command instance from your account using its SID. ```APIDOC ## FetchIpCommand ### Description Fetch IP Command instance from your account. ### Method GET ### Endpoint /v1/IpCommands/{Sid} ### Parameters #### Path Parameters - **Sid** (string) - Required - The SID of the IP Command resource to fetch. #### Query Parameters This endpoint does not need any query parameters. ### Response #### Success Response (200) - **SupersimV1IpCommand** ([SupersimV1IpCommand](SupersimV1IpCommand.md)) - ### Authorization [accountSid_authToken](../README.md#accountSid_authToken) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json ``` -------------------------------- ### ListSipCredentialList Source: https://github.com/twilio/twilio-go/blob/main/rest/api/v2010/README.md Get All Credential Lists. ```APIDOC ## GET /2010-04-01/Accounts/{AccountSid}/SIP/CredentialLists.json ### Description Get All Credential Lists. ### Method GET ### Endpoint /2010-04-01/Accounts/{AccountSid}/SIP/CredentialLists.json ``` -------------------------------- ### FetchSipCredentialList Source: https://github.com/twilio/twilio-go/blob/main/rest/api/v2010/README.md Get a Credential List. ```APIDOC ## GET /2010-04-01/Accounts/{AccountSid}/SIP/CredentialLists/{Sid}.json ### Description Get a Credential List. ### Method GET ### Endpoint /2010-04-01/Accounts/{AccountSid}/SIP/CredentialLists/{Sid}.json ``` -------------------------------- ### FetchApplication Source: https://github.com/twilio/twilio-go/blob/main/rest/api/v2010/docs/AccountsApplicationsApi.md Fetches the application specified by the provided SID. ```APIDOC ## FetchApplication ### Description Fetch the application specified by the provided sid. ### Method GET ### Endpoint /2010-04-01/Accounts/{AccountSid}/Applications/{Sid}.json ### Parameters #### Path Parameters - **AccountSid** (string) - Required - The SID of the Account that created this resource. - **Sid** (string) - Required - The Twilio-provided string that uniquely identifies the Application resource to fetch. ### Response #### Success Response (200) - **Sid** (string) - The unique string that identifies this resource. - **FriendlyName** (string) - A descriptive string that you create to describe the new application. - **ApiVersion** (string) - The API version to use to start a new TwiML session. - **VoiceUrl** (string) - The URL we call when the phone number assigned to this application receives a call. - **VoiceMethod** (string) - The HTTP method we use to call `voice_url`. - **VoiceFallbackUrl** (string) - The URL that we call when an error occurs retrieving or executing the TwiML requested by `url`. - **VoiceFallbackMethod** (string) - The HTTP method we use to call `voice_fallback_url`. - **StatusCallback** (string) - The URL we call using the `status_callback_method` to send status information to your application. - **StatusCallbackMethod** (string) - The HTTP method we use to call `status_callback`. - **VoiceCallerIdLookup** (bool) - Whether we look up the caller's caller-ID name from the CNAM database. - **SmsUrl** (string) - The URL we call when the phone number receives an incoming SMS message. - **SmsMethod** (string) - The HTTP method we use to call `sms_url`. - **SmsFallbackUrl** (string) - The URL that we call when an error occurs while retrieving or executing the TwiML from `sms_url`. - **SmsFallbackMethod** (string) - The HTTP method we use to call `sms_fallback_url`. - **SmsStatusCallback** (string) - The URL we call using a POST method to send status information about SMS messages sent by the application. - **MessageStatusCallback** (string) - The URL we call using a POST method to send message status information to your application. - **PublicApplicationConnectEnabled** (bool) - Whether to allow other Twilio accounts to dial this applicaton using Dial verb. - **DateCreated** (string) - The date and time in GMT when this resource was created. - **DateUpdated** (string) - The date and time in GMT when this resource was last updated. - **AccountSid** (string) - The SID of the Account that created this resource. - **Url** (string) - The URI of this resource. - **Links** (object) - A dictionary of links to related resources. ``` -------------------------------- ### Fetch Tool Source: https://github.com/twilio/twilio-go/blob/main/rest/assistants/v1/README.md Get a tool by ID. ```APIDOC ## GET /v1/Tools/{id} ### Description Get a tool by ID. ### Method GET ### Endpoint /v1/Tools/{id} ### Parameters #### Path Parameters - **id** (string) - Required - The tool ID to fetch. ``` -------------------------------- ### CreateApplication Source: https://github.com/twilio/twilio-go/blob/main/rest/api/v2010/README.md Create a new application within your account. ```APIDOC ## POST /2010-04-01/Accounts/{AccountSid}/Applications.json ### Description Create a new application within your account. ### Method POST ### Endpoint /2010-04-01/Accounts/{AccountSid}/Applications.json #### Path Parameters - **AccountSid** (string) - Required - The unique ID of the Account this application belongs to. ``` -------------------------------- ### Fetch Session Source: https://github.com/twilio/twilio-go/blob/main/rest/assistants/v1/README.md Get a session by ID. ```APIDOC ## GET /v1/Sessions/{id} ### Description Get a session by ID. ### Method GET ### Endpoint /v1/Sessions/{id} ### Parameters #### Path Parameters - **id** (string) - Required - The session ID to fetch. ``` -------------------------------- ### Default Twilio Client Usage Source: https://github.com/twilio/twilio-go/blob/main/advanced-examples/custom-http-client.md This example demonstrates a typical API request using the default Twilio REST client without any custom HTTP configurations. It shows how to create a message with predefined parameters. ```go twilioClient := twilio.NewRestClient() params := &twilioApi.CreateMessageParams{} params.SetTo("+15558675309") params.SetFrom("+15017250604") params.SetBody("Hey there!") resp, err := twilioClient.Api.CreateMessage(params) ``` -------------------------------- ### Fetch Knowledge Source: https://github.com/twilio/twilio-go/blob/main/rest/assistants/v1/README.md Get knowledge by ID. ```APIDOC ## GET /v1/Knowledge/{id} ### Description Get knowledge by ID. ### Method GET ### Endpoint /v1/Knowledge/{id} ### Parameters #### Path Parameters - **id** (string) - Required - The knowledge ID to fetch. ``` -------------------------------- ### Fetch Assistant Source: https://github.com/twilio/twilio-go/blob/main/rest/assistants/v1/README.md Get an assistant by ID. ```APIDOC ## GET /v1/Assistants/{id} ### Description Get an assistant by ID. ### Method GET ### Endpoint /v1/Assistants/{id} ### Parameters #### Path Parameters - **id** (string) - Required - The assistant ID to fetch. ``` -------------------------------- ### Test twilio-go Project Source: https://github.com/twilio/twilio-go/blob/main/README.md Execute the test suite for the twilio-go library by running the `go test ./...` command from the project's root directory. ```shell go test ./... ``` -------------------------------- ### Delete Installed Add-On Source: https://github.com/twilio/twilio-go/blob/main/rest/marketplace/v1/README.md Uninstalls an add-on from the account. ```APIDOC ## DELETE /v1/InstalledAddOns/{Sid} ### Description Uninstalls an add-on from the account. ### Method DELETE ### Endpoint /v1/InstalledAddOns/{Sid} ``` -------------------------------- ### Basic API Key Authentication Source: https://github.com/twilio/twilio-go/blob/main/rest/memory/v1/README.md Demonstrates how to use basic HTTP authentication with an API key. ```APIDOC ## basic_apikey_or_accountsid ### Description Uses HTTP basic authentication with an API key. ### Method HTTP basic authentication ### Example ```golang auth := context.WithValue(context.Background(), sw.ContextBasicAuth, sw.BasicAuth{ UserName: "username", Password: "password", }) r, err := client.Service.Operation(auth, args) ``` ``` -------------------------------- ### Generate Local Documentation with godoc Source: https://github.com/twilio/twilio-go/blob/main/README.md Generate local documentation for the twilio-go project by running `godoc -http=localhost:{port number}` from the root directory. Access the documentation via `http://localhost:{port number}/pkg/github.com/twilio/twilio-go`. ```shell godoc -http=localhost:{port number} ``` ```shell godoc -http=localhost:6060 ``` -------------------------------- ### Basic API Key or Account SID Authentication Source: https://github.com/twilio/twilio-go/blob/main/rest/intelligence/v3/README.md This section details how to authenticate your API requests using basic authentication with an API key or Account SID. It provides a Go code example demonstrating how to set up the authentication context. ```APIDOC ## basic_apikey_or_accountsid ### Description This authentication method uses HTTP basic authentication, typically with an API key or Account SID as the username and a secret as the password. ### Method HTTP Basic Authentication ### Example ```golang auth := context.WithValue(context.Background(), sw.ContextBasicAuth, sw.BasicAuth{ UserName: "username", Password: "password", }) r, err := client.Service.Operation(auth, args) ``` ``` -------------------------------- ### CreateIncomingPhoneNumberAssignedAddOn Source: https://github.com/twilio/twilio-go/blob/main/rest/api/v2010/README.md Assign an Add-on installation to the Number specified. ```APIDOC ## POST /2010-04-01/Accounts/{AccountSid}/IncomingPhoneNumbers/{ResourceSid}/AssignedAddOns.json ### Description Assign an Add-on installation to the Number specified. ### Method POST ### Endpoint /2010-04-01/Accounts/{AccountSid}/IncomingPhoneNumbers/{ResourceSid}/AssignedAddOns.json ### Parameters #### Path Parameters - **AccountSid** (string) - Required - The Account SID of the incoming phone number with the Add-on installation to create. - **ResourceSid** (string) - Required - The Sid of the incoming phone number to which to assign the Add-on. ``` -------------------------------- ### DeleteInstalledAddOn Source: https://github.com/twilio/twilio-go/blob/main/rest/marketplace/v1/docs/InstalledAddOnsApi.md Removes an existing Add-on installation from your Twilio account. ```APIDOC ## DeleteInstalledAddOn ### Description Remove an Add-on installation from your account ### Method DELETE ### Endpoint /v1/InstalledAddOns/{Sid} ### Parameters #### Path Parameters - **Sid** (string) - Required - The SID of the InstalledAddOn resource to delete. ### Response #### Success Response (204) (empty response body) ### Authorization accountSid_authToken ### HTTP request headers - Content-Type: Not defined - Accept: Not defined ``` -------------------------------- ### UpdateInstalledAddOnExtension Source: https://github.com/twilio/twilio-go/blob/main/rest/marketplace/v1/docs/InstalledAddOnsExtensionsApi.md Updates an extension for an add-on installation, such as enabling or disabling it. ```APIDOC ## POST /v1/InstalledAddOns/{InstalledAddOnSid}/Extensions/{Sid} ### Description Update an Extension for an Add-on installation. ### Method POST ### Endpoint /v1/InstalledAddOns/{InstalledAddOnSid}/Extensions/{Sid} ### Parameters #### Path Parameters - **InstalledAddOnSid** (string) - Required - The SID of the InstalledAddOn resource with the extension to update. - **Sid** (string) - Required - The SID of the InstalledAddOn Extension resource to update. #### Request Body - **Enabled** (bool) - Optional - Whether the Extension should be invoked. ### Response #### Success Response (200) - **MarketplaceV1InstalledAddOnExtension** - The updated installed add-on extension. ``` -------------------------------- ### Create Profiles Import V2 Source: https://github.com/twilio/twilio-go/blob/main/rest/memory/v1/README.md Imports profiles into a store. ```APIDOC ## CreateProfilesImportV2 ### Description Import Profiles ### Method POST ### Endpoint /v1/Stores/{storeId}/Profiles/Imports ``` -------------------------------- ### Initialize Twilio Client with Environment Variables Source: https://github.com/twilio/twilio-go/blob/main/README.md Initializes the Twilio RestClient by looking for TWILIO_ACCOUNT_SID and TWILIO_AUTH_TOKEN environment variables. Ensure these variables are set before running. ```go package main import "github.com/twilio/twilio-go" func main() { // This will look for `TWILIO_ACCOUNT_SID` and `TWILIO_AUTH_TOKEN` variables inside the current environment to initialize the constructor // You can find your Account SID and Auth Token at twilio.com/console // `TWILIO_ACCOUNT_SID` should be in format "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" client := twilio.NewRestClient() } ``` -------------------------------- ### ListStores Source: https://github.com/twilio/twilio-go/blob/main/rest/memory/v1/docs/ControlPlaneStoresApi.md Get a list of memory stores for the Twilio account. ```APIDOC ## ListStores ### Description List Memory Stores ### Method GET ### Endpoint /v1/ControlPlane/Stores ### Parameters #### Query Parameters - **PageSize** (int) - Optional - The maximum number of items to return per page, maximum of 100. - **PageToken** (string) - Optional - The token for the page of results to retrieve. - **OrderBy** (string) - Optional - Either 'ASC' or 'DESC' to sort results ascending or descending respectively. - **Limit** (int) - Optional - Max number of records to return. ### Response #### Success Response (200) - **stores** (array) - A list of Memory Store identifiers. #### Response Example ```json { "stores": [ "STxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "STyyyyyyyyyyyyyyyyyyyyyyyyyyyyy" ] } ``` ``` -------------------------------- ### FetchLookupPhoneNumberOverrides Source: https://github.com/twilio/twilio-go/blob/main/rest/lookups/v2/docs/PhoneNumbersOverridesApi.md Get Overrides for a Phone Number for a specific field. ```APIDOC ## GET /v2/PhoneNumbers/{PhoneNumber}/Overrides/{Field} ### Description Get Overrides for a Phone Number for a specific field. ### Method GET ### Endpoint /v2/PhoneNumbers/{PhoneNumber}/Overrides/{Field} ### Parameters #### Path Parameters - **ctx** (context.Context) - Required - context for authentication, logging, cancellation, deadlines, tracing, etc. - **Field** (string) - Required - - **PhoneNumber** (string) - Required - ### Response #### Success Response (200) - **OverridesResponse** (OverridesResponse) - ### Authorization [accountSid_authToken](../README.md#accountSid_authToken) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json ```