live_help Notes

assignment This action requires one of theses roles: Advanced tutor

settings Params

Param name Description
id required . Must be String

The requested id

user optional , nil allowed . Must be a Hash
user[login] optional , nil allowed . Must be String

The login. Default to . Must be unique.

user[email] optional . Must be String

The email. Default to . Must be unique. Must be unique.

user[first_name] optional . Must be String

The first name.

user[last_name] optional . Must be String

The last name.

user[password] optional , nil allowed . Must be String

The password.

user[pool_year] optional , nil allowed . Must be String

The pool year.

user[pool_month] optional , nil allowed . Must be String

The pool month.

user[kind] optional . Must be one of: admin, student, external.

The kind.

user[status] optional , nil allowed . Must be String

The status.

user[image] optional , nil allowed . Must be File

The image. Allow blank length is true. Allow nil length is true. Minimum length is 3072. Maximum length is 1048576.

user[campus_id] optional , nil allowed . Must be String

The campus id.

user[meta] optional , nil allowed . Must be String

The meta.

user[cursus_id] optional , nil allowed . Must be String

The cursus id.

user[user_candidature_attributes] optional , nil allowed . Must be an Array of nested elements

The user candidature attributes.

user[user_candidature_attributes][id] optional , nil allowed . Must be Fixnum

The id.

user[user_candidature_attributes][user_id] optional , nil allowed . Must be Fixnum

The user id.

user[user_candidature_attributes][birth_date] optional , nil allowed . Must be String

The birth date.

user[user_candidature_attributes][gender] optional , nil allowed . Must be String

The gender.

user[user_candidature_attributes][zip_code] optional , nil allowed . Must be String

The zip code.

user[user_candidature_attributes][country] optional , nil allowed . Must be String

The country.

user[user_candidature_attributes][birth_city] optional , nil allowed . Must be String

The birth city.

user[user_candidature_attributes][birth_country] optional , nil allowed . Must be String

The birth country.

user[user_candidature_attributes][postal_street] optional , nil allowed . Must be String

The postal street.

user[user_candidature_attributes][postal_complement] optional , nil allowed . Must be String

The postal complement.

user[user_candidature_attributes][postal_city] optional , nil allowed . Must be String

The postal city.

user[user_candidature_attributes][postal_zip_code] optional , nil allowed . Must be String

The postal zip code.

user[user_candidature_attributes][postal_country] optional , nil allowed . Must be String

The postal country.

user[user_candidature_attributes][contact_affiliation] optional , nil allowed . Must be String

The contact affiliation.

user[user_candidature_attributes][contact_last_name] optional , nil allowed . Must be String

The contact last name.

user[user_candidature_attributes][contact_first_name] optional , nil allowed . Must be String

The contact first name.

user[user_candidature_attributes][contact_phone1] optional , nil allowed . Must be String

The contact phone1.

user[user_candidature_attributes][contact_phone2] optional , nil allowed . Must be String

The contact phone2.

user[user_candidature_attributes][max_level_memory] optional , nil allowed . Must be Fixnum

The max level memory.

user[user_candidature_attributes][max_level_logic] optional , nil allowed . Must be Fixnum

The max level logic.

user[user_candidature_attributes][other_information] optional , nil allowed . Must be String

The other information.

user[user_candidature_attributes][language] optional , nil allowed . Must be String

The language.

user[user_candidature_attributes][meeting_date] optional , nil allowed . Must be DateTime

The meeting date.

user[user_candidature_attributes][piscine_date] optional , nil allowed . Must be String

The piscine date.

user[user_candidature_attributes][email] optional , nil allowed . Must be String

The email.

user[user_candidature_attributes][pin] optional , nil allowed . Must be String

The pin.

user[user_candidature_attributes][phone] optional , nil allowed . Must be String

The phone.

user[cursus_users_attributes] optional , nil allowed . Must be an Array of nested elements

The cursus users attributes.

user[cursus_users_attributes][id] optional , nil allowed . Must be Fixnum

The id.

user[cursus_users_attributes][cursus_id] optional . Must be Fixnum

The cursus id. Must be unique in the scope of a given user.

user[cursus_users_attributes][end_at] optional , nil allowed . Must be DateTime

The end at.

user[cursus_users_attributes][begin_at] optional . Must be DateTime

The begin at.

user[cursus_users_attributes][_destroy] optional , nil allowed . Must be String

The destroy.

user[languages_user_attributes] optional , nil allowed . Must be an Array of nested elements

The languages user attributes.

user[languages_user_attributes][id] optional , nil allowed . Must be Fixnum

The id.

user[languages_user_attributes][language_id] optional . Must be Fixnum

The language id.

user[languages_user_attributes][position] optional , nil allowed . Must be Fixnum

The position.

user[languages_user_attributes][_destroy] optional , nil allowed . Must be String

The destroy.

comments powered by <span class='logo-disqus'>Disqus</span>
PUT /v2/users/27
{
  "user": {
    "campus_id": "1",
    "email": "obi.wan@caramail.net",
    "first_name": "Obi-Wan",
    "kind": "student",
    "last_name": "Kenobi",
    "password": "totoroTOTOROOO",
    "pool_month": "march",
    "pool_year": "2017",
    "status": "admis"
  }
}
204
curl  -X PUT -H "Authorization: Bearer YOUR_ACCESS_TOKEN" -H "Content-Type: application/json" -d '{"user":{"campus_id":"1","email":"obi.wan@caramail.net","first_name":"Obi-Wan","kind":"student","last_name":"Kenobi","password":"totoroTOTOROOO","pool_month":"march","pool_year":"2017","status":"admis"}}' "https://api.intra.42.fr/v2/users/27"
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 = {user: {campus_id: "1", email: "obi.wan@caramail.net", first_name: "Obi-Wan", kind: "student", last_name: "Kenobi", password: "totoroTOTOROOO", pool_month: "march", pool_year: "2017", status: "admis"}}
response = token.put("/v2/users/27", params: params)
response.status
# => 204
response.parsed
# =>