How to create Tag through API?


#1

Is there any way to create a Tag through API?


#2

Hi @saleth123 Currently, the API does not support creating new tags. It only allows for reading existing ones. However, we are in the process of adding full CRUD for tags to the API. We’re hoping to have it completed by the end of the current sprint - 30, which ends on 10/5/2015.


#3

Thanks for your update gtanzilla.


#4

Hi @saleth123. Categories and Tags were recently added to the API.

Provided you have a category, you can create a tag under that category by name, id, or href:

POST api/tags
{
  "name": "tagname",
  "description": "Tag Description",
  "category": {
    "id": <category id>
    OR
    "href": <category href>
    OR
    "name": <category name>
  }
}

You can also create a tag as a subresource of a category:

POST api/categories/<category id>/tags

{
  "name": "tagname",
  "description": "Tag Description"
}

If you need to query for the category, you can list all the categories with:

GET api/categories

And you can create a new category with:

POST api/categories

{
  "name": "categoryname",
  "description": "Category Description"
}

Hope that helps. Let me know if you have any other questions.