settings Params

Param name Description
id required . Must be String

The requested id

comments powered by <span class='logo-disqus'>Disqus</span>
GET /v2/topics/6.json
200
{
  "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/6.json"

{
  "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/6.json")
response.status
# => 200
response.parsed
# => {"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"}]}