Implement your Node-RED flows with the services proposed by the RESTful API of Humhub.
Warning: Beta version - Humhub-services will change in the next releases!
The REST API module provides a generic interface to various subsystems of the HumHub platform.
Ensure you created an Humhub account in order to correctly configure your credentials, either by login/password or with API token/key.
To create a post, you'll need the container's id in which you want to have your post. GET method can get you the container id of a particular post.
To update a post, you'll need the id of the post you want to change. GET method can get you the id of a particular post.
To delete a post, you'll need the id of the post you want to erase. GET method can get you the id of a particular post.
To get all the posts, you can set no filter. If you want to have only some, you can set as many filters as you need. Filters have only few conditions to examine and compare, they'll be enhanced in subsequent versions.
To upload a file on a post, you'll need the post's id in which you want to have your file. Posts GET method can get you the id of a particular post. You'll also need to provide the full path of your file.
To download a file, you'll need it's id. You'll also need to provide the full path of where you want to create your file. The extension will be auto generated from the mime-type of your file.
To create a comment, you'll need the post's id in which you want to have your comment. You'll write it in the "message" property.
To update a comment, you'll need its id. You'll write the updated comment in the "message" property.
To delete a post, you'll need the id of the post you want to erase.
To get the comments you'll need to provide an Id, either one of a particular comment, or one of a post, or one of a content.
To create a topic, you'll need the container's id in which you want to have your topic. You'll also need to provide its name.
To update a topic, you'll need its id. You'll write the updated topic in the "new name" property.
To delete a topic, you'll need the id of the topic you want to erase.
To get the topics you can provide an Id, either one of a particular topic, or one of a container, you can also choose to get all the topics without providing any id.
In order to set an API access go to `Administration -> Modules on your Humhub account.
Then install the restful API module, and click on configure in order to set an access with basic authentification or bearer token.
Under "General" choose to allow the access method you want to use.
If you want to setup an access via bearer token, generate one in the "Bearer Auth" tab, and provide your account as an authorized user. Then you'll just have to add your token in your credentials node.