This API endpoint can be used to create new Address Alteration definitions within an Address Alteration Set or at the root level for policy-less processing.
Currently, the records created via API call are limited to 3000. Additional records can be created within the Administration Console.
Pre-requisites
In order to successfully use this endpoint the logged in user must be a Mimecast administrator with at least the Gateway | Policies | Edit permission.
URI
To use this endpoint you send a POST request to:
/api/policy/address-alteration/create-definition
Request Headers
The following request headers must be included in your request:
Field
Description
Authorization
Please see the
Authorization guide for more information on building the Authorization header.
x-mc-req-id
A randomly generated GUID, for example,
8578FCFC-A305-4D9A-99CB-F4D5ECEFE297
x-mc-app-id
The Application ID provided with your Registered API Application.
x-mc-date
The current date and time in the following format, for example,
Tue, 24 Nov 2015 12:50:11 UTC
Request Body
{
"data": [
{
"folderId": "String",
"addressAlterations": [
{
"originalAddress": "String",
"newAddress": "String",
"addressType": "String",
"routing": "String"
}
]
}
]
}
data
Field
Type
Required
Description
folderId
String
Optional
The Mimecast secure id of an Address Alteration Set. If none is provided, the definition will be created under the root, and will apply to messages without an associated policy.
addressAlterations
Array of AddressAlteration
Required
An Array of Address Aleration definitions to create
AddressAlteration
Field
Type
Required
Description
routing
String
Required
The route at which this definition should rewrite addresses. Possible values are: all, inbound or outbound.
originalAddress
String
Required
The address that should be considered for rewrite. Format should match one of: localPart@domainPart, *@domainPart, localPart@*. All domains must be internal.
addressType
String
Required
The type of address that should be altered. Possible values are: all, envelope_from, envelope_to, from, reply_to, to_cc_bcc or sender.
newAddress
String
Required
The new address structure. Format should match one of: localPart@domainPart, *@domainPart, localPart@*. All domains must be internal.
Response
{
"fail": [],
"meta": {
"status": 200
},
"data": [
{
"success": "true"
}
]
}
meta object
Field
Type
Description
status
Number
The function level status of the request.
meta
Field
Type
Description
status
Number
The function level status of the request.
data
Field
Type
Description
success
Boolean
Outcome of the definition creation request.
Sample Code
Sample code is provided to demonstrate how to use the API and is not representative of a production application. To use the sample code; complete the required variables as described, populate the desired values in the request body, and execute in your favorite IDE. Please see the Global Base URL's page to find the correct base URL to use for your account.
POST {base_url}/api/policy/address-alteration/create-definition
Authorization: MC {accesskKey}:{Base64 encoded signed Data To Sign}
x-mc-date: {dateTime}
x-mc-req-id: {unique id}
x-mc-app-id: {applicationId}
Content-Type: application/json
Accept: application/json
{
"data":[
{
"folderId": "String",
"addressAlterations": [
{
"routing": "String",
"originalAddress": "String",
"addressType": "String",
"newAddress": "String"
}
]
}
]
}
import base64
import hashlib
import hmac
import uuid
import datetime
import requests
# Setup required variables
base_url = "https://xx-api.mimecast.com"
uri = "/api/policy/address-alteration/create-definition"