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.

comments powered by <span class='logo-disqus'>Disqus</span>
POST /v2/teams_uploads
{
  "teams_upload": {
    "comment": "The Curious Incident of the Dog in the Night-Time",
    "final_mark": "42",
    "team_id": "30",
    "upload_id": "1"
  }
}
201
{
  "id": 4,
  "final_mark": 42,
  "comment": "The Curious Incident of the Dog in the Night-Time",
  "created_at": "2017-03-06T15:20:39.113Z",
  "upload_id": 1,
  "upload": {
    "id": 1,
    "evaluation_id": 2,
    "name": "Arkansas buffalo",
    "description": "",
    "created_at": "2017-03-06T14:59:04.352Z",
    "updated_at": "2017-03-06T15:20:39.116Z"
  }
}
curl  -X POST -H "Authorization: Bearer YOUR_ACCESS_TOKEN" -H "Content-Type: application/json" -d '{"teams_upload":{"comment":"The Curious Incident of the Dog in the Night-Time","final_mark":"42","team_id":"30","upload_id":"1"}}' "https://api.intra.42.fr/v2/teams_uploads"

{
  "id": 4,
  "final_mark": 42,
  "comment": "The Curious Incident of the Dog in the Night-Time",
  "created_at": "2017-03-06T15:20:39.113Z",
  "upload_id": 1,
  "upload": {
    "id": 1,
    "evaluation_id": 2,
    "name": "Arkansas buffalo",
    "description": "",
    "created_at": "2017-03-06T14:59:04.352Z",
    "updated_at": "2017-03-06T15:20:39.116Z"
  }
}
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 Curious Incident of the Dog in the Night-Time", final_mark: "42", team_id: "30", upload_id: "1"}}
response = token.post("/v2/teams_uploads", params: params)
response.status
# => 201
response.parsed
# => {"id"=>4, "final_mark"=>42, "comment"=>"The Curious Incident of the Dog in the Night-Time", "created_at"=>"2017-03-06T15:20:39.113Z", "upload_id"=>1, "upload"=>{"id"=>1, "evaluation_id"=>2, "name"=>"Arkansas buffalo", "description"=>"", "created_at"=>"2017-03-06T14:59:04.352Z", "updated_at"=>"2017-03-06T15:20:39.116Z"}}