This API receives data on active personalization experiences. You can fetch data for one or more server-side experiences by using the experience_key field. MoEngage will evaluate targeting rules and in-session attributes automatically and return the correct variation for the user. Typically, you would make this call as part of your larger page and content rendering pipeline.
Authentication is done via Basic Auth. This requires a base64-encoded string of your credentials in the format 'username:password'.
Note: After you generate and save the Personalize API Key (SECRET KEY), DO NOT generate a new key unless there is a security breach. After you generate a different key and save it, API calls using the older key won't work.
For more information on authentication and getting your credentials, refer here.
This is the Workspace ID of your MoEngage account that must be passed with the request. You can find it in the MoEngage dashboard at Settings > Account > APIs > Workspace ID (earlier app id).
"Workspace ID"
This field uniquely identifies each server-side experience created using MoEngage Personalize. You can pass multiple values in a single request and receive the personalized content defined for each experience in the response.
To fetch the payload for a single experience:
experience_key: ["experience-1"]
To fetch payload for multiple experiences in a single call:
experience_key: ["experience-1", "experience-2"]
If no experience_key is specified, API will return:
This field is must contain the same value that has been used to identify users using the In-session attribute Query Parameter.
For example, if you want to target users who have opened the app after clicking on a link in an e-mail campaign and you have specified the parameter name as utm_medium,
utm_medium:"email"
This field must contain the day of the week for evaluating IN-session attribute-based experiences. Example:
DAY_OF_THE_WEEK:"Sunday"
This field must contain the time of the day for evaluating IN-session attribute-based experiences.
Example: For a time interval between 7 PM - 8 PM, the input for this field should be
TIME_OF_THE_DAY: "00"
This field must contain the user’s IP address to fetch experiences for audiences segmented basis geo-location.
This field must contain the USER-AGENT HTTP header. This is useful to delivering experiences personalized based on in-session attributes like Device Type.
Success This response is returned when the request is submitted to MoEngage.