Posting to sub category not working for me


Using the following curl command to post to our forum from bash

curl -X POST -H "Content-Type: application/json" --data @/tmp/json.json "$API_KEY&api_username=$UN"

where json.json contains…

 "title": "test post",
 "category": "cat/subcat",
 "raw": "test post"

This works fine when sending to just a category, but when I try to send to a sub category, as shown above, the post is created without a category, so that everyone on the forum appears to see it

Anything special I need to set to get the post to correct be sent to a sub category

It’s best to use the category ID integer value as indicated by the docs here:

This is untested by me but I believe you can also use the “subcat” without the prefix “cat/” however there may be some issue if you have categories / subcategories with the same names.

I would stick with integer category ID numbers.


Thanks, using the category ID numbers worked :slight_smile:


This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.