GET /v2/internships/:id
Get an internship
GET /v2/users/:user_id/internships/:id
Get an internship of the given Id, associated with the given User
live_help Notes
assignment
This action requires one of theses roles:
Companies manager
settings Params
Param name | Description |
---|---|
id |
required
. Must be String
The requested id |
user_id |
optional
. Must be String
The user id or slug |
Examples
GET /v2/internships/2350
200
{
"id": 2350,
"administration_id": 1,
"offer_id": null,
"language_id": 1,
"state": "uploaded",
"days": "[\"monday\",\"tuesday\",\"wednesday\",\"thursday\",\"friday\"]",
"user_address": "5 rue de la paix",
"user_postal": "75001",
"user_city": "Paris",
"user_country": "France",
"company_name": "Association 42",
"company_boss_user_first_name": "FirstName",
"company_boss_user_last_name": "LastName",
"company_boss_user_email": "[email protected]",
"company_boss_user_phone": "0123456789",
"company_user_first_name": "Quentin",
"company_user_last_name": "Bollache",
"company_user_post": "Responsable technique et pedagogique",
"company_user_email": "[email protected]",
"company_user_phone": "0123456789",
"company_address": "96 Boulevard Bessières",
"company_postal": "75017",
"company_city": "Paris",
"company_country": "France",
"company_siret": "0",
"internship_address": "96 Boulevard Bessières",
"internship_postal": "75017",
"internship_city": "Paris",
"internship_country": "France",
"contract_type": "stage",
"subject": "Développement de tous les sites web reliés à 42",
"start_at": "2017-07-31T22:00:00.000Z",
"end_at": "2018-01-30T23:00:00.000Z",
"duration": 6,
"nb_days": 5,
"nb_hours": 35,
"movement": null,
"salary": 50000,
"currency": "eur",
"breach_at": null,
"convention": {
"convention": {
"url": "/uploads/internship/convention/jgengo-9543c17018c04a7f99fd01bf62a478/2350/jgengo.zip"
}
},
"user": {
"id": 19265,
"login": "jgengo",
"url": "http://localhost:13000/v2/users/jgengo"
}
}
curl -H "Authorization: Bearer YOUR_ACCESS_TOKEN" "https://api.intra.42.fr/v2/internships/2350"
{
"id": 2350,
"administration_id": 1,
"offer_id": null,
"language_id": 1,
"state": "uploaded",
"days": "[\"monday\",\"tuesday\",\"wednesday\",\"thursday\",\"friday\"]",
"user_address": "5 rue de la paix",
"user_postal": "75001",
"user_city": "Paris",
"user_country": "France",
"company_name": "Association 42",
"company_boss_user_first_name": "FirstName",
"company_boss_user_last_name": "LastName",
"company_boss_user_email": "[email protected]",
"company_boss_user_phone": "0123456789",
"company_user_first_name": "Quentin",
"company_user_last_name": "Bollache",
"company_user_post": "Responsable technique et pedagogique",
"company_user_email": "[email protected]",
"company_user_phone": "0123456789",
"company_address": "96 Boulevard Bessières",
"company_postal": "75017",
"company_city": "Paris",
"company_country": "France",
"company_siret": "0",
"internship_address": "96 Boulevard Bessières",
"internship_postal": "75017",
"internship_city": "Paris",
"internship_country": "France",
"contract_type": "stage",
"subject": "Développement de tous les sites web reliés à 42",
"start_at": "2017-07-31T22:00:00.000Z",
"end_at": "2018-01-30T23:00:00.000Z",
"duration": 6,
"nb_days": 5,
"nb_hours": 35,
"movement": null,
"salary": 50000,
"currency": "eur",
"breach_at": null,
"convention": {
"convention": {
"url": "/uploads/internship/convention/jgengo-9543c17018c04a7f99fd01bf62a478/2350/jgengo.zip"
}
},
"user": {
"id": 19265,
"login": "jgengo",
"url": "http://localhost:13000/v2/users/jgengo"
}
}
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/internships/2350")
response.status
# => 200
response.parsed
# => {"id"=>2350, "administration_id"=>1, "offer_id"=>nil, "language_id"=>1, "state"=>"uploaded", "days"=>"[\"monday\",\"tuesday\",\"wednesday\",\"thursday\",\"friday\"]", "user_address"=>"5 rue de la paix", "user_postal"=>"75001", "user_city"=>"Paris", "user_country"=>"France", "company_name"=>"Association 42", "company_boss_user_first_name"=>"FirstName", "company_boss_user_last_name"=>"LastName", "company_boss_user_email"=>"[email protected]", "company_boss_user_phone"=>"0123456789", "company_user_first_name"=>"Quentin", "company_user_last_name"=>"Bollache", "company_user_post"=>"Responsable technique et pedagogique", "company_user_email"=>"[email protected]", "company_user_phone"=>"0123456789", "company_address"=>"96 Boulevard Bessières", "company_postal"=>"75017", "company_city"=>"Paris", "company_country"=>"France", "company_siret"=>"0", "internship_address"=>"96 Boulevard Bessières", "internship_postal"=>"75017", "internship_city"=>"Paris", "internship_country"=>"France", "contract_type"=>"stage", "subject"=>"Développement de tous les sites web reliés à 42", "start_at"=>"2017-07-31T22:00:00.000Z", "end_at"=>"2018-01-30T23:00:00.000Z", "duration"=>6, "nb_days"=>5, "nb_hours"=>35, "movement"=>nil, "salary"=>50000, "currency"=>"eur", "breach_at"=>nil, "convention"=>{"convention"=>{"url"=>"/uploads/internship/convention/jgengo-9543c17018c04a7f99fd01bf62a478/2350/jgengo.zip"}}, "user"=>{"id"=>19265, "login"=>"jgengo", "url"=>"http://localhost:13000/v2/users/jgengo"}}