Bulk Import Users and Events
Use the Bulk Import API to send, to MoEngage, in batch multiple user and event requests using a single API request. You can send a batch request of a maximum of 100 kB in a single API call.
Example Payload
To view the sample API request, select example_payload from dropdown.Array Support
To view the appropriate syntax to pass an attribute in an array, select array_support from the dropdownUser Identity Resolution
In MoEngage, data ingestion uses an ID to create or update a user. For workspaces in MoEngage with Identity Resolution enabled, Bulk Import API can be used to create or update users using a specific identifier, such as a mobile number or email ID, these identifiers need to be enabled for the workspace in Identity Resolution dashboard. You can:- Create users through Server-to-Server Data APIs even when they do not have an ID (but have other identifiers).
- Create a user or track events of a user when identifiers other than ID (for example, email ID or phone number) are known.
Types of Payload in Request Body
The sample cURL request for a Bulk Import API consisting of the following payloads:- User payload: Attribute parameters must contain at least one of the identifiers you have configured based on which users in MoEngage will be created, updated, or merged.
- Event payload: Identifiers set up in the workspace must be mentioned within the user_identifiers parameter, as shown in the below example where moe_mobile is one of the identifiers in the workspace:
Authorizations
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:
- Navigate to Settings -> Account -> APIs.
- Copy the following details:
- Username: Under Workspace ID (earlier app id), click the copy icon to copy the username.
- Password: In the API keys section, click the copy icon in the Data tile to copy the API key.
Use these details to authenticate the API requests.
Headers
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"
Path Parameters
This is the Workspace ID of your MoEngage account that has to be passed along with the request. You can find your MoEngage Workspace ID at Settings > Account > APIs > Workspace ID (earlier app id).''
Body
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.
transition List of data points (events and customers) to track. The type field in this list denotes whether the information is for a customer or an event. This field is case-sensitive. Follow the case as in the example when passing the value in the request.
- User
- Event
- Device