I am trying to create Tags through the REST API. I can GET/POST Discussions, as well as GET Tags, but the POST endpoint for Tags has not worked. I am currently using FreeFlarum and am unsure if that's related as I am new to this platform.
Calling this python code
headers = {"Authorization": f"Token {api_token}"}
url = f"{flarum_url}/api/tags"
data = {
"data": {
"attributes": {
"name": "Lorem Ipsum",
"slug": "loremipsum",
"color": "#009912",
"description": "Lorem ipsum dolor sit amet, consectetur adipiscing elit.",
}
}
}
response = requests.post(url, headers=headers, json=data)
Gives me this a 500 code with this response
{"errors":[{"status":"500","code":"unknown"}]}
If I intentionally remove certain attributes I get a 422 with responses like this:
{"errors":[{"status":"422","code":"validation_error","detail":"The name field is required.","source":{"pointer":"\/data\/attributes\/name"}}]}
So it does seem to able to parse my request. But not sure of where to go from here.