Search Service

Default

searchPost

search MailChannels traffic logs


/search

Usage and SDK Samples

curl -X POST \
-H "X-API-KEY: [[apiKey]]" \
 -H "Accept: application/json" \
 -H "Content-Type: application/json" \
 "https://api.mailchannels.net/outbound/v1/search?start_at=56&count=56" \
 -d '{
  "end_date" : "end_date",
  "rcpt" : "rcpt",
  "rspcode" : 0,
  "rspmsg" : "rspmsg",
  "upstream" : "upstream",
  "subject" : "subject",
  "delivered" : "Y",
  "message_id" : "message_id",
  "spam_disposition" : "CONFIRMED",
  "sender_id" : "sender_id",
  "upstream_hostname" : "upstream_hostname",
  "lastcmd" : "lastcmd",
  "sender" : "sender",
  "virus_disposition" : "CONFIRMED",
  "start_date" : "start_date"
}'
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: X-API-KEY
        ApiKeyAuth X-API-KEY = (ApiKeyAuth) defaultClient.getAuthentication("X-API-KEY");
        X-API-KEY.setApiKey("YOUR API KEY");
        // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
        //X-API-KEY.setApiKeyPrefix("Token");

        // Create an instance of the API class
        DefaultApi apiInstance = new DefaultApi();
        Integer startAt = 56; // Integer | For pagination purposes, defines the offset from the first result. Defaults to 0. To get
the next page, use start_at + count. E.g. if count is 20, the next start_at will be 20, then 40.
Note that there's a hard limit of 10,000 results per query. A bad request is returned if 
"start_at + count" exceeds 9,999.

        Integer count = 56; // Integer | The number of results to return. Defaults to 20, max is 100.
        SearchRequest searchRequest = ; // SearchRequest | 

        try {
            SearchResults result = apiInstance.searchPost(startAt, count, searchRequest);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling DefaultApi#searchPost");
            e.printStackTrace();
        }
    }
}
import org.openapitools.client.api.DefaultApi;

public class DefaultApiExample {
    public static void main(String[] args) {
        DefaultApi apiInstance = new DefaultApi();
        Integer startAt = 56; // Integer | For pagination purposes, defines the offset from the first result. Defaults to 0. To get
the next page, use start_at + count. E.g. if count is 20, the next start_at will be 20, then 40.
Note that there's a hard limit of 10,000 results per query. A bad request is returned if 
"start_at + count" exceeds 9,999.

        Integer count = 56; // Integer | The number of results to return. Defaults to 20, max is 100.
        SearchRequest searchRequest = ; // SearchRequest | 

        try {
            SearchResults result = apiInstance.searchPost(startAt, count, searchRequest);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling DefaultApi#searchPost");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure API key authorization: (authentication scheme: X-API-KEY)
[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"];


// Create an instance of the API class
DefaultApi *apiInstance = [[DefaultApi alloc] init];
Integer *startAt = 56; // For pagination purposes, defines the offset from the first result. Defaults to 0. To get
the next page, use start_at + count. E.g. if count is 20, the next start_at will be 20, then 40.
Note that there's a hard limit of 10,000 results per query. A bad request is returned if 
"start_at + count" exceeds 9,999.
 (optional) (default to null)
Integer *count = 56; // The number of results to return. Defaults to 20, max is 100. (optional) (default to null)
SearchRequest *searchRequest = ; //  (optional)

// search MailChannels traffic logs
[apiInstance searchPostWith:startAt
    count:count
    searchRequest:searchRequest
              completionHandler: ^(SearchResults output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var SearchService = require('search_service');
var defaultClient = SearchService.ApiClient.instance;

// Configure API key authorization: X-API-KEY
var X-API-KEY = defaultClient.authentications['X-API-KEY'];
X-API-KEY.apiKey = "YOUR API KEY";
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//X-API-KEY.apiKeyPrefix['X-API-KEY'] = "Token";

// Create an instance of the API class
var api = new SearchService.DefaultApi()
var opts = {
  'startAt': 56, // {Integer} For pagination purposes, defines the offset from the first result. Defaults to 0. To get
the next page, use start_at + count. E.g. if count is 20, the next start_at will be 20, then 40.
Note that there's a hard limit of 10,000 results per query. A bad request is returned if 
"start_at + count" exceeds 9,999.

  'count': 56, // {Integer} The number of results to return. Defaults to 20, max is 100.
  'searchRequest':  // {SearchRequest} 
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.searchPost(opts, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class searchPostExample
    {
        public void main()
        {
            // Configure API key authorization: X-API-KEY
            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");

            // Create an instance of the API class
            var apiInstance = new DefaultApi();
            var startAt = 56;  // Integer | For pagination purposes, defines the offset from the first result. Defaults to 0. To get
the next page, use start_at + count. E.g. if count is 20, the next start_at will be 20, then 40.
Note that there's a hard limit of 10,000 results per query. A bad request is returned if 
"start_at + count" exceeds 9,999.
 (optional)  (default to null)
            var count = 56;  // Integer | The number of results to return. Defaults to 20, max is 100. (optional)  (default to null)
            var searchRequest = new SearchRequest(); // SearchRequest |  (optional) 

            try {
                // search MailChannels traffic logs
                SearchResults result = apiInstance.searchPost(startAt, count, searchRequest);
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling DefaultApi.searchPost: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure API key authorization: X-API-KEY
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');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\DefaultApi();
$startAt = 56; // Integer | For pagination purposes, defines the offset from the first result. Defaults to 0. To get
the next page, use start_at + count. E.g. if count is 20, the next start_at will be 20, then 40.
Note that there's a hard limit of 10,000 results per query. A bad request is returned if 
"start_at + count" exceeds 9,999.

$count = 56; // Integer | The number of results to return. Defaults to 20, max is 100.
$searchRequest = ; // SearchRequest | 

try {
    $result = $api_instance->searchPost($startAt, $count, $searchRequest);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling DefaultApi->searchPost: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::DefaultApi;

# Configure API key authorization: X-API-KEY
$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";

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::DefaultApi->new();
my $startAt = 56; # Integer | For pagination purposes, defines the offset from the first result. Defaults to 0. To get
the next page, use start_at + count. E.g. if count is 20, the next start_at will be 20, then 40.
Note that there's a hard limit of 10,000 results per query. A bad request is returned if 
"start_at + count" exceeds 9,999.

my $count = 56; # Integer | The number of results to return. Defaults to 20, max is 100.
my $searchRequest = WWW::OPenAPIClient::Object::SearchRequest->new(); # SearchRequest | 

eval {
    my $result = $api_instance->searchPost(startAt => $startAt, count => $count, searchRequest => $searchRequest);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling DefaultApi->searchPost: $@\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: X-API-KEY
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()
startAt = 56 # Integer | For pagination purposes, defines the offset from the first result. Defaults to 0. To get
the next page, use start_at + count. E.g. if count is 20, the next start_at will be 20, then 40.
Note that there's a hard limit of 10,000 results per query. A bad request is returned if 
"start_at + count" exceeds 9,999.
 (optional) (default to null)
count = 56 # Integer | The number of results to return. Defaults to 20, max is 100. (optional) (default to null)
searchRequest =  # SearchRequest |  (optional)

try:
    # search MailChannels traffic logs
    api_response = api_instance.search_post(startAt=startAt, count=count, searchRequest=searchRequest)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling DefaultApi->searchPost: %s\n" % e)
extern crate DefaultApi;

pub fn main() {
    let startAt = 56; // Integer
    let count = 56; // Integer
    let searchRequest = ; // SearchRequest

    let mut context = DefaultApi::Context::default();
    let result = client.searchPost(startAt, count, searchRequest, &context).wait();

    println!("{:?}", result);
}

Scopes

Parameters

Body parameters
Name Description
searchRequest

JSON representation of the search query. If not present, defaults to 20 logs for the authenticated account.

Query parameters
Name Description
start_at
Integer
For pagination purposes, defines the offset from the first result. Defaults to 0. To get the next page, use start_at + count. E.g. if count is 20, the next start_at will be 20, then 40. Note that there's a hard limit of 10,000 results per query. A bad request is returned if "start_at + count" exceeds 9,999.
count
Integer
The number of results to return. Defaults to 20, max is 100.

Responses