<< Back to GForge REST API

Entity: Tag

GET

getTag

Searches for tags matching criteria, or retrieves a single tag by id.

Parameters (8)

Name Type Description
id int Tag id. When provided, returns a single record.
section string Section of the tagged object (e.g. trackeritem). Optional filter.
refId int Id of the tagged object. Optional filter.
tagName string Tag value to filter by. Optional.
sort_field string Field to sort by. Options: section, refId, tagName. Default section.
sort_dir string Sort direction: asc or desc. Default desc.
page_num int Page number (zero-based). Default 0.
page_size int Records per page. Default 20.
Sortable
Use the sort_field and sort_dir parameters to control the order in which records are returned.
Pageable
Use the page_size and page_num parameters to control the set of records returned.

Return: \gforge\core\models\api\TagBasic

Single record or zero or more TagBasic records.

Name Type Description
id int Id of associated object
section string Type of the associated object
refId int Id of object associated with this activity log
tagName string Name of the tag

Example 1

Find all tags matching the section "trackeritem"
  GET http://gforge.api/tag?section=trackeritem

Example 2

Get all tags with the section "trackeritem" and the refId 1001
  GET http://gforge.api/tag/trackeritem/1001

POST

PUT

putTag

Replaces all tags on an object with the provided set.

Parameters (3)

Name Type Description
section string Section of the tagged object (e.g. trackeritem). Required.
refId int Id of the tagged object. Required.
tags string Comma-delimited list of tag values to set. Replaces all existing tags.

Return: array

Associative array with key location containing the URL of the tag list.

Example 1

Set tags on tracker item 1:
  PUT http://gforge.api/tag/trackeritem/1

{ "tags": "tag1,tag2,tag3" }

DELETE