GET /v2/events/:id
Get an event
Return the event specified by the :id
parameter. Invisibles event need at least the basic_staff
role.
settings Params
Param name | Description |
---|---|
id |
required
. Must be String
The requested id |
Examples
GET /v2/events/3
200
{
"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
],
"themes": [
{
"created_at": "2019-01-09T17:18:54.779Z",
"id": 36,
"name": "AI",
"updated_at": "2019-01-09T17:18:54.779Z"
},
{
"created_at": "2019-01-09T17:18:54.819Z",
"id": 37,
"name": "Entrepreneurship",
"updated_at": "2019-01-09T17:18:54.819Z"
}
],
"waitlist": {
"created_at": "2019-01-14T16:25:05.941Z",
"id": 391,
"updated_at": "2019-01-14T16:25:05.941Z",
"waitlistable_id": 3,
"waitlistable_type": "Event"
},
"prohibition_of_cancellation": 10,
"created_at": "2017-11-22T13:42:10.037Z",
"updated_at": "2017-11-22T13:42:10.082Z"
}
curl -H "Authorization: Bearer YOUR_ACCESS_TOKEN" "https://api.intra.42.fr/v2/events/3"
{
"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
],
"themes": [
{
"created_at": "2019-01-09T17:18:54.779Z",
"id": 36,
"name": "AI",
"updated_at": "2019-01-09T17:18:54.779Z"
},
{
"created_at": "2019-01-09T17:18:54.819Z",
"id": 37,
"name": "Entrepreneurship",
"updated_at": "2019-01-09T17:18:54.819Z"
}
],
"waitlist": {
"created_at": "2019-01-14T16:25:05.941Z",
"id": 391,
"updated_at": "2019-01-14T16:25:05.941Z",
"waitlistable_id": 3,
"waitlistable_type": "Event"
},
"prohibition_of_cancellation": 10,
"created_at": "2017-11-22T13:42:10.037Z",
"updated_at": "2017-11-22T13:42:10.082Z"
}
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/3")
response.status
# => 200
response.parsed
# => {"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], "themes"=>[{"created_at"=>"2019-01-09T17:18:54.779Z", "id"=>36, "name"=>"AI", "updated_at"=>"2019-01-09T17:18:54.779Z"}, {"created_at"=>"2019-01-09T17:18:54.819Z", "id"=>37, "name"=>"Entrepreneurship", "updated_at"=>"2019-01-09T17:18:54.819Z"}], "waitlist"=>{"created_at"=>"2019-01-14T16:25:05.941Z", "id"=>391, "updated_at"=>"2019-01-14T16:25:05.941Z", "waitlistable_id"=>3, "waitlistable_type"=>"Event"}, "prohibition_of_cancellation"=>10, "created_at"=>"2017-11-22T13:42:10.037Z", "updated_at"=>"2017-11-22T13:42:10.082Z"}