mailslurp_client.ContactControllerApi

All URIs are relative to https://api.mailslurp.com

MethodHTTP requestDescription
create_contactPOST /contactsCreate a contact
delete_contactDELETE /contacts/{contactId}Delete contact
get_all_contactsGET /contacts/paginatedGet all contacts
get_contactGET /contacts/{contactId}Get contact
get_contact_v_cardGET /contacts/{contactId}/downloadGet contact vCard vcf file
get_contactsGET /contactsGet all contacts

create_contact

ContactDto create_contact(create_contact_options)

Create a contact

Example

  • Api Key Authentication (API_KEY):
from __future__ import print_function
import time
import mailslurp_client
from mailslurp_client.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.mailslurp.com
# See configuration.py for a list of all supported configuration parameters.
configuration = mailslurp_client.Configuration(
    host = "https://api.mailslurp.com"
)

# 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: API_KEY
configuration = mailslurp_client.Configuration(
    host = "https://api.mailslurp.com",
    api_key = {
        'x-api-key': 'YOUR_API_KEY'
    }
)
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['x-api-key'] = 'Bearer'

# Enter a context with an instance of the API client
with mailslurp_client.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = mailslurp_client.ContactControllerApi(api_client)
    create_contact_options = mailslurp_client.CreateContactOptions() # CreateContactOptions | createContactOptions

    try:
        # Create a contact
        api_response = api_instance.create_contact(create_contact_options)
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling ContactControllerApi->create_contact: %sn" % e)

Parameters

NameTypeDescriptionNotes
create_contact_optionsCreateContactOptionscreateContactOptions

Return type

ContactDto

Authorization

API_KEY

HTTP request headers

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

HTTP response details

Status codeDescriptionResponse headers
201Created-
401Unauthorized-
403Forbidden-
404Not Found-

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

delete_contact

delete_contact(contact_id)

Delete contact

Example

  • Api Key Authentication (API_KEY):
from __future__ import print_function
import time
import mailslurp_client
from mailslurp_client.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.mailslurp.com
# See configuration.py for a list of all supported configuration parameters.
configuration = mailslurp_client.Configuration(
    host = "https://api.mailslurp.com"
)

# 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: API_KEY
configuration = mailslurp_client.Configuration(
    host = "https://api.mailslurp.com",
    api_key = {
        'x-api-key': 'YOUR_API_KEY'
    }
)
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['x-api-key'] = 'Bearer'

# Enter a context with an instance of the API client
with mailslurp_client.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = mailslurp_client.ContactControllerApi(api_client)
    contact_id = 'contact_id_example' # str | contactId

    try:
        # Delete contact
        api_instance.delete_contact(contact_id)
    except ApiException as e:
        print("Exception when calling ContactControllerApi->delete_contact: %sn" % e)

Parameters

NameTypeDescriptionNotes
contact_idstrcontactId

Return type

void (empty response body)

Authorization

API_KEY

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

HTTP response details

Status codeDescriptionResponse headers
204No Content-
401Unauthorized-
403Forbidden-

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

get_all_contacts

PageContactProjection get_all_contacts(before=before, page=page, since=since, size=size, sort=sort)

Get all contacts

Example

  • Api Key Authentication (API_KEY):
from __future__ import print_function
import time
import mailslurp_client
from mailslurp_client.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.mailslurp.com
# See configuration.py for a list of all supported configuration parameters.
configuration = mailslurp_client.Configuration(
    host = "https://api.mailslurp.com"
)

# 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: API_KEY
configuration = mailslurp_client.Configuration(
    host = "https://api.mailslurp.com",
    api_key = {
        'x-api-key': 'YOUR_API_KEY'
    }
)
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['x-api-key'] = 'Bearer'

# Enter a context with an instance of the API client
with mailslurp_client.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = mailslurp_client.ContactControllerApi(api_client)
    before = '2013-10-20T19:20:30+01:00' # datetime | Filter by created at before the given timestamp (optional)
page = 0 # int | Optional page  in list pagination (optional) (default to 0)
since = '2013-10-20T19:20:30+01:00' # datetime | Filter by created at after the given timestamp (optional)
size = 20 # int | Optional page size in list pagination (optional) (default to 20)
sort = 'ASC' # str | Optional createdAt sort direction ASC or DESC (optional) (default to 'ASC')

    try:
        # Get all contacts
        api_response = api_instance.get_all_contacts(before=before, page=page, since=since, size=size, sort=sort)
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling ContactControllerApi->get_all_contacts: %sn" % e)

Parameters

NameTypeDescriptionNotes
beforedatetimeFilter by created at before the given timestamp[optional]
pageintOptional page in list pagination[optional] [default to 0]
sincedatetimeFilter by created at after the given timestamp[optional]
sizeintOptional page size in list pagination[optional] [default to 20]
sortstrOptional createdAt sort direction ASC or DESC[optional] [default to ‘ASC’]

Return type

PageContactProjection

Authorization

API_KEY

HTTP request headers

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

HTTP response details

Status codeDescriptionResponse headers
200OK-
401Unauthorized-
403Forbidden-
404Not Found-

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

get_contact

ContactDto get_contact(contact_id)

Get contact

Example

  • Api Key Authentication (API_KEY):
from __future__ import print_function
import time
import mailslurp_client
from mailslurp_client.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.mailslurp.com
# See configuration.py for a list of all supported configuration parameters.
configuration = mailslurp_client.Configuration(
    host = "https://api.mailslurp.com"
)

# 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: API_KEY
configuration = mailslurp_client.Configuration(
    host = "https://api.mailslurp.com",
    api_key = {
        'x-api-key': 'YOUR_API_KEY'
    }
)
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['x-api-key'] = 'Bearer'

# Enter a context with an instance of the API client
with mailslurp_client.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = mailslurp_client.ContactControllerApi(api_client)
    contact_id = 'contact_id_example' # str | contactId

    try:
        # Get contact
        api_response = api_instance.get_contact(contact_id)
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling ContactControllerApi->get_contact: %sn" % e)

Parameters

NameTypeDescriptionNotes
contact_idstrcontactId

Return type

ContactDto

Authorization

API_KEY

HTTP request headers

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

HTTP response details

Status codeDescriptionResponse headers
200OK-
401Unauthorized-
403Forbidden-
404Not Found-

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

get_contact_v_card

str get_contact_v_card(contact_id)

Get contact vCard vcf file

Example

  • Api Key Authentication (API_KEY):
from __future__ import print_function
import time
import mailslurp_client
from mailslurp_client.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.mailslurp.com
# See configuration.py for a list of all supported configuration parameters.
configuration = mailslurp_client.Configuration(
    host = "https://api.mailslurp.com"
)

# 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: API_KEY
configuration = mailslurp_client.Configuration(
    host = "https://api.mailslurp.com",
    api_key = {
        'x-api-key': 'YOUR_API_KEY'
    }
)
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['x-api-key'] = 'Bearer'

# Enter a context with an instance of the API client
with mailslurp_client.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = mailslurp_client.ContactControllerApi(api_client)
    contact_id = 'contact_id_example' # str | contactId

    try:
        # Get contact vCard vcf file
        api_response = api_instance.get_contact_v_card(contact_id)
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling ContactControllerApi->get_contact_v_card: %sn" % e)

Parameters

NameTypeDescriptionNotes
contact_idstrcontactId

Return type

str

Authorization

API_KEY

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/octet-stream

HTTP response details

Status codeDescriptionResponse headers
200OK-
401Unauthorized-
403Forbidden-
404Not Found-

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

get_contacts

list[ContactProjection] get_contacts()

Get all contacts

Example

  • Api Key Authentication (API_KEY):
from __future__ import print_function
import time
import mailslurp_client
from mailslurp_client.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.mailslurp.com
# See configuration.py for a list of all supported configuration parameters.
configuration = mailslurp_client.Configuration(
    host = "https://api.mailslurp.com"
)

# 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: API_KEY
configuration = mailslurp_client.Configuration(
    host = "https://api.mailslurp.com",
    api_key = {
        'x-api-key': 'YOUR_API_KEY'
    }
)
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['x-api-key'] = 'Bearer'

# Enter a context with an instance of the API client
with mailslurp_client.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = mailslurp_client.ContactControllerApi(api_client)
    
    try:
        # Get all contacts
        api_response = api_instance.get_contacts()
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling ContactControllerApi->get_contacts: %sn" % e)

Parameters

This endpoint does not need any parameter.

Return type

**list[ContactProjection]**

Authorization

API_KEY

HTTP request headers

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

HTTP response details

Status codeDescriptionResponse headers
200OK-
401Unauthorized-
403Forbidden-
404Not Found-

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