Skip to content

Commit

Permalink
feat: update createdAt timestamp format in event API
Browse files Browse the repository at this point in the history
  • Loading branch information
Digital39999 committed Aug 13, 2024
1 parent 5959df1 commit 0097cf9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -170,13 +170,13 @@ curl -X POST http://localhost:8080/event \
-d '{
"name": "login",
"userId": "user123",
"createdAt": 1691913600
"createdAt": 1632960000000
}'
```

- **`name`**: The event name (e.g., `login`, `purchase`).
- **`userId`**: A unique identifier for the user.
- **`createdAt`**: The timestamp of the event (in Unix time).
- **`createdAt`**: The timestamp of the event.

### Get Aggregated Analytics

Expand Down Expand Up @@ -222,7 +222,7 @@ async function recordEvent() {
body: JSON.stringify({
name: 'login',
userId: 'user123',
createdAt: Math.floor(Date.now() / 1000) // current Unix time
createdAt: Date.now()
})
}).then(res => res.json());

Expand Down Expand Up @@ -250,7 +250,7 @@ def record_event():
data = {
'name': 'login',
'userId': 'user123',
'createdAt': int(time.time()) # current Unix time
'createdAt': int(time.time())
}

response = requests.post(api_url, json=data)
Expand Down

0 comments on commit 0097cf9

Please sign in to comment.