domainsBatchPost
Bulk provision domains
Provision up to 1000 domains to use MailChannels Inbound.
/domains/batch
Usage and SDK Samples
curl -X POST -H "X-API-Key: [[apiKey]]" "https://api.mailchannels.net/inbound/v1/domains/batch?subscriptionHandle=&associate-key=&overwrite="
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.DefaultApi;
import java.io.File;
import java.util.*;
public class DefaultApiExample {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure API key authorization: APIKeyHeader
ApiKeyAuth APIKeyHeader = (ApiKeyAuth) defaultClient.getAuthentication("APIKeyHeader");
APIKeyHeader.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//APIKeyHeader.setApiKeyPrefix("Token");
DefaultApi apiInstance = new DefaultApi();
String subscriptionHandle = subscriptionHandle_example; // String | The subscription 'handle' that identifies the subscription that domains should be
provisioned against. Subscription handles can be retrieved from the `/subscriptions`
endpoint.
InlineObject body = ; // InlineObject |
Boolean associateKey = true; // Boolean | If present and set to true, the domains will be associated with the api-key in the header.
This means that this api-key must be used for inbound-api actions involving these domains
(for example adding safe/block list entries, etc).
Boolean overwrite = true; // Boolean | If present and set to true, the settings (domain settings, downstream addresses, aliases and admins)
for any existing domains will be overwritten with the ones in the request, unless a section is not
included in the request or there is problem updating a setting in which case the previous settings
are carried forward.
try {
inline_response_200 result = apiInstance.domainsBatchPost(subscriptionHandle, body, associateKey, overwrite);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling DefaultApi#domainsBatchPost");
e.printStackTrace();
}
}
}
import org.openapitools.client.api.DefaultApi;
public class DefaultApiExample {
public static void main(String[] args) {
DefaultApi apiInstance = new DefaultApi();
String subscriptionHandle = subscriptionHandle_example; // String | The subscription 'handle' that identifies the subscription that domains should be
provisioned against. Subscription handles can be retrieved from the `/subscriptions`
endpoint.
InlineObject body = ; // InlineObject |
Boolean associateKey = true; // Boolean | If present and set to true, the domains will be associated with the api-key in the header.
This means that this api-key must be used for inbound-api actions involving these domains
(for example adding safe/block list entries, etc).
Boolean overwrite = true; // Boolean | If present and set to true, the settings (domain settings, downstream addresses, aliases and admins)
for any existing domains will be overwritten with the ones in the request, unless a section is not
included in the request or there is problem updating a setting in which case the previous settings
are carried forward.
try {
inline_response_200 result = apiInstance.domainsBatchPost(subscriptionHandle, body, associateKey, overwrite);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling DefaultApi#domainsBatchPost");
e.printStackTrace();
}
}
}
Configuration *apiConfig = [Configuration sharedConfig];
// Configure API key authorization: (authentication scheme: APIKeyHeader)
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"X-API-Key"];
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"X-API-Key"];
String *subscriptionHandle = subscriptionHandle_example; // The subscription 'handle' that identifies the subscription that domains should be
provisioned against. Subscription handles can be retrieved from the `/subscriptions`
endpoint.
(default to null)
InlineObject *body = ; //
Boolean *associateKey = true; // If present and set to true, the domains will be associated with the api-key in the header.
This means that this api-key must be used for inbound-api actions involving these domains
(for example adding safe/block list entries, etc).
(optional) (default to null)
Boolean *overwrite = true; // If present and set to true, the settings (domain settings, downstream addresses, aliases and admins)
for any existing domains will be overwritten with the ones in the request, unless a section is not
included in the request or there is problem updating a setting in which case the previous settings
are carried forward.
(optional) (default to null)
DefaultApi *apiInstance = [[DefaultApi alloc] init];
// Bulk provision domains
[apiInstance domainsBatchPostWith:subscriptionHandle
body:body
associateKey:associateKey
overwrite:overwrite
completionHandler: ^(inline_response_200 output, NSError* error) {
if (output) {
NSLog(@"%@", output);
}
if (error) {
NSLog(@"Error: %@", error);
}
}];
var InboundApi = require('inbound_api');
var defaultClient = InboundApi.ApiClient.instance;
// Configure API key authorization: APIKeyHeader
var APIKeyHeader = defaultClient.authentications['APIKeyHeader'];
APIKeyHeader.apiKey = "YOUR API KEY"
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//APIKeyHeader.apiKeyPrefix['X-API-Key'] = "Token"
var api = new InboundApi.DefaultApi()
var subscriptionHandle = subscriptionHandle_example; // {String} The subscription 'handle' that identifies the subscription that domains should be
provisioned against. Subscription handles can be retrieved from the `/subscriptions`
endpoint.
var body = ; // {InlineObject}
var opts = {
'associateKey': true, // {Boolean} If present and set to true, the domains will be associated with the api-key in the header.
This means that this api-key must be used for inbound-api actions involving these domains
(for example adding safe/block list entries, etc).
'overwrite': true // {Boolean} If present and set to true, the settings (domain settings, downstream addresses, aliases and admins)
for any existing domains will be overwritten with the ones in the request, unless a section is not
included in the request or there is problem updating a setting in which case the previous settings
are carried forward.
};
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
api.domainsBatchPost(subscriptionHandle, body, opts, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;
namespace Example
{
public class domainsBatchPostExample
{
public void main()
{
// Configure API key authorization: APIKeyHeader
Configuration.Default.ApiKey.Add("X-API-Key", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Configuration.Default.ApiKeyPrefix.Add("X-API-Key", "Bearer");
var apiInstance = new DefaultApi();
var subscriptionHandle = subscriptionHandle_example; // String | The subscription 'handle' that identifies the subscription that domains should be
provisioned against. Subscription handles can be retrieved from the `/subscriptions`
endpoint.
(default to null)
var body = new InlineObject(); // InlineObject |
var associateKey = true; // Boolean | If present and set to true, the domains will be associated with the api-key in the header.
This means that this api-key must be used for inbound-api actions involving these domains
(for example adding safe/block list entries, etc).
(optional) (default to null)
var overwrite = true; // Boolean | If present and set to true, the settings (domain settings, downstream addresses, aliases and admins)
for any existing domains will be overwritten with the ones in the request, unless a section is not
included in the request or there is problem updating a setting in which case the previous settings
are carried forward.
(optional) (default to null)
try
{
// Bulk provision domains
inline_response_200 result = apiInstance.domainsBatchPost(subscriptionHandle, body, associateKey, overwrite);
Debug.WriteLine(result);
}
catch (Exception e)
{
Debug.Print("Exception when calling DefaultApi.domainsBatchPost: " + e.Message );
}
}
}
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure API key authorization: APIKeyHeader
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setApiKey('X-API-Key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// OpenAPITools\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-API-Key', 'Bearer');
$api_instance = new OpenAPITools\Client\Api\DefaultApi();
$subscriptionHandle = subscriptionHandle_example; // String | The subscription 'handle' that identifies the subscription that domains should be
provisioned against. Subscription handles can be retrieved from the `/subscriptions`
endpoint.
$body = ; // InlineObject |
$associateKey = true; // Boolean | If present and set to true, the domains will be associated with the api-key in the header.
This means that this api-key must be used for inbound-api actions involving these domains
(for example adding safe/block list entries, etc).
$overwrite = true; // Boolean | If present and set to true, the settings (domain settings, downstream addresses, aliases and admins)
for any existing domains will be overwritten with the ones in the request, unless a section is not
included in the request or there is problem updating a setting in which case the previous settings
are carried forward.
try {
$result = $api_instance->domainsBatchPost($subscriptionHandle, $body, $associateKey, $overwrite);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling DefaultApi->domainsBatchPost: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::DefaultApi;
# Configure API key authorization: APIKeyHeader
$WWW::OPenAPIClient::Configuration::api_key->{'X-API-Key'} = 'YOUR_API_KEY';
# uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$WWW::OPenAPIClient::Configuration::api_key_prefix->{'X-API-Key'} = "Bearer";
my $api_instance = WWW::OPenAPIClient::DefaultApi->new();
my $subscriptionHandle = subscriptionHandle_example; # String | The subscription 'handle' that identifies the subscription that domains should be
provisioned against. Subscription handles can be retrieved from the `/subscriptions`
endpoint.
my $body = WWW::OPenAPIClient::Object::InlineObject->new(); # InlineObject |
my $associateKey = true; # Boolean | If present and set to true, the domains will be associated with the api-key in the header.
This means that this api-key must be used for inbound-api actions involving these domains
(for example adding safe/block list entries, etc).
my $overwrite = true; # Boolean | If present and set to true, the settings (domain settings, downstream addresses, aliases and admins)
for any existing domains will be overwritten with the ones in the request, unless a section is not
included in the request or there is problem updating a setting in which case the previous settings
are carried forward.
eval {
my $result = $api_instance->domainsBatchPost(subscriptionHandle => $subscriptionHandle, body => $body, associateKey => $associateKey, overwrite => $overwrite);
print Dumper($result);
};
if ($@) {
warn "Exception when calling DefaultApi->domainsBatchPost: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint
# Configure API key authorization: APIKeyHeader
openapi_client.configuration.api_key['X-API-Key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# openapi_client.configuration.api_key_prefix['X-API-Key'] = 'Bearer'
# create an instance of the API class
api_instance = openapi_client.DefaultApi()
subscriptionHandle = subscriptionHandle_example # String | The subscription 'handle' that identifies the subscription that domains should be
provisioned against. Subscription handles can be retrieved from the `/subscriptions`
endpoint.
(default to null)
body = # InlineObject |
associateKey = true # Boolean | If present and set to true, the domains will be associated with the api-key in the header.
This means that this api-key must be used for inbound-api actions involving these domains
(for example adding safe/block list entries, etc).
(optional) (default to null)
overwrite = true # Boolean | If present and set to true, the settings (domain settings, downstream addresses, aliases and admins)
for any existing domains will be overwritten with the ones in the request, unless a section is not
included in the request or there is problem updating a setting in which case the previous settings
are carried forward.
(optional) (default to null)
try:
# Bulk provision domains
api_response = api_instance.domains_batch_post(subscriptionHandle, body, associateKey=associateKey, overwrite=overwrite)
pprint(api_response)
except ApiException as e:
print("Exception when calling DefaultApi->domainsBatchPost: %s\n" % e)
extern crate DefaultApi;
pub fn main() {
let subscriptionHandle = subscriptionHandle_example; // String
let body = ; // InlineObject
let associateKey = true; // Boolean
let overwrite = true; // Boolean
let mut context = DefaultApi::Context::default();
let result = client.domainsBatchPost(subscriptionHandle, body, associateKey, overwrite, &context).wait();
println!("{:?}", result);
}
Scopes
Parameters
Name | Description |
---|---|
body * |
Name | Description |
---|---|
subscriptionHandle* |
String
The subscription 'handle' that identifies the subscription that domains should be
provisioned against. Subscription handles can be retrieved from the `/subscriptions`
endpoint.
Required
|
associate-key |
Boolean
If present and set to true, the domains will be associated with the api-key in the header.
This means that this api-key must be used for inbound-api actions involving these domains
(for example adding safe/block list entries, etc).
|
overwrite |
Boolean
If present and set to true, the settings (domain settings, downstream addresses, aliases and admins)
for any existing domains will be overwritten with the ones in the request, unless a section is not
included in the request or there is problem updating a setting in which case the previous settings
are carried forward.
|