1curl https://api.june.so/sdk/identify \ 2-H "Content-Type: application/json" \ 3-H "Authorization: Basic {YOUR_WRITE_KEY}" \ 4--data '{"userId": "USER_ID","traits": {"email": "test@example.com"},"timestamp": "2012-12-02T00:30:08.276Z"}'
Now, you must send the June SDK with a valid API key as part of the Authorization
header, which you can get from your June workspace.
1curl https://api.june.so/sdk/identify \ 2-H "Content-Type: application/json" \ 3-H "Authorization: Basic {YOUR_WRITE_KEY}" \ 4--data '{"userId": "USER_ID","traits": {"email": "test@example.com"},"timestamp": "2012-12-02T00:30:08.276Z"}'
You can use the identify
endpoint to identify your users. Replace USER_ID
with the unique identifier for the user in your database.
1POST https://api.june.so/sdk/identify
1// Send an identify call 2{ 3"userId": "USER_ID", 4"traits": { 5"email": "test@example.com" 6}, 7"timestamp": "2012-12-02T00:30:08.276Z" 8}
You can use the group
endpoint to identify your companies. Replace GROUP_ID
and USER_ID
with the unique identifier for the company and user in your database.
1POST https://api.june.so/sdk/group
1{ 2"userId": "USER_ID", 3"groupId": "GROUP_ID", 4"traits": { 5"name": "Acme Inc" 6}, 7"timestamp": "2012-12-02T00:31:38.208Z" 8}
In order to track user behaviour, you can use the track
endpoint.
Note: If you're identifying companies, you should pass the groupId
in the track context, as shown in the example below. Replace GROUP_ID
and USER_ID
with the unique identifier for the company and user in your database.
1POST https://api.june.so/sdk/track
1// Send a track event 2{ 3"userId": "USER_ID", 4"event": "Created Account", 5"properties": { 6"plan": "Pro" 7}, 8"context": { 9"groupId": "GROUP_ID" 10}, 11"timestamp": "2012-12-02T00:30:12.984Z" 12}