REST API Documentation
/gallery/images
Upload an image
For requests using an OAuth Access Token for a particular member, any parameters the user doesn't have permission to use are ignored (for example, locked will only be honoured if the authenticated user has permission to lock images).
Parameters
Name | Type | Description |
---|---|---|
Required
album
|
int | The ID number of the album the image should be created in - not required if category is provided (only provide one or the other) |
Required
category
|
int | The ID number of the category the image should be created in - not required if album is provided (only provide one or the other) |
Required
author
|
int | The ID number of the member uploading the image (0 for guest). Required for requests made using an API Key or the Client Credentials Grant Type. For requests using an OAuth Access Token for a particular member, that member will always be the author |
Required
caption
|
string | The image caption |
Required
filename
|
string | The image filename (e.g. 'image.png') |
Required
image
|
string | The base64 encoded image contents |
description
|
string | The description as HTML (e.g. "<p>This is an image.</p>"). Will be sanatized for requests using an OAuth Access Token for a particular member; will be saved unaltered for requests made using an API Key or the Client Credentials Grant Type. |
copyright
|
string | The copyright |
credit
|
string | The credit information |
gpsShow
|
int | If the image contains the location in it's EXIF data, 1/0 indicating if a map should be shown (defaults to 1) |
prefix
|
string | Prefix tag |
tags
|
string | Comma-separated list of tags (do not include prefix) |
date
|
datetime | The date/time that should be used for the image post date. If not provided, will use the current date/time. Ignored for requests using an OAuth Access Token for a particular member. |
ip_address
|
string | The IP address that should be stored for the image. If not provided, will use the IP address from the API request. Ignored for requests using an OAuth Access Token for a particular member. |
locked
|
int | 1/0 indicating if the image should be locked |
hidden
|
int | 0 = unhidden; 1 = hidden, pending moderator approval; -1 = hidden (as if hidden by a moderator) |
pinned
|
int | 1/0 indicating if the image should be locked |
featured
|
int | 1/0 indicating if the image should be featured |
anonymous
|
bool | If 1, the item will be posted anonymously. |
Exceptions
Code | Message | Description |
---|---|---|
1G316/2 |
NO_CATEGORY_OR_ALBUM |
The category or album does not exist |
1G316/3 |
NO_AUTHOR |
The author ID does not exist |
1G316/4 |
NO_CAPTION |
No caption was supplied |
1G316/5 |
NO_FILENAME |
No filename was supplied |
1G316/6 |
NO_IMAGE |
The image was invalid |
2G316/D |
NO_PERMISSION |
The authorized user does not have permission to create an image in that category/album |
1G316/E |
IMAGE_TOO_BIG |
The image exceeds the filesize the authorized user can upload |
Response
Name | Type | Description |
---|---|---|
id
|
int | ID number |
caption
|
string | Caption |
description
|
string | Description |
filename
|
string | Original file name (e.g. 'image.png') |
filesize
|
int | Original file size, in bytes |
images
|
object | URLs to where the images are stored. Keys are 'original', 'large', and 'small', and values are URLs to the corresponding images |
album
|
album object | The album, if in one |
category
|
category object | The category (if in an album, this will be the category that the album is in) |
author
|
member object | The author |
copyright
|
string | Copyright |
credit
|
string | Credit |
location
|
geolocation object | The location where the picture was taken, if it was able to be retreived from the EXIF data |
exif
|
object | The raw EXIF data |
date
|
datetime | Date image was uploaded |
comments
|
int | Number of comments |
reviews
|
int | Number of reviews |
views
|
int | Number of views |
prefix
|
string | The prefix tag, if there is one |
tags
|
array of strings | The tags |
locked
|
bool | Image is locked |
hidden
|
bool | Image is hidden |
featured
|
bool | Image is featured |
pinned
|
bool | Image is pinned |
url
|
string | URL |
rating
|
float | Average Rating |
nsfw
|
bool | Not safe for work |
album
object
Name | Type | Description |
---|---|---|
id
|
int | ID number |
name
|
string | Name |
description
|
string | Description |
category
|
category object | The category |
owner
|
member object | The owner |
privacy
|
string | 'public', 'private' (can only be viewed by owner) or 'restricted' (can only be viewed by owner or approved members) |
approvedMembers
|
array of member objects | If the album is restricted, the members who can view it, in addition to the owner and moderators with appropriate permission |
images
|
int | Number of images |
url
|
string | URL |
category
object
Name | Type | Description |
---|---|---|
id
|
int | ID number |
name
|
string | Name |
url
|
string | URL |
class
|
string | Node class |
parentId
|
int|null | Parent Node ID |
permissions
|
object|null | Node permissions |
member
object
Name | Type | Description |
---|---|---|
id
|
int | ID number |
name
|
string | Username |
title
|
string | Member title |
timezone
|
string | Member timezone |
formattedName
|
string | Username with group formatting |
primaryGroup
|
group object | Primary group |
secondaryGroups
|
array of group objects | Secondary groups |
email
|
string | Email address |
joined
|
datetime | Registration date |
registrationIpAddress
|
string | IP address when registered |
warningPoints
|
int | Number of active warning points |
reputationPoints
|
int | Number of reputation points |
photoUrl
|
string | URL to photo (which will be the site's default if they haven't set one) |
photoUrlIsDefault
|
bool | Indicates if the value of photoUrl is the site's default |
coverPhotoUrl
|
string | URL to profile cover photo (will be blank if there isn't one) |
profileUrl
|
string|null | URL to profile |
validating
|
bool | Whether or not the validating flag is set on the member account |
posts
|
int | Number of content item submissions member has made |
lastActivity
|
datetime|null | Last activity date on the site. |
lastVisit
|
datetime|null | Last distinct visit date on the site. |
lastPost
|
datetime|null | Latest content submission date. |
profileViews
|
int | Number of times member's profile has been viewed |
birthday
|
string | Member birthday in MM/DD/YYYY format (or MM/DD format if no year has been supplied). |
customFields
|
array of fieldgroup objects | Custom profile fields. For requests using an OAuth Access Token for a particular member, only fields the authorized user can view will be included |
rank
|
array of rank objects | Rank |
achievements_points
|
int | Points |
allowAdminEmails
|
bool | Whether or not this member wants to receive admin emails |
completed
|
bool | Whether or not the registration is completed |
group
object
Name | Type | Description |
---|---|---|
id
|
int | ID number |
name
|
string | Name |
formattedName
|
string | Name with formatting |