live_help Notes

chrome_reader_mode This resource is paginated by 30 items

settings Params

Param name Description
notion_id optional . Must be String

The notion id or slug

sort optional . Must be one of: id, notion_id, name, created_at, updated_at, slug, position.

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

Example:

To sort on subnotions on the fields slug on a descending order and position on a ascending order:

...&sort=-slug,position

filter optional . Must be one of: id, notion_id, name, created_at, updated_at, slug, position.

Filtering on one or more fields

Example:

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

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

Filterable fields:
  • id (standard field)
  • notion_id (standard field)
  • name (standard field)
  • created_at (standard field)
  • updated_at (standard field)
  • slug (standard field)
  • position (standard field)
range optional . Must be one of: id, notion_id, name, created_at, updated_at, slug, position.

Select on a particular range

Example:

To range on subnotions with the position field between min_value and max_value:

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

Rangeable fields:
  • id
  • notion_id
  • name
  • created_at
  • updated_at
  • slug
  • position
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/subnotions
200
[
  {
    "id": 10,
    "name": "Conclusion",
    "slug": "piscine-php-d08-even-moar-object-oriented-programming-conclusion",
    "created_at": "2017-11-22T13:41:24.254Z",
    "notepad": null,
    "attachments": [],
    "notion": null
  },
  {
    "id": 5,
    "name": "Cosinus",
    "slug": "fract-ol-cosinus",
    "created_at": "2017-11-22T13:41:24.204Z",
    "notepad": null,
    "attachments": [],
    "notion": null
  },
  {
    "id": 4,
    "name": "Démonstration",
    "slug": "wolf3d-demonstration",
    "created_at": "2017-11-22T13:41:24.195Z",
    "notepad": null,
    "attachments": [],
    "notion": null
  }
]
curl  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" "https://api.intra.42.fr/v2/subnotions"

[
  {
    "id": 10,
    "name": "Conclusion",
    "slug": "piscine-php-d08-even-moar-object-oriented-programming-conclusion",
    "created_at": "2017-11-22T13:41:24.254Z",
    "notepad": null,
    "attachments": [],
    "notion": null
  },
  {
    "id": 5,
    "name": "Cosinus",
    "slug": "fract-ol-cosinus",
    "created_at": "2017-11-22T13:41:24.204Z",
    "notepad": null,
    "attachments": [],
    "notion": null
  },
  {
    "id": 4,
    "name": "Démonstration",
    "slug": "wolf3d-demonstration",
    "created_at": "2017-11-22T13:41:24.195Z",
    "notepad": null,
    "attachments": [],
    "notion": null
  }
]
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/subnotions")
response.status
# => 200
response.parsed
# => [{"id"=>10, "name"=>"Conclusion", "slug"=>"piscine-php-d08-even-moar-object-oriented-programming-conclusion", "created_at"=>"2017-11-22T13:41:24.254Z", "notepad"=>nil, "attachments"=>[], "notion"=>nil}, {"id"=>5, "name"=>"Cosinus", "slug"=>"fract-ol-cosinus", "created_at"=>"2017-11-22T13:41:24.204Z", "notepad"=>nil, "attachments"=>[], "notion"=>nil}, {"id"=>4, "name"=>"Démonstration", "slug"=>"wolf3d-demonstration", "created_at"=>"2017-11-22T13:41:24.195Z", "notepad"=>nil, "attachments"=>[], "notion"=>nil}]