Appearance
Audiences API
All URIs are relative to https://api.syntheticusers.com/api/v1
| Method | HTTP request | Description |
|---|---|---|
| create_audience | POST /audiences | Create Audience |
| delete_audience | DELETE /audiences/ | Delete Audience |
| edit_audience | PATCH /audiences/ | Edit Audience |
| extend_audience | POST /audiences/{audience_id}/extend | Extend Audience |
| generate_audience | POST /audiences/{audience_id}/generate | Generate Audience |
| get_audience | GET /audiences/ | Get Audience |
| list_audiences | GET /audiences | List Audiences |
create_audience
Audience create_audience(audience_create)
Create Audience
Example
- Bearer Authentication (HTTPBearer):
python
import syntheticusers
from syntheticusers.models.audience import Audience
from syntheticusers.models.audience_create import AudienceCreate
from syntheticusers.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.syntheticusers.com/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = syntheticusers.Configuration(
host = "https://api.syntheticusers.com/api/v1"
)
# 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: HTTPBearer
configuration = syntheticusers.Configuration(
access_token = os.environ["BEARER_TOKEN"]
)
# Enter a context with an instance of the API client
with syntheticusers.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = syntheticusers.AudiencesApi(api_client)
audience_create = syntheticusers.AudienceCreate() # AudienceCreate |
try:
# Create Audience
api_response = api_instance.create_audience(audience_create)
print("The response of AudiencesApi->create_audience:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling AudiencesApi->create_audience: %s\n" % e)Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| audience_create | AudienceCreate |
Return type
Authorization
HTTP request headers
- Content-Type: application/json
- Accept: application/json
HTTP response details
| Status code | Description | Response headers |
|---|---|---|
| 200 | Successful Response | - |
| 422 | Validation Error | - |
[Back to top] [Back to API list] [Back to SDK]
delete_audience
object delete_audience(audience_id)
Delete Audience
Example
- Bearer Authentication (HTTPBearer):
python
import syntheticusers
from syntheticusers.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.syntheticusers.com/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = syntheticusers.Configuration(
host = "https://api.syntheticusers.com/api/v1"
)
# 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: HTTPBearer
configuration = syntheticusers.Configuration(
access_token = os.environ["BEARER_TOKEN"]
)
# Enter a context with an instance of the API client
with syntheticusers.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = syntheticusers.AudiencesApi(api_client)
audience_id = 'audience_id_example' # str |
try:
# Delete Audience
api_response = api_instance.delete_audience(audience_id)
print("The response of AudiencesApi->delete_audience:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling AudiencesApi->delete_audience: %s\n" % e)Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| audience_id | str |
Return type
object
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
HTTP response details
| Status code | Description | Response headers |
|---|---|---|
| 200 | Successful Response | - |
| 422 | Validation Error | - |
[Back to top] [Back to API list] [Back to SDK]
edit_audience
Audience edit_audience(audience_id, audience_update)
Edit Audience
Example
- Bearer Authentication (HTTPBearer):
python
import syntheticusers
from syntheticusers.models.audience import Audience
from syntheticusers.models.audience_update import AudienceUpdate
from syntheticusers.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.syntheticusers.com/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = syntheticusers.Configuration(
host = "https://api.syntheticusers.com/api/v1"
)
# 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: HTTPBearer
configuration = syntheticusers.Configuration(
access_token = os.environ["BEARER_TOKEN"]
)
# Enter a context with an instance of the API client
with syntheticusers.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = syntheticusers.AudiencesApi(api_client)
audience_id = 'audience_id_example' # str |
audience_update = syntheticusers.AudienceUpdate() # AudienceUpdate |
try:
# Edit Audience
api_response = api_instance.edit_audience(audience_id, audience_update)
print("The response of AudiencesApi->edit_audience:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling AudiencesApi->edit_audience: %s\n" % e)Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| audience_id | str | ||
| audience_update | AudienceUpdate |
Return type
Authorization
HTTP request headers
- Content-Type: application/json
- Accept: application/json
HTTP response details
| Status code | Description | Response headers |
|---|---|---|
| 200 | Successful Response | - |
| 422 | Validation Error | - |
[Back to top] [Back to API list] [Back to SDK]
extend_audience
object extend_audience(audience_id, audience_extend)
Extend Audience
Example
- Bearer Authentication (HTTPBearer):
python
import syntheticusers
from syntheticusers.models.audience_extend import AudienceExtend
from syntheticusers.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.syntheticusers.com/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = syntheticusers.Configuration(
host = "https://api.syntheticusers.com/api/v1"
)
# 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: HTTPBearer
configuration = syntheticusers.Configuration(
access_token = os.environ["BEARER_TOKEN"]
)
# Enter a context with an instance of the API client
with syntheticusers.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = syntheticusers.AudiencesApi(api_client)
audience_id = 'audience_id_example' # str |
audience_extend = syntheticusers.AudienceExtend() # AudienceExtend |
try:
# Extend Audience
api_response = api_instance.extend_audience(audience_id, audience_extend)
print("The response of AudiencesApi->extend_audience:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling AudiencesApi->extend_audience: %s\n" % e)Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| audience_id | str | ||
| audience_extend | AudienceExtend |
Return type
object
Authorization
HTTP request headers
- Content-Type: application/json
- Accept: application/json
HTTP response details
| Status code | Description | Response headers |
|---|---|---|
| 200 | Successful Response | - |
| 422 | Validation Error | - |
[Back to top] [Back to API list] [Back to SDK]
generate_audience
List[str] generate_audience(audience_id, audience_generate)
Generate Audience
Example
- Bearer Authentication (HTTPBearer):
python
import syntheticusers
from syntheticusers.models.audience_generate import AudienceGenerate
from syntheticusers.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.syntheticusers.com/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = syntheticusers.Configuration(
host = "https://api.syntheticusers.com/api/v1"
)
# 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: HTTPBearer
configuration = syntheticusers.Configuration(
access_token = os.environ["BEARER_TOKEN"]
)
# Enter a context with an instance of the API client
with syntheticusers.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = syntheticusers.AudiencesApi(api_client)
audience_id = 'audience_id_example' # str |
audience_generate = syntheticusers.AudienceGenerate() # AudienceGenerate |
try:
# Generate Audience
api_response = api_instance.generate_audience(audience_id, audience_generate)
print("The response of AudiencesApi->generate_audience:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling AudiencesApi->generate_audience: %s\n" % e)Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| audience_id | str | ||
| audience_generate | AudienceGenerate |
Return type
List[str]
Authorization
HTTP request headers
- Content-Type: application/json
- Accept: application/json
HTTP response details
| Status code | Description | Response headers |
|---|---|---|
| 200 | Successful Response | - |
| 422 | Validation Error | - |
[Back to top] [Back to API list] [Back to SDK]
get_audience
Audience get_audience(audience_id)
Get Audience
Example
- Bearer Authentication (HTTPBearer):
python
import syntheticusers
from syntheticusers.models.audience import Audience
from syntheticusers.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.syntheticusers.com/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = syntheticusers.Configuration(
host = "https://api.syntheticusers.com/api/v1"
)
# 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: HTTPBearer
configuration = syntheticusers.Configuration(
access_token = os.environ["BEARER_TOKEN"]
)
# Enter a context with an instance of the API client
with syntheticusers.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = syntheticusers.AudiencesApi(api_client)
audience_id = 'audience_id_example' # str |
try:
# Get Audience
api_response = api_instance.get_audience(audience_id)
print("The response of AudiencesApi->get_audience:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling AudiencesApi->get_audience: %s\n" % e)Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| audience_id | str |
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
HTTP response details
| Status code | Description | Response headers |
|---|---|---|
| 200 | Successful Response | - |
| 422 | Validation Error | - |
[Back to top] [Back to API list] [Back to SDK]
list_audiences
PageAudience list_audiences(id=id, project_id=project_id, page=page, size=size)
List Audiences
Example
- Bearer Authentication (HTTPBearer):
python
import syntheticusers
from syntheticusers.models.page_audience import PageAudience
from syntheticusers.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.syntheticusers.com/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = syntheticusers.Configuration(
host = "https://api.syntheticusers.com/api/v1"
)
# 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: HTTPBearer
configuration = syntheticusers.Configuration(
access_token = os.environ["BEARER_TOKEN"]
)
# Enter a context with an instance of the API client
with syntheticusers.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = syntheticusers.AudiencesApi(api_client)
id = 'id_example' # str | Comma-separated list of audience IDs (optional)
project_id = 'project_id_example' # str | Comma-separated list of project IDs (optional)
page = 1 # int | Page number (optional) (default to 1)
size = 50 # int | Page size (optional) (default to 50)
try:
# List Audiences
api_response = api_instance.list_audiences(id=id, project_id=project_id, page=page, size=size)
print("The response of AudiencesApi->list_audiences:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling AudiencesApi->list_audiences: %s\n" % e)Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| id | str | Comma-separated list of audience IDs | [optional] |
| project_id | str | Comma-separated list of project IDs | [optional] |
| page | int | Page number | [optional] [default to 1] |
| size | int | Page size | [optional] [default to 50] |
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
HTTP response details
| Status code | Description | Response headers |
|---|---|---|
| 200 | Successful Response | - |
| 422 | Validation Error | - |