This API facilitates the retrieval of information of users by specifying the user ids.
users key, and users not available will be found in the users_not_found key. Please refer to the sample response in this doc.
user_fields_to_export is not passed, then all the custom attributes and exportable standard attributes will be passed. For specific fields, user_fields_to_export needs to be passed along with the required fields.This authentication parameter, used for access control, must be passed along with the request. The API request will be authenticated through Basic Authentication. Basic Authentication sends a Base64-encoded string containing your username and password with every API request. It encodes a 'username:password' string in Base64 and appends the encoded string with 'Basic '. This string is included in the authorization header as shown below:
{"Authorization: Basic Base64_ENCODED_WORKSPACEID_APIKEY=="}
The username and password details can be obtained from the MoEngage Dashboard. If you're using the API for the first time, follow these steps:
Use these details to authenticate the API requests.
The 'X-Forwarded-For' header is used to specify the IP address of the client that made the request. This header may be added by proxy servers or load balancers. The header value must contain the IP address of the original client that initiated the request. Multiple IP addresses may be specified in the header value, separated by commas.
"203.0.113.195"
This is the Workspace ID of your MoEngage account that has to be passed along with the request. You can find your Workspace ID at Settings > Account > APIs > Workspace ID.
"VJ0GSMESHMQA3L7WV1EEK3UR"
This field is used to specify the identifiers for the users for whom the data needs to be fetched. Structure:
"identifiers": [
{
"identifier_type": "customer_id",
"identifier": "<customer_id>"
},
{
"identifier_type": "id",
"identifier": "<MoEngageID>"
},
...{}
]
This field is used to specify the fields that need to be fetched for the user specified in Identifiers. Tracked standard user attributes and custom attributes can be fetched using this API. For the list of tracked standard attributes in MoEngage, refer to User Attributes.
["last_name", "customer_id", "name"]
This response is returned when the request is processed successfully.
This field contains the status of the request and specifies whether the request was successful. Supported values are : "success", "failure"
"success"
This field denotes the fetch type. Supported values are: "export_users".
"export_users"
This field contains the list of users who were not found in MoEngage and returns the data specified for the list of users who were found in MoEngage.
This is the structure:
{
"users_not_found": [
{
"identifier_type": "customer_id",
"identifier": "<customer_id>"
}
],
"users": [
{
"user_attributes": {
"<list of user attributes>"
}
}
]
}