live_help Notes

assignment_ind This action requires a token resource owner scoped on forum with enough privileges or an application with one of theses role(s): Basic staff, Community manager .

settings Params

Param name Description
cursus_topic optional , nil allowed . Must be a Hash
cursus_topic[cursus_id] required . Must be Fixnum

The cursus id.

cursus_topic[topic_id] required . Must be Fixnum

The topic id. Must be unique in the scope of a given cursus.

comments powered by <span class='logo-disqus'>Disqus</span>
POST /v2/cursus_topics
{
  "cursus_topic": {
    "cursus_id": "2",
    "topic_id": "4"
  }
}
201
{
  "id": 11,
  "topic_id": 4,
  "cursus_id": 2,
  "topic": {
    "id": 4,
    "name": "Wars not make one great.",
    "author": {
      "id": 28,
      "login": "wwatto",
      "url": "https://api.intra.42.fr/v2/users/wwatto"
    },
    "kind": "normal",
    "created_at": "2017-11-22T13:42:15.308Z",
    "updated_at": "2017-11-22T13:42:20.471Z",
    "pinned_at": null,
    "locked_at": null,
    "pinner": null,
    "locker": null,
    "language": {
      "id": 2,
      "name": "English",
      "identifier": "en",
      "created_at": "2017-11-22T13:40:59.465Z",
      "updated_at": "2017-11-22T13:40:59.465Z"
    },
    "messages_url": "https://api.intra.42.fr/v2/topics/4/messages",
    "message": {
      "id": 31,
      "content": {
        "markdown": "Schlitz quinoa pbr&b truffaut. Pug meditation biodiesel lomo slow-carb etsy dreamcatcher. Banjo trust fund cronut messenger bag. Blog freegan selvage food truck pitchfork messenger bag cleanse.\nBushwick seitan brooklyn. Lo-fi food truck yr thundercats deep v kinfolk. Chambray letterpress sartorial. Pug diy pbr&b. Salvia offal cronut brooklyn.\nLiterally 90's leggings pabst fingerstache vice irony. Tattooed fingerstache chia. Vinyl craft beer tote bag put a bird on it squid truffaut.",
        "html": null
      }
    }
  },
  "cursus": {
    "id": 2,
    "created_at": "2017-11-22T13:41:00.825Z",
    "name": "42",
    "slug": "42"
  }
}
curl  -X POST -H "Authorization: Bearer YOUR_ACCESS_TOKEN" -H "Content-Type: application/json" -d '{"cursus_topic":{"cursus_id":"2","topic_id":"4"}}' "https://api.intra.42.fr/v2/cursus_topics"

{
  "id": 11,
  "topic_id": 4,
  "cursus_id": 2,
  "topic": {
    "id": 4,
    "name": "Wars not make one great.",
    "author": {
      "id": 28,
      "login": "wwatto",
      "url": "https://api.intra.42.fr/v2/users/wwatto"
    },
    "kind": "normal",
    "created_at": "2017-11-22T13:42:15.308Z",
    "updated_at": "2017-11-22T13:42:20.471Z",
    "pinned_at": null,
    "locked_at": null,
    "pinner": null,
    "locker": null,
    "language": {
      "id": 2,
      "name": "English",
      "identifier": "en",
      "created_at": "2017-11-22T13:40:59.465Z",
      "updated_at": "2017-11-22T13:40:59.465Z"
    },
    "messages_url": "https://api.intra.42.fr/v2/topics/4/messages",
    "message": {
      "id": 31,
      "content": {
        "markdown": "Schlitz quinoa pbr&b truffaut. Pug meditation biodiesel lomo slow-carb etsy dreamcatcher. Banjo trust fund cronut messenger bag. Blog freegan selvage food truck pitchfork messenger bag cleanse.\nBushwick seitan brooklyn. Lo-fi food truck yr thundercats deep v kinfolk. Chambray letterpress sartorial. Pug diy pbr&b. Salvia offal cronut brooklyn.\nLiterally 90's leggings pabst fingerstache vice irony. Tattooed fingerstache chia. Vinyl craft beer tote bag put a bird on it squid truffaut.",
        "html": null
      }
    }
  },
  "cursus": {
    "id": 2,
    "created_at": "2017-11-22T13:41:00.825Z",
    "name": "42",
    "slug": "42"
  }
}
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

params = {cursus_topic: {cursus_id: "2", topic_id: "4"}}
response = token.post("/v2/cursus_topics", params: params)
response.status
# => 201
response.parsed
# => {"id"=>11, "topic_id"=>4, "cursus_id"=>2, "topic"=>{"id"=>4, "name"=>"Wars not make one great.", "author"=>{"id"=>28, "login"=>"wwatto", "url"=>"https://api.intra.42.fr/v2/users/wwatto"}, "kind"=>"normal", "created_at"=>"2017-11-22T13:42:15.308Z", "updated_at"=>"2017-11-22T13:42:20.471Z", "pinned_at"=>nil, "locked_at"=>nil, "pinner"=>nil, "locker"=>nil, "language"=>{"id"=>2, "name"=>"English", "identifier"=>"en", "created_at"=>"2017-11-22T13:40:59.465Z", "updated_at"=>"2017-11-22T13:40:59.465Z"}, "messages_url"=>"https://api.intra.42.fr/v2/topics/4/messages", "message"=>{"id"=>31, "content"=>{"markdown"=>"Schlitz quinoa pbr&b truffaut. Pug meditation biodiesel lomo slow-carb etsy dreamcatcher. Banjo trust fund cronut messenger bag. Blog freegan selvage food truck pitchfork messenger bag cleanse.\nBushwick seitan brooklyn. Lo-fi food truck yr thundercats deep v kinfolk. Chambray letterpress sartorial. Pug diy pbr&b. Salvia offal cronut brooklyn.\nLiterally 90's leggings pabst fingerstache vice irony. Tattooed fingerstache chia. Vinyl craft beer tote bag put a bird on it squid truffaut.", "html"=>nil}}}, "cursus"=>{"id"=>2, "created_at"=>"2017-11-22T13:41:00.825Z", "name"=>"42", "slug"=>"42"}}