Search

Description of search

The search function allows you to query for your data using filters. A search is always run against a single major entity type, such as Contacts or Opportunities, and results are returned as object references.

The simplest search request that you can make is a search with no filters and no options. Such a request for contacts would look like this:

POST /v1/contacts/_search HTTP/1.1
Authorization: ***** Hidden credentials *****
Content-Type: application/json; charset=utf-8
Host: api.marketcircle.net
User-Agent: MC API Documentation
Content-Length: 2

[]

The endpoint will always look like /v1/[ENTITY]/_search, and the request body will always be either a JSON object or array.

Since the query had no filters, it will return all the contacts for the user.

{
    "results": [
        {
            "self": "/v1/contacts/1000",
            "first_name": "Elliott",
            "last_name": "Alderson"
        },
        {
            "self": "/v1/contacts/2000",
            "first_name": "Tyrell",
            "last_name": "Wellick"
        }
    ],
  	"next": "/v1/contacts/_search?start=2001
}

The search function does not search the trash for results, and though results will often be returned in a sorted order, there is no guarantee on result order.

Search is designed to be similar to Daylite smart lists, which features a flexible predicate builder UI for building search filters.

Limiting Results

By default, a maximum of 50 paginated results will be returned by a search query. If you want fewer results, you can override this value by setting the limit query parameter. You can also increase the limit up to a maximum of 250 results.