ePrivacy and GPDR Cookie Consent by Cookie Consent Skip to main content

Meiro Audience API

The API endpoint is developed to check if a customer entity belongs to a defined segment in Meiro Business Explorer. 

API returns 200 responses along with predefined attributes when the customer entity belongs to a defined segment. Attributes of the customer entity are not returned by default. 

Customers' attributes to be returned by the successful API call must be defined in the configuration of the WBS container (for safety reasons). Any customer entity attribute might be returned.

Warning: contact Meiro team/ administrator to set the attributes.


Custom Queries

Meiro Audience API also offers the capability to run custom SQL queries and return their results for both known and unknown customers.

The queries to be run by the successful API call must be defined in the configuration of the WBS container (for safety reasons).

Parameters to these queries are provided via optional URL query parameters - only queries for which all required parameters are provided are executed.

Warning: contact the Meiro team/ administrator to define the custom queries.


1. Authentication

 Authentication is not required.


2. Request

GET: https://cdp.{{CLIENT_INSTANCE_NAME}}.meiro.io/wbs?attribute=&value={&segment,parameter_1,parameter_2,...} 

2.1 Parameters

Parameter

Data type

Description

attribute (required)

text

ID of the attribute used for profile stitching,

example:

ps_meiro_user_id Meiro user ID
ps_email_address Email address
etc depends on client's use case


value (required)

text

Value of defined profile stitching attribute,

example:

29f3aec1-1111-4294-b940-019698f4ac25 Meiro user ID tracked from client website where Meiro SDK is deployed
john@doe.com email address example


segment (optional)

integer

The ID of the segment in Meiro Business Explorer segment builder where the presence of the customer entity should be checked. If the segment parameter is missing, any defined custom queries are executed and their results returned in the response.

custom queries’ parameters (optional)

text

Input parameters and their values to be used in the custom queries. Maximum 10 input parameters are allowed with maximum length of 128 characters for the input parameter value.


3 Valid request example

GET: https://cdp.CLIENT_INSTANCE_NAME.meiro.io/wbs?attribute=ps_meiro_user_id&value=29f3aec1-1111-4294-b940-019698f4ac25&segment=42


3.1 Response examples

200

Customer entity belongs to a defined segment:


json
{
  "status": "ok",
  "returned_attributes": {
    "customer_entity_id": "0000000071e3908f5aaaf022aa842b45",
    "modified": "2000-01-01 00:00:00",
    "attribute_first_name": ["John"],
    "attribute_last_name": ["Doe"],
    "attribute_total_order_value": null
  }
}

customer_entity_id (default)

Internal ID of customer entity.

modified (default) Timestamp of last update of customer entity's attributes.
Returned attributes

attribute_first_name,

attribute_last_name,

attribute_total_order_value must be defined specifically for the client's use case in the configuration of `WBS` container.

404 (Customer not in the segment)

The customer entity defined in the API call is known in the Meiro database but does not belong to the defined segment ID.


json
{
  "status": "error",
  "message": "customer not in segment"
}

404 (Customer not found)

There is no customer entity with a defined value of profile stitching attribute in the Meiro database.

json
{
  "status": "error",
  "message": "customer not found"
}

50x (Internal server error)

 Internal server error. Contact administrator.


4. Custom Queries

4.1 Valid request example

GET: https://cdp.CLIENT_INSTANCE_NAME.meiro.io/wbs?attribute=ps_meiro_user_id&value=29f3aec1-1111-4294-b940-019698f4ac25&product_id=1234

4.2 Response examples

200

Customer entity was found and custom queries were executed:


json
{
"status": "ok",
"returned_attributes":
{
"customer_entity_id": "0000000071e3908f5aaaf022aa842b45",
"modified": "2000-01-01 00:00:00",
"attribute_first_name": ["John"],
"attribute_last_name": ["Doe"],
"attribute_total_order_value": null
},
"data":
{
"found": {"product": [{"sku": "5678"}]},
"not_found": null,
"always": {"next_best_offer": [{"sku": "9012"}]}
}
}
customer_entity_id (default)
Internal ID of customer entity.
modified (default)

Timestamp of last update of customer entity's attributes.

returned attributes

attribute_first_name

attribute_last_name

attribute_total_order_value must be defined specifically for the client's use case in the configuration of `WBS` container.

custom queries data

found - contains results of queries defined for a known customer

not_found - contains results of queries defined for an unknown customer

always - contains results of queries for any customer (known or unknown)


200

Customer entity was found but no custom queries were available to be executed:


json
{
"status": "ok",
"returned_attributes":
{
"customer_entity_id": "0000000071e3908f5aaaf022aa842b45",
"modified": "2000-01-01 00:00:00",
"attribute_first_name": ["John"],
"attribute_last_name": ["Doe"],
"attribute_total_order_value": null
},
"data":
{
"found": {},
"not_found": null,
"always": {}
}
}


customer_entity_id (default)

Internal ID of customer entity.

modified (default)

Timestamp of last update of customer entity's attributes.

returned attributes

attribute_first_name

attribute_last_name

attribute_total_order_value must be defined specifically for the client's use case in the configuration of `WBS` container.

custom queries data

found- contains results of queries defined for a known customer

not_found - contains results of queries defined for an unknown customer

always - contains results of queries for any customer (known or unknown)


200

There is no customer entity with a defined value of profile stitching attribute in the Meiro database but custom queries were available to be executed:


json
{
"status": "ok",
"returned_attributes": {},
"data": {
"found": null,
"not_found": {
"product": [{"sku": "5678"}]
},
"always": {
"next_best_offer": [{"sku": "9012"}]
}
}
}

Custom queries data

found - contains results of queries defined for a known customer

not_found - contains results of queries defined for an unknown customer

always- contains results of queries for any customer (known or unknown)




404 (custom queries not defined)

There is no customer entity with a defined value of profile stitching attribute in the Meiro database and no custom queries were available to be executed.


json
{
  "status": "error",
  "message": "Custom queries not defined"
}


50x (internal server error)

 Internal server error. Contact administrator.