Skip to content

Latest commit

 

History

History
441 lines (302 loc) · 14 KB

File metadata and controls

441 lines (302 loc) · 14 KB

sendx_python_sdk.ListApi

All URIs are relative to https://api.sendx.io/api/v1/rest

Method HTTP request Description
create_list POST /list Create list
delete_list DELETE /list/{identifier} Delete list
get_all_lists GET /list Get all lists
get_list GET /list/{identifier} Get list by ID
update_list PUT /list/{identifier} Update list

create_list

RestRList create_list(rest_e_list)

Create list

Creates a new contact list.

Example

  • Api Key Authentication (TeamApiKey):
import sendx_python_sdk
from sendx_python_sdk.models.rest_e_list import RestEList
from sendx_python_sdk.models.rest_r_list import RestRList
from sendx_python_sdk.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.sendx.io/api/v1/rest
# See configuration.py for a list of all supported configuration parameters.
configuration = sendx_python_sdk.Configuration(
    host = "https://api.sendx.io/api/v1/rest"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure API key authorization: TeamApiKey
configuration.api_key['TeamApiKey'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['TeamApiKey'] = 'Bearer'

# Enter a context with an instance of the API client
with sendx_python_sdk.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = sendx_python_sdk.ListApi(api_client)
    rest_e_list = {"name":"Premium Members"} # RestEList | 

    try:
        # Create list
        api_response = api_instance.create_list(rest_e_list)
        print("The response of ListApi->create_list:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling ListApi->create_list: %s\n" % e)

Parameters

Name Type Description Notes
rest_e_list RestEList

Return type

RestRList

Authorization

TeamApiKey

HTTP request headers

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

HTTP response details

Status code Description Response headers
201 ✅ List created successfully -
400 ❌ Bad Request - Invalid input data -
401 ❌ Unauthorized - Invalid or missing API key -
403 ❌ Forbidden - Resource name already exists -
422 ❌ Unprocessable Entity - Invalid request format -
500 ❌ Internal Server Error - System error occurred -

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

delete_list

DeleteResponse delete_list(identifier)

Delete list

Deletes a list.

Example

  • Api Key Authentication (TeamApiKey):
import sendx_python_sdk
from sendx_python_sdk.models.delete_response import DeleteResponse
from sendx_python_sdk.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.sendx.io/api/v1/rest
# See configuration.py for a list of all supported configuration parameters.
configuration = sendx_python_sdk.Configuration(
    host = "https://api.sendx.io/api/v1/rest"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure API key authorization: TeamApiKey
configuration.api_key['TeamApiKey'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['TeamApiKey'] = 'Bearer'

# Enter a context with an instance of the API client
with sendx_python_sdk.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = sendx_python_sdk.ListApi(api_client)
    identifier = 'identifier_example' # str | List identifier to delete

    try:
        # Delete list
        api_response = api_instance.delete_list(identifier)
        print("The response of ListApi->delete_list:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling ListApi->delete_list: %s\n" % e)

Parameters

Name Type Description Notes
identifier str List identifier to delete

Return type

DeleteResponse

Authorization

TeamApiKey

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 ✅ List deleted successfully -
401 ❌ Unauthorized - Invalid or missing API key -
404 ❌ Not Found - Resource does not exist -
422 ❌ Unprocessable Entity - Invalid request format -
500 ❌ Internal Server Error - System error occurred -

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

get_all_lists

List[RestRList] get_all_lists(offset=offset, limit=limit, search=search)

Get all lists

Retrieves all contact lists in your team.

Example

  • Api Key Authentication (TeamApiKey):
import sendx_python_sdk
from sendx_python_sdk.models.rest_r_list import RestRList
from sendx_python_sdk.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.sendx.io/api/v1/rest
# See configuration.py for a list of all supported configuration parameters.
configuration = sendx_python_sdk.Configuration(
    host = "https://api.sendx.io/api/v1/rest"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure API key authorization: TeamApiKey
configuration.api_key['TeamApiKey'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['TeamApiKey'] = 'Bearer'

# Enter a context with an instance of the API client
with sendx_python_sdk.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = sendx_python_sdk.ListApi(api_client)
    offset = 0 # int | Number of records to skip for pagination (optional) (default to 0)
    limit = 10 # int | Maximum number of lists to return (max: 500) (optional) (default to 10)
    search = 'search_example' # str | Search lists by name (optional)

    try:
        # Get all lists
        api_response = api_instance.get_all_lists(offset=offset, limit=limit, search=search)
        print("The response of ListApi->get_all_lists:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling ListApi->get_all_lists: %s\n" % e)

Parameters

Name Type Description Notes
offset int Number of records to skip for pagination [optional] [default to 0]
limit int Maximum number of lists to return (max: 500) [optional] [default to 10]
search str Search lists by name [optional]

Return type

List[RestRList]

Authorization

TeamApiKey

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 ✅ Lists retrieved successfully -
401 ❌ Unauthorized - Invalid or missing API key -
500 ❌ Internal Server Error - System error occurred -

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

get_list

RestRList get_list(identifier)

Get list by ID

Retrieves detailed information about a specific list.

Example

  • Api Key Authentication (TeamApiKey):
import sendx_python_sdk
from sendx_python_sdk.models.rest_r_list import RestRList
from sendx_python_sdk.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.sendx.io/api/v1/rest
# See configuration.py for a list of all supported configuration parameters.
configuration = sendx_python_sdk.Configuration(
    host = "https://api.sendx.io/api/v1/rest"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure API key authorization: TeamApiKey
configuration.api_key['TeamApiKey'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['TeamApiKey'] = 'Bearer'

# Enter a context with an instance of the API client
with sendx_python_sdk.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = sendx_python_sdk.ListApi(api_client)
    identifier = 'identifier_example' # str | List identifier - `list_OcuxJHdiAvujmwQVJfd3ss` 

    try:
        # Get list by ID
        api_response = api_instance.get_list(identifier)
        print("The response of ListApi->get_list:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling ListApi->get_list: %s\n" % e)

Parameters

Name Type Description Notes
identifier str List identifier - `list_OcuxJHdiAvujmwQVJfd3ss`

Return type

RestRList

Authorization

TeamApiKey

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 ✅ List retrieved successfully -
401 ❌ Unauthorized - Invalid or missing API key -
404 ❌ Not Found - Resource does not exist -
422 ❌ Unprocessable Entity - Invalid request format -
500 ❌ Internal Server Error - System error occurred -

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

update_list

RestRList update_list(identifier, rest_e_list)

Update list

Updates an existing list's settings.

Example

  • Api Key Authentication (TeamApiKey):
import sendx_python_sdk
from sendx_python_sdk.models.rest_e_list import RestEList
from sendx_python_sdk.models.rest_r_list import RestRList
from sendx_python_sdk.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.sendx.io/api/v1/rest
# See configuration.py for a list of all supported configuration parameters.
configuration = sendx_python_sdk.Configuration(
    host = "https://api.sendx.io/api/v1/rest"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure API key authorization: TeamApiKey
configuration.api_key['TeamApiKey'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['TeamApiKey'] = 'Bearer'

# Enter a context with an instance of the API client
with sendx_python_sdk.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = sendx_python_sdk.ListApi(api_client)
    identifier = 'identifier_example' # str | List identifier to update
    rest_e_list = {"name":"2024 Newsletter Subscribers"} # RestEList | 

    try:
        # Update list
        api_response = api_instance.update_list(identifier, rest_e_list)
        print("The response of ListApi->update_list:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling ListApi->update_list: %s\n" % e)

Parameters

Name Type Description Notes
identifier str List identifier to update
rest_e_list RestEList

Return type

RestRList

Authorization

TeamApiKey

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 ✅ List updated successfully -
401 ❌ Unauthorized - Invalid or missing API key -
403 ❌ Forbidden - Resource name already exists -
404 ❌ Not Found - Resource does not exist -
422 ❌ Unprocessable Entity - Invalid request format -
500 ❌ Internal Server Error - System error occurred -

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