GET /v2/campus
Return all the campus
live_help Notes
chrome_reader_mode
This resource is paginated by 30 items
settings Params
Param name | Description |
---|---|
sort |
optional
. Must be one of: id , name , created_at , updated_at , time_zone , language_id , slug , main_email , endpoint_id , vogsphere_id , content_email , time_of_community_service_started , companies_mail , address , zip , city , country , pro_needs_validation , logo , website , facebook , twitter , display_name , email_extension , help_url , active , open_to_job_offers , default_hidden_phone , tig_email , minimum_slot_duration , alumni_system , manual_alumnization_before_first_internship , public .
The sort field. Sorted by id desc by default. MoreExample:To sort on campus on the fields manual_alumnization_before_first_internship on a descending order and public on a ascending order: ...&sort=-manual_alumnization_before_first_internship,public |
filter |
optional
. Must be one of: id , name , created_at , updated_at , time_zone , language_id , slug , main_email , endpoint_id , vogsphere_id , content_email , time_of_community_service_started , companies_mail , address , zip , city , country , pro_needs_validation , logo , website , facebook , twitter , display_name , email_extension , help_url , active , open_to_job_offers , default_hidden_phone , tig_email , minimum_slot_duration , alumni_system , manual_alumnization_before_first_internship , public .
Filtering on one or more fields MoreExample:
To filter on campus with the
...&filter[id]=a_value,another_value Filterable fields:
|
range |
optional
. Must be one of: id , name , created_at , updated_at , time_zone , language_id , slug , main_email , endpoint_id , vogsphere_id , content_email , time_of_community_service_started , companies_mail , address , zip , city , country , pro_needs_validation , logo , website , facebook , twitter , display_name , email_extension , help_url , active , open_to_job_offers , default_hidden_phone , tig_email , minimum_slot_duration , alumni_system , manual_alumnization_before_first_internship , public .
Select on a particular range MoreExample:
To range on campus with the
...&range[public]=min_value,max_value Rangeable fields:
|
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 |
Examples
GET /v2/campus
200
[
{
"id": 1,
"name": "Paris",
"time_zone": "Europe/Paris",
"language": {
"id": 1,
"name": "Français",
"identifier": "fr"
},
"users_count": 22997,
"vogsphere_id": 1,
"country": "France",
"address": "96, boulevard Bessières",
"zip": "75017",
"city": "Paris",
"website": "http://www.42.fr/",
"facebook": "https://facebook.com/42born2code",
"twitter": "https://twitter.com/42born2code",
"active": true,
"public": true,
"email_extension": "42.fr",
"default_hidden_phone": false,
"endpoint": {
"id": 33,
"url": "https://endpoint.42paris.fr",
"description": "42paris's new ldapkdc endpoint",
"created_at": "2021-06-14T07:49:14.872Z",
"updated_at": "2021-06-28T15:24:45.089Z"
}
},
{
"id": 9,
"name": "Lyon",
"time_zone": "Europe/Paris",
"language": {
"id": 1,
"name": "Français",
"identifier": "fr"
},
"users_count": 2077,
"vogsphere_id": 4,
"country": "France",
"address": "Campus Région – 78 route de Paris",
"zip": "69260",
"city": "Charbonnières-les-Bains",
"website": "https://www.42lyon.fr/",
"facebook": "https://www.facebook.com/42lyon",
"twitter": "https://twitter.com/42lyon",
"active": true,
"public": true,
"email_extension": "42lyon.fr",
"default_hidden_phone": false,
"endpoint": {
"id": 19,
"url": "https://bigbro.42lyon.fr",
"description": "42 Lyon endpoint tmp",
"created_at": "2020-07-28T15:21:29.199Z",
"updated_at": "2020-07-28T15:21:29.199Z"
}
}
]
curl -H "Authorization: Bearer YOUR_ACCESS_TOKEN" "https://api.intra.42.fr/v2/campus"
[
{
"id": 1,
"name": "Paris",
"time_zone": "Europe/Paris",
"language": {
"id": 1,
"name": "Français",
"identifier": "fr"
},
"users_count": 22997,
"vogsphere_id": 1,
"country": "France",
"address": "96, boulevard Bessières",
"zip": "75017",
"city": "Paris",
"website": "http://www.42.fr/",
"facebook": "https://facebook.com/42born2code",
"twitter": "https://twitter.com/42born2code",
"active": true,
"public": true,
"email_extension": "42.fr",
"default_hidden_phone": false,
"endpoint": {
"id": 33,
"url": "https://endpoint.42paris.fr",
"description": "42paris's new ldapkdc endpoint",
"created_at": "2021-06-14T07:49:14.872Z",
"updated_at": "2021-06-28T15:24:45.089Z"
}
},
{
"id": 9,
"name": "Lyon",
"time_zone": "Europe/Paris",
"language": {
"id": 1,
"name": "Français",
"identifier": "fr"
},
"users_count": 2077,
"vogsphere_id": 4,
"country": "France",
"address": "Campus Région – 78 route de Paris",
"zip": "69260",
"city": "Charbonnières-les-Bains",
"website": "https://www.42lyon.fr/",
"facebook": "https://www.facebook.com/42lyon",
"twitter": "https://twitter.com/42lyon",
"active": true,
"public": true,
"email_extension": "42lyon.fr",
"default_hidden_phone": false,
"endpoint": {
"id": 19,
"url": "https://bigbro.42lyon.fr",
"description": "42 Lyon endpoint tmp",
"created_at": "2020-07-28T15:21:29.199Z",
"updated_at": "2020-07-28T15:21:29.199Z"
}
}
]
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/campus")
response.status
# => 200
response.parsed
# => [{"id"=>1, "name"=>"Paris", "time_zone"=>"Europe/Paris", "language"=>{"id"=>1, "name"=>"Français", "identifier"=>"fr"}, "users_count"=>22997, "vogsphere_id"=>1, "country"=>"France", "address"=>"96, boulevard Bessières", "zip"=>"75017", "city"=>"Paris", "website"=>"http://www.42.fr/", "facebook"=>"https://facebook.com/42born2code", "twitter"=>"https://twitter.com/42born2code", "active"=>true, "public"=>true, "email_extension"=>"42.fr", "default_hidden_phone"=>false, "endpoint"=>{"id"=>33, "url"=>"https://endpoint.42paris.fr", "description"=>"42paris's new ldapkdc endpoint", "created_at"=>"2021-06-14T07:49:14.872Z", "updated_at"=>"2021-06-28T15:24:45.089Z"}}, {"id"=>9, "name"=>"Lyon", "time_zone"=>"Europe/Paris", "language"=>{"id"=>1, "name"=>"Français", "identifier"=>"fr"}, "users_count"=>2077, "vogsphere_id"=>4, "country"=>"France", "address"=>"Campus Région – 78 route de Paris", "zip"=>"69260", "city"=>"Charbonnières-les-Bains", "website"=>"https://www.42lyon.fr/", "facebook"=>"https://www.facebook.com/42lyon", "twitter"=>"https://twitter.com/42lyon", "active"=>true, "public"=>true, "email_extension"=>"42lyon.fr", "default_hidden_phone"=>false, "endpoint"=>{"id"=>19, "url"=>"https://bigbro.42lyon.fr", "description"=>"42 Lyon endpoint tmp", "created_at"=>"2020-07-28T15:21:29.199Z", "updated_at"=>"2020-07-28T15:21:29.199Z"}}]