Zinc > Zinc for Integrators > Working With the Zinc APIs > User Properties Import API
User Properties Import API
You can use the User Properties Import API to import a list of User Properties for your users to your Zinc instance.
Request Format
//POST /admin/talkers/properties/import

{
"url": "http://localhost:3000/properties.csv", //required
"email" "address@example.com" //optional
}
* 
To receive an email notification when data import is complete, use the optional email parameter in your API request.
Request Header
When you submit an API request to this API, set the following headers:
Content-Type: application/json
Accept: application/vnd.zinc+json;level=16
Authorization: Basic <your_authorization_token>
X-Zinc-Organization: <your_organization_id>
To find your Zinc authentication token, after you log into zinc-app.com with Chrome, open the Developer Tools pane, navigate to Network XHR and expand an item. In the Headers tab, in the Request Headers section, the token is the long string of characters that is preceded by Authorization: Basic.
Request Response Codes
The API response always returns one of the following status codes:
200: Request successful.
400: The url parameter was missing or invalid.
CSV File Format and Example
The .csv file you specify in the url parameter must be in a specific format to successfully import data, for example:
email,role,location
john@example.com,VP of Product,San Francisco
adam@example.com,Software Engineer,"[San Francisco, Denver]"
stacey@example.com,CEO,San Francisco
The first row of the .csv is the header, which contains the names of the property keys in your system. Each row after the header must start with the user email address associated with the account to which properties are assigned in the request. Add the remaining values for each User Property in a comma-separated list in the same order as the property keys in the header row. Any rows that contain data for user accounts that are not in Zinc are skipped.
In this example, the adam@example.com user is assigned two separate values in the location property. This is valid only for property keys that allow multiple values.
* 
Before you use this API, Zinc Customer Support must configure the property keys in your Zinc instance. Any keys in the header row that are not defined in your system are skipped. Contact Zinc Customer Support for assistance before using this API.
Imported .csv data is handled as an exhaustive list of User Properties, and any missing keys or value are deleted from Zinc, which means that request behavior acts as find-and-replace.
As a best practice, include only users with new or updated properties to maximize system efficiency and speed processing. Also, we recommend that you limit your use of this API to once per day. Because this API is designed for bulk updates, and processing can take time, you cannot send an update when a previous request is still in progress. For faster updates, contact Zinc Customer Support for details on our SCIM API that can sync updates in real time.
Uploading a CSV File
If you cannot host a .csv file on a server that provides a URL you can specify in the url parameter, you can host your file on the Zinc content system. To do so, send the following POST request to the Zinc file upload system:
> curl -XPOST -k https://api.zincit.io/files/providers/zinc/files/FILENAME
-H 'Authorization:Basic <AUTH_TOKEN>' -H 'Accept: application/json' -H
'Content-Type: text/csv' --data-binary @<FILE_NAME>
This request returns the following JSON response:
{
"link": {
"download_url":"https://api.zincit.io/files/links/M4RUp8Wobv4YLSRc/download"
// other attributes
}
}
Use the value of download_url in the url parameter when you call //POST/admin/talkers/properties/import.
* 
After your property updates are imported and processed, the returned file shown above is deleted to ensure data security.
For more information:
Was this helpful?