GET /v2/flashes/:id
Get a flash
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 |
Examples
GET /v2/flashes/27
200
{
"id": 27,
"title": "Achievement unlocked !",
"content": "<div class='achievement-modal'>\n<img class='achievement-modal--image' src='https://admin.intrav2.42.fr/uploads/achievement/image/83/PED010.svg' alt='achievement logo'/>\n <div class='achievement-modal--content'>\n <h3 class='achievement-modal--title'>Serial examiner</h3>\n <p class='achievement-modal--desc'>Effectuer 10 soutenances en une journée en tant que correcteur.</p>\n</div>\n</div>\n",
"identifier": "achievement-83",
"duration": 4320,
"selector": ""
}
curl -H "Authorization: Bearer YOUR_ACCESS_TOKEN" "https://api.intra.42.fr/v2/flashes/27"
{
"id": 27,
"title": "Achievement unlocked !",
"content": "<div class='achievement-modal'>\n<img class='achievement-modal--image' src='https://admin.intrav2.42.fr/uploads/achievement/image/83/PED010.svg' alt='achievement logo'/>\n <div class='achievement-modal--content'>\n <h3 class='achievement-modal--title'>Serial examiner</h3>\n <p class='achievement-modal--desc'>Effectuer 10 soutenances en une journée en tant que correcteur.</p>\n</div>\n</div>\n",
"identifier": "achievement-83",
"duration": 4320,
"selector": ""
}
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/flashes/27")
response.status
# => 200
response.parsed
# => {"id"=>27, "title"=>"Achievement unlocked !", "content"=>"<div class='achievement-modal'>\n<img class='achievement-modal--image' src='https://admin.intrav2.42.fr/uploads/achievement/image/83/PED010.svg' alt='achievement logo'/>\n <div class='achievement-modal--content'>\n <h3 class='achievement-modal--title'>Serial examiner</h3>\n <p class='achievement-modal--desc'>Effectuer 10 soutenances en une journée en tant que correcteur.</p>\n</div>\n</div>\n", "identifier"=>"achievement-83", "duration"=>4320, "selector"=>""}