live_help Notes

chrome_reader_mode This resource is paginated by 30 items

settings Params

Param name Description
project_id optional . Must be String

The project id or slug

sort optional . Must be one of: id, project_id, campus_id, cursus_id, estimate_time, created_at, updated_at, begin_at, end_at, max_people, duration_days, terminating_after, solo, is_subscriptable, minimum_mark, team_behaviour.

The sort field. Sorted by id desc by default.

Example:

To sort on project sessions on the fields minimum_mark on a descending order and team_behaviour on a ascending order:

...&sort=-minimum_mark,team_behaviour

filter optional . Must be one of: id, project_id, campus_id, cursus_id, estimate_time, created_at, updated_at, begin_at, end_at, max_people, duration_days, terminating_after, solo, is_subscriptable, team_behaviour, future, end.

Filtering on one or more fields

Example:

To filter on project sessions with the id field matching a_value or another_value:

...&filter[id]=a_value,another_value

Filterable fields:
  • id (standard field)
  • project_id (standard field)
  • campus_id (standard field)
  • cursus_id (standard field)
  • estimate_time (standard field)
  • created_at (standard field)
  • updated_at (standard field)
  • begin_at (standard field)
  • end_at (standard field)
  • max_people (standard field)
  • duration_days (standard field)
  • terminating_after (standard field)
  • solo (standard field)
  • is_subscriptable (standard field)
  • team_behaviour (standard field)
  • future : Return only project sessions which begins in the future. Can be one of: true, false
  • end (standard field)
range optional . Must be one of: id, project_id, campus_id, cursus_id, estimate_time, created_at, updated_at, begin_at, end_at, max_people, duration_days, terminating_after, solo, is_subscriptable, team_behaviour.

Select on a particular range

Example:

To range on project sessions with the team_behaviour field between min_value and max_value:

...&range[team_behaviour]=min_value,max_value

Rangeable fields:
  • id
  • project_id
  • campus_id
  • cursus_id
  • estimate_time
  • created_at
  • updated_at
  • begin_at
  • end_at
  • max_people
  • duration_days
  • terminating_after
  • solo
  • is_subscriptable
  • team_behaviour
page optional . Must be a Hash

The pagination params, as a hash

page[number] optional . Must be Fixnum

The current page

page[size] optional . Must be Fixnum

The number of items per page, defaults to 30, maximum 100

comments powered by <span class='logo-disqus'>Disqus</span>
GET /v2/project_sessions
200
[
  {
    "id": 5,
    "solo": false,
    "begin_at": null,
    "end_at": null,
    "estimate_time": null,
    "duration_days": null,
    "terminating_after": null,
    "project_id": 5,
    "campus_id": null,
    "cursus_id": null,
    "created_at": "2017-11-22T13:41:26.911Z",
    "updated_at": "2017-11-22T13:41:26.911Z",
    "max_people": null,
    "is_subscriptable": true,
    "scales": [],
    "uploads": [],
    "team_behaviour": "user",
    "project": {
      "id": 5,
      "name": "Quarter Finals",
      "slug": "hogwarts-quidditch-cup-quarter-finals",
      "description": null,
      "parent": {
        "name": "Hogwarts Quidditch Cup",
        "id": 4,
        "slug": "hogwarts-quidditch-cup",
        "url": "https://projects.intra.42.fr/hogwarts-quidditch-cup/mine"
      },
      "children": [],
      "objectives": null,
      "tier": null,
      "attachments": [],
      "created_at": "2017-11-22T13:41:26.895Z",
      "updated_at": "2017-11-22T13:41:26.973Z",
      "exam": false
    },
    "campus": null,
    "cursus": null,
    "evaluations": [
      {
        "id": 5,
        "kind": "scale"
      }
    ]
  },
  {
    "id": 4,
    "solo": false,
    "begin_at": null,
    "end_at": null,
    "estimate_time": null,
    "duration_days": null,
    "terminating_after": null,
    "project_id": 4,
    "campus_id": null,
    "cursus_id": null,
    "created_at": "2017-11-22T13:41:26.786Z",
    "updated_at": "2017-11-22T13:41:26.786Z",
    "max_people": null,
    "is_subscriptable": true,
    "scales": [],
    "uploads": [],
    "team_behaviour": "user",
    "project": {
      "id": 4,
      "name": "Hogwarts Quidditch Cup",
      "slug": "hogwarts-quidditch-cup",
      "description": "The game starts with the referee releasing all four balls from the central circle. The Bludgers and the Snitch, having been bewitched, fly off of their own accord, the Snitch to hide itself quickly and the Bludgers to attack the nearest players. The Quaffle is thrown into the air by the referee to signal the start of play.",
      "parent": null,
      "children": [
        {
          "name": "Quarter Finals",
          "id": 5,
          "slug": "hogwarts-quidditch-cup-quarter-finals",
          "url": "https://projects.intra.42.fr/hogwarts-quidditch-cup-quarter-finals/mine"
        }
      ],
      "objectives": [
        "Quidditch"
      ],
      "tier": 1,
      "attachments": [],
      "created_at": "2017-11-22T13:41:26.765Z",
      "updated_at": "2017-11-22T13:41:26.975Z",
      "exam": false
    },
    "campus": null,
    "cursus": null,
    "evaluations": []
  },
  {
    "id": 3,
    "solo": true,
    "begin_at": null,
    "end_at": null,
    "estimate_time": 2592000,
    "duration_days": null,
    "terminating_after": null,
    "project_id": 3,
    "campus_id": null,
    "cursus_id": null,
    "created_at": "2017-11-22T13:41:26.545Z",
    "updated_at": "2017-11-22T13:41:26.545Z",
    "max_people": null,
    "is_subscriptable": true,
    "scales": [],
    "uploads": [],
    "team_behaviour": "user",
    "project": {
      "id": 3,
      "name": "Metaprogramming in OCaml",
      "slug": "metaprogramming-in-ocaml",
      "description": "Something you shouldn't see",
      "parent": null,
      "children": [],
      "objectives": [
        "Run away"
      ],
      "tier": 1,
      "attachments": [],
      "created_at": "2017-11-22T13:41:26.537Z",
      "updated_at": "2017-11-22T13:41:26.616Z",
      "exam": true
    },
    "campus": null,
    "cursus": null,
    "evaluations": [
      {
        "id": 4,
        "kind": "scale"
      }
    ]
  }
]
curl  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" "https://api.intra.42.fr/v2/project_sessions"

[
  {
    "id": 5,
    "solo": false,
    "begin_at": null,
    "end_at": null,
    "estimate_time": null,
    "duration_days": null,
    "terminating_after": null,
    "project_id": 5,
    "campus_id": null,
    "cursus_id": null,
    "created_at": "2017-11-22T13:41:26.911Z",
    "updated_at": "2017-11-22T13:41:26.911Z",
    "max_people": null,
    "is_subscriptable": true,
    "scales": [],
    "uploads": [],
    "team_behaviour": "user",
    "project": {
      "id": 5,
      "name": "Quarter Finals",
      "slug": "hogwarts-quidditch-cup-quarter-finals",
      "description": null,
      "parent": {
        "name": "Hogwarts Quidditch Cup",
        "id": 4,
        "slug": "hogwarts-quidditch-cup",
        "url": "https://projects.intra.42.fr/hogwarts-quidditch-cup/mine"
      },
      "children": [],
      "objectives": null,
      "tier": null,
      "attachments": [],
      "created_at": "2017-11-22T13:41:26.895Z",
      "updated_at": "2017-11-22T13:41:26.973Z",
      "exam": false
    },
    "campus": null,
    "cursus": null,
    "evaluations": [
      {
        "id": 5,
        "kind": "scale"
      }
    ]
  },
  {
    "id": 4,
    "solo": false,
    "begin_at": null,
    "end_at": null,
    "estimate_time": null,
    "duration_days": null,
    "terminating_after": null,
    "project_id": 4,
    "campus_id": null,
    "cursus_id": null,
    "created_at": "2017-11-22T13:41:26.786Z",
    "updated_at": "2017-11-22T13:41:26.786Z",
    "max_people": null,
    "is_subscriptable": true,
    "scales": [],
    "uploads": [],
    "team_behaviour": "user",
    "project": {
      "id": 4,
      "name": "Hogwarts Quidditch Cup",
      "slug": "hogwarts-quidditch-cup",
      "description": "The game starts with the referee releasing all four balls from the central circle. The Bludgers and the Snitch, having been bewitched, fly off of their own accord, the Snitch to hide itself quickly and the Bludgers to attack the nearest players. The Quaffle is thrown into the air by the referee to signal the start of play.",
      "parent": null,
      "children": [
        {
          "name": "Quarter Finals",
          "id": 5,
          "slug": "hogwarts-quidditch-cup-quarter-finals",
          "url": "https://projects.intra.42.fr/hogwarts-quidditch-cup-quarter-finals/mine"
        }
      ],
      "objectives": [
        "Quidditch"
      ],
      "tier": 1,
      "attachments": [],
      "created_at": "2017-11-22T13:41:26.765Z",
      "updated_at": "2017-11-22T13:41:26.975Z",
      "exam": false
    },
    "campus": null,
    "cursus": null,
    "evaluations": []
  },
  {
    "id": 3,
    "solo": true,
    "begin_at": null,
    "end_at": null,
    "estimate_time": 2592000,
    "duration_days": null,
    "terminating_after": null,
    "project_id": 3,
    "campus_id": null,
    "cursus_id": null,
    "created_at": "2017-11-22T13:41:26.545Z",
    "updated_at": "2017-11-22T13:41:26.545Z",
    "max_people": null,
    "is_subscriptable": true,
    "scales": [],
    "uploads": [],
    "team_behaviour": "user",
    "project": {
      "id": 3,
      "name": "Metaprogramming in OCaml",
      "slug": "metaprogramming-in-ocaml",
      "description": "Something you shouldn't see",
      "parent": null,
      "children": [],
      "objectives": [
        "Run away"
      ],
      "tier": 1,
      "attachments": [],
      "created_at": "2017-11-22T13:41:26.537Z",
      "updated_at": "2017-11-22T13:41:26.616Z",
      "exam": true
    },
    "campus": null,
    "cursus": null,
    "evaluations": [
      {
        "id": 4,
        "kind": "scale"
      }
    ]
  }
]
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

response = token.get("/v2/project_sessions")
response.status
# => 200
response.parsed
# => [{"id"=>5, "solo"=>false, "begin_at"=>nil, "end_at"=>nil, "estimate_time"=>nil, "duration_days"=>nil, "terminating_after"=>nil, "project_id"=>5, "campus_id"=>nil, "cursus_id"=>nil, "created_at"=>"2017-11-22T13:41:26.911Z", "updated_at"=>"2017-11-22T13:41:26.911Z", "max_people"=>nil, "is_subscriptable"=>true, "scales"=>[], "uploads"=>[], "team_behaviour"=>"user", "project"=>{"id"=>5, "name"=>"Quarter Finals", "slug"=>"hogwarts-quidditch-cup-quarter-finals", "description"=>nil, "parent"=>{"name"=>"Hogwarts Quidditch Cup", "id"=>4, "slug"=>"hogwarts-quidditch-cup", "url"=>"https://projects.intra.42.fr/hogwarts-quidditch-cup/mine"}, "children"=>[], "objectives"=>nil, "tier"=>nil, "attachments"=>[], "created_at"=>"2017-11-22T13:41:26.895Z", "updated_at"=>"2017-11-22T13:41:26.973Z", "exam"=>false}, "campus"=>nil, "cursus"=>nil, "evaluations"=>[{"id"=>5, "kind"=>"scale"}]}, {"id"=>4, "solo"=>false, "begin_at"=>nil, "end_at"=>nil, "estimate_time"=>nil, "duration_days"=>nil, "terminating_after"=>nil, "project_id"=>4, "campus_id"=>nil, "cursus_id"=>nil, "created_at"=>"2017-11-22T13:41:26.786Z", "updated_at"=>"2017-11-22T13:41:26.786Z", "max_people"=>nil, "is_subscriptable"=>true, "scales"=>[], "uploads"=>[], "team_behaviour"=>"user", "project"=>{"id"=>4, "name"=>"Hogwarts Quidditch Cup", "slug"=>"hogwarts-quidditch-cup", "description"=>"The game starts with the referee releasing all four balls from the central circle. The Bludgers and the Snitch, having been bewitched, fly off of their own accord, the Snitch to hide itself quickly and the Bludgers to attack the nearest players. The Quaffle is thrown into the air by the referee to signal the start of play.", "parent"=>nil, "children"=>[{"name"=>"Quarter Finals", "id"=>5, "slug"=>"hogwarts-quidditch-cup-quarter-finals", "url"=>"https://projects.intra.42.fr/hogwarts-quidditch-cup-quarter-finals/mine"}], "objectives"=>["Quidditch"], "tier"=>1, "attachments"=>[], "created_at"=>"2017-11-22T13:41:26.765Z", "updated_at"=>"2017-11-22T13:41:26.975Z", "exam"=>false}, "campus"=>nil, "cursus"=>nil, "evaluations"=>[]}, {"id"=>3, "solo"=>true, "begin_at"=>nil, "end_at"=>nil, "estimate_time"=>2592000, "duration_days"=>nil, "terminating_after"=>nil, "project_id"=>3, "campus_id"=>nil, "cursus_id"=>nil, "created_at"=>"2017-11-22T13:41:26.545Z", "updated_at"=>"2017-11-22T13:41:26.545Z", "max_people"=>nil, "is_subscriptable"=>true, "scales"=>[], "uploads"=>[], "team_behaviour"=>"user", "project"=>{"id"=>3, "name"=>"Metaprogramming in OCaml", "slug"=>"metaprogramming-in-ocaml", "description"=>"Something you shouldn't see", "parent"=>nil, "children"=>[], "objectives"=>["Run away"], "tier"=>1, "attachments"=>[], "created_at"=>"2017-11-22T13:41:26.537Z", "updated_at"=>"2017-11-22T13:41:26.616Z", "exam"=>true}, "campus"=>nil, "cursus"=>nil, "evaluations"=>[{"id"=>4, "kind"=>"scale"}]}]