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 the 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.
Segment IDs
Meiro Audience API allows checking whether a customer belongs to a segment against all available segments, with the possibility to filter the segments by tags.
The number of segments to check against is limited to 10 by default for performance reasons but it might be overridden in the configuration of the WBS container.
Tag names are provided to the segment IDs API endpoint via an optional URL query parameter.
Warning: contact the Meiro team/ administrator to change the number of segments to check against.
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:
|
||||||
value (required) |
text |
Value of defined profile stitching attribute, 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 are 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 a 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:
|
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.
|
404
(Customer not found)
There is no customer entity with a defined value of profile stitching attribute in the Meiro database.
|
50x
(Internal server error)
Internal server error. Contact administrator.
customer_entity_id (default) |
Internal ID of customer entity. |
modified (default) |
Timestamp of last update of customer entity's attributes. |
Returned attributes |
|
4. Valid request example - 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:
|
200
Customer entity was found but no custom queries were available to be executed:
|
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:
|
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.
|
50x
(internal server error)
Internal server error. Contact administrator.
5. Request - Customer Segment IDs
GET: https://cdp.{{CLIENT_INSTANCE_NAME}}.meiro.io/wbs/segments?attribute=&value={&tags,tags,...}
5.1. Parameters
Parameter |
Data type |
Description |
||||||
attribute (required) |
text |
ID of the attribute used for profile stitching, example:
|
||||||
value (required) |
text |
Value of defined profile stitching attribute, example:
|
||||||
tags (optional) |
text |
List of tags to be used for filtering segments to check the customer against. |
Valid request example - No tags provided
GET: https://cdp.CLIENT_INSTANCE_NAME.meiro.io/wbs/segments?attribute=ps_meiro_user_id&value=29f3aec1-1111-4294-b940-019698f4ac25
Response examples
200
Customer entity belongs to the segments with the following IDs:
|
404
(No segments found for the customer)
The customer entity defined in the API call is known in the Meiro database but does not belong to any available segments.
|
404
(Customer not found)
There is no customer entity with a defined value of profile stitching attribute in the Meiro database.
50x
(Internal server error)
Internal server error. Contact administrator.
Valid request example - Tags provided
GET: https://cdp.CLIENT_INSTANCE_NAME.meiro.io/wbs/segments?attribute=ps_meiro_user_id&value=29f3aec1-1111-4294-b940-019698f4ac25&tags=Drama&tags=Sport
Response examples
200
Customer entity belongs to the segments with tags “Drama” or “Sport” with the following IDs:
|