You can use a CSV upload for larger, one-time imports of user data such as historic push tokens or email addresses. For this, you'll use the multi (CSV) API call.
Once uploaded and processed, this information will be stored in Leanplum and available on our platform for targeting and segmenting users.
Save your file in regular CSV format without any encoding.
Depending on what type of data you want to import, you'll need to include different parameter fields in your file. The upload will fail if the CSV is formatted incorrectly.
The header row of your file will include the parameter fields for the data you're importing (such as user attributes), separated by commas. Use a dot to indicate nested parameters. For example:
Here are the various types of info you can import — click each to learn how to format the CSV.
For more about file formatting, see Prepare a CSV file to import user data.
Your CSM will provide you with access to your Leanplum Google Bucket. You'll need to link the appropriate Google Bucket folder in your API call path.
The API method for CSV upload is multi (CSV). You will need to pass different values to the
defaultAction parameter depending on what kind of data you are uploading.
- User Attributes: defaultAction=setUserAttributes
- Device Attributes: defaultAction=setDeviceAttributes
- Events: defaultAction=track
- Historical Events: defaultAction=setUserAttributes
- Email Unsubscribe: defaultAction=setUserAttributes
If you are uploading systemName for device-level information, you will need to make a
startcall for all users. Using the
startAPI call will reset the Last Active and Last Session time/date. You may reset the Last Active time/date by re-using the
You can use the getMultiResults API call to check the status of the uploading job.
Your response will be one of these:
- Pending. The job is still waiting in the queue and has not started processing yet.
- Running. The job is currently being processed.
- Finished. The job has finished. (This means the file has processed, not necessarily that the upload was 100% successful.)
- Failed. The job failed before it could execute. The most common reason is Leanplum's backend could not read the file, perhaps due to file permissions or the file not being public.
To perform the
getMultiResults call, you'll need the original
multi call ID, found here:
Updated about a year ago