Skip to content

Commit c3ddb6c

Browse files
Merge pull request #5 from interakt/master
Taking latest readMe changes
2 parents 11d3d06 + cfbb46e commit c3ddb6c

1 file changed

Lines changed: 12 additions & 18 deletions

File tree

README.md

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,6 @@ import track
1414
1515
track.api_key = "YOUR_API_KEY"
1616
```
17-
Interakt Track APIs uses HTTP Basic Auth, which involves a `‘username:password’` that is **base64 encoded** and prepended with the string `‘Basic ‘`.
18-
19-
Your **api_key** is your `username` and `password` is empty. Which means if your **api_key** is `'abcd123'`, a colon is added to it, and then the password field is left empty.
20-
21-
After base64 encoding `'abcd123:'` becomes `'YWJjZDEyMzo='`; and this is passed in the authorization header like so: `'Authorization: Basic YWJjZDEyMzo='`
22-
2317

2418

2519
## Development Settings
@@ -47,32 +41,32 @@ track.on_error = on_error
4741

4842

4943
# APIs
50-
## Identify
44+
## User
5145
The `identify` lets you tie a user to their actions and record traits about them. It includes a unique **User ID** or **Phone Number and Country Code** any optional traits you know about them.
5246

53-
Example `identify` call:
47+
Example `user` call:
5448
```
55-
track.identify(
56-
user_id="<user_id in your db>",
49+
track.user(
50+
userId="<user_id in your db>",
5751
traits={
5852
"name": "John Doe",
5953
"email": "john@email.com",
6054
"age": 24
6155
}
6256
)
6357
```
64-
#### The `identify` call has the following fields:
58+
#### The `user` call has the following fields:
6559
|Field|Data type|Description|
6660
|--|--|--|
67-
|user_id|str or int|The ID for the user in your database.|
68-
|country_code|str|country code for the phone_number (default value is "+91")|
69-
|phone_number|str|phone_number without country_code (eg: "9876598765")|
61+
|userId|str or int|The ID for the user in your database.|
62+
|countryCode|str|country code for the phone_number (default value is "+91")|
63+
|phoneNumber|str|phone_number without country_code (eg: "9876598765")|
7064
|traits|dict|A dict of traits you know about the user. Things like: `email`, `name` or `age`|
7165

7266
**NOTE:** Atleast one of these two is required for user identification :
7367

74-
- **user_id**, OR
75-
- **phone_number** with **country_code**
68+
- **userId**, OR
69+
- **phoneNumber** with **countryCode**
7670

7771

7872

@@ -82,7 +76,7 @@ track.identify(
8276
Example `event` call:
8377
```
8478
track.event(
85-
user_id="<user_id in your db>",
79+
userId="<user id in your db>",
8680
event="Product Added",
8781
traits={"price": 200}
8882
)
@@ -91,6 +85,6 @@ track.event(
9185

9286
|Field|Data type|Description|
9387
|--|--|--|
94-
|user_id|str or int|The ID for the user in your database.|
88+
|userId|str or int|The ID for the user in your database.|
9589
|event|str|Name of the event you want to track, For eg: "Product Added".|
9690
|traits|dict|dictionary of properties for the event. If the event was **Product Added**, it might have properties like `price` or `product_name`.|

0 commit comments

Comments
 (0)