live_help Notes

assignment This action requires one of theses roles: Advanced tutor

settings Params

Param name Description
id required . Must be String

The requested id

announcement optional , nil allowed . Must be a Hash
announcement[cursus_ids] optional , nil allowed . Must be an array of Integer

The cursus ids.

announcement[campus_ids] optional , nil allowed . Must be an array of Integer

The campus ids.

announcement[author] optional . Must be String

The author.

announcement[title] optional . Must be String

The title.

announcement[text] optional . Must be String

The text.

announcement[kind] optional , nil allowed . Must be String

The kind.

announcement[expire_at] optional . Must be DateTime

The expire at.

announcement[image] optional , nil allowed . Must be String

The image.

comments powered by <span class='logo-disqus'>Disqus</span>
PUT /v2/announcements/4
{
  "announcement": {
    "author": "42partnerships",
    "campus_ids": [
      "1"
    ],
    "cursus_ids": [
      "1"
    ],
    "expire_at": "2017-11-22 14:13:10 UTC",
    "kind": "global",
    "text": "42partnerships revient",
    "title": "Partenariats écoles 2016"
  }
}
204
curl  -X PUT -H "Authorization: Bearer YOUR_ACCESS_TOKEN" -H "Content-Type: application/json" -d '{"announcement":{"author":"42partnerships","campus_ids":["1"],"cursus_ids":["1"],"expire_at":"2017-11-22 14:13:10 UTC","kind":"global","text":"42partnerships revient","title":"Partenariats écoles 2016"}}' "https://api.intra.42.fr/v2/announcements/4"
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 = {announcement: {author: "42partnerships", campus_ids: ["1"], cursus_ids: ["1"], expire_at: "2017-11-22 14:13:10 UTC", kind: "global", text: "42partnerships revient", title: "Partenariats écoles 2016"}}
response = token.put("/v2/announcements/4", params: params)
response.status
# => 204
response.parsed
# =>