Zum Hauptinhalt springen

Create a mail address

POST/v2/projects/{projectId}/mail-addresses
API-Version
v2
Request-Methode
POST
Operation-ID
mail-create-mail-address

Request​

  • projectIdstringrequired

    ID of the project to create a MailAddress for.

Responses​

Format
application/json
Beschreibung

OK

  • idstring (uuid)required
Content-Type: application/json

{
"id": "f0f86186-0a5a-45b2-aa33-502777496347"
}
{
"properties": {
"id": {
"format": "uuid",
"type": "string"
}
},
"required": [
"id"
],
"type": "object"
}

Nutzungsbeispiele​

$ curl \
--fail \
--location \
-X POST \
-d '{"address":"email@mittwald.example","forwardAddresses":["email@mittwald.example"]}' \
-H "Authorization: Bearer $MITTWALD_API_TOKEN" \
-H 'Content-Type: application/json' \
https://api.mittwald.de/v2/projects/string/mail-addresses
import { MittwaldAPIV2Client } from "@mittwald/api-client";
import { assertStatus } from "@mittwald/api-client-commons";

const client = MittwaldAPIClient.newWithToken(process.env.MITTWALD_API_TOKEN);
const response = await client.mail.createMailAddress({
"projectId": "string",
"data": {
"address": "email@mittwald.example",
"forwardAddresses": [
"email@mittwald.example"
]
}
});

assertStatus(response, 201);

use \Mittwald\ApiClient\Generated\V2\Clients\Mail\CreateMailAddress\CreateMailAddressRequest;
use \Mittwald\ApiClient\Generated\V2\Clients\Mail\CreateMailAddress\CreateMailAddressRequestBody;

$client = MittwaldAPIClient::newWithToken(getenv('MITTWALD_API_TOKEN'));

// TODO: Please consult the properties and constructor signature of
// CreateMailAddressRequestBody to learn how to construct a valid instance
$body = new CreateMailAddressRequestBody(/* TODO: ... */);

$request = (new CreateMailAddressRequest(
projectId: "string",
body: $body
));
$response = $client->mail()->createMailAddress($request);

var_dump($response->getBody();

Auf dieser Seite