File Lookup

Endpoints:

GET /files/{file_id}

Token: user

Scope: files

Retrieve a file object. If url_expires_at has expired, this will update the url and any embedded references to it.

URL Parameters

Name Description
file_id ID of the requested file
Example
curl "https://api.pnut.io/v1/files/69" \
    -H "Authorization: Bearer ${ACCESS_TOKEN}" \
    -H "X-Pretty-Json: 1"

Returns the requested file details

{
    "meta": {
        "code": 200
    },
    "data": {"...File Object..."}
}

GET /files

Token: user

Scope: files

Retrieve a list of specified file objects. Only returns the first 200 found.

If the file needs a file_token_read to access, you may include them with query parameters in the pattern ?file_token_read_{file_id}=xxx&file_token_read_{file_id}=xxx.

Query String Parameters

Name Description
ids Comma-separated list of file IDs
Example
curl "https://api.pnut.io/v1/files?ids=69,71" \
    -H "Authorization: Bearer ${ACCESS_TOKEN}" \
    -H "X-Pretty-Json: 1"

Returns a list of files

{
    "meta": {
        "code": 200
    },
    "data": [
        {"...File Object..."}
    ]
}

GET /users/me/files

Token: user

Scope: files

Retrieve a list of files created by the authenticated user.

Example
curl "https://api.pnut.io/v1/users/me/files" \
    -H "Authorization: Bearer ${ACCESS_TOKEN}" \
    -H "X-Pretty-Json: 1"

Returns a list of files

{
    "meta": {
        "code": 200,
        "more": false,
        "max_id": "0",
        "min_id": "0"
    },
    "data": [
        {"...File Object..."}
    ]
}