Providers
GET /api/rent_email.php?method=get_providers
Send a GET request and check JSON status, even with HTTP 200: 1 means success, 0 means failure, and 2 means no mailbox was available when creating a rental. Error details may be in msg, errormsg and errorid.
Authentication
You can call this method without an API key.
Parameters
| Name | Location | Type | Required | Example | Description |
|---|---|---|---|---|---|
method | query | string | Yes | "get_providers" | Method selector. |
How to use this method
Get the enabled email providers and use their pcode values to build your selector. Refresh this list rather than keeping a fixed set of codes. A provider can be enabled while having no mailboxes for a particular service.
Use the selected pcode for services and prices, counts and creating an order.
Request examples
Environment and dependencies. Each example encodes query values and allows 30 seconds for the request. Check HTTP and JSON status before using data. cURL prints the response for you to check; Java uses Jackson to read the JSON.
curl --get --fail-with-body --max-time 30 "https://smspva.com/api/rent_email.php" \
--data-urlencode "method=get_providers"Responses
Check the response that matches your request. Example values and dates are illustrative. Optional fields can depend on the outcome or the response format you selected.
HTTP 200
Check status in the JSON even when HTTP is 200. Examples use illustrative values.
application/json
Success (illustrative)
{
"status": 1,
"data": [
{
"id": 2,
"pcode": "gmailcom",
"name": "Gmail"
},
{
"id": 6,
"pcode": "outlookcom",
"name": "Microsoft Outlook"
}
]
}Error
{
"status": 0,
"msg": "Provider not found"
}Success
| Name | Type | Description |
|---|---|---|
status | integer | (enum: [1]) |
data | array<object> | |
data[].id | integer | Provider ID. |
data[].pcode | string | Provider code used in filters and orders. |
data[].name | string | Display name. |
Required: status, data
Error
Some errors include errorid and errormsg; others contain only msg. Check all available error fields.
| Name | Type | Description |
|---|---|---|
status | integer | (enum: [0]) |
errorid | integer | Optional structured error code. |
errormsg | string | Optional error description. |
msg | string | Error message. |