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": "Adventure. Excitement. A Jedi craves not these things.",
  "author": {
    "id": 49,
    "login": "podamero",
    "url": "https://api.intra.42.fr/v2/users/podamero"
  },
  "kind": "normal",
  "created_at": "2017-03-06T14:59:43.686Z",
  "updated_at": "2017-03-06T14:59:44.569Z",
  "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/10/messages",
  "message": {
    "id": 91,
    "content": {
      "markdown": "You probably haven't heard of them ugh lo-fi selfies tofu diy hoodie yolo. Neutra vice brunch scenester sartorial authentic jean shorts. Plaid selvage goth aesthetic echo poutine irony yuccie.\nKnausgaard disrupt irony listicle messenger bag. Cliche raw denim freegan street wes anderson distillery hammock. Taxidermy salvia pork belly cronut. Taxidermy banh mi paleo. Church-key cliche seitan flexitarian tousled green juice wolf.\nMessenger bag neutra pabst schlitz godard irony. Squid roof fanny pack wes anderson. Swag vinyl organic waistcoat. Crucifix banh mi put a bird on it plaid. Lumbersexual tote bag blue bottle food truck selfies ramps.",
      "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/10.json"

{
  "id": 10,
  "name": "Adventure. Excitement. A Jedi craves not these things.",
  "author": {
    "id": 49,
    "login": "podamero",
    "url": "https://api.intra.42.fr/v2/users/podamero"
  },
  "kind": "normal",
  "created_at": "2017-03-06T14:59:43.686Z",
  "updated_at": "2017-03-06T14:59:44.569Z",
  "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/10/messages",
  "message": {
    "id": 91,
    "content": {
      "markdown": "You probably haven't heard of them ugh lo-fi selfies tofu diy hoodie yolo. Neutra vice brunch scenester sartorial authentic jean shorts. Plaid selvage goth aesthetic echo poutine irony yuccie.\nKnausgaard disrupt irony listicle messenger bag. Cliche raw denim freegan street wes anderson distillery hammock. Taxidermy salvia pork belly cronut. Taxidermy banh mi paleo. Church-key cliche seitan flexitarian tousled green juice wolf.\nMessenger bag neutra pabst schlitz godard irony. Squid roof fanny pack wes anderson. Swag vinyl organic waistcoat. Crucifix banh mi put a bird on it plaid. Lumbersexual tote bag blue bottle food truck selfies ramps.",
      "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/10.json")
response.status
# => 200
response.parsed
# => {"id"=>10, "name"=>"Adventure. Excitement. A Jedi craves not these things.", "author"=>{"id"=>49, "login"=>"podamero", "url"=>"https://api.intra.42.fr/v2/users/podamero"}, "kind"=>"normal", "created_at"=>"2017-03-06T14:59:43.686Z", "updated_at"=>"2017-03-06T14:59:44.569Z", "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/10/messages", "message"=>{"id"=>91, "content"=>{"markdown"=>"You probably haven't heard of them ugh lo-fi selfies tofu diy hoodie yolo. Neutra vice brunch scenester sartorial authentic jean shorts. Plaid selvage goth aesthetic echo poutine irony yuccie.\nKnausgaard disrupt irony listicle messenger bag. Cliche raw denim freegan street wes anderson distillery hammock. Taxidermy salvia pork belly cronut. Taxidermy banh mi paleo. Church-key cliche seitan flexitarian tousled green juice wolf.\nMessenger bag neutra pabst schlitz godard irony. Squid roof fanny pack wes anderson. Swag vinyl organic waistcoat. Crucifix banh mi put a bird on it plaid. Lumbersexual tote bag blue bottle food truck selfies ramps.", "html"=>nil}}, "tags"=>[{"id"=>8, "name"=>"WTF?!", "kind"=>"general"}, {"id"=>9, "name"=>"Lost and found", "kind"=>"general"}]}