List notifications
This commit is contained in:
parent
921b6f5d95
commit
1b50309c09
5 changed files with 39 additions and 3 deletions
|
|
@ -33,7 +33,9 @@ import trustcafeapiwrapper, os
|
|||
|
||||
API = trustcafeapiwrapper.APIClient(
|
||||
client_id=os.getenv("client_id"),
|
||||
client_secret=os.getenv("client_secret")
|
||||
client_secret=os.getenv("client_secret"),
|
||||
env="alpha" # alpha | production.
|
||||
debug=False
|
||||
)
|
||||
|
||||
profile = API.run_job('userprofile.get', "simon-little")
|
||||
|
|
|
|||
|
|
@ -90,7 +90,31 @@ print(postlist)
|
|||
## mute
|
||||
## notifcation
|
||||
### `listnotifications`
|
||||
```python
|
||||
API.run_job('notification.listnotifications')
|
||||
```
|
||||
### `markallasread`
|
||||
```python
|
||||
API.run_job('notification.markallasread')
|
||||
```
|
||||
## post
|
||||
### create
|
||||
```python
|
||||
API.run_job('post.create', {
|
||||
"postText": "This is a test post created via the API wrapper.",
|
||||
"parent": {
|
||||
"pk": "maintrunk#maintrunk",
|
||||
"sk": "maintrunk#maintrunk"
|
||||
}
|
||||
})
|
||||
```
|
||||
### get
|
||||
### listall
|
||||
### listbybranch
|
||||
### listbyuserprofile
|
||||
### listpublic
|
||||
### listremove
|
||||
### update
|
||||
## reaction
|
||||
## trust
|
||||
## userprofile
|
||||
|
|
|
|||
|
|
@ -1 +1,2 @@
|
|||
from .listnotifications import listnotifications
|
||||
from .listnotifications import listnotifications
|
||||
from .markallasread import markallasread
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
def markallasread(API):
|
||||
"""
|
||||
Mark all notifications as read.
|
||||
|
||||
Returns:
|
||||
|
||||
"""
|
||||
API.make_request("POST", "megaphone", "inbox/markallread", authenticate=True)
|
||||
|
|
@ -138,6 +138,7 @@ def save_response(response):
|
|||
# x += 1
|
||||
|
||||
# save_response(API.run_job('notification.listnotifications'))
|
||||
save_response(API.run_job('notification.markallasread'))
|
||||
|
||||
# save_response(API.run_job('feed.cafefeed'))
|
||||
|
||||
|
|
@ -149,7 +150,7 @@ def save_response(response):
|
|||
# }))
|
||||
|
||||
# save_response(API.run_job('post.listall'))
|
||||
save_response(API.run_job('post.listpublic'))
|
||||
# save_response(API.run_job('post.listpublic'))
|
||||
|
||||
# from trustcafeapiwrapper.wrappers.post.create_post import create_post
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue