PATCH /v2/scales/:id
Update a scale
PUT /v2/scales/:id
Update a scale
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 |
scale | optional , nil allowed . Must be a Hash |
scale[name] |
optional
. Must be String
The name. Must be unique in the scope of a given evaluation. |
scale[lg] |
optional
, nil allowed
. Must be String
The language id. |
scale[is_primary] |
optional
, nil allowed
. Must be one of: true , false .
Is it is primary ? Default to false. |
scale[is_external] |
optional
, nil allowed
. Must be one of: true , false .
Is it is external ? Default to false. |
scale[manual_subscription] |
optional
, nil allowed
. Must be one of: true , false .
Is it manual subscription ? Default to false. |
scale[comment] |
optional
, nil allowed
. Must be String
The comment. |
scale[introduction_md] |
optional
, nil allowed
. Must be String
The introduction md. |
scale[disclaimer_md] |
optional
, nil allowed
. Must be String
The disclaimer md. |
scale[guidelines_md] |
optional
. Must be String
The guidelines md. |
scale[correction_number] |
optional
. Must be Fixnum
The correction number. |
scale[duration] |
optional
. Must be Fixnum
The duration. |
scale[free] |
optional
, nil allowed
. Must be one of: true , false .
Is it free ? |
scale[evaluation_id] |
optional
, nil allowed
. Must be Fixnum
The evaluation id. |
scale[flag_ids] |
optional
, nil allowed
. Must be an array of Integer
The flag ids. |
scale[attachments_attributes] |
optional
, nil allowed
. Must be an Array of nested elements
The attachments attributes. |
scale[attachments_attributes][id] |
optional
, nil allowed
. Must be Fixnum
The id. |
scale[attachments_attributes][kind] |
optional
, nil allowed
. Must be one of: code , pdf , link , document , video .
The kind. |
scale[attachments_attributes][language_id] |
optional
. Must be Fixnum
The language id. |
scale[attachments_attributes][_destroy] |
optional
, nil allowed
. Must be String
The destroy. |
scale[attachments_attributes][untranslatable] |
optional
, nil allowed
. Must be one of: true , false .
Is it untranslatable ? Default to false. |
scale[attachments_attributes][attachable_attributes] |
optional
, nil allowed
. Must be an Array of nested elements
The attachable attributes. |
scale[sections_attributes] |
optional
, nil allowed
. Must be an Array of nested elements
The sections attributes. |
scale[sections_attributes][id] |
optional
, nil allowed
. Must be Fixnum
The id. |
scale[sections_attributes][description] |
optional
, nil allowed
. Must be String
The description. |
scale[sections_attributes][questions_attributes] |
optional
, nil allowed
. Must be an Array of nested elements
The questions attributes. |
scale[sections_attributes][questions_attributes][id] |
optional
, nil allowed
. Must be Fixnum
The id. |
scale[sections_attributes][questions_attributes][name] |
optional
. Must be String
The name. |
scale[sections_attributes][questions_attributes][kind] |
optional
. Must be one of: standard , bonus .
The kind. |
scale[sections_attributes][questions_attributes][rating] |
optional
. Must be one of: bool , multi , text .
The rating. |
scale[sections_attributes][questions_attributes][guidelines] |
optional
. Must be String
The guidelines. |
scale[sections_attributes][questions_attributes][_destroy] |
optional
, nil allowed
. Must be String
The destroy. |
scale[sections_attributes][questions_attributes][questions_skills_attributes] |
optional
, nil allowed
. Must be an Array of nested elements
The questions skills attributes. |
scale[sections_attributes][questions_attributes][questions_skills_attributes][id] |
optional
, nil allowed
. Must be Fixnum
The id. |
scale[sections_attributes][questions_attributes][questions_skills_attributes][skill_id] |
optional
. Must be Fixnum
The skill id. |
scale[sections_attributes][questions_attributes][questions_skills_attributes][percentage] |
optional
. Must be Fixnum
The percentage. |
scale[sections_attributes][questions_attributes][questions_skills_attributes][_destroy] |
optional
, nil allowed
. Must be String
The destroy. |
scale[sections_attributes][name] |
optional
. Must be String
The name. |
scale[sections_attributes][_destroy] |
optional
, nil allowed
. Must be String
The destroy. |
Examples
PUT /v2/scales/2
{
"scale": {
"comment": "Dolores facere letterpress. Facilis pork belly church-key rem enim ut twee.",
"disclaimer_md": "Narwhal harum et voluptatum dolor similique minus biodiesel. Mlkshk architecto sapiente harum ipsum. Ut selvage paleo. Quia franzen listicle occupy.",
"guidelines_md": "Ut kickstarter aut wolf harum vel cornhole stumptown. Next level semiotics ab squid sit ethical lumbersexual. Venmo aspernatur retro letterpress quae ea pickled provident. Small batch ugh quia flexitarian.",
"introduction_md": "Amet sed sint perferendis sriracha. Thundercats consequuntur salvia. Jean shorts church-key ut enim est selvage aut. Alias cray paleo quia ea nulla five dollar toast in. Vitae eos vegan aut inventore at dolorem quo."
}
}
204
curl -X PUT -H "Authorization: Bearer YOUR_ACCESS_TOKEN" -H "Content-Type: application/json" -d '{"scale":{"comment":"Dolores facere letterpress. Facilis pork belly church-key rem enim ut twee.","disclaimer_md":"Narwhal harum et voluptatum dolor similique minus biodiesel. Mlkshk architecto sapiente harum ipsum. Ut selvage paleo. Quia franzen listicle occupy.","guidelines_md":"Ut kickstarter aut wolf harum vel cornhole stumptown. Next level semiotics ab squid sit ethical lumbersexual. Venmo aspernatur retro letterpress quae ea pickled provident. Small batch ugh quia flexitarian.","introduction_md":"Amet sed sint perferendis sriracha. Thundercats consequuntur salvia. Jean shorts church-key ut enim est selvage aut. Alias cray paleo quia ea nulla five dollar toast in. Vitae eos vegan aut inventore at dolorem quo."}}' "https://api.intra.42.fr/v2/scales/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 = {scale: {comment: "Dolores facere letterpress. Facilis pork belly church-key rem enim ut twee.", disclaimer_md: "Narwhal harum et voluptatum dolor similique minus biodiesel. Mlkshk architecto sapiente harum ipsum. Ut selvage paleo. Quia franzen listicle occupy.", guidelines_md: "Ut kickstarter aut wolf harum vel cornhole stumptown. Next level semiotics ab squid sit ethical lumbersexual. Venmo aspernatur retro letterpress quae ea pickled provident. Small batch ugh quia flexitarian.", introduction_md: "Amet sed sint perferendis sriracha. Thundercats consequuntur salvia. Jean shorts church-key ut enim est selvage aut. Alias cray paleo quia ea nulla five dollar toast in. Vitae eos vegan aut inventore at dolorem quo."}}
response = token.put("/v2/scales/2", params: params)
response.status
# => 204
response.parsed
# =>