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
project optional , nil allowed . Must be a Hash
project[name] required . Must be String

The name.

project[description] optional , nil allowed . Must be String

The description.

project[difficulty] required . Must be Fixnum

The difficulty.

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[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[tag_ids] optional , nil allowed . Must be an array of Integer

The tag ids.

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] required . Must be Fixnum

The minimum mark.

project[project_sessions_attributes][team_behaviour] required . 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[projects_skills_attributes] optional , nil allowed . Must be an Array of nested elements

The projects skills attributes.

project[projects_skills_attributes][id] optional , nil allowed . Must be Fixnum

The id.

project[projects_skills_attributes][value] required . Must be Float

The value.

project[projects_skills_attributes][project_id] required . Must be Fixnum

The project id. Must be unique in the scope of a given skill.

project[projects_skills_attributes][skill_id] required . Must be Fixnum

The skill id.

project[projects_skills_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] required . 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.

comments powered by <span class='logo-disqus'>Disqus</span>
POST /v2/projects
{
  "project": {
    "campus_ids": [
      "1",
      "2",
      "3"
    ],
    "cursus_ids": [
      "2"
    ],
    "description": "Echo loko butcher beard irony literally sartorial brooklyn.",
    "difficulty": "0",
    "has_git": "true",
    "has_mark": "true",
    "is_subscriptable": "true",
    "name": "Specimen Days",
    "project_sessions_attributes": [
      {
        "campus_id": "",
        "cursus_id": "",
        "estimate_time": "2592000",
        "is_subscriptable": "true",
        "minimum_mark": "77",
        "solo": "true",
        "team_behaviour": "user"
      },
      {
        "campus_id": "",
        "cursus_id": "2",
        "estimate_time": "2592000",
        "is_subscriptable": "true",
        "minimum_mark": "77",
        "solo": "true",
        "team_behaviour": "user"
      }
    ],
    "visible": "true"
  }
}
201
{
  "id": 8,
  "name": "Specimen Days",
  "slug": "42-specimen-days",
  "description": "Echo loko butcher beard irony literally sartorial brooklyn.",
  "parent": null,
  "children": [],
  "objectives": null,
  "tier": 0,
  "attachments": [],
  "created_at": "2017-03-06T15:20:27.660Z",
  "updated_at": "2017-03-06T15:20:27.729Z",
  "exam": false,
  "cursus": [
    {
      "id": 2,
      "created_at": "2017-03-06T14:58:44.047Z",
      "name": "42",
      "slug": "42"
    }
  ],
  "campus": [
    {
      "id": 1,
      "name": "Cluj",
      "time_zone": "Bucharest",
      "language": {
        "id": 3,
        "name": "Romanian",
        "identifier": "ro",
        "created_at": "2017-03-06T14:58:43.176Z",
        "updated_at": "2017-03-06T14:58:43.176Z"
      },
      "users_count": 16,
      "vogsphere_id": 1
    },
    {
      "id": 2,
      "name": "Johannesburg",
      "time_zone": "Pretoria",
      "language": {
        "id": 2,
        "name": "English",
        "identifier": "en",
        "created_at": "2017-03-06T14:58:43.172Z",
        "updated_at": "2017-03-06T14:58:43.172Z"
      },
      "users_count": 13,
      "vogsphere_id": 1
    },
    {
      "id": 3,
      "name": "Chisinau",
      "time_zone": "Bucharest",
      "language": {
        "id": 3,
        "name": "Romanian",
        "identifier": "ro",
        "created_at": "2017-03-06T14:58:43.176Z",
        "updated_at": "2017-03-06T14:58:43.176Z"
      },
      "users_count": 6,
      "vogsphere_id": 1
    }
  ],
  "skills": [],
  "videos": [],
  "tags": [],
  "project_sessions": [
    {
      "id": 19,
      "solo": true,
      "begin_at": null,
      "end_at": null,
      "estimate_time": 2592000,
      "duration_days": null,
      "terminating_after": null,
      "project_id": 8,
      "campus_id": null,
      "cursus_id": null,
      "created_at": "2017-03-06T15:20:27.675Z",
      "updated_at": "2017-03-06T15:20:27.675Z",
      "max_people": null,
      "is_subscriptable": true,
      "scales": [],
      "uploads": [],
      "team_behaviour": "user",
      "minimum_mark": 77
    },
    {
      "id": 20,
      "solo": true,
      "begin_at": null,
      "end_at": null,
      "estimate_time": 2592000,
      "duration_days": null,
      "terminating_after": null,
      "project_id": 8,
      "campus_id": null,
      "cursus_id": 2,
      "created_at": "2017-03-06T15:20:27.678Z",
      "updated_at": "2017-03-06T15:20:27.678Z",
      "max_people": null,
      "is_subscriptable": true,
      "scales": [],
      "uploads": [],
      "team_behaviour": "user",
      "minimum_mark": 77
    }
  ]
}
curl  -X POST -H "Authorization: Bearer YOUR_ACCESS_TOKEN" -H "Content-Type: application/json" -d '{"project":{"campus_ids":["1","2","3"],"cursus_ids":["2"],"description":"Echo loko butcher beard irony literally sartorial brooklyn.","difficulty":"0","has_git":"true","has_mark":"true","is_subscriptable":"true","name":"Specimen Days","project_sessions_attributes":[{"campus_id":"","cursus_id":"","estimate_time":"2592000","is_subscriptable":"true","minimum_mark":"77","solo":"true","team_behaviour":"user"},{"campus_id":"","cursus_id":"2","estimate_time":"2592000","is_subscriptable":"true","minimum_mark":"77","solo":"true","team_behaviour":"user"}],"visible":"true"}}' "https://api.intra.42.fr/v2/projects"

{
  "id": 8,
  "name": "Specimen Days",
  "slug": "42-specimen-days",
  "description": "Echo loko butcher beard irony literally sartorial brooklyn.",
  "parent": null,
  "children": [],
  "objectives": null,
  "tier": 0,
  "attachments": [],
  "created_at": "2017-03-06T15:20:27.660Z",
  "updated_at": "2017-03-06T15:20:27.729Z",
  "exam": false,
  "cursus": [
    {
      "id": 2,
      "created_at": "2017-03-06T14:58:44.047Z",
      "name": "42",
      "slug": "42"
    }
  ],
  "campus": [
    {
      "id": 1,
      "name": "Cluj",
      "time_zone": "Bucharest",
      "language": {
        "id": 3,
        "name": "Romanian",
        "identifier": "ro",
        "created_at": "2017-03-06T14:58:43.176Z",
        "updated_at": "2017-03-06T14:58:43.176Z"
      },
      "users_count": 16,
      "vogsphere_id": 1
    },
    {
      "id": 2,
      "name": "Johannesburg",
      "time_zone": "Pretoria",
      "language": {
        "id": 2,
        "name": "English",
        "identifier": "en",
        "created_at": "2017-03-06T14:58:43.172Z",
        "updated_at": "2017-03-06T14:58:43.172Z"
      },
      "users_count": 13,
      "vogsphere_id": 1
    },
    {
      "id": 3,
      "name": "Chisinau",
      "time_zone": "Bucharest",
      "language": {
        "id": 3,
        "name": "Romanian",
        "identifier": "ro",
        "created_at": "2017-03-06T14:58:43.176Z",
        "updated_at": "2017-03-06T14:58:43.176Z"
      },
      "users_count": 6,
      "vogsphere_id": 1
    }
  ],
  "skills": [],
  "videos": [],
  "tags": [],
  "project_sessions": [
    {
      "id": 19,
      "solo": true,
      "begin_at": null,
      "end_at": null,
      "estimate_time": 2592000,
      "duration_days": null,
      "terminating_after": null,
      "project_id": 8,
      "campus_id": null,
      "cursus_id": null,
      "created_at": "2017-03-06T15:20:27.675Z",
      "updated_at": "2017-03-06T15:20:27.675Z",
      "max_people": null,
      "is_subscriptable": true,
      "scales": [],
      "uploads": [],
      "team_behaviour": "user",
      "minimum_mark": 77
    },
    {
      "id": 20,
      "solo": true,
      "begin_at": null,
      "end_at": null,
      "estimate_time": 2592000,
      "duration_days": null,
      "terminating_after": null,
      "project_id": 8,
      "campus_id": null,
      "cursus_id": 2,
      "created_at": "2017-03-06T15:20:27.678Z",
      "updated_at": "2017-03-06T15:20:27.678Z",
      "max_people": null,
      "is_subscriptable": true,
      "scales": [],
      "uploads": [],
      "team_behaviour": "user",
      "minimum_mark": 77
    }
  ]
}
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: {campus_ids: ["1", "2", "3"], cursus_ids: ["2"], description: "Echo loko butcher beard irony literally sartorial brooklyn.", difficulty: "0", has_git: "true", has_mark: "true", is_subscriptable: "true", name: "Specimen Days", project_sessions_attributes: [{campus_id: "", cursus_id: "", estimate_time: "2592000", is_subscriptable: "true", minimum_mark: "77", solo: "true", team_behaviour: "user"}, {campus_id: "", cursus_id: "2", estimate_time: "2592000", is_subscriptable: "true", minimum_mark: "77", solo: "true", team_behaviour: "user"}], visible: "true"}}
response = token.post("/v2/projects", params: params)
response.status
# => 201
response.parsed
# => {"id"=>8, "name"=>"Specimen Days", "slug"=>"42-specimen-days", "description"=>"Echo loko butcher beard irony literally sartorial brooklyn.", "parent"=>nil, "children"=>[], "objectives"=>nil, "tier"=>0, "attachments"=>[], "created_at"=>"2017-03-06T15:20:27.660Z", "updated_at"=>"2017-03-06T15:20:27.729Z", "exam"=>false, "cursus"=>[{"id"=>2, "created_at"=>"2017-03-06T14:58:44.047Z", "name"=>"42", "slug"=>"42"}], "campus"=>[{"id"=>1, "name"=>"Cluj", "time_zone"=>"Bucharest", "language"=>{"id"=>3, "name"=>"Romanian", "identifier"=>"ro", "created_at"=>"2017-03-06T14:58:43.176Z", "updated_at"=>"2017-03-06T14:58:43.176Z"}, "users_count"=>16, "vogsphere_id"=>1}, {"id"=>2, "name"=>"Johannesburg", "time_zone"=>"Pretoria", "language"=>{"id"=>2, "name"=>"English", "identifier"=>"en", "created_at"=>"2017-03-06T14:58:43.172Z", "updated_at"=>"2017-03-06T14:58:43.172Z"}, "users_count"=>13, "vogsphere_id"=>1}, {"id"=>3, "name"=>"Chisinau", "time_zone"=>"Bucharest", "language"=>{"id"=>3, "name"=>"Romanian", "identifier"=>"ro", "created_at"=>"2017-03-06T14:58:43.176Z", "updated_at"=>"2017-03-06T14:58:43.176Z"}, "users_count"=>6, "vogsphere_id"=>1}], "skills"=>[], "videos"=>[], "tags"=>[], "project_sessions"=>[{"id"=>19, "solo"=>true, "begin_at"=>nil, "end_at"=>nil, "estimate_time"=>2592000, "duration_days"=>nil, "terminating_after"=>nil, "project_id"=>8, "campus_id"=>nil, "cursus_id"=>nil, "created_at"=>"2017-03-06T15:20:27.675Z", "updated_at"=>"2017-03-06T15:20:27.675Z", "max_people"=>nil, "is_subscriptable"=>true, "scales"=>[], "uploads"=>[], "team_behaviour"=>"user", "minimum_mark"=>77}, {"id"=>20, "solo"=>true, "begin_at"=>nil, "end_at"=>nil, "estimate_time"=>2592000, "duration_days"=>nil, "terminating_after"=>nil, "project_id"=>8, "campus_id"=>nil, "cursus_id"=>2, "created_at"=>"2017-03-06T15:20:27.678Z", "updated_at"=>"2017-03-06T15:20:27.678Z", "max_people"=>nil, "is_subscriptable"=>true, "scales"=>[], "uploads"=>[], "team_behaviour"=>"user", "minimum_mark"=>77}]}