Real Time User Profile

CoolaData provides you with a real-time query API to retrieve all of the data related to a specific user, to enable you to provide customized responses on your app based on the user’s characteristics.

To retrieve all of the user’s real-time data, use the following query:

select * from RTcooladata where user_id=<internal_user_id>|customer_user_id=<customer_user_id>

To retrieve a user’s internal user ID use the property name “user_id” on queries from CoolaData.

The following table specifies all the response parameters:

PropertyExampleDescription
userProperties{}All user scope properties as last saved (see last event timestamp for last update time)
userCreationTimestamp23-10-2015The time the first event by this user was received
lastSessionProperties{referring_domain=52.8.167.96:9999, is_new=1, tracker_version=2.1.12, tracker_type=javascript, session_ip=209.49.75.2, referring_url=http://52.8.167.96:9999/, session_screen_size=1440x900, session_dua=Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.71 Safari/537.36}All session scope properties sent by the user or from CoolaData's enrichment process as last saved (see last event timestamp for last update time)
lastSessionId6216554409976259594The last session's session ID (not included in lastSessionProperties)
userId6216552964336012458CoolaData's internal user ID
lastEventTimestamp7-11-2015The time the last event by this user was received
lastKnownSessionId6216554409976259594Same as lastSessionId
lastSessionTimestampN/AThe last session's start time

You can also query specific columns from this response by specifying them in the select clause.

Print Friendly, PDF & Email

Update User API

CoolaData provides an API that can be used  to update user information without having to send events especially for this purpose. This can be used for a bulk update of user information, or for ongoing updates.

The update support only existing user scope properties in the project (adding new properties is not supported with this API) and will affect any future events sent for this user.

The API is called using customer_user_id (the actual user id sent in events, not the internal_user_id Cooladata allocated per user). The API will work only for existing users that sent events in the past. Notice that since Cooladata deletes users after a period of inactivity, the user updated might not exist in Cooladata records if the period has past. For more information about the period Cooladata keeps users for please contact support@cooladata.com or contact your CSM directly.

 

API End Point

https://app.cooladata.com/api/v2/projects/{projectId}/users/update

Replace the [project_id] placeholder with your actual Project ID found in the project settings.

Method

POST

Header

ContentType:application/json
Authorization:Token [User_API_Token]

Replace the [User_API_Token] placeholder with your actual user API Token found when clicking on your user in the application.

The request will be permitted only for ADMIN user permissions.

Payload

[
{
 "customer_user_id" : "<user_id>",
  "properties":{
   "user":{
    "<property name>":"<new value>",
    "<property name2>":"<new value>"
   }
  },
  ...
}
]

Sample Payload

[
{
 "customer_user_id" : "458dsf832-4324h3-dsfsf34532-dsf73d",
  "properties":{
   "user":{
    "email":"johng@4x4videos.com",
    "plan_type":"Premium"}
   }
  },
{ "customer_user_id" : "29fh84g7-fg86fg0gh-dsfsf34341-239hf47", 
   "properties":{ 
     "user":{
       "email":"neo.goldman@gmail.com",
       "plan_type":"Free",
       "plan_update_date":"2018-05-23" } }  
}
]

 

Response

  • Success: 200 ok + number of users updated
  • Failure: 400 bad request
    •  No customer user id <id> for project <project id> – this means the user_id you requested to update does not exist (never sent events) or was deleted since the period of user inactivity defined in your project has past.
Print Friendly, PDF & Email