GET /v2/notions/:notion_id/subnotions
Return all the subnotions of the given Notion
GET /v2/subnotions
Return all the subnotions
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. MoreExample: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 MoreExample:
To filter on subnotions with the
...&filter[id]=a_value,another_value Filterable fields:
|
range |
optional
. Must be one of: id , notion_id , name , created_at , updated_at , slug , position .
Select on a particular range MoreExample:
To range on subnotions with the
...&range[position]=min_value,max_value Rangeable fields:
|
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 |
Examples
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}]