POST database/people/search

(Difference between revisions)
Jump to: navigation, search
 
Line 1: Line 1:
#REDIRECT [[POST database/people/search PT-BR]]
+
== Description ==
 +
 
 +
This API allows searching for contacts in the Marketing Database.
 +
 
 +
See [[Search Filters|search fields]] page for further details on query specification.
 +
 
 +
== Resource URL ==
 +
 
 +
  POST https://api.socialidnow.com/v1/marketing/database/people/search
 +
 
 +
== Parameters ==
 +
 
 +
=== JSON Parameters ===
 +
 
 +
{|
 +
! align="left" width="200px" | filters
 +
| width="200px" | required
 +
| SQL-like logical expression to specify [[Search Filters|search filters]].
 +
|-
 +
! align="left" width="200px" | limit
 +
| width="200px" | optional
 +
| maximum amount of results to be returned (page size). Default: 128.
 +
|-
 +
! align="left" width="200px" | offset
 +
| width="200px" | optional
 +
| amount of results to be discarded (page start). Default: 0.
 +
|}
 +
 
 +
== Authentication ==
 +
 
 +
This API requires Marketing Account authentication. See [[Authentication]].
 +
 
 +
== Response ==
 +
 
 +
=== Response Status ===
 +
 
 +
{|
 +
! align="left" width="200px" | ok (200)
 +
| The search was performed successfully.
 +
|-
 +
! align="left" width="200px" | unauthorized (401)
 +
| The authentication is wrong. See [[Authentication]].
 +
|-
 +
! align="left" width="200px" | internal_server_error (500)
 +
| An unknown error happened.
 +
|}
 +
 
 +
=== Response Body ===
 +
 
 +
A successful search returns the following fields:
 +
 
 +
{|
 +
! align="left" width="200px" | total
 +
| total amount of contacts found in the Marketing Database for the given query.
 +
|-
 +
! align="left" width="200px" | count
 +
| amount of contacts returned for this request.
 +
|-
 +
! align="left" width="200px" | offset
 +
| amount of contacts discarded (page start).
 +
|-
 +
! align="left" width="200px" | results
 +
| array with contact details.
 +
|}
 +
 
 +
== Examples ==
 +
 
 +
=== Request ===
 +
 
 +
Search for users named "Guilherme".
 +
 
 +
  curl -X POST "https://api.socialidnow.com/v1/marketing/database/people/search" \
 +
        --data "{\"filters\": \"profile.name.given_name = 'Guilherme'\"}" \
 +
        -H "Content-type: application/json" \
 +
        --user <api_id>:<api_secret>
 +
 
 +
=== Response ===
 +
 
 +
==== Response Headers ====
 +
 
 +
HTTP/1.1 200 Ok
 +
Status: 200
 +
 
 +
==== Response Body ====
 +
 
 +
  {
 +
    "total": 13,
 +
    "count": 13,
 +
    "offset": 0,
 +
    "results": [...]
 +
  }
 +
 
 +
[[File:Search results.png]]

Revision as of 21:17, 3 November 2014

Contents

Description

This API allows searching for contacts in the Marketing Database.

See search fields page for further details on query specification.

Resource URL

  POST https://api.socialidnow.com/v1/marketing/database/people/search

Parameters

JSON Parameters

filters required SQL-like logical expression to specify search filters.
limit optional maximum amount of results to be returned (page size). Default: 128.
offset optional amount of results to be discarded (page start). Default: 0.

Authentication

This API requires Marketing Account authentication. See Authentication.

Response

Response Status

ok (200) The search was performed successfully.
unauthorized (401) The authentication is wrong. See Authentication.
internal_server_error (500) An unknown error happened.

Response Body

A successful search returns the following fields:

total total amount of contacts found in the Marketing Database for the given query.
count amount of contacts returned for this request.
offset amount of contacts discarded (page start).
results array with contact details.

Examples

Request

Search for users named "Guilherme".

 curl -X POST "https://api.socialidnow.com/v1/marketing/database/people/search" \
       --data "{\"filters\": \"profile.name.given_name = 'Guilherme'\"}" \
       -H "Content-type: application/json" \
       --user <api_id>:<api_secret>

Response

Response Headers

HTTP/1.1 200 Ok
Status: 200

Response Body

 {
    "total": 13,
    "count": 13,
    "offset": 0,
    "results": [...]
 }

Search results.png

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox