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.

Example:

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

Example:

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

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

Filterable fields:
  • id (standard field)
  • name (standard field)
  • author_id (standard field)
  • kind (standard field)
  • created_at (standard field)
  • updated_at (standard field)
  • pinned_at (standard field)
  • locked_at (standard field)
  • pinner_id (standard field)
  • locker_id (standard field)
  • language_id (standard field)
  • write_at (standard field)
  • message_id (standard field)
  • answer_id (standard field)
  • pinned (standard field)
  • locked (standard field)
  • write (standard field)
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

Example:

To range on topics with the answer_id field between min_value and max_value:

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

Rangeable fields:
  • 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
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/topics.json
200
[
  {
    "id": 6,
    "name": "Fear is the path to the dark side... fear leads to anger... anger leads to hate... hate leads to suffering.",
    "author": {
      "id": 48,
      "login": "dmaul",
      "url": "https://api.intra.42.fr/v2/users/dmaul"
    },
    "kind": "normal",
    "created_at": "2017-03-06T14:59:41.165Z",
    "updated_at": "2017-03-06T14:59:44.644Z",
    "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": "Portland echo irony. Scenester farm-to-table paleo. 3 wolf moon stumptown pickled skateboard bitters tacos next level tilde. Taxidermy pabst echo aesthetic.\nShoreditch pork belly put a bird on it bushwick offal beard. Williamsburg kickstarter marfa waistcoat food truck photo booth. Fingerstache tacos tousled humblebrag drinking. Umami wes anderson hashtag bicycle rights selfies echo freegan kale chips. Polaroid chartreuse fanny pack.\nPoutine heirloom deep v wayfarers green juice. Gastropub farm-to-table tousled ennui slow-carb aesthetic crucifix narwhal. Pour-over austin synth flexitarian wayfarers tattooed jean shorts.",
        "html": null
      }
    },
    "tags": [
      {
        "id": 9,
        "name": "Lost and found",
        "kind": "general"
      },
      {
        "id": 7,
        "name": "Bocal",
        "kind": "general"
      }
    ]
  },
  {
    "id": 1,
    "name": "Shut him up or shut him down.",
    "author": {
      "id": 20,
      "login": "pamidala",
      "url": "https://api.intra.42.fr/v2/users/pamidala"
    },
    "kind": "normal",
    "created_at": "2017-03-06T14:59:37.752Z",
    "updated_at": "2017-03-06T14:59:44.626Z",
    "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/1/messages",
    "message": {
      "id": 1,
      "content": {
        "markdown": "Cliche seitan hella post-ironic chicharrones everyday chia health. Wolf intelligentsia vice polaroid carry. Sustainable chillwave asymmetrical church-key pour-over letterpress.\nEthical tacos leggings vegan sriracha. Helvetica kogi master chillwave forage kinfolk williamsburg. Bushwick kinfolk bitters echo crucifix salvia. Kickstarter semiotics park cold-pressed. Cornhole stumptown pitchfork hammock tousled chambray meggings twee.\nVegan typewriter marfa helvetica portland. Squid ethical neutra cold-pressed tumblr. Everyday vice umami. Shabby chic vice chartreuse keffiyeh umami migas pop-up. Sriracha lomo cred 90's typewriter selvage fanny pack.",
        "html": null
      }
    },
    "tags": [
      {
        "id": 13,
        "name": "Ordinary Wizarding Levels",
        "kind": "general"
      },
      {
        "id": 7,
        "name": "Bocal",
        "kind": "general"
      }
    ]
  },
  {
    "id": 7,
    "name": "You will never find a more wretched hive of scum and villainy. We must be cautious.",
    "author": {
      "id": 42,
      "login": "padamida",
      "url": "https://api.intra.42.fr/v2/users/padamida"
    },
    "kind": "normal",
    "created_at": "2017-03-06T14:59:41.830Z",
    "updated_at": "2017-03-06T14:59:44.608Z",
    "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/7/messages",
    "message": {
      "id": 61,
      "content": {
        "markdown": "Distillery mumblecore carry single-origin coffee tilde church-key shoreditch. Health park butcher gentrify tattooed ramps pug. Post-ironic try-hard flannel tote bag pour-over iphone organic freegan.\nOffal irony readymade thundercats stumptown. Vegan everyday cray mixtape. Drinking intelligentsia echo kinfolk bespoke sartorial disrupt raw denim.\nHella lumbersexual wes anderson typewriter stumptown. Cliche leggings craft beer kinfolk salvia put a bird on it pitchfork marfa. Heirloom before they sold out sartorial godard wolf truffaut street. Pinterest gentrify loko sustainable church-key. Truffaut fingerstache beard.",
        "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": 6,
    "name": "Fear is the path to the dark side... fear leads to anger... anger leads to hate... hate leads to suffering.",
    "author": {
      "id": 48,
      "login": "dmaul",
      "url": "https://api.intra.42.fr/v2/users/dmaul"
    },
    "kind": "normal",
    "created_at": "2017-03-06T14:59:41.165Z",
    "updated_at": "2017-03-06T14:59:44.644Z",
    "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": "Portland echo irony. Scenester farm-to-table paleo. 3 wolf moon stumptown pickled skateboard bitters tacos next level tilde. Taxidermy pabst echo aesthetic.\nShoreditch pork belly put a bird on it bushwick offal beard. Williamsburg kickstarter marfa waistcoat food truck photo booth. Fingerstache tacos tousled humblebrag drinking. Umami wes anderson hashtag bicycle rights selfies echo freegan kale chips. Polaroid chartreuse fanny pack.\nPoutine heirloom deep v wayfarers green juice. Gastropub farm-to-table tousled ennui slow-carb aesthetic crucifix narwhal. Pour-over austin synth flexitarian wayfarers tattooed jean shorts.",
        "html": null
      }
    },
    "tags": [
      {
        "id": 9,
        "name": "Lost and found",
        "kind": "general"
      },
      {
        "id": 7,
        "name": "Bocal",
        "kind": "general"
      }
    ]
  },
  {
    "id": 1,
    "name": "Shut him up or shut him down.",
    "author": {
      "id": 20,
      "login": "pamidala",
      "url": "https://api.intra.42.fr/v2/users/pamidala"
    },
    "kind": "normal",
    "created_at": "2017-03-06T14:59:37.752Z",
    "updated_at": "2017-03-06T14:59:44.626Z",
    "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/1/messages",
    "message": {
      "id": 1,
      "content": {
        "markdown": "Cliche seitan hella post-ironic chicharrones everyday chia health. Wolf intelligentsia vice polaroid carry. Sustainable chillwave asymmetrical church-key pour-over letterpress.\nEthical tacos leggings vegan sriracha. Helvetica kogi master chillwave forage kinfolk williamsburg. Bushwick kinfolk bitters echo crucifix salvia. Kickstarter semiotics park cold-pressed. Cornhole stumptown pitchfork hammock tousled chambray meggings twee.\nVegan typewriter marfa helvetica portland. Squid ethical neutra cold-pressed tumblr. Everyday vice umami. Shabby chic vice chartreuse keffiyeh umami migas pop-up. Sriracha lomo cred 90's typewriter selvage fanny pack.",
        "html": null
      }
    },
    "tags": [
      {
        "id": 13,
        "name": "Ordinary Wizarding Levels",
        "kind": "general"
      },
      {
        "id": 7,
        "name": "Bocal",
        "kind": "general"
      }
    ]
  },
  {
    "id": 7,
    "name": "You will never find a more wretched hive of scum and villainy. We must be cautious.",
    "author": {
      "id": 42,
      "login": "padamida",
      "url": "https://api.intra.42.fr/v2/users/padamida"
    },
    "kind": "normal",
    "created_at": "2017-03-06T14:59:41.830Z",
    "updated_at": "2017-03-06T14:59:44.608Z",
    "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/7/messages",
    "message": {
      "id": 61,
      "content": {
        "markdown": "Distillery mumblecore carry single-origin coffee tilde church-key shoreditch. Health park butcher gentrify tattooed ramps pug. Post-ironic try-hard flannel tote bag pour-over iphone organic freegan.\nOffal irony readymade thundercats stumptown. Vegan everyday cray mixtape. Drinking intelligentsia echo kinfolk bespoke sartorial disrupt raw denim.\nHella lumbersexual wes anderson typewriter stumptown. Cliche leggings craft beer kinfolk salvia put a bird on it pitchfork marfa. Heirloom before they sold out sartorial godard wolf truffaut street. Pinterest gentrify loko sustainable church-key. Truffaut fingerstache beard.",
        "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"=>6, "name"=>"Fear is the path to the dark side... fear leads to anger... anger leads to hate... hate leads to suffering.", "author"=>{"id"=>48, "login"=>"dmaul", "url"=>"https://api.intra.42.fr/v2/users/dmaul"}, "kind"=>"normal", "created_at"=>"2017-03-06T14:59:41.165Z", "updated_at"=>"2017-03-06T14:59:44.644Z", "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"=>"Portland echo irony. Scenester farm-to-table paleo. 3 wolf moon stumptown pickled skateboard bitters tacos next level tilde. Taxidermy pabst echo aesthetic.\nShoreditch pork belly put a bird on it bushwick offal beard. Williamsburg kickstarter marfa waistcoat food truck photo booth. Fingerstache tacos tousled humblebrag drinking. Umami wes anderson hashtag bicycle rights selfies echo freegan kale chips. Polaroid chartreuse fanny pack.\nPoutine heirloom deep v wayfarers green juice. Gastropub farm-to-table tousled ennui slow-carb aesthetic crucifix narwhal. Pour-over austin synth flexitarian wayfarers tattooed jean shorts.", "html"=>nil}}, "tags"=>[{"id"=>9, "name"=>"Lost and found", "kind"=>"general"}, {"id"=>7, "name"=>"Bocal", "kind"=>"general"}]}, {"id"=>1, "name"=>"Shut him up or shut him down.", "author"=>{"id"=>20, "login"=>"pamidala", "url"=>"https://api.intra.42.fr/v2/users/pamidala"}, "kind"=>"normal", "created_at"=>"2017-03-06T14:59:37.752Z", "updated_at"=>"2017-03-06T14:59:44.626Z", "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/1/messages", "message"=>{"id"=>1, "content"=>{"markdown"=>"Cliche seitan hella post-ironic chicharrones everyday chia health. Wolf intelligentsia vice polaroid carry. Sustainable chillwave asymmetrical church-key pour-over letterpress.\nEthical tacos leggings vegan sriracha. Helvetica kogi master chillwave forage kinfolk williamsburg. Bushwick kinfolk bitters echo crucifix salvia. Kickstarter semiotics park cold-pressed. Cornhole stumptown pitchfork hammock tousled chambray meggings twee.\nVegan typewriter marfa helvetica portland. Squid ethical neutra cold-pressed tumblr. Everyday vice umami. Shabby chic vice chartreuse keffiyeh umami migas pop-up. Sriracha lomo cred 90's typewriter selvage fanny pack.", "html"=>nil}}, "tags"=>[{"id"=>13, "name"=>"Ordinary Wizarding Levels", "kind"=>"general"}, {"id"=>7, "name"=>"Bocal", "kind"=>"general"}]}, {"id"=>7, "name"=>"You will never find a more wretched hive of scum and villainy. We must be cautious.", "author"=>{"id"=>42, "login"=>"padamida", "url"=>"https://api.intra.42.fr/v2/users/padamida"}, "kind"=>"normal", "created_at"=>"2017-03-06T14:59:41.830Z", "updated_at"=>"2017-03-06T14:59:44.608Z", "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/7/messages", "message"=>{"id"=>61, "content"=>{"markdown"=>"Distillery mumblecore carry single-origin coffee tilde church-key shoreditch. Health park butcher gentrify tattooed ramps pug. Post-ironic try-hard flannel tote bag pour-over iphone organic freegan.\nOffal irony readymade thundercats stumptown. Vegan everyday cray mixtape. Drinking intelligentsia echo kinfolk bespoke sartorial disrupt raw denim.\nHella lumbersexual wes anderson typewriter stumptown. Cliche leggings craft beer kinfolk salvia put a bird on it pitchfork marfa. Heirloom before they sold out sartorial godard wolf truffaut street. Pinterest gentrify loko sustainable church-key. Truffaut fingerstache beard.", "html"=>nil}}, "tags"=>[{"id"=>8, "name"=>"WTF?!", "kind"=>"general"}, {"id"=>9, "name"=>"Lost and found", "kind"=>"general"}]}]