POST /v2/teams_uploads
Create a teams upload
live_help Notes
assignment
This action requires one of theses roles:
Advanced tutor
group_work
Requires following application scopes:
projects
settings Params
Param name | Description |
---|---|
teams_upload | optional , nil allowed . Must be a Hash |
teams_upload[team_id] |
required
. Must be Fixnum
The team id. Must be unique in the scope of a given upload. |
teams_upload[upload_id] |
required
. Must be Fixnum
The upload id. |
teams_upload[final_mark] |
optional
, nil allowed
. Must be Fixnum
The final mark. |
teams_upload[comment] |
optional
, nil allowed
. Must be String
The comment. |
Examples
POST /v2/teams_uploads
{
"teams_upload": {
"comment": "The Other Side of Silence",
"final_mark": "42",
"team_id": "66",
"upload_id": "1"
}
}
201
{
"id": 2,
"final_mark": 42,
"comment": "The Other Side of Silence",
"created_at": "2017-11-22T13:44:07.389Z",
"upload_id": 1,
"upload": {
"id": 1,
"evaluation_id": 2,
"name": "Idaho kangaroos",
"description": "",
"created_at": "2017-11-22T13:41:26.168Z",
"updated_at": "2017-11-22T13:44:07.391Z"
}
}
curl -X POST -H "Authorization: Bearer YOUR_ACCESS_TOKEN" -H "Content-Type: application/json" -d '{"teams_upload":{"comment":"The Other Side of Silence","final_mark":"42","team_id":"66","upload_id":"1"}}' "https://api.intra.42.fr/v2/teams_uploads"
{
"id": 2,
"final_mark": 42,
"comment": "The Other Side of Silence",
"created_at": "2017-11-22T13:44:07.389Z",
"upload_id": 1,
"upload": {
"id": 1,
"evaluation_id": 2,
"name": "Idaho kangaroos",
"description": "",
"created_at": "2017-11-22T13:41:26.168Z",
"updated_at": "2017-11-22T13:44:07.391Z"
}
}
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 = {teams_upload: {comment: "The Other Side of Silence", final_mark: "42", team_id: "66", upload_id: "1"}}
response = token.post("/v2/teams_uploads", params: params)
response.status
# => 201
response.parsed
# => {"id"=>2, "final_mark"=>42, "comment"=>"The Other Side of Silence", "created_at"=>"2017-11-22T13:44:07.389Z", "upload_id"=>1, "upload"=>{"id"=>1, "evaluation_id"=>2, "name"=>"Idaho kangaroos", "description"=>"", "created_at"=>"2017-11-22T13:41:26.168Z", "updated_at"=>"2017-11-22T13:44:07.391Z"}}