live_help Notes

assignment This action requires one of theses roles: 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/Midway, Pacific/Midway, 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/Caracas, America/Halifax, America/Guyana, America/La_Paz, America/St_Johns, America/Sao_Paulo, America/Argentina/Buenos_Aires, America/Godthab, America/Montevideo, America/Santiago, Atlantic/South_Georgia, Atlantic/Azores, Atlantic/Cape_Verde, Africa/Casablanca, Europe/Dublin, Europe/London, Europe/Lisbon, Europe/London, Africa/Monrovia, Etc/UTC, Europe/Amsterdam, Europe/Belgrade, Europe/Berlin, Europe/Zurich, Europe/Bratislava, Europe/Brussels, Europe/Budapest, Europe/Copenhagen, Europe/Ljubljana, Europe/Madrid, Europe/Paris, Europe/Prague, Europe/Rome, Europe/Sarajevo, Europe/Skopje, Europe/Stockholm, Europe/Vienna, Europe/Warsaw, Africa/Algiers, Europe/Zagreb, Europe/Zurich, Europe/Athens, Europe/Bucharest, Africa/Cairo, Africa/Harare, Europe/Helsinki, Europe/Istanbul, Asia/Jerusalem, Europe/Kaliningrad, Europe/Kiev, Africa/Johannesburg, Europe/Riga, Europe/Sofia, Europe/Tallinn, Europe/Vilnius, Asia/Baghdad, Asia/Kuwait, Europe/Minsk, Europe/Moscow, Africa/Nairobi, Asia/Riyadh, Europe/Moscow, Europe/Volgograd, Asia/Tehran, Asia/Muscat, Asia/Baku, Asia/Muscat, Europe/Samara, Asia/Tbilisi, 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/Novosibirsk, Asia/Urumqi, Asia/Rangoon, Asia/Bangkok, Asia/Bangkok, Asia/Jakarta, Asia/Krasnoyarsk, Asia/Shanghai, Asia/Chongqing, 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, Asia/Magadan, Australia/Melbourne, Pacific/Port_Moresby, Australia/Sydney, Asia/Vladivostok, 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[slug] optional , nil allowed . Must be String

The slug.

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.

campus[time_of_community_service_started] optional , nil allowed . 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[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.

comments powered by <span class='logo-disqus'>Disqus</span>
POST /v2/campus
{
  "campus": {
    "address": "230 Smith Point",
    "city": "Ritchieville",
    "country": "Bangladesh",
    "language_id": "1",
    "name": "Macedonia1",
    "zip": "68260-9569"
  }
}
201
{
  "id": 8,
  "name": "Macedonia1",
  "time_zone": null,
  "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":"230 Smith Point","city":"Ritchieville","country":"Bangladesh","language_id":"1","name":"Macedonia1","zip":"68260-9569"}}' "https://api.intra.42.fr/v2/campus"

{
  "id": 8,
  "name": "Macedonia1",
  "time_zone": null,
  "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: "230 Smith Point", city: "Ritchieville", country: "Bangladesh", language_id: "1", name: "Macedonia1", zip: "68260-9569"}}
response = token.post("/v2/campus", params: params)
response.status
# => 201
response.parsed
# => {"id"=>8, "name"=>"Macedonia1", "time_zone"=>nil, "language"=>{"id"=>1, "name"=>"Français", "identifier"=>"fr"}, "users_count"=>0, "vogsphere_id"=>nil, "endpoint"=>nil}