All URIs are relative to https://api.sendx.io/api/v1/rest
| Method | HTTP request | Description |
|---|---|---|
| CreateCustomField | Post /customfield | Create custom field |
| DeleteCustomField | Delete /customfield/{identifier} | Delete custom field |
| GetAllCustomFields | Get /customfield | Get all custom fields |
| GetCustomField | Get /customfield/{identifier} | Get custom field by ID |
| UpdateCustomField | Put /customfield/{identifier} | Update custom field |
RestRCustomField CreateCustomField(ctx).RestECustomField(restECustomField).Execute()
Create custom field
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/sendx/sendx-go-sdk"
)
func main() {
restECustomField := *openapiclient.NewRestECustomField("Account Type", int32(123)) // RestECustomField |
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.CustomFieldAPI.CreateCustomField(context.Background()).RestECustomField(restECustomField).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `CustomFieldAPI.CreateCustomField``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `CreateCustomField`: RestRCustomField
fmt.Fprintf(os.Stdout, "Response from `CustomFieldAPI.CreateCustomField`: %v\n", resp)
}Other parameters are passed through a pointer to a apiCreateCustomFieldRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|---|---|---|
| restECustomField | RestECustomField |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
DeleteResponse DeleteCustomField(ctx, identifier).Execute()
Delete custom field
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/sendx/sendx-go-sdk"
)
func main() {
identifier := "identifier_example" // string | Custom field identifier to update
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.CustomFieldAPI.DeleteCustomField(context.Background(), identifier).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `CustomFieldAPI.DeleteCustomField``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `DeleteCustomField`: DeleteResponse
fmt.Fprintf(os.Stdout, "Response from `CustomFieldAPI.DeleteCustomField`: %v\n", resp)
}| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| identifier | string | Custom field identifier to update |
Other parameters are passed through a pointer to a apiDeleteCustomFieldRequest 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]
[]RestRCustomField GetAllCustomFields(ctx).Offset(offset).Limit(limit).Search(search).Execute()
Get all custom fields
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/sendx/sendx-go-sdk"
)
func main() {
offset := int32(56) // int32 | Number of fields to skip for pagination (optional) (default to 0)
limit := int32(56) // int32 | Maximum number of fields to return (optional) (default to 10)
search := "search_example" // string | Search custom fields by name (case-insensitive partial matching). **Examples:** - `points` - Finds \"Loyalty points\", \"Reward points\" (optional)
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.CustomFieldAPI.GetAllCustomFields(context.Background()).Offset(offset).Limit(limit).Search(search).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `CustomFieldAPI.GetAllCustomFields``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetAllCustomFields`: []RestRCustomField
fmt.Fprintf(os.Stdout, "Response from `CustomFieldAPI.GetAllCustomFields`: %v\n", resp)
}Other parameters are passed through a pointer to a apiGetAllCustomFieldsRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|---|---|---|
| offset | int32 | Number of fields to skip for pagination | [default to 0] |
| limit | int32 | Maximum number of fields to return | [default to 10] |
| search | string | Search custom fields by name (case-insensitive partial matching). Examples: - `points` - Finds "Loyalty points", "Reward points" |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
RestRCustomField GetCustomField(ctx, identifier).Execute()
Get custom field by ID
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/sendx/sendx-go-sdk"
)
func main() {
identifier := "identifier_example" // string | Custom field identifier to update
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.CustomFieldAPI.GetCustomField(context.Background(), identifier).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `CustomFieldAPI.GetCustomField``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetCustomField`: RestRCustomField
fmt.Fprintf(os.Stdout, "Response from `CustomFieldAPI.GetCustomField`: %v\n", resp)
}| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| identifier | string | Custom field identifier to update |
Other parameters are passed through a pointer to a apiGetCustomFieldRequest 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]
RestRCustomField UpdateCustomField(ctx, identifier).RestECustomField(restECustomField).Execute()
Update custom field
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/sendx/sendx-go-sdk"
)
func main() {
restECustomField := *openapiclient.NewRestECustomField("Account Type", int32(123)) // RestECustomField |
identifier := "identifier_example" // string | Custom field identifier to update
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.CustomFieldAPI.UpdateCustomField(context.Background(), identifier).RestECustomField(restECustomField).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `CustomFieldAPI.UpdateCustomField``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `UpdateCustomField`: RestRCustomField
fmt.Fprintf(os.Stdout, "Response from `CustomFieldAPI.UpdateCustomField`: %v\n", resp)
}| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| identifier | string | Custom field identifier to update |
Other parameters are passed through a pointer to a apiUpdateCustomFieldRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|---|---|---|
| restECustomField | RestECustomField |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]