live_help Notes

assignment This action requires one of theses roles: Advanced tutor
chrome_reader_mode This resource is paginated by 30 items

settings Params

Param name Description
sort optional . Must be one of: id, content, selector, created_at, updated_at, identifier, title, url, duration.

The sort field. Sorted by created_at asc by default.

Example:

To sort on flashes on the fields url on a descending order and duration on a ascending order:

...&sort=-url,duration

filter optional . Must be one of: id, content, selector, created_at, updated_at, identifier, title, url, duration.

Filtering on one or more fields

Example:

To filter on flashes with the id field matching a_value or another_value:

...&filter[id]=a_value,another_value

Filterable fields:
  • id (standard field)
  • content (standard field)
  • selector (standard field)
  • created_at (standard field)
  • updated_at (standard field)
  • identifier (standard field)
  • title (standard field)
  • url (standard field)
  • duration (standard field)
page optional . Must be a Hash

The pagination params, as a hash

page[number] optional . Must be Fixnum

The current page

page[size] optional . Must be Fixnum

The number of items per page, defaults to 30, maximum 100

GET /v2/flashes?page=1

[
  {
    "id": 24,
    "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": ""
  },
  {
    "id": 25,
    "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-84",
    "duration": 4320,
    "selector": ""
  },
  {
    "id": 26,
    "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-85",
    "duration": 4320,
    "selector": ""
  }
]
curl  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" "https://api.intra.42.fr/v2/flashes?page=1"

[
  {
    "id": 24,
    "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": ""
  },
  {
    "id": 25,
    "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-84",
    "duration": 4320,
    "selector": ""
  },
  {
    "id": 26,
    "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-85",
    "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?page=1")
response.status
# => 
response.parsed
# => [{"id"=>24, "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"=>""}, {"id"=>25, "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-84", "duration"=>4320, "selector"=>""}, {"id"=>26, "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-85", "duration"=>4320, "selector"=>""}]