live_help Notes

chrome_reader_mode This resource is paginated by 30 items

settings Params

Param name Description
cursus_id optional . Must be String

The cursus id or slug

campus_id optional . Must be String

The campus id or slug

user_id optional . Must be String

The user id or slug

sort optional . Must be one of: id, begin_at, end_at, name, description, location, kind, max_people, created_at, updated_at, prohibition_of_cancellation.

The sort field. Sorted by begin_at desc by default.

Example:

To sort on events on the fields updated_at on a descending order and prohibition_of_cancellation on a ascending order:

...&sort=-updated_at,prohibition_of_cancellation

filter optional . Must be one of: id, begin_at, end_at, name, description, location, kind, max_people, created_at, updated_at, prohibition_of_cancellation, future, end.

Filtering on one or more fields

Example:

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

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

Filterable fields:
  • id (standard field)
  • begin_at (standard field)
  • end_at (standard field)
  • name (standard field)
  • description (standard field)
  • location (standard field)
  • kind (standard field)
  • max_people (standard field)
  • created_at (standard field)
  • updated_at (standard field)
  • prohibition_of_cancellation (standard field)
  • future : Return only events which begins in the future. Can be one of: true, false
  • end (standard field)
range optional . Must be one of: id, begin_at, end_at, name, description, location, kind, max_people, created_at, updated_at, prohibition_of_cancellation.

Select on a particular range

Example:

To range on events with the prohibition_of_cancellation field between min_value and max_value:

...&range[prohibition_of_cancellation]=min_value,max_value

Rangeable fields:
  • id
  • begin_at
  • end_at
  • name
  • description
  • location
  • kind
  • max_people
  • created_at
  • updated_at
  • prohibition_of_cancellation
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

comments powered by <span class='logo-disqus'>Disqus</span>
GET /v2/events
200
[
  {
    "id": 4,
    "name": "Connecticut oxen",
    "description": "Bitters keytar twee aperiam ipsam omnis. Tofu keffiyeh chartreuse excepturi.",
    "location": "Southern Wisoky College",
    "kind": "extern",
    "max_people": 75,
    "nbr_subscribers": 0,
    "begin_at": "2017-03-09T14:59:35.165Z",
    "end_at": "2017-03-09T16:59:35.165Z",
    "campus_ids": [
      6
    ],
    "cursus_ids": [
      1
    ],
    "created_at": "2017-03-06T14:59:35.186Z",
    "updated_at": "2017-03-06T14:59:35.209Z"
  },
  {
    "id": 3,
    "name": "Kentucky monkeys",
    "description": "Tempora qui tenetur ut pbr&b. Ipsa eum quis.",
    "location": "South Torphy",
    "kind": "hackathon",
    "max_people": 39,
    "nbr_subscribers": 0,
    "begin_at": "2017-03-08T14:59:35.114Z",
    "end_at": "2017-03-08T16:59:35.115Z",
    "campus_ids": [
      3
    ],
    "cursus_ids": [
      1
    ],
    "created_at": "2017-03-06T14:59:35.134Z",
    "updated_at": "2017-03-06T14:59:35.157Z"
  },
  {
    "id": 2,
    "name": "Virginia dwarves",
    "description": "Facilis twee ut bespoke. Banh mi whatever schlitz ramps. Pickled at disrupt totam. Repellat neutra cupiditate photo booth.",
    "location": "Western Marquardt Academy",
    "kind": "rush",
    "max_people": 16,
    "nbr_subscribers": 0,
    "begin_at": "2017-03-07T14:59:35.063Z",
    "end_at": "2017-03-07T16:59:35.063Z",
    "campus_ids": [
      3
    ],
    "cursus_ids": [
      2
    ],
    "created_at": "2017-03-06T14:59:35.083Z",
    "updated_at": "2017-03-06T14:59:35.106Z"
  }
]
curl  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" "https://api.intra.42.fr/v2/events"

[
  {
    "id": 4,
    "name": "Connecticut oxen",
    "description": "Bitters keytar twee aperiam ipsam omnis. Tofu keffiyeh chartreuse excepturi.",
    "location": "Southern Wisoky College",
    "kind": "extern",
    "max_people": 75,
    "nbr_subscribers": 0,
    "begin_at": "2017-03-09T14:59:35.165Z",
    "end_at": "2017-03-09T16:59:35.165Z",
    "campus_ids": [
      6
    ],
    "cursus_ids": [
      1
    ],
    "created_at": "2017-03-06T14:59:35.186Z",
    "updated_at": "2017-03-06T14:59:35.209Z"
  },
  {
    "id": 3,
    "name": "Kentucky monkeys",
    "description": "Tempora qui tenetur ut pbr&b. Ipsa eum quis.",
    "location": "South Torphy",
    "kind": "hackathon",
    "max_people": 39,
    "nbr_subscribers": 0,
    "begin_at": "2017-03-08T14:59:35.114Z",
    "end_at": "2017-03-08T16:59:35.115Z",
    "campus_ids": [
      3
    ],
    "cursus_ids": [
      1
    ],
    "created_at": "2017-03-06T14:59:35.134Z",
    "updated_at": "2017-03-06T14:59:35.157Z"
  },
  {
    "id": 2,
    "name": "Virginia dwarves",
    "description": "Facilis twee ut bespoke. Banh mi whatever schlitz ramps. Pickled at disrupt totam. Repellat neutra cupiditate photo booth.",
    "location": "Western Marquardt Academy",
    "kind": "rush",
    "max_people": 16,
    "nbr_subscribers": 0,
    "begin_at": "2017-03-07T14:59:35.063Z",
    "end_at": "2017-03-07T16:59:35.063Z",
    "campus_ids": [
      3
    ],
    "cursus_ids": [
      2
    ],
    "created_at": "2017-03-06T14:59:35.083Z",
    "updated_at": "2017-03-06T14:59:35.106Z"
  }
]
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/events")
response.status
# => 200
response.parsed
# => [{"id"=>4, "name"=>"Connecticut oxen", "description"=>"Bitters keytar twee aperiam ipsam omnis. Tofu keffiyeh chartreuse excepturi.", "location"=>"Southern Wisoky College", "kind"=>"extern", "max_people"=>75, "nbr_subscribers"=>0, "begin_at"=>"2017-03-09T14:59:35.165Z", "end_at"=>"2017-03-09T16:59:35.165Z", "campus_ids"=>[6], "cursus_ids"=>[1], "created_at"=>"2017-03-06T14:59:35.186Z", "updated_at"=>"2017-03-06T14:59:35.209Z"}, {"id"=>3, "name"=>"Kentucky monkeys", "description"=>"Tempora qui tenetur ut pbr&b. Ipsa eum quis.", "location"=>"South Torphy", "kind"=>"hackathon", "max_people"=>39, "nbr_subscribers"=>0, "begin_at"=>"2017-03-08T14:59:35.114Z", "end_at"=>"2017-03-08T16:59:35.115Z", "campus_ids"=>[3], "cursus_ids"=>[1], "created_at"=>"2017-03-06T14:59:35.134Z", "updated_at"=>"2017-03-06T14:59:35.157Z"}, {"id"=>2, "name"=>"Virginia dwarves", "description"=>"Facilis twee ut bespoke. Banh mi whatever schlitz ramps. Pickled at disrupt totam. Repellat neutra cupiditate photo booth.", "location"=>"Western Marquardt Academy", "kind"=>"rush", "max_people"=>16, "nbr_subscribers"=>0, "begin_at"=>"2017-03-07T14:59:35.063Z", "end_at"=>"2017-03-07T16:59:35.063Z", "campus_ids"=>[3], "cursus_ids"=>[2], "created_at"=>"2017-03-06T14:59:35.083Z", "updated_at"=>"2017-03-06T14:59:35.106Z"}]