Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
MOOC packages by hacklab
django-courses
Commits
8bce54ba
Commit
8bce54ba
authored
Sep 11, 2020
by
Laury Bueno
Browse files
[Docs] Add info about activity endpoints
parent
e450be9c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
3 deletions
+20
-3
README.md
README.md
+20
-3
No files found.
README.md
View file @
8bce54ba
...
...
@@ -30,6 +30,23 @@ urlpatterns = [
```
## Activity streams
Accepted actions:
-
user accessed the platform
Its possible to log
`user-access`
by sending a POST request to
`/api/stats/user-access/`
. Payload example:
```
json
{
"area"
:
"dashboard"
}
```
Note: available areas must be created via Django Admin previously:
`<HOST>/django/admin/stats/accessiblearea/`
To log generic activities, send a POST request to
`/api/user-actions/`
.
```
json
{
"verb"
:
"created comment"
,
"action_object_id"
:
7
,
#
optional
"action_object_type"
:
"Topic"
,
#
optional
"target_id"
:
26
,
#
optional
"target_type"
:
"Forum"
#
optional
}
```
Note: any model used as object or target must have been previously registered at
`django-courses/courses/stats/apps.py`
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment