GET /v2/project_sessions/:project_session_id/attachments/:id
Get an attachment of the given Id, associated with the given Project session
GET /v2/attachments/:id
Get an attachment
settings Params
Param name | Description |
---|---|
project_session_id |
optional
. Must be String
The project_session id |
id |
required
. Must be String
The requested id |
Examples
GET /v2/attachments/1
200
{
"id": 1,
"name": "New Jersey zombies",
"pdf": {
"pdf": {
"url": null,
"thumb": {
"url": null
}
}
},
"page_count": 1,
"created_at": "2017-11-22T13:41:25.981Z",
"pdf_processing": true,
"slug": "new-jersey-zombies",
"url": null,
"thumb_url": null,
"base_id": 1,
"language": {
"id": 3,
"name": "Romanian",
"identifier": "ro"
},
"type": "Pdf"
}
curl -H "Authorization: Bearer YOUR_ACCESS_TOKEN" "https://api.intra.42.fr/v2/attachments/1"
{
"id": 1,
"name": "New Jersey zombies",
"pdf": {
"pdf": {
"url": null,
"thumb": {
"url": null
}
}
},
"page_count": 1,
"created_at": "2017-11-22T13:41:25.981Z",
"pdf_processing": true,
"slug": "new-jersey-zombies",
"url": null,
"thumb_url": null,
"base_id": 1,
"language": {
"id": 3,
"name": "Romanian",
"identifier": "ro"
},
"type": "Pdf"
}
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/attachments/1")
response.status
# => 200
response.parsed
# => {"id"=>1, "name"=>"New Jersey zombies", "pdf"=>{"pdf"=>{"url"=>nil, "thumb"=>{"url"=>nil}}}, "page_count"=>1, "created_at"=>"2017-11-22T13:41:25.981Z", "pdf_processing"=>true, "slug"=>"new-jersey-zombies", "url"=>nil, "thumb_url"=>nil, "base_id"=>1, "language"=>{"id"=>3, "name"=>"Romanian", "identifier"=>"ro"}, "type"=>"Pdf"}