List all visibles achievements. Invisibles achievements need at least the basic_staff role.

live_help Notes

chrome_reader_mode This resource is paginated by 30 items
assignment_ind This action have additional content with a token resource owner or an application with one of theses role(s): Basic staff .

settings Params

Param name Description
cursus_id optional . Must be String

The cursus id or slug

campus_id optional . Must be String

The campus id or slug

title_id optional . Must be String

The title id or slug

sort optional . Must be one of: id, name, internal_name, kind, tier, description, pedago, visible, nbr_of_success, parent_id, image, created_at, updated_at, slug, position, reward, title_id.

The sort field. Sorted by id asc by default.

Example:

To sort on achievements on the fields reward on a descending order and title_id on a ascending order:

...&sort=-reward,title_id

filter optional . Must be one of: id, name, internal_name, kind, tier, description, pedago, visible, nbr_of_success, parent_id, image, created_at, updated_at, slug, position, reward, title_id.

Filtering on one or more fields

Example:

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

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

Filterable fields:
  • id (standard field)
  • name (standard field)
  • internal_name (standard field)
  • kind (standard field)
  • tier (standard field)
  • description (standard field)
  • pedago (standard field)
  • visible (standard field)
  • nbr_of_success (standard field)
  • parent_id (standard field)
  • image (standard field)
  • created_at (standard field)
  • updated_at (standard field)
  • slug (standard field)
  • position (standard field)
  • reward (standard field)
  • title_id (standard field)
range optional . Must be one of: id, name, internal_name, kind, tier, description, pedago, visible, nbr_of_success, parent_id, image, created_at, updated_at, slug, position, reward, title_id.

Select on a particular range

Example:

To range on achievements with the title_id field between min_value and max_value:

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

Rangeable fields:
  • id
  • name
  • internal_name
  • kind
  • tier
  • description
  • pedago
  • visible
  • nbr_of_success
  • parent_id
  • image
  • created_at
  • updated_at
  • slug
  • position
  • reward
  • title_id
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/achievements
200
[
  {
    "id": 1,
    "name": "Film buff",
    "description": "Regarder 1 video sur l'e-learning.",
    "tier": "none",
    "kind": "pedagogy",
    "visible": true,
    "image": "/uploads/achievement/image/1/logo.svg",
    "nbr_of_success": 1,
    "users_url": "https://api.intra.42.fr/v2/achievements/1/users",
    "achievements": [],
    "parent": null,
    "title": null
  },
  {
    "id": 3,
    "name": "Film buff",
    "description": "Regarder 21 videos sur l'e-learning.",
    "tier": "none",
    "kind": "pedagogy",
    "visible": true,
    "image": "/uploads/achievement/image/3/logo.svg",
    "nbr_of_success": 21,
    "users_url": "https://api.intra.42.fr/v2/achievements/3/users",
    "achievements": [],
    "parent": null,
    "title": null
  },
  {
    "id": 4,
    "name": "Film buff",
    "description": "Regarder 42 videos sur l'e-learning.",
    "tier": "none",
    "kind": "pedagogy",
    "visible": true,
    "image": "/uploads/achievement/image/4/logo.svg",
    "nbr_of_success": 42,
    "users_url": "https://api.intra.42.fr/v2/achievements/4/users",
    "achievements": [],
    "parent": null,
    "title": null
  }
]
curl  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" "https://api.intra.42.fr/v2/achievements"

[
  {
    "id": 1,
    "name": "Film buff",
    "description": "Regarder 1 video sur l'e-learning.",
    "tier": "none",
    "kind": "pedagogy",
    "visible": true,
    "image": "/uploads/achievement/image/1/logo.svg",
    "nbr_of_success": 1,
    "users_url": "https://api.intra.42.fr/v2/achievements/1/users",
    "achievements": [],
    "parent": null,
    "title": null
  },
  {
    "id": 3,
    "name": "Film buff",
    "description": "Regarder 21 videos sur l'e-learning.",
    "tier": "none",
    "kind": "pedagogy",
    "visible": true,
    "image": "/uploads/achievement/image/3/logo.svg",
    "nbr_of_success": 21,
    "users_url": "https://api.intra.42.fr/v2/achievements/3/users",
    "achievements": [],
    "parent": null,
    "title": null
  },
  {
    "id": 4,
    "name": "Film buff",
    "description": "Regarder 42 videos sur l'e-learning.",
    "tier": "none",
    "kind": "pedagogy",
    "visible": true,
    "image": "/uploads/achievement/image/4/logo.svg",
    "nbr_of_success": 42,
    "users_url": "https://api.intra.42.fr/v2/achievements/4/users",
    "achievements": [],
    "parent": null,
    "title": null
  }
]
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/achievements")
response.status
# => 200
response.parsed
# => [{"id"=>1, "name"=>"Film buff", "description"=>"Regarder 1 video sur l'e-learning.", "tier"=>"none", "kind"=>"pedagogy", "visible"=>true, "image"=>"/uploads/achievement/image/1/logo.svg", "nbr_of_success"=>1, "users_url"=>"https://api.intra.42.fr/v2/achievements/1/users", "achievements"=>[], "parent"=>nil, "title"=>nil}, {"id"=>3, "name"=>"Film buff", "description"=>"Regarder 21 videos sur l'e-learning.", "tier"=>"none", "kind"=>"pedagogy", "visible"=>true, "image"=>"/uploads/achievement/image/3/logo.svg", "nbr_of_success"=>21, "users_url"=>"https://api.intra.42.fr/v2/achievements/3/users", "achievements"=>[], "parent"=>nil, "title"=>nil}, {"id"=>4, "name"=>"Film buff", "description"=>"Regarder 42 videos sur l'e-learning.", "tier"=>"none", "kind"=>"pedagogy", "visible"=>true, "image"=>"/uploads/achievement/image/4/logo.svg", "nbr_of_success"=>42, "users_url"=>"https://api.intra.42.fr/v2/achievements/4/users", "achievements"=>[], "parent"=>nil, "title"=>nil}]