API Documentation

The PhotoStack API is built on REST principles, offering predictable, resource-oriented endpoints. It supports form-encoded request bodies, returns responses in JSON format, and adheres to standard HTTP methods, authentication protocols, and status codes for seamless integration and predictable behavior.

The PhotoStack API lets you create custom integrations to further streamline workflows and enhance the photographer experience. We look forward to seeing the innovative solutions you build!

Authentication

Authentication is made via the header with the keys stacker-id and stacker-token

Endpoints
GET /validate

Validate

We can check if the user has entered a valid Token by querying /validate/ passing stacker-id and stacker-token in as headers.

Query
curl --location --request GET 'https://api.photostack.io/validate/' \
--header 'stacker-id: 12345' \
--header 'stacker-token: 1111-2222-3333-4444-5'
Response
[
  {
      "message": "authenticated"
  }
]
Status Codes
200 Valid API token provided 400 Token or ID not specified 401 Invalid API token provided

Settings

A list of settings and account details related to the PhotoStack user's account.

Endpoints
GET /settings

List all Settings

Query
curl --location --request GET 'https://api.photostack.io/settings/' \
--header 'stacker-id: 12345' \
--header 'stacker-token: 1111-2222-3333-4444-5'
Response
[
    {
        "id": "12345",
        "domain": "johnsmithphotography.com",
        "title": "John Smith Photography",
        "package": "Pro Unlimited",
        "usage": "220 GB / 1 TB"
    }
]
Status Codes
200 Successfully executed query 204 Successfully created item 204 Success but empty result 400 Incomplete parameters received 401 Invalid token provided 404 API resource doesn't exist 405 Method not supported, only GET & POST are supported 409 Conflict, item already exists 503 API unavailable

Clients

A list of Clients a user can deliver photos to, in the Clients Area. Clients are usually named after the business or the people the photos are shot for. For example 'Joe's Windows LTD' or 'Kate + John'.

Endpoints
GET /clients/:id GET /clients POST /clients

List all Clients

We can check if the user has entered a valid Token by querying /validate/ passing stacker-id and stacker-token in as headers.

Query
curl --location --request GET 'https://api.photostack.io/clients/' \
--header 'stacker-id: 12345' \
--header 'stacker-token: 1111-2222-3333-4444-5'
Response
[
    {
        "id": "1",
        "client": "Joe's Windows LTD"
    },
    {
        "id": "2",
        "client": "Kate + John"
    }
]
Status Codes
200 Successfully executed query 204 Successfully created item 204 Success but empty result 400 Incomplete parameters received 401 Invalid token provided 404 API resource doesn't exist 405 Method not supported, only GET & POST are supported 409 Conflict, item already exists 503 API unavailable

List single Client

Specify an id number in the request URL to get a single client's details.

Query
curl --location --request GET 'https://api.photostack.io/clients/1234/' \
--header 'stacker-id: 12345' \
--header 'stacker-token: 1111-2222-3333-4444-5'
Response
[
    {
        "id": "1234",
        "client": "Super Cool Hats"
    }
]
Status Codes
200 Successfully executed query 204 Successfully created item 204 Success but empty result 400 Incomplete parameters received 401 Invalid token provided 404 API resource doesn't exist 405 Method not supported, only GET & POST are supported 409 Conflict, item already exists 503 API unavailable

Create a new Client

Parameters required:

client string

The name of the new client in plain text.

Query
curl --location --request POST 'https://api.photostack.io/clients/' \
--header 'stacker-id: 12345' \
--header 'stacker-token: 1111-2222-3333-4444-5' \
--data-raw '{"client":"Oooober"}'
Response
[
    {
        "id": "1234",
        "client": "Oooober"
    }
]
Status Codes
200 Successfully executed query 204 Successfully created item 204 Success but empty result 400 Incomplete parameters received 401 Invalid token provided 404 API resource doesn't exist 405 Method not supported, only GET & POST are supported 409 Conflict, item already exists 503 API unavailable

Collections

A list of created Collections of photos. Collections can be either of type Portfolio which show on the user's website or type Client where the collection shows in the Clients Area for only the Client.

Endpoints
GET /collections/:id GET /collections POST /collections

List all Collections

Query
curl --location --request GET 'https://api.photostack.io/collections/' \
--header 'stacker-id: 12345' \
--header 'stacker-token: 1111-2222-3333-4444-5'
Response
[
    {
        "id": "1",
        "name": "Portraits",
        "url": "portraits",
        "type": "portfolio",
        "client": "0"
    },
    {
        "id": "2",
        "name": "Landscapes",
        "url": "landscapes",
        "type": "portfolio",
        "client": "0"
    },
    {
        "id": "3",
        "name": "Kate + John",
        "url": "kate-and-john",
        "type": "client",
        "client": "2"
    }
]
Status Codes
200 Successfully executed query 204 Successfully created item 204 Success but empty result 400 Incomplete parameters received 401 Invalid token provided 404 API resource doesn't exist 405 Method not supported, only GET & POST are supported 409 Conflict, item already exists 503 API unavailable

List single Collection

Specify an id number in the request URL to get a single collection's details.

Query
curl --location --request GET 'https://api.photostack.io/collections/3/' \
--header 'stacker-id: 12345' \
--header 'stacker-token: 1111-2222-3333-4444-5'
Response
[
    {
        "id": "3",
        "name": "Kate + John",
        "url": "kate-and-john",
        "type": "client",
        "client": "2"
    }
]
Status Codes
200 Successfully executed query 204 Successfully created item 204 Success but empty result 400 Incomplete parameters received 401 Invalid token provided 404 API resource doesn't exist 405 Method not supported, only GET & POST are supported 409 Conflict, item already exists 503 API unavailable

Create a new Collection

Parameters required:

name string

The name of the new collection in plain text.

client integer

For collection type of Portfolio set client to 0, for collection type of Client set the client to the relevant client ID.

Query
curl --location --request POST 'https://api.photostack.io/collections/' \
--header 'stacker-id: 12345' \
--header 'stacker-token: 1111-2222-3333-4444-5' \
--data-raw '{"name":"Oooober Head Shots", "client":"1234"}'
Response
[
    {
        "id": "1234",
        "name": "Oooober Head Shots",
        "url": "oooober-head-shots",
        "type": "client",
        "client": "1234"
    }
]
Status Codes
200 Successfully executed query 204 Successfully created item 204 Success but empty result 400 Incomplete parameters received 401 Invalid token provided 404 API resource doesn't exist 405 Method not supported, only GET & POST are supported 409 Conflict, item already exists 503 API unavailable

Images

A list of Images organised into Collections.

Endpoints
GET /collections/:id/images GET /collections/:id/images/:id POST /collections/:id/images

List all Images in a Collection

Specify an id number in the request URL to get a collection's images.

Query
curl --location --request GET 'https://api.photostack.io/collections/4/images/' \
--header 'stacker-id: 12345' \
--header 'stacker-token: 1111-2222-3333-4444-5'
Response
[
    {
        "id": "428",
        "filename": "Oooober Head Shots - IMG_0480.jpg"
    },
    {
        "id": "429",
        "filename": "Oooober Head Shots - IMG_0481.jpg"
    },
    {
        "id": "430",
        "filename": "Oooober Head Shots - IMG_0482.jpg"
    }
]
Status Codes
200 Successfully executed query 204 Successfully created item 204 Success but empty result 400 Incomplete parameters received 401 Invalid token provided 404 API resource doesn't exist 405 Method not supported, only GET & POST are supported 409 Conflict, item already exists 503 API unavailable

List single Image in a Collection

Specify an id number for both the collection and image in the request URL to get a specific image's data.

Query
curl --location --request GET 'https://api.photostack.io/collections/4/images/430/' \
--header 'stacker-id: 12345' \
--header 'stacker-token: 1111-2222-3333-4444-5'
Response
[
    {
        "id": "430",
        "filename": "Oooober Head Shots - IMG_0482.jpg"
    }
]
Status Codes
200 Successfully executed query 204 Successfully created item 204 Success but empty result 400 Incomplete parameters received 401 Invalid token provided 404 API resource doesn't exist 405 Method not supported, only GET & POST are supported 409 Conflict, item already exists 503 API unavailable

Upload a new Image to a Collection

Specify an id number in the request URL to set the destination collection.

Parameters required:

upload file

The image to be uploaded should be sent as form-data with the key name upload.

Images can be in the following formats:

.jpg
.jpeg
.png
.gif

Maximum file size allowed is 100MB.

Query
curl --location --request POST 'https://api.photostack.io/collections/4/images/' \
--header 'stacker-id: 12345' \
--header 'stacker-token: 1111-2222-3333-4444-5' \
--form 'upload=@"path/filename.jpg"'
Response
[
    {
        "collection": "1",
        "filename": "filename.jpg"
    }
]
Status Codes
200 Successfully executed query 204 Successfully created item 204 Success but empty result 400 Incomplete parameters received 401 Invalid token provided 404 API resource doesn't exist 405 Method not supported, only GET & POST are supported 409 Conflict, item already exists 503 API unavailable