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": "2"
  }
}
201
{
  "id": 19,
  "topic_id": 2,
  "cursus_id": 2,
  "topic": {
    "id": 2,
    "name": "Wars not make one great.",
    "author": {
      "id": 28,
      "login": "nugunray",
      "url": "https://api.intra.42.fr/v2/users/nugunray"
    },
    "kind": "normal",
    "created_at": "2017-03-06T14:59:38.615Z",
    "updated_at": "2017-03-06T14:59:44.589Z",
    "pinned_at": null,
    "locked_at": null,
    "pinner": null,
    "locker": null,
    "language": {
      "id": 2,
      "name": "English",
      "identifier": "en",
      "created_at": "2017-03-06T14:58:43.172Z",
      "updated_at": "2017-03-06T14:58:43.172Z"
    },
    "messages_url": "https://api.intra.42.fr/v2/topics/2/messages",
    "message": {
      "id": 11,
      "content": {
        "markdown": "Kale chips sriracha occupy green juice artisan beard carry. Franzen food truck shabby chic selfies ethical everyday art party vegan. Fap church-key diy bushwick park ethical lumbersexual.\nFive dollar toast lo-fi swag. Bitters irony helvetica single-origin coffee direct trade twee tumblr. Art party meh small batch offal sustainable cred 3 wolf moon umami.\nKeffiyeh iphone pinterest cred normcore bespoke freegan. Lo-fi blog five dollar toast direct trade. Selfies tofu poutine distillery vegan normcore. Aesthetic cold-pressed pickled celiac organic echo tumblr paleo. Offal vegan roof pickled kitsch try-hard.",
        "html": null
      }
    }
  },
  "cursus": {
    "id": 2,
    "created_at": "2017-03-06T14:58:44.047Z",
    "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":"2"}}' "https://api.intra.42.fr/v2/cursus_topics"

{
  "id": 19,
  "topic_id": 2,
  "cursus_id": 2,
  "topic": {
    "id": 2,
    "name": "Wars not make one great.",
    "author": {
      "id": 28,
      "login": "nugunray",
      "url": "https://api.intra.42.fr/v2/users/nugunray"
    },
    "kind": "normal",
    "created_at": "2017-03-06T14:59:38.615Z",
    "updated_at": "2017-03-06T14:59:44.589Z",
    "pinned_at": null,
    "locked_at": null,
    "pinner": null,
    "locker": null,
    "language": {
      "id": 2,
      "name": "English",
      "identifier": "en",
      "created_at": "2017-03-06T14:58:43.172Z",
      "updated_at": "2017-03-06T14:58:43.172Z"
    },
    "messages_url": "https://api.intra.42.fr/v2/topics/2/messages",
    "message": {
      "id": 11,
      "content": {
        "markdown": "Kale chips sriracha occupy green juice artisan beard carry. Franzen food truck shabby chic selfies ethical everyday art party vegan. Fap church-key diy bushwick park ethical lumbersexual.\nFive dollar toast lo-fi swag. Bitters irony helvetica single-origin coffee direct trade twee tumblr. Art party meh small batch offal sustainable cred 3 wolf moon umami.\nKeffiyeh iphone pinterest cred normcore bespoke freegan. Lo-fi blog five dollar toast direct trade. Selfies tofu poutine distillery vegan normcore. Aesthetic cold-pressed pickled celiac organic echo tumblr paleo. Offal vegan roof pickled kitsch try-hard.",
        "html": null
      }
    }
  },
  "cursus": {
    "id": 2,
    "created_at": "2017-03-06T14:58:44.047Z",
    "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: "2"}}
response = token.post("/v2/cursus_topics", params: params)
response.status
# => 201
response.parsed
# => {"id"=>19, "topic_id"=>2, "cursus_id"=>2, "topic"=>{"id"=>2, "name"=>"Wars not make one great.", "author"=>{"id"=>28, "login"=>"nugunray", "url"=>"https://api.intra.42.fr/v2/users/nugunray"}, "kind"=>"normal", "created_at"=>"2017-03-06T14:59:38.615Z", "updated_at"=>"2017-03-06T14:59:44.589Z", "pinned_at"=>nil, "locked_at"=>nil, "pinner"=>nil, "locker"=>nil, "language"=>{"id"=>2, "name"=>"English", "identifier"=>"en", "created_at"=>"2017-03-06T14:58:43.172Z", "updated_at"=>"2017-03-06T14:58:43.172Z"}, "messages_url"=>"https://api.intra.42.fr/v2/topics/2/messages", "message"=>{"id"=>11, "content"=>{"markdown"=>"Kale chips sriracha occupy green juice artisan beard carry. Franzen food truck shabby chic selfies ethical everyday art party vegan. Fap church-key diy bushwick park ethical lumbersexual.\nFive dollar toast lo-fi swag. Bitters irony helvetica single-origin coffee direct trade twee tumblr. Art party meh small batch offal sustainable cred 3 wolf moon umami.\nKeffiyeh iphone pinterest cred normcore bespoke freegan. Lo-fi blog five dollar toast direct trade. Selfies tofu poutine distillery vegan normcore. Aesthetic cold-pressed pickled celiac organic echo tumblr paleo. Offal vegan roof pickled kitsch try-hard.", "html"=>nil}}}, "cursus"=>{"id"=>2, "created_at"=>"2017-03-06T14:58:44.047Z", "name"=>"42", "slug"=>"42"}}