POST /v2/campus
Create a campus
live_help Notes
Advanced tutor
settings Params
Param name | Description |
---|---|
campus | optional , nil allowed . Must be a Hash |
campus[name] |
required
. Must be String
The name. Must be unique. |
campus[time_zone] |
required
. Must be one of: Pacific/Pago_Pago , Pacific/Pago_Pago , Pacific/Pago_Pago , Pacific/Honolulu , America/Juneau , America/Los_Angeles , America/Tijuana , America/Phoenix , America/Chihuahua , America/Mazatlan , America/Denver , America/Guatemala , America/Chicago , America/Mexico_City , America/Mexico_City , America/Monterrey , America/Regina , America/Bogota , America/New_York , America/Indiana/Indianapolis , America/Lima , America/Lima , America/Halifax , America/Caracas , America/Guyana , America/La_Paz , America/Santiago , America/St_Johns , America/Sao_Paulo , America/Argentina/Buenos_Aires , America/Godthab , America/Montevideo , Atlantic/South_Georgia , Atlantic/Azores , Atlantic/Cape_Verde , Europe/London , Europe/Lisbon , Europe/London , Africa/Monrovia , Etc/UTC , Europe/Amsterdam , Europe/Belgrade , Europe/Berlin , Europe/Zurich , Europe/Prague , Europe/Brussels , Europe/Budapest , Africa/Casablanca , Europe/Copenhagen , Europe/Dublin , Europe/Belgrade , Europe/Madrid , Europe/Paris , Europe/Prague , Europe/Rome , Europe/Belgrade , Europe/Belgrade , Europe/Stockholm , Europe/Vienna , Europe/Warsaw , Africa/Algiers , Europe/Belgrade , Europe/Zurich , Europe/Athens , Europe/Bucharest , Africa/Cairo , Africa/Maputo , Europe/Helsinki , Asia/Jerusalem , Europe/Kaliningrad , Europe/Kiev , Africa/Johannesburg , Europe/Riga , Europe/Sofia , Europe/Tallinn , Europe/Vilnius , Asia/Baghdad , Europe/Istanbul , Asia/Riyadh , Europe/Minsk , Europe/Moscow , Africa/Nairobi , Asia/Riyadh , Europe/Moscow , Asia/Tehran , Asia/Dubai , Asia/Baku , Asia/Dubai , Europe/Samara , Asia/Tbilisi , Europe/Volgograd , Asia/Yerevan , Asia/Kabul , Asia/Yekaterinburg , Asia/Karachi , Asia/Karachi , Asia/Tashkent , Asia/Kolkata , Asia/Kolkata , Asia/Kolkata , Asia/Kolkata , Asia/Colombo , Asia/Kathmandu , Asia/Almaty , Asia/Dhaka , Asia/Dhaka , Asia/Urumqi , Asia/Yangon , Asia/Bangkok , Asia/Bangkok , Asia/Jakarta , Asia/Krasnoyarsk , Asia/Novosibirsk , Asia/Shanghai , Asia/Shanghai , Asia/Hong_Kong , Asia/Irkutsk , Asia/Kuala_Lumpur , Australia/Perth , Asia/Singapore , Asia/Taipei , Asia/Ulaanbaatar , Asia/Tokyo , Asia/Tokyo , Asia/Seoul , Asia/Tokyo , Asia/Yakutsk , Australia/Adelaide , Australia/Darwin , Australia/Brisbane , Australia/Melbourne , Pacific/Guam , Australia/Hobart , Australia/Melbourne , Pacific/Port_Moresby , Australia/Sydney , Asia/Vladivostok , Asia/Magadan , Pacific/Noumea , Pacific/Guadalcanal , Asia/Srednekolymsk , Pacific/Auckland , Pacific/Fiji , Asia/Kamchatka , Pacific/Majuro , Pacific/Auckland , Pacific/Chatham , Pacific/Tongatapu , Pacific/Apia , Pacific/Fakaofo .
The time zone. |
campus[language_id] |
required
. Must be Fixnum
The language id. |
campus[main_email] |
optional
, nil allowed
. Must be String
The main email. |
campus[endpoint_id] |
optional
, nil allowed
. Must be Fixnum
The endpoint id. |
campus[vogsphere_id] |
optional
, nil allowed
. Must be Fixnum
The vogsphere id. |
campus[content_email] |
required
. Must be String
The content email. Default to greetings first name and welcome at 42,
. |
campus[tig_email] |
required
. Must be String
The tig email. Default to hi, your account has been closed for the following reason: “ reason ”. to unclose your account, you must choose a date for your community services hererl schedule ). your community services will last ** duration hours. warning: do not set your community services on national holiday, otherwise your community services duration will be doubled. meet the bocal at start at . if you are late or missing, your community services duration will be doubled. . |
campus[time_of_community_service_started] |
required
. Must be String
The time of community service started. |
campus[companies_mail] |
optional
, nil allowed
. Must be String
The companies mail. |
campus[address] |
required
. Must be String
The address. |
campus[zip] |
required
. Must be String
The zip. |
campus[city] |
required
. Must be String
The city. |
campus[country] |
required
. Must be one of: Afghanistan , Åland Islands , Albania , Algeria , American Samoa , Andorra , Angola , Anguilla , Antarctica , Antigua and Barbuda , Argentina , Armenia , Aruba , Australia , Austria , Azerbaijan , Bahamas , Bahrain , Bangladesh , Barbados , Belarus , Belgium , Belize , Benin , Bermuda , Bhutan , Bolivia, Plurinational State of , Bonaire, Sint Eustatius and Saba , Bosnia and Herzegovina , Botswana , Bouvet Island , Brazil , British Indian Ocean Territory , Brunei Darussalam , Bulgaria , Burkina Faso , Burundi , Cambodia , Cameroon , Canada , Cape Verde , Cayman Islands , Central African Republic , Chad , Chile , China , Christmas Island , Cocos (Keeling) Islands , Colombia , Comoros , Congo , Congo, The Democratic Republic of the , Cook Islands , Costa Rica , Côte d'Ivoire , Croatia , Cuba , Curaçao , Cyprus , Czech Republic , Denmark , Djibouti , Dominica , Dominican Republic , Ecuador , Egypt , El Salvador , Equatorial Guinea , Eritrea , Estonia , Ethiopia , Falkland Islands (Malvinas) , Faroe Islands , Fiji , Finland , France , French Guiana , French Polynesia , French Southern Territories , Gabon , Gambia , Georgia , Germany , Ghana , Gibraltar , Greece , Greenland , Grenada , Guadeloupe , Guam , Guatemala , Guernsey , Guinea , Guinea-Bissau , Guyana , Haiti , Heard Island and McDonald Islands , Holy See (Vatican City State) , Honduras , Hong Kong , Hungary , Iceland , India , Indonesia , Iran, Islamic Republic of , Iraq , Ireland , Isle of Man , Israel , Italy , Jamaica , Japan , Jersey , Jordan , Kazakhstan , Kenya , Kiribati , Korea, Democratic People's Republic of , Korea, Republic of , Kuwait , Kyrgyzstan , Lao People's Democratic Republic , Latvia , Lebanon , Lesotho , Liberia , Libya , Liechtenstein , Lithuania , Luxembourg , Macao , Macedonia, Republic of , Madagascar , Malawi , Malaysia , Maldives , Mali , Malta , Marshall Islands , Martinique , Mauritania , Mauritius , Mayotte , Mexico , Micronesia, Federated States of , Moldova, Republic of , Monaco , Mongolia , Montenegro , Montserrat , Morocco , Mozambique , Myanmar , Namibia , Nauru , Nepal , Netherlands , New Caledonia , New Zealand , Nicaragua , Niger , Nigeria , Niue , Norfolk Island , Northern Mariana Islands , Norway , Oman , Pakistan , Palau , Palestine, State of , Panama , Papua New Guinea , Paraguay , Peru , Philippines , Pitcairn , Poland , Portugal , Puerto Rico , Qatar , Réunion , Romania , Russian Federation , Rwanda , Saint Barthélemy , Saint Helena, Ascension and Tristan da Cunha , Saint Kitts and Nevis , Saint Lucia , Saint Martin (French part) , Saint Pierre and Miquelon , Saint Vincent and the Grenadines , Samoa , San Marino , Sao Tome and Principe , Saudi Arabia , Senegal , Serbia , Seychelles , Sierra Leone , Singapore , Sint Maarten (Dutch part) , Slovakia , Slovenia , Solomon Islands , Somalia , South Africa , South Georgia and the South Sandwich Islands , Spain , Sri Lanka , Sudan , Suriname , South Sudan , Svalbard and Jan Mayen , Swaziland , Sweden , Switzerland , Syrian Arab Republic , Taiwan , Tajikistan , Tanzania, United Republic of , Thailand , Timor-Leste , Togo , Tokelau , Tonga , Trinidad and Tobago , Tunisia , Turkey , Turkmenistan , Turks and Caicos Islands , Tuvalu , Uganda , Ukraine , United Arab Emirates , United Kingdom , United States , United States Minor Outlying Islands , Uruguay , Uzbekistan , Vanuatu , Venezuela, Bolivarian Republic of , Viet Nam , Virgin Islands, British , Virgin Islands, U.S. , Wallis and Futuna , Western Sahara , Yemen , Zambia , Zimbabwe .
The country. |
campus[pro_needs_validation] |
optional
, nil allowed
. Must be one of: true , false .
Is it pro needs validation ? Default to false. |
campus[open_to_job_offers] |
optional
, nil allowed
. Must be one of: true , false .
Is it open to job offers ? |
campus[logo] |
optional
, nil allowed
. Must be File
The logo. |
campus[website] |
required
. Must be String
The website. |
campus[facebook] |
optional
, nil allowed
. Must be String
The facebook. |
campus[twitter] |
optional
, nil allowed
. Must be String
The twitter. |
campus[display_name] |
required
. Must be String
The display name. |
campus[email_extension] |
optional
, nil allowed
. Must be String
The email extension. |
campus[help_url] |
optional
, nil allowed
. Must be String
The help url. |
campus[logo_cache] |
optional
, nil allowed
. Must be String
The logo cache. |
campus[default_hidden_phone] |
optional
, nil allowed
. Must be one of: true , false .
Is it default hidden phone ? Default to false. |
campus[minimum_slot_duration] |
optional
, nil allowed
. Must be Fixnum
The minimum slot duration. Default to 30. |
campus[manual_alumnization_before_first_internship] |
optional
, nil allowed
. Must be one of: true , false .
Is it manual alumnization before first internship ? Default to true. |
campus[public] |
optional
, nil allowed
. Must be one of: true , false .
Is it public ? Default to false. |
Examples
POST /v2/campus
{
"campus": {
"address": "42007 Mossie Forest",
"city": "Danielton",
"content_email": "Hi __first_name__",
"country": "Bonaire, Sint Eustatius and Saba",
"display_name": "42 Paris",
"language_id": "1",
"logo": "#<File:0x007fa9e8b2c048>",
"name": "Argentina1",
"time_of_community_service_started": "2017-11-22 14:00:00 +0100",
"time_zone": "Pacific/Pago_Pago",
"website": "http://cruickshankwehner.org/pinkie_reynolds",
"zip": "19751-7157"
}
}
201
{
"id": 7,
"name": "Argentina1",
"time_zone": "Pacific/Pago_Pago",
"language": {
"id": 1,
"name": "Français",
"identifier": "fr"
},
"users_count": 0,
"vogsphere_id": null,
"endpoint": null
}
curl -X POST -H "Authorization: Bearer YOUR_ACCESS_TOKEN" -H "Content-Type: application/json" -d '{"campus":{"address":"42007 Mossie Forest","city":"Danielton","content_email":"Hi __first_name__","country":"Bonaire, Sint Eustatius and Saba","display_name":"42 Paris","language_id":"1","logo":"#\u003cFile:0x007fa9e8b2c048\u003e","name":"Argentina1","time_of_community_service_started":"2017-11-22 14:00:00 +0100","time_zone":"Pacific/Pago_Pago","website":"http://cruickshankwehner.org/pinkie_reynolds","zip":"19751-7157"}}' "https://api.intra.42.fr/v2/campus"
{
"id": 7,
"name": "Argentina1",
"time_zone": "Pacific/Pago_Pago",
"language": {
"id": 1,
"name": "Français",
"identifier": "fr"
},
"users_count": 0,
"vogsphere_id": null,
"endpoint": null
}
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
params = {campus: {address: "42007 Mossie Forest", city: "Danielton", content_email: "Hi __first_name__", country: "Bonaire, Sint Eustatius and Saba", display_name: "42 Paris", language_id: "1", logo: "#<File:0x007fa9e8b2c048>", name: "Argentina1", time_of_community_service_started: "2017-11-22 14:00:00 +0100", time_zone: "Pacific/Pago_Pago", website: "http://cruickshankwehner.org/pinkie_reynolds", zip: "19751-7157"}}
response = token.post("/v2/campus", params: params)
response.status
# => 201
response.parsed
# => {"id"=>7, "name"=>"Argentina1", "time_zone"=>"Pacific/Pago_Pago", "language"=>{"id"=>1, "name"=>"Français", "identifier"=>"fr"}, "users_count"=>0, "vogsphere_id"=>nil, "endpoint"=>nil}