Retrieves the one-time password for a given base32-encoded secret.
Body parameters
- Name
sharedSecret
- Type
- string
- Description
The base32-encoded shared secret to generate a one-time password for.
curl \
-X POST \
-H 'Content-Type: application/json' \
-d '{"sharedSecret":"ONSWG4TFOQYTEMY="}' \
-u api:YOUR_API_KEY \
https://mailosaur.com/api/devices/otp
{
"code": "123456",
"expires": "2022-01-01T00:00:00Z"
}
curl \
-u api:YOUR_API_KEY \
https://mailosaur.com/api/devices
[
{
"id": "abcd1234",
"name": "Device name"
}
]
Creates a new virtual security device and returns it.
Body parameters
- Name
name
- Type
- string
- Description
A name for the virtual device.
- Name
sharedSecret
- Type
- string
- Description
The base32-encoded shared secret to generate a one-time password for.
curl \
-X POST \
-H 'Content-Type: application/json' \
-d '{"name":"Example","sharedSecret":"ONSWG4TFOQYTEMY="}' \
-u api:YOUR_API_KEY \
https://mailosaur.com/api/devices
{
"id": "abcd1234",
"name": "My device"
}
Retrieves the current one-time password for an existing virtual security device. Simply supply the unique identifier for the required device.
Path parameters
- Name
id
- Type
- string
- Description
The identifier of the device to be retrieved.
curl \
-u api:YOUR_API_KEY \
https://mailosaur.com/api/devices/DEVICE_ID/otp
{
"code": "123456",
"expires": "2022-01-01T00:00:00Z"
}
Permanently deletes a device. This operation cannot be undone.
Path parameters
- Name
id
- Type
- string
- Description
The identifier of the device to be deleted.
curl \
-X DELETE \
-u api:YOUR_API_KEY \
https://mailosaur.com/api/devices/DEVICE_ID