live_help Notes

chrome_reader_mode This resource is paginated by 30 items

settings Params

Param name Description
project_id optional . Must be String

The project id or slug

issue_id optional . Must be String

The issue id

notion_id optional . Must be String

The notion id or slug

cursus_id optional . Must be String

The cursus id or slug

user_id optional . Must be String

The user id or slug

sort optional . Must be one of: id, name, created_at, updated_at, pinner_id, kind, description.

The sort field. Sorted by name asc, id desc by default.

Example:

To sort on tags on the fields kind on a descending order and description on a ascending order:

...&sort=-kind,description

filter optional . Must be one of: id, name, created_at, updated_at, pinner_id, kind, description, cursus_id.

Filtering on one or more fields

Example:

To filter on tags with the id field matching a_value or another_value:

...&filter[id]=a_value,another_value

Filterable fields:
  • id (standard field)
  • name (standard field)
  • created_at (standard field)
  • updated_at (standard field)
  • pinner_id (standard field)
  • kind (standard field)
  • description (standard field)
  • cursus_id : . Can be one of: 1, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 25, 26, 27, 28, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 46, 47, 48, 49, 50, 51, 52, 53, 54, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 73, 74, 75, 76
range optional . Must be one of: id, name, created_at, updated_at, pinner_id, kind, description.

Select on a particular range

Example:

To range on tags with the description field between min_value and max_value:

...&range[description]=min_value,max_value

Rangeable fields:
  • id
  • name
  • created_at
  • updated_at
  • pinner_id
  • kind
  • description
page optional . Must be a Hash

The pagination params, as a hash

page[number] optional . Must be Fixnum

The current page

page[size] optional . Must be Fixnum

The number of items per page, defaults to 30, maximum 100

GET /v2/tags
200
[
  {
    "id": 11,
    "name": "Archived",
    "kind": "archived",
    "users": [],
    "subnotions": []
  },
  {
    "id": 7,
    "name": "Bocal",
    "kind": "general",
    "users": [],
    "subnotions": [
      {
        "id": 1,
        "name": "Emacs",
        "slug": "piscine-c-text-editors-emacs",
        "created_at": "2017-11-22T13:41:24.154Z",
        "notepad": null
      }
    ]
  },
  {
    "id": 4,
    "name": "Colle 08",
    "kind": "project",
    "users": [],
    "subnotions": []
  }
]
curl  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" "https://api.intra.42.fr/v2/tags"

[
  {
    "id": 11,
    "name": "Archived",
    "kind": "archived",
    "users": [],
    "subnotions": []
  },
  {
    "id": 7,
    "name": "Bocal",
    "kind": "general",
    "users": [],
    "subnotions": [
      {
        "id": 1,
        "name": "Emacs",
        "slug": "piscine-c-text-editors-emacs",
        "created_at": "2017-11-22T13:41:24.154Z",
        "notepad": null
      }
    ]
  },
  {
    "id": 4,
    "name": "Colle 08",
    "kind": "project",
    "users": [],
    "subnotions": []
  }
]
require "oauth2"
UID = "Your application uid"
SECRET = "Your application secret"
client = OAuth2::Client.new(UID, SECRET, site: "https://api.intra.42.fr")
token = client.client_credentials.get_token

response = token.get("/v2/tags")
response.status
# => 200
response.parsed
# => [{"id"=>11, "name"=>"Archived", "kind"=>"archived", "users"=>[], "subnotions"=>[]}, {"id"=>7, "name"=>"Bocal", "kind"=>"general", "users"=>[], "subnotions"=>[{"id"=>1, "name"=>"Emacs", "slug"=>"piscine-c-text-editors-emacs", "created_at"=>"2017-11-22T13:41:24.154Z", "notepad"=>nil}]}, {"id"=>4, "name"=>"Colle 08", "kind"=>"project", "users"=>[], "subnotions"=>[]}]