I'm trying to write a Python API wrapper over the NodeBB REST API but I'm a little confused by the interface. I understand that you can add
/api to most if not all urls and be able to get json response.
However, I'd prefer to reference a resource by their
id rather than the associated username, topic name, category name etc.
# My username vs my uid.
I ask because it seems like there's quite a split between the read-api and the write-api provided by the
nodebb-plugin-write-api plugin. For example, if I wanted to
PUT to a user, I have to reference the resource via the
uid, but when I want to
GET a user, I need to use their
It's not too bad when it's the user resource but it gets pretty weird when it comes to say, topics. With topics, I need the
tid AND the topic
title. In addition, the topic title needs to be formatted in a specific way (removing commas, lowercase, replacing spaces with hyphens etc.).
# The original title was "Deleted topics, comments"
It's very confusing and it makes it quite difficult to use the API.
Am I missing something? Is it possible to reference resources just by their id? Is there a switch I need to turn on in the ACP for this to work? Is there a piece of documentation I'm missing?
Because ideally, I'd prefer to only have to use the id as the resource reference, e.g.
PUT, DELETE "https://community.nodebb.org/api/topic/6438/"
PUT, DELETE "https://community.nodebb.org/api/user/6438/"
PUT, DELETE "https://community.nodebb.org/api/category/6438/"
PS. I'm using NodeBB v0.7.3