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

user_id optional . Must be String

The user id or slug

sort optional . Must be one of: id, project_id, user_id, created_at, updated_at, occurrence, final_mark, retriable_at.

The sort field. Sorted by id asc by default.

Example:

To sort on projects users on the fields final_mark on a descending order and retriable_at on a ascending order:

...&sort=-final_mark,retriable_at

filter optional . Must be one of: id, project_id, user_id, created_at, updated_at, occurrence, final_mark, retriable_at, cursus, campus, retriable.

Filtering on one or more fields

Example:

To filter on projects users 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)
  • user_id (standard field)
  • created_at (standard field)
  • updated_at (standard field)
  • occurrence (standard field)
  • final_mark (standard field)
  • retriable_at (standard field)
  • cursus : Only return projects users with users in the given cursus. Can be one of: 1, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13
  • campus : Only return projects users with users in the given campus. Can be one of: 1, 2, 5, 6, 7, 8, 9
  • retriable (standard field)
range optional . Must be one of: id, project_id, user_id, created_at, updated_at, occurrence, final_mark, retriable_at.

Select on a particular range

Example:

To range on projects users with the retriable_at field between min_value and max_value:

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

Rangeable fields:
  • id
  • project_id
  • user_id
  • created_at
  • updated_at
  • occurrence
  • final_mark
  • retriable_at
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/projects_users
200
[
  {
    "id": 1,
    "occurrence": 0,
    "final_mark": null,
    "status": "in_progress",
    "validated?": null,
    "current_team_id": 1,
    "project": {
      "id": 2,
      "name": "Ordinary Wizarding Levels",
      "slug": "ordinary-wizarding-levels",
      "parent_id": null
    },
    "cursus_ids": [
      1
    ],
    "user": {
      "id": 66,
      "login": "cdooku",
      "url": "https://api.intra.42.fr/v2/users/cdooku"
    },
    "teams": [
      {
        "id": 1,
        "name": "cdooku's group",
        "url": "https://api.intra.42.fr/v2/teams/1",
        "final_mark": null,
        "project_id": 2,
        "created_at": "2017-03-06T14:59:06.290Z",
        "updated_at": "2017-03-06T14:59:06.367Z",
        "status": "in_progress",
        "terminating_at": null,
        "users": [
          {
            "id": 66,
            "login": "jbinks2",
            "url": "https://api.intra.42.fr/v2/users/jbinks2",
            "leader": true,
            "occurrence": 0,
            "validated": true,
            "projects_user_id": 1
          }
        ],
        "locked?": true,
        "validated?": null,
        "closed?": false,
        "repo_url": null,
        "repo_uuid": "intra-uuid-5f2281bb-10a1-4fd6-a3f7-11177562a335-1",
        "locked_at": "2017-03-06T14:59:06.330Z",
        "closed_at": null,
        "project_session_id": 2
      }
    ]
  },
  {
    "id": 2,
    "occurrence": 0,
    "final_mark": null,
    "status": "in_progress",
    "validated?": null,
    "current_team_id": 2,
    "project": {
      "id": 4,
      "name": "Hogwarts Quidditch Cup",
      "slug": "hogwarts-quidditch-cup",
      "parent_id": null
    },
    "cursus_ids": [
      1
    ],
    "user": {
      "id": 18,
      "login": "lcalriss",
      "url": "https://api.intra.42.fr/v2/users/lcalriss"
    },
    "teams": [
      {
        "id": 2,
        "name": "lcalriss's group",
        "url": "https://api.intra.42.fr/v2/teams/2",
        "final_mark": null,
        "project_id": 4,
        "created_at": "2017-03-06T14:59:06.409Z",
        "updated_at": "2017-03-06T14:59:06.471Z",
        "status": "in_progress",
        "terminating_at": null,
        "users": [
          {
            "id": 18,
            "login": "lcalriss",
            "url": "https://api.intra.42.fr/v2/users/lcalriss",
            "leader": true,
            "occurrence": 0,
            "validated": true,
            "projects_user_id": 2
          }
        ],
        "locked?": false,
        "validated?": null,
        "closed?": true,
        "repo_url": null,
        "repo_uuid": "intra-uuid-74c9b55c-1f1f-464c-821b-4640f43947a6-2",
        "locked_at": null,
        "closed_at": "2017-03-06T14:59:06.435Z",
        "project_session_id": 4
      }
    ]
  },
  {
    "id": 3,
    "occurrence": 0,
    "final_mark": null,
    "status": "creating_group",
    "validated?": null,
    "current_team_id": 3,
    "project": {
      "id": 5,
      "name": "Quarter Finals",
      "slug": "hogwarts-quidditch-cup-quarter-finals",
      "parent_id": 4
    },
    "cursus_ids": [
      1
    ],
    "user": {
      "id": 18,
      "login": "lcalriss",
      "url": "https://api.intra.42.fr/v2/users/lcalriss"
    },
    "teams": [
      {
        "id": 3,
        "name": "lcalriss's group",
        "url": "https://api.intra.42.fr/v2/teams/3",
        "final_mark": null,
        "project_id": 5,
        "created_at": "2017-03-06T14:59:06.529Z",
        "updated_at": "2017-03-06T14:59:06.572Z",
        "status": "creating_group",
        "terminating_at": null,
        "users": [
          {
            "id": 18,
            "login": "lcalriss",
            "url": "https://api.intra.42.fr/v2/users/lcalriss",
            "leader": true,
            "occurrence": 0,
            "validated": true,
            "projects_user_id": 3
          }
        ],
        "locked?": false,
        "validated?": null,
        "closed?": false,
        "repo_url": null,
        "repo_uuid": "intra-uuid-03baedf5-3936-4266-a4aa-10718bdb756a-3",
        "locked_at": null,
        "closed_at": null,
        "project_session_id": 5
      }
    ]
  }
]
curl  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" "https://api.intra.42.fr/v2/projects_users"

[
  {
    "id": 1,
    "occurrence": 0,
    "final_mark": null,
    "status": "in_progress",
    "validated?": null,
    "current_team_id": 1,
    "project": {
      "id": 2,
      "name": "Ordinary Wizarding Levels",
      "slug": "ordinary-wizarding-levels",
      "parent_id": null
    },
    "cursus_ids": [
      1
    ],
    "user": {
      "id": 66,
      "login": "cdooku",
      "url": "https://api.intra.42.fr/v2/users/cdooku"
    },
    "teams": [
      {
        "id": 1,
        "name": "cdooku's group",
        "url": "https://api.intra.42.fr/v2/teams/1",
        "final_mark": null,
        "project_id": 2,
        "created_at": "2017-03-06T14:59:06.290Z",
        "updated_at": "2017-03-06T14:59:06.367Z",
        "status": "in_progress",
        "terminating_at": null,
        "users": [
          {
            "id": 66,
            "login": "jbinks2",
            "url": "https://api.intra.42.fr/v2/users/jbinks2",
            "leader": true,
            "occurrence": 0,
            "validated": true,
            "projects_user_id": 1
          }
        ],
        "locked?": true,
        "validated?": null,
        "closed?": false,
        "repo_url": null,
        "repo_uuid": "intra-uuid-5f2281bb-10a1-4fd6-a3f7-11177562a335-1",
        "locked_at": "2017-03-06T14:59:06.330Z",
        "closed_at": null,
        "project_session_id": 2
      }
    ]
  },
  {
    "id": 2,
    "occurrence": 0,
    "final_mark": null,
    "status": "in_progress",
    "validated?": null,
    "current_team_id": 2,
    "project": {
      "id": 4,
      "name": "Hogwarts Quidditch Cup",
      "slug": "hogwarts-quidditch-cup",
      "parent_id": null
    },
    "cursus_ids": [
      1
    ],
    "user": {
      "id": 18,
      "login": "lcalriss",
      "url": "https://api.intra.42.fr/v2/users/lcalriss"
    },
    "teams": [
      {
        "id": 2,
        "name": "lcalriss's group",
        "url": "https://api.intra.42.fr/v2/teams/2",
        "final_mark": null,
        "project_id": 4,
        "created_at": "2017-03-06T14:59:06.409Z",
        "updated_at": "2017-03-06T14:59:06.471Z",
        "status": "in_progress",
        "terminating_at": null,
        "users": [
          {
            "id": 18,
            "login": "lcalriss",
            "url": "https://api.intra.42.fr/v2/users/lcalriss",
            "leader": true,
            "occurrence": 0,
            "validated": true,
            "projects_user_id": 2
          }
        ],
        "locked?": false,
        "validated?": null,
        "closed?": true,
        "repo_url": null,
        "repo_uuid": "intra-uuid-74c9b55c-1f1f-464c-821b-4640f43947a6-2",
        "locked_at": null,
        "closed_at": "2017-03-06T14:59:06.435Z",
        "project_session_id": 4
      }
    ]
  },
  {
    "id": 3,
    "occurrence": 0,
    "final_mark": null,
    "status": "creating_group",
    "validated?": null,
    "current_team_id": 3,
    "project": {
      "id": 5,
      "name": "Quarter Finals",
      "slug": "hogwarts-quidditch-cup-quarter-finals",
      "parent_id": 4
    },
    "cursus_ids": [
      1
    ],
    "user": {
      "id": 18,
      "login": "lcalriss",
      "url": "https://api.intra.42.fr/v2/users/lcalriss"
    },
    "teams": [
      {
        "id": 3,
        "name": "lcalriss's group",
        "url": "https://api.intra.42.fr/v2/teams/3",
        "final_mark": null,
        "project_id": 5,
        "created_at": "2017-03-06T14:59:06.529Z",
        "updated_at": "2017-03-06T14:59:06.572Z",
        "status": "creating_group",
        "terminating_at": null,
        "users": [
          {
            "id": 18,
            "login": "lcalriss",
            "url": "https://api.intra.42.fr/v2/users/lcalriss",
            "leader": true,
            "occurrence": 0,
            "validated": true,
            "projects_user_id": 3
          }
        ],
        "locked?": false,
        "validated?": null,
        "closed?": false,
        "repo_url": null,
        "repo_uuid": "intra-uuid-03baedf5-3936-4266-a4aa-10718bdb756a-3",
        "locked_at": null,
        "closed_at": null,
        "project_session_id": 5
      }
    ]
  }
]
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/projects_users")
response.status
# => 200
response.parsed
# => [{"id"=>1, "occurrence"=>0, "final_mark"=>nil, "status"=>"in_progress", "validated?"=>nil, "current_team_id"=>1, "project"=>{"id"=>2, "name"=>"Ordinary Wizarding Levels", "slug"=>"ordinary-wizarding-levels", "parent_id"=>nil}, "cursus_ids"=>[1], "user"=>{"id"=>66, "login"=>"cdooku", "url"=>"https://api.intra.42.fr/v2/users/cdooku"}, "teams"=>[{"id"=>1, "name"=>"cdooku's group", "url"=>"https://api.intra.42.fr/v2/teams/1", "final_mark"=>nil, "project_id"=>2, "created_at"=>"2017-03-06T14:59:06.290Z", "updated_at"=>"2017-03-06T14:59:06.367Z", "status"=>"in_progress", "terminating_at"=>nil, "users"=>[{"id"=>66, "login"=>"jbinks2", "url"=>"https://api.intra.42.fr/v2/users/jbinks2", "leader"=>true, "occurrence"=>0, "validated"=>true, "projects_user_id"=>1}], "locked?"=>true, "validated?"=>nil, "closed?"=>false, "repo_url"=>nil, "repo_uuid"=>"intra-uuid-5f2281bb-10a1-4fd6-a3f7-11177562a335-1", "locked_at"=>"2017-03-06T14:59:06.330Z", "closed_at"=>nil, "project_session_id"=>2}]}, {"id"=>2, "occurrence"=>0, "final_mark"=>nil, "status"=>"in_progress", "validated?"=>nil, "current_team_id"=>2, "project"=>{"id"=>4, "name"=>"Hogwarts Quidditch Cup", "slug"=>"hogwarts-quidditch-cup", "parent_id"=>nil}, "cursus_ids"=>[1], "user"=>{"id"=>18, "login"=>"lcalriss", "url"=>"https://api.intra.42.fr/v2/users/lcalriss"}, "teams"=>[{"id"=>2, "name"=>"lcalriss's group", "url"=>"https://api.intra.42.fr/v2/teams/2", "final_mark"=>nil, "project_id"=>4, "created_at"=>"2017-03-06T14:59:06.409Z", "updated_at"=>"2017-03-06T14:59:06.471Z", "status"=>"in_progress", "terminating_at"=>nil, "users"=>[{"id"=>18, "login"=>"lcalriss", "url"=>"https://api.intra.42.fr/v2/users/lcalriss", "leader"=>true, "occurrence"=>0, "validated"=>true, "projects_user_id"=>2}], "locked?"=>false, "validated?"=>nil, "closed?"=>true, "repo_url"=>nil, "repo_uuid"=>"intra-uuid-74c9b55c-1f1f-464c-821b-4640f43947a6-2", "locked_at"=>nil, "closed_at"=>"2017-03-06T14:59:06.435Z", "project_session_id"=>4}]}, {"id"=>3, "occurrence"=>0, "final_mark"=>nil, "status"=>"creating_group", "validated?"=>nil, "current_team_id"=>3, "project"=>{"id"=>5, "name"=>"Quarter Finals", "slug"=>"hogwarts-quidditch-cup-quarter-finals", "parent_id"=>4}, "cursus_ids"=>[1], "user"=>{"id"=>18, "login"=>"lcalriss", "url"=>"https://api.intra.42.fr/v2/users/lcalriss"}, "teams"=>[{"id"=>3, "name"=>"lcalriss's group", "url"=>"https://api.intra.42.fr/v2/teams/3", "final_mark"=>nil, "project_id"=>5, "created_at"=>"2017-03-06T14:59:06.529Z", "updated_at"=>"2017-03-06T14:59:06.572Z", "status"=>"creating_group", "terminating_at"=>nil, "users"=>[{"id"=>18, "login"=>"lcalriss", "url"=>"https://api.intra.42.fr/v2/users/lcalriss", "leader"=>true, "occurrence"=>0, "validated"=>true, "projects_user_id"=>3}], "locked?"=>false, "validated?"=>nil, "closed?"=>false, "repo_url"=>nil, "repo_uuid"=>"intra-uuid-03baedf5-3936-4266-a4aa-10718bdb756a-3", "locked_at"=>nil, "closed_at"=>nil, "project_session_id"=>5}]}]