File Format for Token Import

If you are migrating from another push provider (or from your existing homegrown solution), you can import a list of existing push tokens into Marigold. This can allow you to send push notifications to these devices and temporarily import other device properties (such as User IDs and attributes) so you can target these devices until they upgrade to Marigold.

This is a managed process and it is handled by Marigold. To get started, you will need to provide a file in the format and with the requirements highlighted in this page. If you want more general information, read Migrating to Marigold.

File Format

Tokens must be passed as a CSV list (one token per line). The first row is a header record containing column (field) names. For each token you must also specify the target platform.

We only support custom attribute fields that are registered against the user. For consistency purposes, attributes such as locale, country, timezone, etc, cannot be uploaded, as these default attributes are generated directly from the mobile app via the Marigold SDK.

Each line in the import file should represent a user's device. Only scalar values are allowed (one value per attribute).

Field nameRequiredDescription
tokenYesThe push token issued by APNS or FCM. Only ASCII characters are allowed.
os_nameYesThe platform name. Use either iOS or Android (case sensitive).
user_idNoThe ID of the user, if available. Can be any value.
custom.<DATA_TYPE>.<ATTRIBUTE_NAME>NoCustom user attributes you wish to import along with the token. Valid data type values are:
integer
float
string
date
* boolean

For example, if you store the customer's life time value as an integer, your field name could be named custom.integer.life_time_value.

📘

Duplicate tokens will be ignored during the import. If you have multiple User IDs belonging to the same tokens, only the first valid entry will be imported.

Data items

  • The number of items in each row should match the number of columns defined in the header row.
  • All columns should be separated by a , character.
  • Strings which include a " character, should have the character escaped with "" (double quotations)
  • If you do not want to set an attribute for a device, pass through an empty string between the commas using ,,.

Data types

Marigold will make a best effort to parse the value into the specified data format. Only scalar values are allowed for custom attributes (one value per attribute).

Data typeRanges/valid valuesExampleNotes
integer-2,147,483,647 to 2,147,483,64712, 24, 25Floating point numbers are accepted but they will be truncated to an integer. If you wish to keep the decimal part, use float instead.
float12.343, 123.33
stringUTF-8 character encodingCody, gold, A string with a , commaIn a CSV, wrap , in quotation marks, and " in double quotation marks.
dateISO 8601, e.g. YYYY-MM-ddTHH:mm:ssZ2017-02-06T18:25:32+0300
booleantrue or false

The import process

The import process is structured to ensure Marigold only import quality data.

  1. We will check the import file to verify it has the correct format required to proceed. If the data is valid, we will import it into a test app.
  2. You will need to verify the data and notify Marigold that the import can proceed. If you need to add additional data, you will need to update the import file. We will then proceed with a new upload to a new test app.
  3. Once you're satisfied with the data, we will then import the data into your production app.

Next Steps

It is important to remember that as the app update is installed, and the user starts to use the app, the anonymous user will be replaced by the real user.

This means that their attributes will be removed. To address this, make sure you set the current values of the user attributes on the first launch of the updated app.