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 .

settings Params

Param name Description
id required . Must be String

The requested id

topic optional , nil allowed . Must be a Hash
topic[name] optional . Must be String

The name.

topic[kind] optional . Must be one of: normal, survey, stack_overflow.

The kind.

topic[language_id] optional . Must be Fixnum

The language id.

topic[author_id] optional , nil allowed . Must be Fixnum

The author id.

topic[messages_attributes] optional , nil allowed . Must be an Array of nested elements

The messages attributes.

topic[messages_attributes][content] optional . Must be String

The content.

topic[messages_attributes][id] optional , nil allowed . Must be Fixnum

The id.

topic[messages_attributes][author_id] optional . Must be Fixnum

The author id.

topic[tag_ids] optional , nil allowed . Must be an array of Integer

The tag ids.

topic[cursus_ids] optional , nil allowed . Must be an array of Integer

The cursus ids.

topic[survey_attributes] optional , nil allowed . Must be an Array of nested elements

The survey attributes.

topic[survey_attributes][name] optional . Must be String

The name.

topic[survey_attributes][expire_at] optional , nil allowed . Must be DateTime

The expire at.

topic[survey_attributes][id] optional , nil allowed . Must be Fixnum

The id.

topic[survey_attributes][_destroy] optional , nil allowed . Must be String

The destroy.

topic[survey_attributes][survey_answers_attributes] optional , nil allowed . Must be an Array of nested elements

The survey answers attributes.

topic[survey_attributes][survey_answers_attributes][name] optional . Must be String

The name.

topic[survey_attributes][survey_answers_attributes][id] optional , nil allowed . Must be Fixnum

The id.

topic[survey_attributes][survey_answers_attributes][_destroy] optional , nil allowed . Must be String

The destroy.

comments powered by <span class='logo-disqus'>Disqus</span>
PUT /v2/topics/6.json
{
  "topic": {
    "name": "The daily unicorn #837 🦄"
  }
}
204
curl  -X PUT -H "Authorization: Bearer YOUR_ACCESS_TOKEN" -H "Content-Type: application/json" -d '{"topic":{"name":"The daily unicorn #837 🦄"}}' "https://api.intra.42.fr/v2/topics/6.json"
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 = {topic: {name: "The daily unicorn #837 🦄"}}
response = token.put("/v2/topics/6.json", params: params)
response.status
# => 204
response.parsed
# =>