Using API to create posts and topics
Unsolved
Technical Support
-
Hi, @phenomlab!
Calls to create:
In my project I call the
/api/v3/topics/
to create a new topic via Python andrequests
lib:data = { "cid": int(cid), "title": entry.title, "content": '\n'.join(description), "tags": tags } headers = {'Authorization': 'Bearer {token}'.format(token=os.environ.get('NODEBB_TOKEN'))} url = '{host}/api/v3/topics/'.format(host=os.environ.get('NODEBB_URL')) response = requests.post( url=url, headers=headers, json=data ) response.raise_for_status()
Copyright © 2024 NodeBB | Contributors