GET /v2/cursus/:cursus_id/topics
Return all the topics of the given Cursus
GET /v2/topics/unread
Return all the topics
GET /v2/topics
Return all the topics
GET /v2/users/:user_id/topics
Return all the topics of the given User
GET /v2/tags/:tag_id/topics
Return all the topics of the given Tag
GET /v2/me/topics
Return all the topics for the current resource owner
live_help Notes
chrome_reader_mode
This resource is paginated by 30 items
settings Params
Param name | Description |
---|---|
cursus_id |
optional
. Must be String
The cursus id or slug |
user_id |
optional
. Must be String
The user id or slug |
tag_id |
optional
. Must be String
The tag id |
sort |
optional
. Must be one of: id , name , author_id , kind , created_at , updated_at , pinned_at , locked_at , pinner_id , locker_id , language_id , write_at , message_id , answer_id .
The sort field. Sorted by updated_at desc by default. MoreExample:To sort on topics on the fields message_id on a descending order and answer_id on a ascending order: ...&sort=-message_id,answer_id |
filter |
optional
. Must be one of: id , name , author_id , kind , created_at , updated_at , pinned_at , locked_at , pinner_id , locker_id , language_id , write_at , message_id , answer_id , pinned , locked , write .
Filtering on one or more fields MoreExample:
To filter on topics with the
...&filter[id]=a_value,another_value Filterable fields:
|
range |
optional
. Must be one of: id , name , author_id , kind , created_at , updated_at , pinned_at , locked_at , pinner_id , locker_id , language_id , write_at , message_id , answer_id .
Select on a particular range MoreExample:
To range on topics with the
...&range[answer_id]=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/topics.json
200
[
{
"id": 1,
"name": "Never tell me the odds!",
"author": {
"id": 110,
"login": "kki-adi2",
"url": "https://api.intra.42.fr/v2/users/kki-adi2"
},
"kind": "normal",
"created_at": "2017-11-22T13:42:13.251Z",
"updated_at": "2017-11-22T13:42:20.680Z",
"pinned_at": null,
"locked_at": null,
"pinner": null,
"locker": null,
"language": {
"id": 2,
"name": "English",
"identifier": "en"
},
"messages_url": "https://api.intra.42.fr/v2/topics/1/messages",
"message": {
"id": 1,
"content": {
"markdown": "Five dollar toast freegan kickstarter. Blue bottle swag pitchfork cornhole schlitz. Fashion axe pbr&b austin. Ethical echo deep v. Fashion axe franzen twee organic vegan marfa authentic tilde.\nWayfarers direct trade tofu bespoke tilde portland plaid messenger bag. Jean shorts locavore tousled fanny pack freegan. Normcore gluten-free franzen plaid irony.\nSynth irony retro single-origin coffee squid meggings. Street trust fund disrupt iphone keffiyeh 90's lo-fi heirloom. Beard disrupt pitchfork. Craft beer vegan butcher keffiyeh mumblecore gentrify pickled tacos.",
"html": null
}
},
"survey": null,
"tags": [
{
"id": 9,
"name": "Lost and found",
"kind": "general"
},
{
"id": 8,
"name": "WTF?!",
"kind": "general"
}
]
},
{
"id": 5,
"name": "You will never find a more wretched hive of scum and villainy. We must be cautious.",
"author": {
"id": 1,
"login": "jeanne",
"url": "https://api.intra.42.fr/v2/users/jeanne"
},
"kind": "normal",
"created_at": "2017-11-22T13:42:15.962Z",
"updated_at": "2017-11-22T13:42:20.667Z",
"pinned_at": null,
"locked_at": null,
"pinner": null,
"locker": null,
"language": {
"id": 3,
"name": "Romanian",
"identifier": "ro"
},
"messages_url": "https://api.intra.42.fr/v2/topics/5/messages",
"message": {
"id": 41,
"content": {
"markdown": "Fap stumptown waistcoat godard narwhal actually. Ramps thundercats hella trust fund lomo franzen. Pickled artisan kitsch banh mi cleanse church-key trust fund plaid.\nLo-fi yolo cronut tousled photo booth pitchfork readymade try-hard. Truffaut skateboard locavore street wayfarers banh mi. 8-bit celiac butcher. Slow-carb banjo ethical single-origin coffee.\nSelfies cardigan bespoke aesthetic. Listicle trust fund fap cliche locavore. Master shoreditch pabst cold-pressed helvetica microdosing echo humblebrag. Farm-to-table vegan salvia shabby chic chillwave pug forage. Quinoa venmo direct trade.",
"html": null
}
},
"survey": {
"answers": [
{
"id": 552,
"name": "Maybe"
},
{
"id": 553,
"name": "Idk"
}
],
"id": 140,
"name": "Yes or no ?"
},
"tags": [
{
"id": 7,
"name": "Bocal",
"kind": "general"
},
{
"id": 8,
"name": "WTF?!",
"kind": "general"
}
]
},
{
"id": 6,
"name": "Aren't you a little short for a Stormtrooper?",
"author": {
"id": 68,
"login": "borvohut",
"url": "https://api.intra.42.fr/v2/users/borvohut"
},
"kind": "normal",
"created_at": "2017-11-22T13:42:16.662Z",
"updated_at": "2017-11-22T13:42:20.614Z",
"pinned_at": null,
"locked_at": null,
"pinner": null,
"locker": null,
"language": {
"id": 1,
"name": "Français",
"identifier": "fr"
},
"messages_url": "https://api.intra.42.fr/v2/topics/6/messages",
"message": {
"id": 51,
"content": {
"markdown": "Hammock truffaut sustainable chia bespoke photo booth. Wolf kickstarter portland swag salvia etsy microdosing. Seitan literally raw denim. Keytar raw denim pop-up tousled heirloom thundercats gentrify sartorial.\nKeytar hella etsy lomo food truck shabby chic lumbersexual dreamcatcher. Salvia portland brunch skateboard 8-bit carry. Cornhole echo selvage migas kitsch kale chips pabst kickstarter. Ennui chambray whatever master kickstarter cred helvetica next level.\nYolo literally cronut. Forage diy everyday fingerstache lomo. Health quinoa bitters authentic cleanse. Food truck ennui kickstarter street venmo crucifix.",
"html": null
}
},
"tags": [
{
"id": 8,
"name": "WTF?!",
"kind": "general"
},
{
"id": 9,
"name": "Lost and found",
"kind": "general"
}
]
}
]
curl -H "Authorization: Bearer YOUR_ACCESS_TOKEN" "https://api.intra.42.fr/v2/topics.json"
[
{
"id": 1,
"name": "Never tell me the odds!",
"author": {
"id": 110,
"login": "kki-adi2",
"url": "https://api.intra.42.fr/v2/users/kki-adi2"
},
"kind": "normal",
"created_at": "2017-11-22T13:42:13.251Z",
"updated_at": "2017-11-22T13:42:20.680Z",
"pinned_at": null,
"locked_at": null,
"pinner": null,
"locker": null,
"language": {
"id": 2,
"name": "English",
"identifier": "en"
},
"messages_url": "https://api.intra.42.fr/v2/topics/1/messages",
"message": {
"id": 1,
"content": {
"markdown": "Five dollar toast freegan kickstarter. Blue bottle swag pitchfork cornhole schlitz. Fashion axe pbr&b austin. Ethical echo deep v. Fashion axe franzen twee organic vegan marfa authentic tilde.\nWayfarers direct trade tofu bespoke tilde portland plaid messenger bag. Jean shorts locavore tousled fanny pack freegan. Normcore gluten-free franzen plaid irony.\nSynth irony retro single-origin coffee squid meggings. Street trust fund disrupt iphone keffiyeh 90's lo-fi heirloom. Beard disrupt pitchfork. Craft beer vegan butcher keffiyeh mumblecore gentrify pickled tacos.",
"html": null
}
},
"survey": null,
"tags": [
{
"id": 9,
"name": "Lost and found",
"kind": "general"
},
{
"id": 8,
"name": "WTF?!",
"kind": "general"
}
]
},
{
"id": 5,
"name": "You will never find a more wretched hive of scum and villainy. We must be cautious.",
"author": {
"id": 1,
"login": "jeanne",
"url": "https://api.intra.42.fr/v2/users/jeanne"
},
"kind": "normal",
"created_at": "2017-11-22T13:42:15.962Z",
"updated_at": "2017-11-22T13:42:20.667Z",
"pinned_at": null,
"locked_at": null,
"pinner": null,
"locker": null,
"language": {
"id": 3,
"name": "Romanian",
"identifier": "ro"
},
"messages_url": "https://api.intra.42.fr/v2/topics/5/messages",
"message": {
"id": 41,
"content": {
"markdown": "Fap stumptown waistcoat godard narwhal actually. Ramps thundercats hella trust fund lomo franzen. Pickled artisan kitsch banh mi cleanse church-key trust fund plaid.\nLo-fi yolo cronut tousled photo booth pitchfork readymade try-hard. Truffaut skateboard locavore street wayfarers banh mi. 8-bit celiac butcher. Slow-carb banjo ethical single-origin coffee.\nSelfies cardigan bespoke aesthetic. Listicle trust fund fap cliche locavore. Master shoreditch pabst cold-pressed helvetica microdosing echo humblebrag. Farm-to-table vegan salvia shabby chic chillwave pug forage. Quinoa venmo direct trade.",
"html": null
}
},
"survey": {
"answers": [
{
"id": 552,
"name": "Maybe"
},
{
"id": 553,
"name": "Idk"
}
],
"id": 140,
"name": "Yes or no ?"
},
"tags": [
{
"id": 7,
"name": "Bocal",
"kind": "general"
},
{
"id": 8,
"name": "WTF?!",
"kind": "general"
}
]
},
{
"id": 6,
"name": "Aren't you a little short for a Stormtrooper?",
"author": {
"id": 68,
"login": "borvohut",
"url": "https://api.intra.42.fr/v2/users/borvohut"
},
"kind": "normal",
"created_at": "2017-11-22T13:42:16.662Z",
"updated_at": "2017-11-22T13:42:20.614Z",
"pinned_at": null,
"locked_at": null,
"pinner": null,
"locker": null,
"language": {
"id": 1,
"name": "Français",
"identifier": "fr"
},
"messages_url": "https://api.intra.42.fr/v2/topics/6/messages",
"message": {
"id": 51,
"content": {
"markdown": "Hammock truffaut sustainable chia bespoke photo booth. Wolf kickstarter portland swag salvia etsy microdosing. Seitan literally raw denim. Keytar raw denim pop-up tousled heirloom thundercats gentrify sartorial.\nKeytar hella etsy lomo food truck shabby chic lumbersexual dreamcatcher. Salvia portland brunch skateboard 8-bit carry. Cornhole echo selvage migas kitsch kale chips pabst kickstarter. Ennui chambray whatever master kickstarter cred helvetica next level.\nYolo literally cronut. Forage diy everyday fingerstache lomo. Health quinoa bitters authentic cleanse. Food truck ennui kickstarter street venmo crucifix.",
"html": null
}
},
"tags": [
{
"id": 8,
"name": "WTF?!",
"kind": "general"
},
{
"id": 9,
"name": "Lost and found",
"kind": "general"
}
]
}
]
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/topics.json")
response.status
# => 200
response.parsed
# => [{"id"=>1, "name"=>"Never tell me the odds!", "author"=>{"id"=>110, "login"=>"kki-adi2", "url"=>"https://api.intra.42.fr/v2/users/kki-adi2"}, "kind"=>"normal", "created_at"=>"2017-11-22T13:42:13.251Z", "updated_at"=>"2017-11-22T13:42:20.680Z", "pinned_at"=>nil, "locked_at"=>nil, "pinner"=>nil, "locker"=>nil, "language"=>{"id"=>2, "name"=>"English", "identifier"=>"en"}, "messages_url"=>"https://api.intra.42.fr/v2/topics/1/messages", "message"=>{"id"=>1, "content"=>{"markdown"=>"Five dollar toast freegan kickstarter. Blue bottle swag pitchfork cornhole schlitz. Fashion axe pbr&b austin. Ethical echo deep v. Fashion axe franzen twee organic vegan marfa authentic tilde.\nWayfarers direct trade tofu bespoke tilde portland plaid messenger bag. Jean shorts locavore tousled fanny pack freegan. Normcore gluten-free franzen plaid irony.\nSynth irony retro single-origin coffee squid meggings. Street trust fund disrupt iphone keffiyeh 90's lo-fi heirloom. Beard disrupt pitchfork. Craft beer vegan butcher keffiyeh mumblecore gentrify pickled tacos.", "html"=>nil}}, "survey"=>nil, "tags"=>[{"id"=>9, "name"=>"Lost and found", "kind"=>"general"}, {"id"=>8, "name"=>"WTF?!", "kind"=>"general"}]}, {"id"=>5, "name"=>"You will never find a more wretched hive of scum and villainy. We must be cautious.", "author"=>{"id"=>1, "login"=>"jeanne", "url"=>"https://api.intra.42.fr/v2/users/jeanne"}, "kind"=>"normal", "created_at"=>"2017-11-22T13:42:15.962Z", "updated_at"=>"2017-11-22T13:42:20.667Z", "pinned_at"=>nil, "locked_at"=>nil, "pinner"=>nil, "locker"=>nil, "language"=>{"id"=>3, "name"=>"Romanian", "identifier"=>"ro"}, "messages_url"=>"https://api.intra.42.fr/v2/topics/5/messages", "message"=>{"id"=>41, "content"=>{"markdown"=>"Fap stumptown waistcoat godard narwhal actually. Ramps thundercats hella trust fund lomo franzen. Pickled artisan kitsch banh mi cleanse church-key trust fund plaid.\nLo-fi yolo cronut tousled photo booth pitchfork readymade try-hard. Truffaut skateboard locavore street wayfarers banh mi. 8-bit celiac butcher. Slow-carb banjo ethical single-origin coffee.\nSelfies cardigan bespoke aesthetic. Listicle trust fund fap cliche locavore. Master shoreditch pabst cold-pressed helvetica microdosing echo humblebrag. Farm-to-table vegan salvia shabby chic chillwave pug forage. Quinoa venmo direct trade.", "html"=>nil}}, "survey"=>{"answers"=>[{"id"=>552, "name"=>"Maybe"}, {"id"=>553, "name"=>"Idk"}], "id"=>140, "name"=>"Yes or no ?"}, "tags"=>[{"id"=>7, "name"=>"Bocal", "kind"=>"general"}, {"id"=>8, "name"=>"WTF?!", "kind"=>"general"}]}, {"id"=>6, "name"=>"Aren't you a little short for a Stormtrooper?", "author"=>{"id"=>68, "login"=>"borvohut", "url"=>"https://api.intra.42.fr/v2/users/borvohut"}, "kind"=>"normal", "created_at"=>"2017-11-22T13:42:16.662Z", "updated_at"=>"2017-11-22T13:42:20.614Z", "pinned_at"=>nil, "locked_at"=>nil, "pinner"=>nil, "locker"=>nil, "language"=>{"id"=>1, "name"=>"Français", "identifier"=>"fr"}, "messages_url"=>"https://api.intra.42.fr/v2/topics/6/messages", "message"=>{"id"=>51, "content"=>{"markdown"=>"Hammock truffaut sustainable chia bespoke photo booth. Wolf kickstarter portland swag salvia etsy microdosing. Seitan literally raw denim. Keytar raw denim pop-up tousled heirloom thundercats gentrify sartorial.\nKeytar hella etsy lomo food truck shabby chic lumbersexual dreamcatcher. Salvia portland brunch skateboard 8-bit carry. Cornhole echo selvage migas kitsch kale chips pabst kickstarter. Ennui chambray whatever master kickstarter cred helvetica next level.\nYolo literally cronut. Forage diy everyday fingerstache lomo. Health quinoa bitters authentic cleanse. Food truck ennui kickstarter street venmo crucifix.", "html"=>nil}}, "tags"=>[{"id"=>8, "name"=>"WTF?!", "kind"=>"general"}, {"id"=>9, "name"=>"Lost and found", "kind"=>"general"}]}]