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

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

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)
  • marked_at (standard field)
  • status (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, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 25, 26, 27, 28, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 46, 47, 48, 49, 50, 51, 52, 53, 54, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 73, 74, 75
  • campus : Only return projects users with users in the given campus. Can be one of: 1, 2, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74
  • retriable (standard field)
  • marked (standard field)
range optional . Must be one of: id, project_id, user_id, created_at, updated_at, occurrence, final_mark, retriable_at, marked_at, status.

Select on a particular range

Example:

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

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

Rangeable fields:
  • id
  • project_id
  • user_id
  • created_at
  • updated_at
  • occurrence
  • final_mark
  • retriable_at
  • marked_at
  • status
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

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": 111,
      "login": "jabinks2",
      "url": "https://api.intra.42.fr/v2/users/jabinks2"
    },
    "teams": [
      {
        "id": 1,
        "name": "jabinks2's group",
        "url": "https://api.intra.42.fr/v2/teams/1",
        "final_mark": null,
        "project_id": 2,
        "created_at": "2017-11-22T13:41:28.447Z",
        "updated_at": "2017-11-22T13:41:28.519Z",
        "status": "in_progress",
        "terminating_at": null,
        "users": [
          {
            "id": 111,
            "login": "coundook",
            "url": "https://api.intra.42.fr/v2/users/coundook",
            "leader": true,
            "occurrence": 0,
            "validated": true,
            "projects_user_id": 1
          }
        ],
        "locked?": true,
        "validated?": null,
        "closed?": false,
        "repo_url": null,
        "repo_uuid": "intra-uuid-e8f23ddc-8e52-47a8-87e9-9bd490621cfd-1",
        "locked_at": "2017-11-22T13:41:28.487Z",
        "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": 108,
      "login": "podamer2",
      "url": "https://api.intra.42.fr/v2/users/podamer2"
    },
    "teams": [
      {
        "id": 2,
        "name": "podamer2's group",
        "url": "https://api.intra.42.fr/v2/teams/2",
        "final_mark": null,
        "project_id": 4,
        "created_at": "2017-11-22T13:41:28.554Z",
        "updated_at": "2017-11-22T13:41:28.608Z",
        "status": "in_progress",
        "terminating_at": null,
        "users": [
          {
            "id": 108,
            "login": "podamer2",
            "url": "https://api.intra.42.fr/v2/users/podamer2",
            "leader": true,
            "occurrence": 0,
            "validated": true,
            "projects_user_id": 2
          }
        ],
        "locked?": false,
        "validated?": null,
        "closed?": true,
        "repo_url": null,
        "repo_uuid": "intra-uuid-ae9bdbbc-9c16-4c27-8f18-eccee5a31020-2",
        "locked_at": null,
        "closed_at": "2017-11-22T13:41:28.578Z",
        "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": 108,
      "login": "podamer2",
      "url": "https://api.intra.42.fr/v2/users/podamer2"
    },
    "teams": [
      {
        "id": 3,
        "name": "podamer2's group",
        "url": "https://api.intra.42.fr/v2/teams/3",
        "final_mark": null,
        "project_id": 5,
        "created_at": "2017-11-22T13:41:28.661Z",
        "updated_at": "2017-11-22T13:41:28.704Z",
        "status": "creating_group",
        "terminating_at": null,
        "users": [
          {
            "id": 108,
            "login": "podamer2",
            "url": "https://api.intra.42.fr/v2/users/podamer2",
            "leader": true,
            "occurrence": 0,
            "validated": true,
            "projects_user_id": 3
          }
        ],
        "locked?": false,
        "validated?": null,
        "closed?": false,
        "repo_url": null,
        "repo_uuid": "intra-uuid-d6aded82-d02e-4597-a33a-acd2544ec015-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": 111,
      "login": "jabinks2",
      "url": "https://api.intra.42.fr/v2/users/jabinks2"
    },
    "teams": [
      {
        "id": 1,
        "name": "jabinks2's group",
        "url": "https://api.intra.42.fr/v2/teams/1",
        "final_mark": null,
        "project_id": 2,
        "created_at": "2017-11-22T13:41:28.447Z",
        "updated_at": "2017-11-22T13:41:28.519Z",
        "status": "in_progress",
        "terminating_at": null,
        "users": [
          {
            "id": 111,
            "login": "coundook",
            "url": "https://api.intra.42.fr/v2/users/coundook",
            "leader": true,
            "occurrence": 0,
            "validated": true,
            "projects_user_id": 1
          }
        ],
        "locked?": true,
        "validated?": null,
        "closed?": false,
        "repo_url": null,
        "repo_uuid": "intra-uuid-e8f23ddc-8e52-47a8-87e9-9bd490621cfd-1",
        "locked_at": "2017-11-22T13:41:28.487Z",
        "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": 108,
      "login": "podamer2",
      "url": "https://api.intra.42.fr/v2/users/podamer2"
    },
    "teams": [
      {
        "id": 2,
        "name": "podamer2's group",
        "url": "https://api.intra.42.fr/v2/teams/2",
        "final_mark": null,
        "project_id": 4,
        "created_at": "2017-11-22T13:41:28.554Z",
        "updated_at": "2017-11-22T13:41:28.608Z",
        "status": "in_progress",
        "terminating_at": null,
        "users": [
          {
            "id": 108,
            "login": "podamer2",
            "url": "https://api.intra.42.fr/v2/users/podamer2",
            "leader": true,
            "occurrence": 0,
            "validated": true,
            "projects_user_id": 2
          }
        ],
        "locked?": false,
        "validated?": null,
        "closed?": true,
        "repo_url": null,
        "repo_uuid": "intra-uuid-ae9bdbbc-9c16-4c27-8f18-eccee5a31020-2",
        "locked_at": null,
        "closed_at": "2017-11-22T13:41:28.578Z",
        "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": 108,
      "login": "podamer2",
      "url": "https://api.intra.42.fr/v2/users/podamer2"
    },
    "teams": [
      {
        "id": 3,
        "name": "podamer2's group",
        "url": "https://api.intra.42.fr/v2/teams/3",
        "final_mark": null,
        "project_id": 5,
        "created_at": "2017-11-22T13:41:28.661Z",
        "updated_at": "2017-11-22T13:41:28.704Z",
        "status": "creating_group",
        "terminating_at": null,
        "users": [
          {
            "id": 108,
            "login": "podamer2",
            "url": "https://api.intra.42.fr/v2/users/podamer2",
            "leader": true,
            "occurrence": 0,
            "validated": true,
            "projects_user_id": 3
          }
        ],
        "locked?": false,
        "validated?": null,
        "closed?": false,
        "repo_url": null,
        "repo_uuid": "intra-uuid-d6aded82-d02e-4597-a33a-acd2544ec015-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"=>111, "login"=>"jabinks2", "url"=>"https://api.intra.42.fr/v2/users/jabinks2"}, "teams"=>[{"id"=>1, "name"=>"jabinks2's group", "url"=>"https://api.intra.42.fr/v2/teams/1", "final_mark"=>nil, "project_id"=>2, "created_at"=>"2017-11-22T13:41:28.447Z", "updated_at"=>"2017-11-22T13:41:28.519Z", "status"=>"in_progress", "terminating_at"=>nil, "users"=>[{"id"=>111, "login"=>"coundook", "url"=>"https://api.intra.42.fr/v2/users/coundook", "leader"=>true, "occurrence"=>0, "validated"=>true, "projects_user_id"=>1}], "locked?"=>true, "validated?"=>nil, "closed?"=>false, "repo_url"=>nil, "repo_uuid"=>"intra-uuid-e8f23ddc-8e52-47a8-87e9-9bd490621cfd-1", "locked_at"=>"2017-11-22T13:41:28.487Z", "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"=>108, "login"=>"podamer2", "url"=>"https://api.intra.42.fr/v2/users/podamer2"}, "teams"=>[{"id"=>2, "name"=>"podamer2's group", "url"=>"https://api.intra.42.fr/v2/teams/2", "final_mark"=>nil, "project_id"=>4, "created_at"=>"2017-11-22T13:41:28.554Z", "updated_at"=>"2017-11-22T13:41:28.608Z", "status"=>"in_progress", "terminating_at"=>nil, "users"=>[{"id"=>108, "login"=>"podamer2", "url"=>"https://api.intra.42.fr/v2/users/podamer2", "leader"=>true, "occurrence"=>0, "validated"=>true, "projects_user_id"=>2}], "locked?"=>false, "validated?"=>nil, "closed?"=>true, "repo_url"=>nil, "repo_uuid"=>"intra-uuid-ae9bdbbc-9c16-4c27-8f18-eccee5a31020-2", "locked_at"=>nil, "closed_at"=>"2017-11-22T13:41:28.578Z", "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"=>108, "login"=>"podamer2", "url"=>"https://api.intra.42.fr/v2/users/podamer2"}, "teams"=>[{"id"=>3, "name"=>"podamer2's group", "url"=>"https://api.intra.42.fr/v2/teams/3", "final_mark"=>nil, "project_id"=>5, "created_at"=>"2017-11-22T13:41:28.661Z", "updated_at"=>"2017-11-22T13:41:28.704Z", "status"=>"creating_group", "terminating_at"=>nil, "users"=>[{"id"=>108, "login"=>"podamer2", "url"=>"https://api.intra.42.fr/v2/users/podamer2", "leader"=>true, "occurrence"=>0, "validated"=>true, "projects_user_id"=>3}], "locked?"=>false, "validated?"=>nil, "closed?"=>false, "repo_url"=>nil, "repo_uuid"=>"intra-uuid-d6aded82-d02e-4597-a33a-acd2544ec015-3", "locked_at"=>nil, "closed_at"=>nil, "project_session_id"=>5}]}]