PATCH /v2/projects/:id
Update a project
PUT /v2/projects/:id
Update a project
live_help Notes
Advanced tutor
settings Params
Param name | Description |
---|---|
id |
required
. Must be String
The requested id |
project | optional , nil allowed . Must be a Hash |
project[name] |
optional
. Must be String
The name. |
project[terminating_after] |
optional
, nil allowed
. Must be String
The terminating after. |
project[exam] |
optional
, nil allowed
. Must be one of: true , false .
Is it exam ? Default to false. |
project[has_mark] |
optional
, nil allowed
. Must be one of: true , false .
Is it has mark ? Default to true. |
project[repository] |
optional
. Must be String
The repository. |
project[git_id] |
optional
, nil allowed
. Must be Fixnum
The git id. |
project[has_git] |
optional
, nil allowed
. Must be one of: true , false .
Is it has git ? Default to true. |
project[is_subscriptable] |
optional
, nil allowed
. Must be String
The is subscriptable. |
project[inherited_team] |
optional
, nil allowed
. Must be one of: true , false .
Is it inherited team ? Default to false. |
project[minimum_mark] |
optional
, nil allowed
. Must be String
The minimum mark. |
project[parent_id] |
optional
, nil allowed
. Must be Fixnum
The parent id. |
project[max_people] |
optional
, nil allowed
. Must be String
The max people. |
project[visible] |
optional
, nil allowed
. Must be one of: true , false .
Is it visible ? Default to false. |
project[cursus_ids] |
optional
, nil allowed
. Must be an array of Integer
The cursus ids. |
project[campus_ids] |
optional
, nil allowed
. Must be an array of Integer
The campus ids. |
project[authors_user_ids] |
optional
, nil allowed
. Must be an array of Integer
The authors user ids. |
project[notion_ids] |
optional
, nil allowed
. Must be an array of Integer
The notion ids. |
project[project_sessions_attributes] |
optional
, nil allowed
. Must be an Array of nested elements
The project sessions attributes. |
project[project_sessions_attributes][id] |
optional
, nil allowed
. Must be Fixnum
The id. |
project[project_sessions_attributes][campus_id] |
optional
, nil allowed
. Must be Fixnum
The campus id. |
project[project_sessions_attributes][cursus_id] |
optional
, nil allowed
. Must be Fixnum
The cursus id. |
project[project_sessions_attributes][estimate_time] |
optional
, nil allowed
. Must be Fixnum
The estimate time. |
project[project_sessions_attributes][created_at] |
optional
, nil allowed
. Must be DateTime
The created at. |
project[project_sessions_attributes][updated_at] |
optional
, nil allowed
. Must be DateTime
The updated at. |
project[project_sessions_attributes][begin_at] |
optional
, nil allowed
. Must be DateTime
The begin at. |
project[project_sessions_attributes][end_at] |
optional
, nil allowed
. Must be DateTime
The end at. |
project[project_sessions_attributes][max_people] |
optional
, nil allowed
. Must be Fixnum
The max people. |
project[project_sessions_attributes][duration_days] |
optional
, nil allowed
. Must be Fixnum
The duration days. |
project[project_sessions_attributes][terminating_after] |
optional
, nil allowed
. Must be Fixnum
The terminating after. |
project[project_sessions_attributes][solo] |
optional
, nil allowed
. Must be one of: true , false .
Is it solo ? Default to false. |
project[project_sessions_attributes][is_subscriptable] |
optional
, nil allowed
. Must be one of: true , false .
Is it is subscriptable ? Default to true. |
project[project_sessions_attributes][minimum_mark] |
optional
. Must be Fixnum
The minimum mark. |
project[project_sessions_attributes][team_behaviour] |
optional
. Must be one of: user , upload , by_rule , none .
The team behaviour. |
project[project_sessions_attributes][_destroy] |
optional
, nil allowed
. Must be String
The destroy. |
project[evaluations_attributes] |
optional
, nil allowed
. Must be an Array of nested elements
The evaluations attributes. |
project[evaluations_attributes][id] |
optional
, nil allowed
. Must be Fixnum
The id. |
project[evaluations_attributes][kind] |
optional
, nil allowed
. Must be one of: scale , upload .
The kind. |
project[evaluations_attributes][_destroy] |
optional
, nil allowed
. Must be String
The destroy. |
project[attachments_attributes] |
optional
, nil allowed
. Must be an Array of nested elements
The attachments attributes. |
project[attachments_attributes][id] |
optional
, nil allowed
. Must be Fixnum
The id. |
project[attachments_attributes][language_id] |
optional
. Must be Fixnum
The language id. |
project[attachments_attributes][kind] |
optional
, nil allowed
. Must be one of: code , pdf , link , document , video .
The kind. |
project[attachments_attributes][_destroy] |
optional
, nil allowed
. Must be String
The destroy. |
project[attachments_attributes][untranslatable] |
optional
, nil allowed
. Must be one of: true , false .
Is it untranslatable ? Default to false. |
project[attachments_attributes][attachable_attributes] |
optional
, nil allowed
. Must be an Array of nested elements
The attachable attributes. |
project[projects_rules_attributes] |
optional
, nil allowed
. Must be an Array of nested elements
The projects rules attributes. |
Examples
PUT /v2/projects/2
{
"project": {
"description": "Cliche kinfolk kickstarter chia.",
"has_git": "true",
"has_mark": "true",
"is_subscriptable": "true",
"name": "Butter In a Lordly Dish",
"visible": "true"
}
}
204
curl -X PUT -H "Authorization: Bearer YOUR_ACCESS_TOKEN" -H "Content-Type: application/json" -d '{"project":{"description":"Cliche kinfolk kickstarter chia.","has_git":"true","has_mark":"true","is_subscriptable":"true","name":"Butter In a Lordly Dish","visible":"true"}}' "https://api.intra.42.fr/v2/projects/2"
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 = {project: {description: "Cliche kinfolk kickstarter chia.", has_git: "true", has_mark: "true", is_subscriptable: "true", name: "Butter In a Lordly Dish", visible: "true"}}
response = token.put("/v2/projects/2", params: params)
response.status
# => 204
response.parsed
# =>