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
Validate
We can check if the user has entered a valid Token
by querying /validate/
passing stacker-id
and stacker-token
in as headers.
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
Settings
A list of settings and account details related to the PhotoStack user's account
.
List all Settings
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
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'.
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.
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
List single Client
Specify an id
number in the request URL to get a single client's details.
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
Create a new Client
Parameters required:
client
string
The name of the new client in plain text.
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
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
.
List all Collections
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
List single Collection
Specify an id
number in the request URL to get a single collection's details.
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
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.
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
Images
A list of Images
organised into Collections
.
List all Images
in a Collection
Specify an id
number in the request URL to get a collection's images.
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
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.
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
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.
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