MailSlurp::ContactControllerApi

Load the API package

use MailSlurp::Object::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_contact_options)

Create a contact

Example

use Data::Dumper;
use MailSlurp::ContactControllerApi;
my $api_instance = MailSlurp::ContactControllerApi->new(

    # Configure API key authorization: API_KEY
    api_key => {'x-api-key' => 'YOUR_API_KEY'},
    # uncomment below to setup prefix (e.g. Bearer) for API key, if needed
    #api_key_prefix => {'x-api-key' => 'Bearer'},
);

my $create_contact_options = MailSlurp::Object::CreateContactOptions->new(); # CreateContactOptions | createContactOptions

eval { 
    my $result = $api_instance->create_contact(create_contact_options => $create_contact_options);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling ContactControllerApi->create_contact: $@n";
}

Parameters

NameTypeDescriptionNotes
create_contact_optionsCreateContactOptionscreateContactOptions

Return type

ContactDto

Authorization

API_KEY

HTTP request headers

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

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

delete_contact

delete_contact(contact_id => $contact_id)

Delete contact

Example

use Data::Dumper;
use MailSlurp::ContactControllerApi;
my $api_instance = MailSlurp::ContactControllerApi->new(

    # Configure API key authorization: API_KEY
    api_key => {'x-api-key' => 'YOUR_API_KEY'},
    # uncomment below to setup prefix (e.g. Bearer) for API key, if needed
    #api_key_prefix => {'x-api-key' => 'Bearer'},
);

my $contact_id = null; # string | contactId

eval { 
    $api_instance->delete_contact(contact_id => $contact_id);
};
if ($@) {
    warn "Exception when calling ContactControllerApi->delete_contact: $@n";
}

Parameters

NameTypeDescriptionNotes
contact_idstringcontactId

Return type

void (empty response body)

Authorization

API_KEY

HTTP request headers

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

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

get_all_contacts

PageContactProjection get_all_contacts(page => $page, size => $size, sort => $sort)

Get all contacts

Example

use Data::Dumper;
use MailSlurp::ContactControllerApi;
my $api_instance = MailSlurp::ContactControllerApi->new(

    # Configure API key authorization: API_KEY
    api_key => {'x-api-key' => 'YOUR_API_KEY'},
    # uncomment below to setup prefix (e.g. Bearer) for API key, if needed
    #api_key_prefix => {'x-api-key' => 'Bearer'},
);

my $page = 0; # int | Optional page  in inbox list pagination
my $size = 20; # int | Optional page size in inbox list pagination
my $sort = 'ASC'; # string | Optional createdAt sort direction ASC or DESC

eval { 
    my $result = $api_instance->get_all_contacts(page => $page, size => $size, sort => $sort);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling ContactControllerApi->get_all_contacts: $@n";
}

Parameters

NameTypeDescriptionNotes
pageintOptional page in inbox list pagination[optional] [default to 0]
sizeintOptional page size in inbox list pagination[optional] [default to 20]
sortstringOptional 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

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

get_contact

ContactDto get_contact(contact_id => $contact_id)

Get contact

Example

use Data::Dumper;
use MailSlurp::ContactControllerApi;
my $api_instance = MailSlurp::ContactControllerApi->new(

    # Configure API key authorization: API_KEY
    api_key => {'x-api-key' => 'YOUR_API_KEY'},
    # uncomment below to setup prefix (e.g. Bearer) for API key, if needed
    #api_key_prefix => {'x-api-key' => 'Bearer'},
);

my $contact_id = null; # string | contactId

eval { 
    my $result = $api_instance->get_contact(contact_id => $contact_id);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling ContactControllerApi->get_contact: $@n";
}

Parameters

NameTypeDescriptionNotes
contact_idstringcontactId

Return type

ContactDto

Authorization

API_KEY

HTTP request headers

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

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

get_contact_v_card

string get_contact_v_card(contact_id => $contact_id)

Get contact vCard vcf file

Example

use Data::Dumper;
use MailSlurp::ContactControllerApi;
my $api_instance = MailSlurp::ContactControllerApi->new(

    # Configure API key authorization: API_KEY
    api_key => {'x-api-key' => 'YOUR_API_KEY'},
    # uncomment below to setup prefix (e.g. Bearer) for API key, if needed
    #api_key_prefix => {'x-api-key' => 'Bearer'},
);

my $contact_id = null; # string | contactId

eval { 
    my $result = $api_instance->get_contact_v_card(contact_id => $contact_id);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling ContactControllerApi->get_contact_v_card: $@n";
}

Parameters

NameTypeDescriptionNotes
contact_idstringcontactId

Return type

string

Authorization

API_KEY

HTTP request headers

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

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

get_contacts

ARRAY[ContactProjection] get_contacts()

Get all contacts

Example

use Data::Dumper;
use MailSlurp::ContactControllerApi;
my $api_instance = MailSlurp::ContactControllerApi->new(

    # Configure API key authorization: API_KEY
    api_key => {'x-api-key' => 'YOUR_API_KEY'},
    # uncomment below to setup prefix (e.g. Bearer) for API key, if needed
    #api_key_prefix => {'x-api-key' => 'Bearer'},
);


eval { 
    my $result = $api_instance->get_contacts();
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling ContactControllerApi->get_contacts: $@n";
}

Parameters

This endpoint does not need any parameter.

Return type

**ARRAY[ContactProjection]**

Authorization

API_KEY

HTTP request headers

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

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