[go: up one dir, main page]

User Import

Import customer records to your EnjoyHQ account

User import/update

User bulk import endpoint can be used for importing user properties for both new and existing users.

πŸ“˜

User update

User properties
In case you want to update user properties you can send a new set of properties for given user.

Sending a new set of properties will overwrite the previously properties imported via API.
In case you want to delete all imported user properties, you can send empty array as properties (see Delete all user properties example).
Properties support the following field_type values:

  • string - suitable for pieces of text (company.name, region, cohort) as well as identifiers (user IDs, company IDs)
  • number - best for numeric properties tracking the number of occurrences of an event (searched: 7) or countable properties (number_of_documents: 10, company.team_size: 20)
  • date - used to track point-in-time events (converted_at, company.signed_up_at)

User segments
Segments update works the same as properties.

Name of the user
You can send in new name in case you want to overwrite current user's name (see Update username example). The name cannot be deleted (null is not allowed value for name field)!

Partial user update
If you want to do partial user update do not send in the keys you don't want to update. This will update the new values and leave the previously imported values for the keys you skipped. (see Update username example)

Full user update

In case you want to completely overwrite user you can send full user data again (empty vector send in for properties/segments will delete all previously imported properties/segments for given user).

Validation of data

❗️

Failed validation response

If you see HTTP response code 403, then something in your data was not right. We will help you fix the problem by sending you list of errors for each of the users. When list is empty, the given user has no errors.

Each element in list of errors indicates which user attribute was incorrect and the source of problem. There are 4 types of errors:

  • missing-required-key: This data is required in order to be able to create user.
  • disallowed-key: We don't recognise this data.
  • invalid-value: There is an error in the value field. Please ensure you're using the correct datatype (e.g. the property value is not matching the specified field type)
  • property-field-type-mismatch: You uploaded the same property key with two different value types.

In example below request contains 3 users.

  • The first user will pass the validation.
  • The second one does not contain the required attribute 'email'.
  • The third one is using incorrect data type for property value (value is expected to be number)

⚠️ None of the users will be imported.

curl -XPOST \
-H "Content-Type: application/json" \
-H "Authorization: Token 32b252f2da0cadcb42fd7edbac787c735a41c04da0dd0d299f" \
'api.nenjoyhq.com/v1/users/import' \
-d '[{"email":"[email protected]","properties":[]}, 
     {"properties":[]}, 
     {"email":"[email protected]",
      "properties":[{"key":"number", "value":"1", "field_type":"number"}]}]'
HTTP/1.1 403 Forbidden
Date: Mon, 05 Sep 2016 12:05:13 GMT
Content-Type: application/json; charset=UTF-8
Content-Length: 96
Server: nginx

[{"errors":[],"email":"[email protected]"},
 {"errors":[{"key":"email","error":"missing-required-key"}],"email":null}, 
 {"errors":[{"key":"properties","error":"invalid-value"}],
  "email":"[email protected]"}]

Processed users

You can see imported users and their properties in People search view in EnjoyHQ (note we only display those users which have also document present in EnjoyHQ).

You can use user properties & segments in search User Properties in Search or in creating segments User Segments.

πŸ“˜

Async processing

After your import request is acknowledged it will take approx 1 minute for the user properties to be added to your documents. If you importing large number of records there might be a bigger delay.
To see newly imported properties in your search suggestions, you need to refresh your search page.

Language
Credentials
Header