The (New) CSV Import API provides methods to upload, configure, and perform CSV imports to manage Studio users and contacts on Staffbase Email. Unlike the Contact API, it uses a different approach to handling contact data. If you are migrating from the Employee Email to the Staffbase Email, you need to adjust your existing import feed accordingly.
Authentication
- Create an API token with administrative access via the Staffbase Studio.
The Staffbase platform API authentication works differently than API keys generated in the Employee Email (Classic) platform. Therefore any old Employee Email (Classic) API keys are not compatible with Staffbase Email.
Prepare contact data
- The API requires data in CSV format. Convert your existing JSON contact data into a CSV file, following these requirements:
- Each system and custom field must be represented as a column header.
- Each row must contain contact data that matches the order of the headers.
For more information on CSV examples, refer CSV File Examples.
Example Conversion
JSON example
{ "contacts": [ { "firstName": "Contact", "lastName": "One", "email": "contact.one@email.com", "location": "Vancouver", "department": "Sales", "jobTitle": "SDR", "customFields": { "team": "Team A", "costcenter": "12345" } }, { "firstName": "Contact", "lastName": "Two", "email": "contact.two@email.com", "location": "Vancouver", "department": "Sales", "jobTitle": "VP", "customFields": { "team": "Team B", "costcenter": "12345" } }, { "firstName": "Contact", "lastName": "Three", "email": "contact.three@email.com", "location": "Vancouver", "department": "Product", "jobTitle": "Engineer", "customFields": { "team": "Team B", "costcenter": "12345" } } ]}
Converted CSV example:
firstName,lastName,email,location,department,jobTitle,team,costcenterContact,One,contact.one@email.com,Vancouver,Sales,SDR,Team A,12345Contact,Two,contact.two@email.com,Vancouver,Sales,VP,Team B,12345Contact,Three,contact.three@email.com,Vancouver,Product,Engineer,Team B,12345
To learn how the CSV file should be formatted and encoded, refer Setting up the CSV File.
Add profile fields to Staffbase Studio
- Before importing contacts, ensure all custom fields in your CSV file are set up in Staffbase Studio. Check the customFields object nested in the
contacts
object in your current JSON data and add the necessary fields in the Studio. Learn more.
Perform the CSV import via the (New) CSV Import API
Once your data is prepared and your custom fields are configured, follow the Get Started With CSV Import to start the import. When importing via CSV, set "type": "CONTACT"
for contacts and "type": "USER"
for users.