This API helps add or update users and user properties in MoEngage.
project_code in the API endpoint. This identifies which project a user or event belongs to. For more information, refer to Portfolio: Data Ingestion and Management.Segment > Create Segment > Search for users using their IDs
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 is used to identify the type of request. This field is case-sensitive. Follow the case as in the example when passing the value in the request.
customer The unique identifier is used to identify/create a user in MoEngage. Not mandatory in Identity Resolution enabled workspaces If the User Identity Resolution feature is enabled in your workspace, the attribute parameters in the payload must contain at least one of the identifiers you have activated in your workspace based on which users in MoEngage will be created, updated, or merged. In the following example, moe_mobile is one of the identifiers in the workspace and is passed in attributes:
{
"type": "customer",
"attributes": {"moe_mobile": "{{Mobile_Number}}",
"first_name": "John"
}
}
```'
This field should be passed in the request when only existing users in MoEngage should be updated.
If this value is passed as true:
If this value is passed as false:
A dictionary containing user attributes to add / update in the user profile. For example, to track custom attributes of different data types like string, numeric, boolean, and date, pass the following payload where points are a number, expiry_date is a date type attribute, and super_user is a boolean attribute.
Note:
- "id", "_id", and "" keywords are blocked and not to be used as user attribute names.
- You can not use "moe_" as a prefix while naming user attributes. It is a system prefix and using it might result in periodic blacklisting without prior communication. For other attributes that are not listed below, use the key-value pairs that you intend to use.
{
"name": "John",
"points": 20,
"expiry_date": "2020-05-31T03:47:35Z",
"super_user": true,
"user_persona": "browsers"
}
List of dictionaries with the associated platforms out of ANDROID, iOS, and web and their status.