List notifications

This commit is contained in:
simonwt 2026-04-13 17:43:52 +01:00
parent 921b6f5d95
commit 1b50309c09
5 changed files with 39 additions and 3 deletions

View file

@ -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")

View file

@ -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

View file

@ -1 +1,2 @@
from .listnotifications import listnotifications
from .listnotifications import listnotifications
from .markallasread import markallasread

View file

@ -0,0 +1,8 @@
def markallasread(API):
"""
Mark all notifications as read.
Returns:
"""
API.make_request("POST", "megaphone", "inbox/markallread", authenticate=True)

View file

@ -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