Link Search Menu Expand Document

Searching Users

curl "-XPOST -v -k \
-H 'Session-User-Id:<your user ID>' \
-H 'Session-Key:<your session key>' \
-H 'Session-Chain-Id:<your chain ID>' \
-d 'chain_id=<your chain ID>’ \
-d 'query=smith’ \
-d 'page=1 \
-d 'count=25 \
-d 'opted_in=1 \

'https://services-[API_ENVIRONMENT].spaaza.com/search/users'"

Example response

[
	{
		"id": 12345678,
		"entity_code": {
			"code": "100002"
		},
		"username": "john.smith@spaaza.com",
		"firstname": "John",
		"lastname": "Smith",
		"created_date": "2017-10-19T12:46:34Z",
		"gender": "M",
		"birthday": "1982-06-30T00:00:00Z",
		"spaaza_opted_in": true,
		"country_code": "NL",
		"store_id": ""
	},
	{
		"id": 12345679,
		"entity_code": {
			"code": "100003"
		},
		"username": "jane.smith@example.com",
		"firstname": "Jane",
		"lastname": "Smith",
		"created_date": "2017-10-29T13:24:33Z",
		"gender": "M",
		"birthday": "1979-04-29T00:00:00Z",
		"spaaza_opted_in": true,
		"country_code": "UK",
		"store_id": "12"
	}
]

Overview

  • Call name: search
  • Endpoint URL: https://services-[API_ENVIRONMENT].spaaza.com/search/users
  • Request methods: HTTP POST
  • Auth required: yes

You can use this API endpoint to search for users in Spaaza.

The API_ENVIRONMENT value varies according to whether the request is being made to Spaaza’s production or staging API:

Environment API_ENVIRONMENT value
Production prod
Staging test01

Headers

The following headers are required:

Header Description
Session-User-Id ID of the user obtained from the login endpoint
Session-Key key of the session obtained from the login endpoint
Session-Chain-Id the ID of the Spaaza chain or retailer

The following authentication methods are permitted:

Method Description
admin A session generated by administrative user login.

Query Parameters (application/x-www-form-urlencoded)

This API accepts the following parameters:

Parameter Description
chain_id required The ID of the Spaaza chain or retailer
query End-user supplied search term(s) (string)
page The page number of desired results
count Number of results to return
opted_in (boolean) Filter the search to opted-in users. To search for all users do not pass this parameter.