maislurp-client-powershell.maislurp-client-powershell/Api.SmsControllerApi
All URIs are relative to https://api.mailslurp.com
Method | HTTP request | Description |
---|---|---|
Invoke-DeleteSmsMessage | DELETE /sms/{smsId} | Delete SMS message. |
Invoke-DeleteSmsMessages | DELETE /sms | Delete all SMS messages |
Get-SmsMessage | GET /sms/{smsId} | Get SMS content including body. Expects SMS to exist by ID. For SMS that may not have arrived yet use the WaitForController. |
Get-SmsMessagesPaginated | GET /sms | Get all SMS messages in all phone numbers in paginated form. . |
void Invoke-DeleteSmsMessage
[-SmsId]
Delete SMS message.
Delete an SMS message
Example
# general setting of the PowerShell module, e.g. base URL, authentication, etc
$Configuration = Get-Configuration
# Configure API key authorization: API_KEY
$Configuration.ApiKey.x-api-key = "YOUR_API_KEY"
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$Configuration.ApiKeyPrefix.x-api-key = "Bearer"
$SmsId = "SmsId_example" # String |
# Delete SMS message.
try {
$Result = Invoke-DeleteSmsMessage -SmsId $SmsId
} catch {
Write-Host ("Exception occured when calling Invoke-DeleteSmsMessage: {0}" -f ($_.ErrorDetails | ConvertFrom-Json))
Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json))
}
Parameters
Name | Type | Description | Notes |
---|---|---|---|
SmsId | String |
Return type
void (empty response body)
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: Not defined
[Back to top] [Back to API list] [Back to Model list] [Back to ]
void Invoke-DeleteSmsMessages
[-PhoneNumberId]
Delete all SMS messages
Delete all SMS messages or all messages for a given phone number
Example
# general setting of the PowerShell module, e.g. base URL, authentication, etc
$Configuration = Get-Configuration
# Configure API key authorization: API_KEY
$Configuration.ApiKey.x-api-key = "YOUR_API_KEY"
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$Configuration.ApiKeyPrefix.x-api-key = "Bearer"
$PhoneNumberId = "PhoneNumberId_example" # String | (optional)
# Delete all SMS messages
try {
$Result = Invoke-DeleteSmsMessages -PhoneNumberId $PhoneNumberId
} catch {
Write-Host ("Exception occured when calling Invoke-DeleteSmsMessages: {0}" -f ($_.ErrorDetails | ConvertFrom-Json))
Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json))
}
Parameters
Name | Type | Description | Notes |
---|---|---|---|
PhoneNumberId | String | [optional] |
Return type
void (empty response body)
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: Not defined
[Back to top] [Back to API list] [Back to Model list] [Back to ]
SmsDto Get-SmsMessage
[-SmsId]
Get SMS content including body. Expects SMS to exist by ID. For SMS that may not have arrived yet use the WaitForController.
Returns a SMS summary object with content.
Example
# general setting of the PowerShell module, e.g. base URL, authentication, etc
$Configuration = Get-Configuration
# Configure API key authorization: API_KEY
$Configuration.ApiKey.x-api-key = "YOUR_API_KEY"
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$Configuration.ApiKeyPrefix.x-api-key = "Bearer"
$SmsId = "SmsId_example" # String |
# Get SMS content including body. Expects SMS to exist by ID. For SMS that may not have arrived yet use the WaitForController.
try {
$Result = Get-SmsMessage -SmsId $SmsId
} catch {
Write-Host ("Exception occured when calling Get-SmsMessage: {0}" -f ($_.ErrorDetails | ConvertFrom-Json))
Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json))
}
Parameters
Name | Type | Description | Notes |
---|---|---|---|
SmsId | String |
Return type
SmsDto (PSCustomObject)
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: /
[Back to top] [Back to API list] [Back to Model list] [Back to ]
PageSmsProjection Get-SmsMessagesPaginated
[-PhoneNumber]
[-Page]
[-Size]
[-Sort]
[-UnreadOnly]
[-Since]
[-Before]
Get all SMS messages in all phone numbers in paginated form. .
By default returns all SMS messages across all phone numbers sorted by ascending created at date. Responses are paginated. You can restrict results to a list of phone number IDs. You can also filter out read messages
Example
# general setting of the PowerShell module, e.g. base URL, authentication, etc
$Configuration = Get-Configuration
# Configure API key authorization: API_KEY
$Configuration.ApiKey.x-api-key = "YOUR_API_KEY"
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$Configuration.ApiKeyPrefix.x-api-key = "Bearer"
$PhoneNumber = "PhoneNumber_example" # String | Optional receiving phone number to filter SMS messages for (optional)
$Page = 987 # Int32 | Optional page in SMS list pagination (optional) (default to 0)
$Size = 987 # Int32 | Optional page size in SMS list pagination. Maximum size is 100. Use page and sort to page through larger results (optional) (default to 20)
$Sort = "ASC" # String | Optional createdAt sort direction ASC or DESC (optional) (default to "ASC")
$UnreadOnly = true # Boolean | Optional filter for unread SMS only. All SMS are considered unread until they are viewed in the dashboard or requested directly (optional) (default to $false)
$Since = Get-Date # System.DateTime | Optional filter SMSs received after given date time (optional)
$Before = Get-Date # System.DateTime | Optional filter SMSs received before given date time (optional)
# Get all SMS messages in all phone numbers in paginated form. .
try {
$Result = Get-SmsMessagesPaginated -PhoneNumber $PhoneNumber -Page $Page -Size $Size -Sort $Sort -UnreadOnly $UnreadOnly -Since $Since -Before $Before
} catch {
Write-Host ("Exception occured when calling Get-SmsMessagesPaginated: {0}" -f ($_.ErrorDetails | ConvertFrom-Json))
Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json))
}
Parameters
Name | Type | Description | Notes |
---|---|---|---|
PhoneNumber | String | Optional receiving phone number to filter SMS messages for | [optional] |
Page | Int32 | Optional page in SMS list pagination | [optional] [default to 0] |
Size | Int32 | Optional page size in SMS list pagination. Maximum size is 100. Use page and sort to page through larger results | [optional] [default to 20] |
Sort | String | Optional createdAt sort direction ASC or DESC | [optional] [default to "ASC"] |
UnreadOnly | Boolean | Optional filter for unread SMS only. All SMS are considered unread until they are viewed in the dashboard or requested directly | [optional] [default to $false] |
Since | System.DateTime | Optional filter SMSs received after given date time | [optional] |
Before | System.DateTime | Optional filter SMSs received before given date time | [optional] |
Return type
PageSmsProjection (PSCustomObject)
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: /
[Back to top] [Back to API list] [Back to Model list] [Back to ]