All URIs are relative to https://api.mailbaby.net
| Method | HTTP request | Description |
|---|---|---|
| get_mail_order_by_id | GET /mail/{id} | Displays details for a single mail order |
| get_mail_orders | GET /mail | Displays a list of mail service orders |
MailOrderDetail get_mail_order_by_id(id)
Displays details for a single mail order
Returns the full detail record for one specific mail order identified by its numeric id. In addition to the fields returned by GET /mail, this endpoint also includes the current SMTP password for the order.
The username and password values returned here can be used directly to authenticate against relay.mailbaby.net:25 (SMTP AUTH) if you need to send email via a native SMTP client rather than through the REST API.
The id path parameter is the same integer id value returned by GET /mail.
- Api Key Authentication (apiKeyAuth):
import openapi_client
from openapi_client.models.mail_order_detail import MailOrderDetail
from openapi_client.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.mailbaby.net
# See configuration.py for a list of all supported configuration parameters.
configuration = openapi_client.Configuration(
host = "https://api.mailbaby.net"
)
# 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: apiKeyAuth
configuration.api_key['apiKeyAuth'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['apiKeyAuth'] = 'Bearer'
# Enter a context with an instance of the API client
with openapi_client.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = openapi_client.ServicesApi(api_client)
id = 39 # int | The numeric ID of the mail order.
try:
# Displays details for a single mail order
api_response = api_instance.get_mail_order_by_id(id)
print("The response of ServicesApi->get_mail_order_by_id:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling ServicesApi->get_mail_order_by_id: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| id | int | The numeric ID of the mail order. |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | OK | - |
| 400 | Bad request — one or more input parameters were missing or invalid. | - |
| 401 | Authentication failed. Ensure you are sending a valid `X-API-KEY` header. Obtain your API key from my.interserver.net/account_security. | - |
| 404 | The specified resource was not found or does not belong to your account. | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
List[MailOrder] get_mail_orders()
Displays a list of mail service orders
Returns every mail order (active and inactive) associated with your account. Each record includes the numeric id, the status (active or canceled), the SMTP username (always mb<id>), and an optional human-readable comment.
The id values returned here are used as the id input parameter on all sending endpoints (/mail/send, /mail/advsend, /mail/rawsend) as well as the log and stats queries. When the id parameter is omitted on those calls the API automatically picks the first active order returned by this endpoint.
To retrieve full details — including the current SMTP password — for a single order use GET /mail/{id}.
- Api Key Authentication (apiKeyAuth):
import openapi_client
from openapi_client.models.mail_order import MailOrder
from openapi_client.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.mailbaby.net
# See configuration.py for a list of all supported configuration parameters.
configuration = openapi_client.Configuration(
host = "https://api.mailbaby.net"
)
# 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: apiKeyAuth
configuration.api_key['apiKeyAuth'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['apiKeyAuth'] = 'Bearer'
# Enter a context with an instance of the API client
with openapi_client.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = openapi_client.ServicesApi(api_client)
try:
# Displays a list of mail service orders
api_response = api_instance.get_mail_orders()
print("The response of ServicesApi->get_mail_orders:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling ServicesApi->get_mail_orders: %s\n" % e)This endpoint does not need any parameter.
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | OK | - |
| 401 | Authentication failed. Ensure you are sending a valid `X-API-KEY` header. Obtain your API key from my.interserver.net/account_security. | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]