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/10.json
200
{
  "id": 10,
  "name": "That is why you fail.",
  "author": {
    "id": 27,
    "login": "ki-aki-a",
    "url": "https://api.intra.42.fr/v2/users/ki-aki-a"
  },
  "kind": "normal",
  "created_at": "2017-11-21T17:09:55.480Z",
  "updated_at": "2017-11-21T17:09:56.349Z",
  "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/10/messages",
  "message": {
    "id": 91,
    "content": {
      "markdown": "Tofu yr venmo meh knausgaard pop-up tousled. Trust fund mustache fixie twee fap. Skateboard try-hard franzen deep v. +1 humblebrag 8-bit occupy gluten-free tousled cronut. Pickled vhs banjo plaid bushwick neutra cold-pressed.\nWilliamsburg kickstarter kinfolk microdosing flexitarian swag. Letterpress blog 8-bit iphone offal listicle pug biodiesel. Trust fund listicle diy tote bag artisan.\nVinegar keytar everyday cred viral vinyl brooklyn goth. Shabby chic readymade try-hard dreamcatcher locavore bitters tofu. Biodiesel mlkshk ethical waistcoat drinking.",
      "html": null
    }
  },
  "tags": [
    {
      "id": 7,
      "name": "Bocal",
      "kind": "general"
    },
    {
      "id": 8,
      "name": "WTF?!",
      "kind": "general"
    }
  ]
}
curl  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" "https://api.intra.42.fr/v2/topics/10.json"

{
  "id": 10,
  "name": "That is why you fail.",
  "author": {
    "id": 27,
    "login": "ki-aki-a",
    "url": "https://api.intra.42.fr/v2/users/ki-aki-a"
  },
  "kind": "normal",
  "created_at": "2017-11-21T17:09:55.480Z",
  "updated_at": "2017-11-21T17:09:56.349Z",
  "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/10/messages",
  "message": {
    "id": 91,
    "content": {
      "markdown": "Tofu yr venmo meh knausgaard pop-up tousled. Trust fund mustache fixie twee fap. Skateboard try-hard franzen deep v. +1 humblebrag 8-bit occupy gluten-free tousled cronut. Pickled vhs banjo plaid bushwick neutra cold-pressed.\nWilliamsburg kickstarter kinfolk microdosing flexitarian swag. Letterpress blog 8-bit iphone offal listicle pug biodiesel. Trust fund listicle diy tote bag artisan.\nVinegar keytar everyday cred viral vinyl brooklyn goth. Shabby chic readymade try-hard dreamcatcher locavore bitters tofu. Biodiesel mlkshk ethical waistcoat drinking.",
      "html": null
    }
  },
  "tags": [
    {
      "id": 7,
      "name": "Bocal",
      "kind": "general"
    },
    {
      "id": 8,
      "name": "WTF?!",
      "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/10.json")
response.status
# => 200
response.parsed
# => {"id"=>10, "name"=>"That is why you fail.", "author"=>{"id"=>27, "login"=>"ki-aki-a", "url"=>"https://api.intra.42.fr/v2/users/ki-aki-a"}, "kind"=>"normal", "created_at"=>"2017-11-21T17:09:55.480Z", "updated_at"=>"2017-11-21T17:09:56.349Z", "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/10/messages", "message"=>{"id"=>91, "content"=>{"markdown"=>"Tofu yr venmo meh knausgaard pop-up tousled. Trust fund mustache fixie twee fap. Skateboard try-hard franzen deep v. +1 humblebrag 8-bit occupy gluten-free tousled cronut. Pickled vhs banjo plaid bushwick neutra cold-pressed.\nWilliamsburg kickstarter kinfolk microdosing flexitarian swag. Letterpress blog 8-bit iphone offal listicle pug biodiesel. Trust fund listicle diy tote bag artisan.\nVinegar keytar everyday cred viral vinyl brooklyn goth. Shabby chic readymade try-hard dreamcatcher locavore bitters tofu. Biodiesel mlkshk ethical waistcoat drinking.", "html"=>nil}}, "tags"=>[{"id"=>7, "name"=>"Bocal", "kind"=>"general"}, {"id"=>8, "name"=>"WTF?!", "kind"=>"general"}]}