POST /v2/users/:user_id/user_candidature
Create a user candidature for the given User
POST /v2/user_candidatures
Create a user candidature
live_help Notes
assignment
This action requires one of theses roles:
Advanced staff, Advanced tutor
settings Params
| Param name | Description |
|---|---|
| user_id |
optional
. Must be String
The user id or slug |
| user_candidature | optional , nil allowed . Must be a Hash |
| user_candidature[id] |
optional
, nil allowed
. Must be Fixnum
The id. |
| user_candidature[user_id] |
optional
, nil allowed
. Must be Fixnum
The user id. |
| user_candidature[birth_date] |
optional
, nil allowed
. Must be Fixnum
The birth date. Must be at least 13 years ago. must be at most 99 years ago. |
| user_candidature[gender] |
optional
, nil allowed
. Must be one of: male, female, other.
The gender. |
| user_candidature[zip_code] |
optional
, nil allowed
. Must be String
The zip code. |
| user_candidature[country] |
optional
, nil allowed
. Must be String
The country. |
| user_candidature[phone_country_code] |
optional
, nil allowed
. Must be one of: AD, AE, AF, AG, AI, AL, AM, AN, AO, AQ, AR, AS, AT, AU, AW, AX, AZ, BA, BB, BD, BE, BF, BG, BH, BI, BJ, BL, BM, BN, BO, BQ, BR, BS, BT, BV, BW, BY, BZ, CA, CC, CD, CF, CG, CH, CI, CK, CL, CM, CN, CO, CR, CU, CV, CW, CX, CY, CZ, DE, DJ, DK, DM, DO, DZ, EC, EE, EG, EH, ER, ES, ET, FI, FJ, FK, FM, FO, FR, GA, GB, GD, GE, GF, GG, GH, GI, GL, GM, GN, GP, GQ, GR, GS, GT, GU, GW, GY, HK, HM, HN, HR, HT, HU, ID, IE, IL, IM, IN, IO, IQ, IR, IS, IT, JE, JM, JO, JP, KE, KG, KH, KI, KM, KN, KP, KR, KW, KY, KZ, LA, LB, LC, LI, LK, LR, LS, LT, LU, LV, LY, MA, MC, MD, ME, MF, MG, MH, MK, ML, MM, MN, MO, MP, MQ, MR, MS, MT, MU, MV, MW, MX, MY, MZ, NA, NC, NE, NF, NG, NI, NL, NO, NP, NR, NU, NZ, OM, PA, PE, PF, PG, PH, PK, PL, PM, PN, PR, PS, PT, PW, PY, QA, RE, RO, RS, RU, RW, SA, SB, SC, SD, SE, SG, SH, SI, SJ, SK, SL, SM, SN, SO, SR, SS, ST, SV, SX, SY, SZ, TC, TD, TF, TG, TH, TJ, TK, TL, TM, TN, TO, TR, TT, TV, TW, TZ, UA, UG, UM, US, UY, UZ, VA, VC, VE, VG, VI, VN, VU, WF, WS, XK, YE, YT, ZA, ZM, ZW, .
The phone country code. |
| user_candidature[birth_city] |
optional
, nil allowed
. Must be String
The birth city. |
| user_candidature[birth_country] |
optional
, nil allowed
. Must be String
The birth country. |
| user_candidature[postal_street] |
optional
, nil allowed
. Must be String
The postal street. |
| user_candidature[postal_complement] |
optional
, nil allowed
. Must be String
The postal complement. |
| user_candidature[postal_city] |
optional
, nil allowed
. Must be String
The postal city. |
| user_candidature[postal_zip_code] |
optional
, nil allowed
. Must be String
The postal zip code. |
| user_candidature[email] |
optional
, nil allowed
. Must be String
The email. |
| user_candidature[postal_country] |
optional
, nil allowed
. Must be String
The postal country. |
| user_candidature[contact_affiliation] |
optional
, nil allowed
. Must be String
The contact affiliation. |
| user_candidature[contact_last_name] |
optional
, nil allowed
. Must be String
The contact last name. |
| user_candidature[contact_first_name] |
optional
, nil allowed
. Must be String
The contact first name. |
| user_candidature[contact_phone1] |
optional
, nil allowed
. Must be String
The contact phone1. |
| user_candidature[contact_phone2] |
optional
, nil allowed
. Must be String
The contact phone2. |
| user_candidature[max_level_memory] |
optional
, nil allowed
. Must be Fixnum
The max level memory. |
| user_candidature[max_level_logic] |
optional
, nil allowed
. Must be Fixnum
The max level logic. |
| user_candidature[other_information] |
optional
, nil allowed
. Must be String
The other information. |
| user_candidature[language] |
optional
, nil allowed
. Must be String
The language. |
| user_candidature[meeting_date] |
optional
, nil allowed
. Must be DateTime
The meeting date. |
| user_candidature[piscine_date] |
optional
, nil allowed
. Must be String
The piscine date. |
| user_candidature[pin] |
optional
, nil allowed
. Must be String
The pin. |
| user_candidature[phone] |
optional
, nil allowed
. Must be String
The phone. |
Examples
POST /v2/user_candidatures
{
"user_candidature": {
"birth_city": "West Stefanieburgh",
"birth_country": "Burkina Faso",
"birth_date": "1989-01-30",
"contact_affiliation": "other",
"contact_first_name": "Barton",
"contact_last_name": "Mertz",
"contact_phone1": "0695847362",
"contact_phone2": "0491314200",
"country": "Honduras",
"gender": "female",
"language": "",
"max_level_logic": "2",
"max_level_memory": "1",
"meeting_date": "2017-07-11",
"other_information": "3",
"pin": "4242",
"piscine_date": "2017-11-15",
"postal_city": "Tillmanton",
"postal_complement": "",
"postal_country": "Georgia",
"postal_street": "5030 Serenity Plaza",
"postal_zip_code": "65440",
"user_id": "9",
"zip_code": "37528-3874"
}
}
201
{
"id": 127,
"user_id": 9,
"birth_date": "1989-01-30",
"gender": "female",
"zip_code": "37528-3874",
"country": "Honduras",
"birth_city": "West Stefanieburgh",
"birth_country": "Burkina Faso",
"postal_street": "5030 Serenity Plaza",
"postal_complement": "",
"postal_city": "Tillmanton",
"postal_zip_code": "65440",
"postal_country": "Georgia",
"contact_affiliation": "other",
"contact_last_name": "Mertz",
"contact_first_name": "Barton",
"contact_phone1": "0695847362",
"contact_phone2": "0491314200",
"max_level_memory": 1,
"max_level_logic": 2,
"other_information": "3",
"language": "",
"meeting_date": "2017-07-11T00:00:00.000Z",
"piscine_date": "2017-11-15",
"created_at": "2017-11-22T13:44:17.725Z",
"updated_at": "2017-11-22T13:44:17.725Z",
"phone": null,
"email": null,
"pin": "4242",
"phone_country_code": null,
"hidden_phone": null
}
curl -X POST -H "Authorization: Bearer YOUR_ACCESS_TOKEN" -H "Content-Type: application/json" -d '{"user_candidature":{"birth_city":"West Stefanieburgh","birth_country":"Burkina Faso","birth_date":"1989-01-30","contact_affiliation":"other","contact_first_name":"Barton","contact_last_name":"Mertz","contact_phone1":"0695847362","contact_phone2":"0491314200","country":"Honduras","gender":"female","language":"","max_level_logic":"2","max_level_memory":"1","meeting_date":"2017-07-11","other_information":"3","pin":"4242","piscine_date":"2017-11-15","postal_city":"Tillmanton","postal_complement":"","postal_country":"Georgia","postal_street":"5030 Serenity Plaza","postal_zip_code":"65440","user_id":"9","zip_code":"37528-3874"}}' "https://api.intra.42.fr/v2/user_candidatures"
{
"id": 127,
"user_id": 9,
"birth_date": "1989-01-30",
"gender": "female",
"zip_code": "37528-3874",
"country": "Honduras",
"birth_city": "West Stefanieburgh",
"birth_country": "Burkina Faso",
"postal_street": "5030 Serenity Plaza",
"postal_complement": "",
"postal_city": "Tillmanton",
"postal_zip_code": "65440",
"postal_country": "Georgia",
"contact_affiliation": "other",
"contact_last_name": "Mertz",
"contact_first_name": "Barton",
"contact_phone1": "0695847362",
"contact_phone2": "0491314200",
"max_level_memory": 1,
"max_level_logic": 2,
"other_information": "3",
"language": "",
"meeting_date": "2017-07-11T00:00:00.000Z",
"piscine_date": "2017-11-15",
"created_at": "2017-11-22T13:44:17.725Z",
"updated_at": "2017-11-22T13:44:17.725Z",
"phone": null,
"email": null,
"pin": "4242",
"phone_country_code": null,
"hidden_phone": 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 = {user_candidature: {birth_city: "West Stefanieburgh", birth_country: "Burkina Faso", birth_date: "1989-01-30", contact_affiliation: "other", contact_first_name: "Barton", contact_last_name: "Mertz", contact_phone1: "0695847362", contact_phone2: "0491314200", country: "Honduras", gender: "female", language: "", max_level_logic: "2", max_level_memory: "1", meeting_date: "2017-07-11", other_information: "3", pin: "4242", piscine_date: "2017-11-15", postal_city: "Tillmanton", postal_complement: "", postal_country: "Georgia", postal_street: "5030 Serenity Plaza", postal_zip_code: "65440", user_id: "9", zip_code: "37528-3874"}}
response = token.post("/v2/user_candidatures", params: params)
response.status
# => 201
response.parsed
# => {"id"=>127, "user_id"=>9, "birth_date"=>"1989-01-30", "gender"=>"female", "zip_code"=>"37528-3874", "country"=>"Honduras", "birth_city"=>"West Stefanieburgh", "birth_country"=>"Burkina Faso", "postal_street"=>"5030 Serenity Plaza", "postal_complement"=>"", "postal_city"=>"Tillmanton", "postal_zip_code"=>"65440", "postal_country"=>"Georgia", "contact_affiliation"=>"other", "contact_last_name"=>"Mertz", "contact_first_name"=>"Barton", "contact_phone1"=>"0695847362", "contact_phone2"=>"0491314200", "max_level_memory"=>1, "max_level_logic"=>2, "other_information"=>"3", "language"=>"", "meeting_date"=>"2017-07-11T00:00:00.000Z", "piscine_date"=>"2017-11-15", "created_at"=>"2017-11-22T13:44:17.725Z", "updated_at"=>"2017-11-22T13:44:17.725Z", "phone"=>nil, "email"=>nil, "pin"=>"4242", "phone_country_code"=>nil, "hidden_phone"=>nil}