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
flash_id optional . Must be String

The flash id

sort optional . Must be one of: id, user_id, flash_id, seen, created_at, updated_at, end_at.

The sort field. Sorted by created_at asc by default.

Example:

To sort on flash users on the fields updated_at on a descending order and end_at on a ascending order:

...&sort=-updated_at,end_at

filter optional . Must be one of: id, user_id, flash_id, seen, created_at, updated_at, end_at, end.

Filtering on one or more fields

Example:

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

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

Filterable fields:
  • id (standard field)
  • user_id (standard field)
  • flash_id (standard field)
  • seen (standard field)
  • created_at (standard field)
  • updated_at (standard field)
  • end_at (standard field)
  • end (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/flash_users?page=1

[
  {
    "id": 28,
    "flash_id": 2,
    "seen": true,
    "end_at": "2016-06-13T18:40:57.031Z",
    "user": {
      "id": 10292,
      "login": "mguilbau",
      "url": "http://localhost:13000/v2/users/mguilbau"
    }
  },
  {
    "id": 29,
    "flash_id": 2,
    "seen": true,
    "end_at": "2016-06-13T18:40:57.031Z",
    "user": {
      "id": 10316,
      "login": "spuyet",
      "url": "http://localhost:13000/v2/users/spuyet"
    }
  },
  {
    "id": 30,
    "flash_id": 2,
    "seen": true,
    "end_at": "2016-06-13T18:40:57.031Z",
    "user": {
      "id": 10317,
      "login": "evoisin",
      "url": "http://localhost:13000/v2/users/evoisin"
    }
  }
]
curl  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" "https://api.intra.42.fr/v2/flash_users?page=1"

[
  {
    "id": 28,
    "flash_id": 2,
    "seen": true,
    "end_at": "2016-06-13T18:40:57.031Z",
    "user": {
      "id": 10292,
      "login": "mguilbau",
      "url": "http://localhost:13000/v2/users/mguilbau"
    }
  },
  {
    "id": 29,
    "flash_id": 2,
    "seen": true,
    "end_at": "2016-06-13T18:40:57.031Z",
    "user": {
      "id": 10316,
      "login": "spuyet",
      "url": "http://localhost:13000/v2/users/spuyet"
    }
  },
  {
    "id": 30,
    "flash_id": 2,
    "seen": true,
    "end_at": "2016-06-13T18:40:57.031Z",
    "user": {
      "id": 10317,
      "login": "evoisin",
      "url": "http://localhost:13000/v2/users/evoisin"
    }
  }
]
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/flash_users?page=1")
response.status
# => 
response.parsed
# => [{"id"=>28, "flash_id"=>2, "seen"=>true, "end_at"=>"2016-06-13T18:40:57.031Z", "user"=>{"id"=>10292, "login"=>"mguilbau", "url"=>"http://localhost:13000/v2/users/mguilbau"}}, {"id"=>29, "flash_id"=>2, "seen"=>true, "end_at"=>"2016-06-13T18:40:57.031Z", "user"=>{"id"=>10316, "login"=>"spuyet", "url"=>"http://localhost:13000/v2/users/spuyet"}}, {"id"=>30, "flash_id"=>2, "seen"=>true, "end_at"=>"2016-06-13T18:40:57.031Z", "user"=>{"id"=>10317, "login"=>"evoisin", "url"=>"http://localhost:13000/v2/users/evoisin"}}]