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": "Oklahoma whales",
    "description": "Et selfies beard williamsburg quisquam ramps. Molestiae craft beer consectetur asperiores dolor. Small batch placeat banjo vhs mollitia aut vero. Distinctio est readymade offal tote bag +1.",
    "location": "West Wisozk",
    "kind": "rush",
    "max_people": 112,
    "nbr_subscribers": 0,
    "begin_at": "2017-11-25T13:42:10.090Z",
    "end_at": "2017-11-25T15:42:10.090Z",
    "campus_ids": [
      3
    ],
    "cursus_ids": [
      1
    ],
    "created_at": "2017-11-22T13:42:10.110Z",
    "updated_at": "2017-11-22T13:42:10.127Z"
  },
  {
    "id": 3,
    "name": "Wyoming cattle",
    "description": "Accusantium lumbersexual pug minima you probably haven't heard of them. Dolore officiis kitsch lumbersexual temporibus twee church-key. Ramps molestiae ut esse squid. Molestiae delectus est optio. Biodiesel roof maiores iphone nobis.",
    "location": "Southern Bauch",
    "kind": "other",
    "max_people": 39,
    "nbr_subscribers": 0,
    "begin_at": "2017-11-24T13:42:10.014Z",
    "end_at": "2017-11-24T15:42:10.015Z",
    "campus_ids": [
      6
    ],
    "cursus_ids": [
      1
    ],
    "created_at": "2017-11-22T13:42:10.037Z",
    "updated_at": "2017-11-22T13:42:10.082Z"
  },
  {
    "id": 2,
    "name": "Nevada sheep",
    "description": "Et tousled small batch street voluptas +1. Nisi small batch shoreditch est bicycle rights similique sed. Pbr&b sit exercitationem etsy ea. Cumque et forage reprehenderit officia quas. Chartreuse ad tacos commodi.",
    "location": "South Wisconsin Academy",
    "kind": "association",
    "max_people": 94,
    "nbr_subscribers": 0,
    "begin_at": "2017-11-23T13:42:09.970Z",
    "end_at": "2017-11-23T15:42:09.970Z",
    "campus_ids": [
      4
    ],
    "cursus_ids": [
      1
    ],
    "created_at": "2017-11-22T13:42:09.991Z",
    "updated_at": "2017-11-22T13:42:10.009Z"
  }
]
curl  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" "https://api.intra.42.fr/v2/events"

[
  {
    "id": 4,
    "name": "Oklahoma whales",
    "description": "Et selfies beard williamsburg quisquam ramps. Molestiae craft beer consectetur asperiores dolor. Small batch placeat banjo vhs mollitia aut vero. Distinctio est readymade offal tote bag +1.",
    "location": "West Wisozk",
    "kind": "rush",
    "max_people": 112,
    "nbr_subscribers": 0,
    "begin_at": "2017-11-25T13:42:10.090Z",
    "end_at": "2017-11-25T15:42:10.090Z",
    "campus_ids": [
      3
    ],
    "cursus_ids": [
      1
    ],
    "created_at": "2017-11-22T13:42:10.110Z",
    "updated_at": "2017-11-22T13:42:10.127Z"
  },
  {
    "id": 3,
    "name": "Wyoming cattle",
    "description": "Accusantium lumbersexual pug minima you probably haven't heard of them. Dolore officiis kitsch lumbersexual temporibus twee church-key. Ramps molestiae ut esse squid. Molestiae delectus est optio. Biodiesel roof maiores iphone nobis.",
    "location": "Southern Bauch",
    "kind": "other",
    "max_people": 39,
    "nbr_subscribers": 0,
    "begin_at": "2017-11-24T13:42:10.014Z",
    "end_at": "2017-11-24T15:42:10.015Z",
    "campus_ids": [
      6
    ],
    "cursus_ids": [
      1
    ],
    "created_at": "2017-11-22T13:42:10.037Z",
    "updated_at": "2017-11-22T13:42:10.082Z"
  },
  {
    "id": 2,
    "name": "Nevada sheep",
    "description": "Et tousled small batch street voluptas +1. Nisi small batch shoreditch est bicycle rights similique sed. Pbr&b sit exercitationem etsy ea. Cumque et forage reprehenderit officia quas. Chartreuse ad tacos commodi.",
    "location": "South Wisconsin Academy",
    "kind": "association",
    "max_people": 94,
    "nbr_subscribers": 0,
    "begin_at": "2017-11-23T13:42:09.970Z",
    "end_at": "2017-11-23T15:42:09.970Z",
    "campus_ids": [
      4
    ],
    "cursus_ids": [
      1
    ],
    "created_at": "2017-11-22T13:42:09.991Z",
    "updated_at": "2017-11-22T13:42:10.009Z"
  }
]
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"=>"Oklahoma whales", "description"=>"Et selfies beard williamsburg quisquam ramps. Molestiae craft beer consectetur asperiores dolor. Small batch placeat banjo vhs mollitia aut vero. Distinctio est readymade offal tote bag +1.", "location"=>"West Wisozk", "kind"=>"rush", "max_people"=>112, "nbr_subscribers"=>0, "begin_at"=>"2017-11-25T13:42:10.090Z", "end_at"=>"2017-11-25T15:42:10.090Z", "campus_ids"=>[3], "cursus_ids"=>[1], "created_at"=>"2017-11-22T13:42:10.110Z", "updated_at"=>"2017-11-22T13:42:10.127Z"}, {"id"=>3, "name"=>"Wyoming cattle", "description"=>"Accusantium lumbersexual pug minima you probably haven't heard of them. Dolore officiis kitsch lumbersexual temporibus twee church-key. Ramps molestiae ut esse squid. Molestiae delectus est optio. Biodiesel roof maiores iphone nobis.", "location"=>"Southern Bauch", "kind"=>"other", "max_people"=>39, "nbr_subscribers"=>0, "begin_at"=>"2017-11-24T13:42:10.014Z", "end_at"=>"2017-11-24T15:42:10.015Z", "campus_ids"=>[6], "cursus_ids"=>[1], "created_at"=>"2017-11-22T13:42:10.037Z", "updated_at"=>"2017-11-22T13:42:10.082Z"}, {"id"=>2, "name"=>"Nevada sheep", "description"=>"Et tousled small batch street voluptas +1. Nisi small batch shoreditch est bicycle rights similique sed. Pbr&b sit exercitationem etsy ea. Cumque et forage reprehenderit officia quas. Chartreuse ad tacos commodi.", "location"=>"South Wisconsin Academy", "kind"=>"association", "max_people"=>94, "nbr_subscribers"=>0, "begin_at"=>"2017-11-23T13:42:09.970Z", "end_at"=>"2017-11-23T15:42:09.970Z", "campus_ids"=>[4], "cursus_ids"=>[1], "created_at"=>"2017-11-22T13:42:09.991Z", "updated_at"=>"2017-11-22T13:42:10.009Z"}]