mailslurp_netstandard_2x.Api.ContactControllerApi
All URIs are relative to https://csharp.api.mailslurp.com
Method | HTTP request | Description |
---|---|---|
CreateContact | POST /contacts | Create a contact |
DeleteContact | DELETE /contacts/{contactId} | Delete contact |
GetAllContacts | GET /contacts/paginated | Get all contacts |
GetContact | GET /contacts/{contactId} | Get contact |
GetContactVCard | GET /contacts/{contactId}/download | Get contact vCard vcf file |
GetContacts | GET /contacts | Get all contacts |
ContactDto CreateContact (CreateContactOptions createContactOptions)
Create a contact
Example
using System.Collections.Generic;
using System.Diagnostics;
using mailslurp_netstandard_2x.Api;
using mailslurp_netstandard_2x.Client;
using mailslurp_netstandard_2x.Model;
namespace Example
{
public class CreateContactExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "https://csharp.api.mailslurp.com";
// Configure API key authorization: API_KEY
config.AddApiKey("x-api-key", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// config.AddApiKeyPrefix("x-api-key", "Bearer");
var apiInstance = new ContactControllerApi(config);
var createContactOptions = new CreateContactOptions(); // CreateContactOptions |
try
{
// Create a contact
ContactDto result = apiInstance.CreateContact(createContactOptions);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling ContactControllerApi.CreateContact: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Using the CreateContactWithHttpInfo variant
This returns an ApiResponse object which contains the response data, status code and headers.
try
{
// Create a contact
ApiResponse<ContactDto> response = apiInstance.CreateContactWithHttpInfo(createContactOptions);
Debug.Write("Status Code: " + response.StatusCode);
Debug.Write("Response Headers: " + response.Headers);
Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
Debug.Print("Exception when calling ContactControllerApi.CreateContactWithHttpInfo: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
Parameters
Name | Type | Description | Notes |
---|---|---|---|
createContactOptions | CreateContactOptions |
Return type
Authorization
HTTP request headers
- Content-Type: application/json
- Accept: /
HTTP response details
Status code | Description | Response headers |
---|---|---|
201 | Created | - |
[Back to top] [Back to API list] [Back to Model list] [Back to ]
void DeleteContact (Guid contactId)
Delete contact
Example
using System.Collections.Generic;
using System.Diagnostics;
using mailslurp_netstandard_2x.Api;
using mailslurp_netstandard_2x.Client;
using mailslurp_netstandard_2x.Model;
namespace Example
{
public class DeleteContactExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "https://csharp.api.mailslurp.com";
// Configure API key authorization: API_KEY
config.AddApiKey("x-api-key", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// config.AddApiKeyPrefix("x-api-key", "Bearer");
var apiInstance = new ContactControllerApi(config);
var contactId = "contactId_example"; // Guid |
try
{
// Delete contact
apiInstance.DeleteContact(contactId);
}
catch (ApiException e)
{
Debug.Print("Exception when calling ContactControllerApi.DeleteContact: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Using the DeleteContactWithHttpInfo variant
This returns an ApiResponse object which contains the response data, status code and headers.
try
{
// Delete contact
apiInstance.DeleteContactWithHttpInfo(contactId);
}
catch (ApiException e)
{
Debug.Print("Exception when calling ContactControllerApi.DeleteContactWithHttpInfo: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
Parameters
Name | Type | Description | Notes |
---|---|---|---|
contactId | Guid |
Return type
void (empty response body)
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: Not defined
HTTP response details
Status code | Description | Response headers |
---|---|---|
204 | No Content | - |
[Back to top] [Back to API list] [Back to Model list] [Back to ]
PageContactProjection GetAllContacts (int? page = null, int? size = null, string sort = null, DateTime? since = null, DateTime? before = null)
Get all contacts
Example
using System.Collections.Generic;
using System.Diagnostics;
using mailslurp_netstandard_2x.Api;
using mailslurp_netstandard_2x.Client;
using mailslurp_netstandard_2x.Model;
namespace Example
{
public class GetAllContactsExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "https://csharp.api.mailslurp.com";
// Configure API key authorization: API_KEY
config.AddApiKey("x-api-key", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// config.AddApiKeyPrefix("x-api-key", "Bearer");
var apiInstance = new ContactControllerApi(config);
var page = 0; // int? | Optional page in list pagination (optional) (default to 0)
var size = 20; // int? | Optional page size in list pagination (optional) (default to 20)
var sort = "ASC"; // string | Optional createdAt sort direction ASC or DESC (optional) (default to ASC)
var since = DateTime.Parse("2013-10-20T19:20:30+01:00"); // DateTime? | Filter by created at after the given timestamp (optional)
var before = DateTime.Parse("2013-10-20T19:20:30+01:00"); // DateTime? | Filter by created at before the given timestamp (optional)
try
{
// Get all contacts
PageContactProjection result = apiInstance.GetAllContacts(page, size, sort, since, before);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling ContactControllerApi.GetAllContacts: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Using the GetAllContactsWithHttpInfo variant
This returns an ApiResponse object which contains the response data, status code and headers.
try
{
// Get all contacts
ApiResponse<PageContactProjection> response = apiInstance.GetAllContactsWithHttpInfo(page, size, sort, since, before);
Debug.Write("Status Code: " + response.StatusCode);
Debug.Write("Response Headers: " + response.Headers);
Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
Debug.Print("Exception when calling ContactControllerApi.GetAllContactsWithHttpInfo: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
Parameters
Name | Type | Description | Notes |
---|---|---|---|
page | int? | Optional page in list pagination | [optional] [default to 0] |
size | int? | Optional page size in list pagination | [optional] [default to 20] |
sort | string | Optional createdAt sort direction ASC or DESC | [optional] [default to ASC] |
since | DateTime? | Filter by created at after the given timestamp | [optional] |
before | DateTime? | Filter by created at before the given timestamp | [optional] |
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: /
HTTP response details
Status code | Description | Response headers |
---|---|---|
200 | OK | - |
[Back to top] [Back to API list] [Back to Model list] [Back to ]
ContactDto GetContact (Guid contactId)
Get contact
Example
using System.Collections.Generic;
using System.Diagnostics;
using mailslurp_netstandard_2x.Api;
using mailslurp_netstandard_2x.Client;
using mailslurp_netstandard_2x.Model;
namespace Example
{
public class GetContactExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "https://csharp.api.mailslurp.com";
// Configure API key authorization: API_KEY
config.AddApiKey("x-api-key", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// config.AddApiKeyPrefix("x-api-key", "Bearer");
var apiInstance = new ContactControllerApi(config);
var contactId = "contactId_example"; // Guid |
try
{
// Get contact
ContactDto result = apiInstance.GetContact(contactId);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling ContactControllerApi.GetContact: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Using the GetContactWithHttpInfo variant
This returns an ApiResponse object which contains the response data, status code and headers.
try
{
// Get contact
ApiResponse<ContactDto> response = apiInstance.GetContactWithHttpInfo(contactId);
Debug.Write("Status Code: " + response.StatusCode);
Debug.Write("Response Headers: " + response.Headers);
Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
Debug.Print("Exception when calling ContactControllerApi.GetContactWithHttpInfo: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
Parameters
Name | Type | Description | Notes |
---|---|---|---|
contactId | Guid |
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: /
HTTP response details
Status code | Description | Response headers |
---|---|---|
200 | OK | - |
[Back to top] [Back to API list] [Back to Model list] [Back to ]
List
GetContactVCard (Guid contactId)
Get contact vCard vcf file
Example
using System.Collections.Generic;
using System.Diagnostics;
using mailslurp_netstandard_2x.Api;
using mailslurp_netstandard_2x.Client;
using mailslurp_netstandard_2x.Model;
namespace Example
{
public class GetContactVCardExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "https://csharp.api.mailslurp.com";
// Configure API key authorization: API_KEY
config.AddApiKey("x-api-key", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// config.AddApiKeyPrefix("x-api-key", "Bearer");
var apiInstance = new ContactControllerApi(config);
var contactId = "contactId_example"; // Guid |
try
{
// Get contact vCard vcf file
List<byte[]> result = apiInstance.GetContactVCard(contactId);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling ContactControllerApi.GetContactVCard: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Using the GetContactVCardWithHttpInfo variant
This returns an ApiResponse object which contains the response data, status code and headers.
try
{
// Get contact vCard vcf file
ApiResponse<List<byte[]>> response = apiInstance.GetContactVCardWithHttpInfo(contactId);
Debug.Write("Status Code: " + response.StatusCode);
Debug.Write("Response Headers: " + response.Headers);
Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
Debug.Print("Exception when calling ContactControllerApi.GetContactVCardWithHttpInfo: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
Parameters
Name | Type | Description | Notes |
---|---|---|---|
contactId | Guid |
Return type
List
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: /
HTTP response details
Status code | Description | Response headers |
---|---|---|
200 | OK | - |
[Back to top] [Back to API list] [Back to Model list] [Back to ]
List
GetContacts ()
Get all contacts
Example
using System.Collections.Generic;
using System.Diagnostics;
using mailslurp_netstandard_2x.Api;
using mailslurp_netstandard_2x.Client;
using mailslurp_netstandard_2x.Model;
namespace Example
{
public class GetContactsExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "https://csharp.api.mailslurp.com";
// Configure API key authorization: API_KEY
config.AddApiKey("x-api-key", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// config.AddApiKeyPrefix("x-api-key", "Bearer");
var apiInstance = new ContactControllerApi(config);
try
{
// Get all contacts
List<ContactProjection> result = apiInstance.GetContacts();
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling ContactControllerApi.GetContacts: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Using the GetContactsWithHttpInfo variant
This returns an ApiResponse object which contains the response data, status code and headers.
try
{
// Get all contacts
ApiResponse<List<ContactProjection>> response = apiInstance.GetContactsWithHttpInfo();
Debug.Write("Status Code: " + response.StatusCode);
Debug.Write("Response Headers: " + response.Headers);
Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
Debug.Print("Exception when calling ContactControllerApi.GetContactsWithHttpInfo: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
Parameters
This endpoint does not need any parameter.
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: /
HTTP response details
Status code | Description | Response headers |
---|---|---|
200 | OK | - |
[Back to top] [Back to API list] [Back to Model list] [Back to ]