All URIs are relative to https://api.smooch.io
| Method | HTTP request | Description |
|---|---|---|
| get_device | GET /v2/apps/{appId}/users/{userIdOrExternalId}/devices/{deviceId} | Get Device |
| list_devices | GET /v2/apps/{appId}/users/{userIdOrExternalId}/devices | List Devices |
DeviceResponse get_device(app_id, user_id_or_external_id, device_id)
Get Device
Fetches a specific Device.
- Basic Authentication (basicAuth):
- Bearer (JWT) Authentication (bearerAuth):
import sunshine_conversations_client
from sunshine_conversations_client.models.device_response import DeviceResponse
from sunshine_conversations_client.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.smooch.io
# See configuration.py for a list of all supported configuration parameters.
configuration = sunshine_conversations_client.Configuration(
host = "https://api.smooch.io"
)
# 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 HTTP basic authorization: basicAuth
configuration = sunshine_conversations_client.Configuration(
username = os.environ["USERNAME"],
password = os.environ["PASSWORD"]
)
# Configure Bearer authorization (JWT): bearerAuth
configuration = sunshine_conversations_client.Configuration(
access_token = os.environ["BEARER_TOKEN"]
)
# Enter a context with an instance of the API client
with sunshine_conversations_client.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = sunshine_conversations_client.DevicesApi(api_client)
app_id = '5d8cff3cd55b040010928b5b' # str | Identifies the app.
user_id_or_external_id = '42589ad070d43be9b00ff7e5' # str | The user's id or externalId.
device_id = '5d8cff3cd55b040010928b5b' # str | The device's id.
try:
# Get Device
api_response = api_instance.get_device(app_id, user_id_or_external_id, device_id)
print("The response of DevicesApi->get_device:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling DevicesApi->get_device: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| app_id | str | Identifies the app. | |
| user_id_or_external_id | str | The user's id or externalId. | |
| device_id | str | The device's id. |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Ok | - |
| 404 | Not found | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
DeviceListResponse list_devices(app_id, user_id_or_external_id)
List Devices
Get all the devices for a particular user. The Devices are sorted based on last seen time.
- Basic Authentication (basicAuth):
- Bearer (JWT) Authentication (bearerAuth):
import sunshine_conversations_client
from sunshine_conversations_client.models.device_list_response import DeviceListResponse
from sunshine_conversations_client.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.smooch.io
# See configuration.py for a list of all supported configuration parameters.
configuration = sunshine_conversations_client.Configuration(
host = "https://api.smooch.io"
)
# 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 HTTP basic authorization: basicAuth
configuration = sunshine_conversations_client.Configuration(
username = os.environ["USERNAME"],
password = os.environ["PASSWORD"]
)
# Configure Bearer authorization (JWT): bearerAuth
configuration = sunshine_conversations_client.Configuration(
access_token = os.environ["BEARER_TOKEN"]
)
# Enter a context with an instance of the API client
with sunshine_conversations_client.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = sunshine_conversations_client.DevicesApi(api_client)
app_id = '5d8cff3cd55b040010928b5b' # str | Identifies the app.
user_id_or_external_id = '42589ad070d43be9b00ff7e5' # str | The user's id or externalId.
try:
# List Devices
api_response = api_instance.list_devices(app_id, user_id_or_external_id)
print("The response of DevicesApi->list_devices:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling DevicesApi->list_devices: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| app_id | str | Identifies the app. | |
| user_id_or_external_id | str | The user's id or externalId. |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Ok | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]