live_help Notes

chrome_reader_mode This resource is paginated by 30 items

settings Params

Param name Description
project_id required . Must be String

The project id or slug

sort optional . Must be one of: id, attachable_id, attachable_type, kind, created_at, updated_at, language_id, user_id, default, up_to_date, container_id, container_type, base_id, untranslatable, attachments_structure_id.

The sort field. Sorted by id asc by default.

Example:

To sort on attachments on the fields untranslatable on a descending order and attachments_structure_id on a ascending order:

...&sort=-untranslatable,attachments_structure_id

filter optional . Must be one of: id, attachable_id, attachable_type, kind, created_at, updated_at, language_id, user_id, default, up_to_date, container_id, container_type, base_id, untranslatable, attachments_structure_id.

Filtering on one or more fields

Example:

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

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

Filterable fields:
  • id (standard field)
  • attachable_id (standard field)
  • attachable_type (standard field)
  • kind (standard field)
  • created_at (standard field)
  • updated_at (standard field)
  • language_id (standard field)
  • user_id (standard field)
  • default (standard field)
  • up_to_date (standard field)
  • container_id (standard field)
  • container_type (standard field)
  • base_id (standard field)
  • untranslatable (standard field)
  • attachments_structure_id (standard field)
range optional . Must be one of: id, attachable_id, attachable_type, kind, created_at, updated_at, language_id, user_id, default, up_to_date, container_id, container_type, base_id, untranslatable, attachments_structure_id.

Select on a particular range

Example:

To range on attachments with the attachments_structure_id field between min_value and max_value:

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

Rangeable fields:
  • id
  • attachable_id
  • attachable_type
  • kind
  • created_at
  • updated_at
  • language_id
  • user_id
  • default
  • up_to_date
  • container_id
  • container_type
  • base_id
  • untranslatable
  • attachments_structure_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/projects/1/attachments
200
[

]
curl  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" "https://api.intra.42.fr/v2/projects/1/attachments"

[

]
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/1/attachments")
response.status
# => 200
response.parsed
# => []