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.

Example:

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

Example:

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

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

Filterable fields:
  • id (standard field)
  • name (standard field)
  • created_at (standard field)
  • updated_at (standard field)
  • time_zone (standard field)
  • language_id (standard field)
  • slug (standard field)
  • main_email (standard field)
  • endpoint_id (standard field)
  • vogsphere_id (standard field)
  • content_email (standard field)
  • time_of_community_service_started (standard field)
  • companies_mail (standard field)
  • address (standard field)
  • zip (standard field)
  • city (standard field)
  • country (standard field)
  • pro_needs_validation (standard field)
  • logo (standard field)
  • website (standard field)
  • facebook (standard field)
  • twitter (standard field)
  • display_name (standard field)
  • email_extension (standard field)
  • help_url (standard field)
  • active (standard field)
  • open_to_job_offers (standard field)
  • default_hidden_phone (standard field)
  • tig_email (standard field)
  • minimum_slot_duration (standard field)
  • alumni_system (standard field)
  • manual_alumnization_before_first_internship (standard field)
  • public (standard field)
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

Example:

To range on campus with the public field between min_value and max_value:

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

Rangeable fields:
  • 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
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/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"}}]