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

topic_id optional . Must be String

The topic id

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 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: 14, 11, 15, 16, 9, 5, 10, 6, 7, 12, 4, 17, 13, 8, 1, 3
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

comments powered by <span class='logo-disqus'>Disqus</span>
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"=>[]}]