All URIs are relative to https://api.sendx.io/api/v1/rest
| Method | HTTP request | Description |
|---|---|---|
| CreateList | Post /list | Create List |
| DeleteList | Delete /list/{listId} | Delete List |
| GetAllLists | Get /list | Get All Lists |
| GetListById | Get /list/{listId} | Get List |
| UpdateList | Put /list/{listId} | Update List |
CreateResponse CreateList(ctx).ListRequest(listRequest).Execute()
Create List
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/sendx/sendx-go-sdk"
)
func main() {
listRequest := *openapiclient.NewListRequest() // ListRequest |
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.ListAPI.CreateList(context.Background()).ListRequest(listRequest).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `ListAPI.CreateList``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `CreateList`: CreateResponse
fmt.Fprintf(os.Stdout, "Response from `ListAPI.CreateList`: %v\n", resp)
}Other parameters are passed through a pointer to a apiCreateListRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|---|---|---|
| listRequest | ListRequest |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
DeleteResponse DeleteList(ctx, listId).Execute()
Delete List
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/sendx/sendx-go-sdk"
)
func main() {
listId := "sendx123" // string | The ID of the list you want to delete
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.ListAPI.DeleteList(context.Background(), listId).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `ListAPI.DeleteList``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `DeleteList`: DeleteResponse
fmt.Fprintf(os.Stdout, "Response from `ListAPI.DeleteList`: %v\n", resp)
}| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| listId | string | The ID of the list you want to delete |
Other parameters are passed through a pointer to a apiDeleteListRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
[]ListModel GetAllLists(ctx).Offset(offset).Limit(limit).Search(search).Execute()
Get All Lists
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/sendx/sendx-go-sdk"
)
func main() {
offset := int32(0) // int32 | Offset for pagination. (optional)
limit := int32(10) // int32 | Limit the number of results returned. (optional)
search := "Marketing" // string | Search term to filter lists. (optional)
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.ListAPI.GetAllLists(context.Background()).Offset(offset).Limit(limit).Search(search).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `ListAPI.GetAllLists``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetAllLists`: []ListModel
fmt.Fprintf(os.Stdout, "Response from `ListAPI.GetAllLists`: %v\n", resp)
}Other parameters are passed through a pointer to a apiGetAllListsRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|---|---|---|
| offset | int32 | Offset for pagination. | |
| limit | int32 | Limit the number of results returned. | |
| search | string | Search term to filter lists. |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ListModel GetListById(ctx, listId).Execute()
Get List
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/sendx/sendx-go-sdk"
)
func main() {
listId := "sendx123" // string | The ID of the list you want to retrieve
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.ListAPI.GetListById(context.Background(), listId).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `ListAPI.GetListById``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetListById`: ListModel
fmt.Fprintf(os.Stdout, "Response from `ListAPI.GetListById`: %v\n", resp)
}| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| listId | string | The ID of the list you want to retrieve |
Other parameters are passed through a pointer to a apiGetListByIdRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Response UpdateList(ctx, listId).ListRequest(listRequest).Execute()
Update List
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/sendx/sendx-go-sdk"
)
func main() {
listRequest := *openapiclient.NewListRequest() // ListRequest |
listId := "listId_example" // string | The ID of the list to be updated.
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.ListAPI.UpdateList(context.Background(), listId).ListRequest(listRequest).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `ListAPI.UpdateList``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `UpdateList`: Response
fmt.Fprintf(os.Stdout, "Response from `ListAPI.UpdateList`: %v\n", resp)
}| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| listId | string | The ID of the list to be updated. |
Other parameters are passed through a pointer to a apiUpdateListRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|---|---|---|
| listRequest | ListRequest |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]