All URIs are relative to https://workplace-console.truehost.cloud/api
| Method | HTTP request | Description |
|---|---|---|
| emails_create | POST /subscriptions/ | Create a new emails |
| subscriptions_list | GET /subscriptions/ | List subscriptions |
| subscriptions_read | GET /subscriptions/{context_id}/ | Get subscription details |
| update_subscription_status | POST /subscriptions/{context_id}/ | Update subscription status |
StandardResponse emails_create(workplace_create_emails)
Create a new emails
Create a new emails, it will also create a new subscription for the domain if emails list is not empty and new_subscription is true
- Bearer (JWT) Authentication (BearerAuth):
import workplace_client
from workplace_client.models.standard_response import StandardResponse
from workplace_client.models.workplace_create_emails import WorkplaceCreateEmails
from workplace_client.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://workplace-console.truehost.cloud/api
# See configuration.py for a list of all supported configuration parameters.
configuration = workplace_client.Configuration(
host = "https://workplace-console.truehost.cloud/api"
)
# 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 Bearer authorization (JWT): BearerAuth
configuration = workplace_client.Configuration(
access_token = os.environ["BEARER_TOKEN"]
)
# Enter a context with an instance of the API client
with workplace_client.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = workplace_client.SubscriptionsApi(api_client)
workplace_create_emails = workplace_client.WorkplaceCreateEmails() # WorkplaceCreateEmails |
try:
# Create a new emails
api_response = api_instance.emails_create(workplace_create_emails)
print("The response of SubscriptionsApi->emails_create:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling SubscriptionsApi->emails_create: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| workplace_create_emails | WorkplaceCreateEmails |
- Content-Type: application/json
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Success | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
object subscriptions_list()
List subscriptions
Get list of subscriptions
- Bearer (JWT) Authentication (BearerAuth):
import workplace_client
from workplace_client.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://workplace-console.truehost.cloud/api
# See configuration.py for a list of all supported configuration parameters.
configuration = workplace_client.Configuration(
host = "https://workplace-console.truehost.cloud/api"
)
# 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 Bearer authorization (JWT): BearerAuth
configuration = workplace_client.Configuration(
access_token = os.environ["BEARER_TOKEN"]
)
# Enter a context with an instance of the API client
with workplace_client.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = workplace_client.SubscriptionsApi(api_client)
try:
# List subscriptions
api_response = api_instance.subscriptions_list()
print("The response of SubscriptionsApi->subscriptions_list:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling SubscriptionsApi->subscriptions_list: %s\n" % e)This endpoint does not need any parameter.
object
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | List of subscriptions | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
SubscriptionsReadResponse subscriptions_read(context_id)
Get subscription details
Get subscription details
- Bearer (JWT) Authentication (BearerAuth):
import workplace_client
from workplace_client.models.subscriptions_read_response import SubscriptionsReadResponse
from workplace_client.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://workplace-console.truehost.cloud/api
# See configuration.py for a list of all supported configuration parameters.
configuration = workplace_client.Configuration(
host = "https://workplace-console.truehost.cloud/api"
)
# 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 Bearer authorization (JWT): BearerAuth
configuration = workplace_client.Configuration(
access_token = os.environ["BEARER_TOKEN"]
)
# Enter a context with an instance of the API client
with workplace_client.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = workplace_client.SubscriptionsApi(api_client)
context_id = 'context_id_example' # str |
try:
# Get subscription details
api_response = api_instance.subscriptions_read(context_id)
print("The response of SubscriptionsApi->subscriptions_read:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling SubscriptionsApi->subscriptions_read: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| context_id | str |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Subscription details | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
StandardResponse update_subscription_status(context_id, service_action)
Update subscription status
Update subscription status, delete, suspend, unsuspend, etc...
- Bearer (JWT) Authentication (BearerAuth):
import workplace_client
from workplace_client.models.service_action import ServiceAction
from workplace_client.models.standard_response import StandardResponse
from workplace_client.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://workplace-console.truehost.cloud/api
# See configuration.py for a list of all supported configuration parameters.
configuration = workplace_client.Configuration(
host = "https://workplace-console.truehost.cloud/api"
)
# 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 Bearer authorization (JWT): BearerAuth
configuration = workplace_client.Configuration(
access_token = os.environ["BEARER_TOKEN"]
)
# Enter a context with an instance of the API client
with workplace_client.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = workplace_client.SubscriptionsApi(api_client)
context_id = 'context_id_example' # str |
service_action = workplace_client.ServiceAction() # ServiceAction |
try:
# Update subscription status
api_response = api_instance.update_subscription_status(context_id, service_action)
print("The response of SubscriptionsApi->update_subscription_status:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling SubscriptionsApi->update_subscription_status: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| context_id | str | ||
| service_action | ServiceAction |
- Content-Type: application/json
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Success | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]