You are here: Photobucket API Help > Getting Started > Conventions

Conventions

The Conventions section explains the documentation conventions, the code conventions that are used in the examples and methods, as well as general Photobucket conventions.

Documentation Conventions

In the documentation, the following conventions are observed:

Code Conventions

Code Convention Description
Boolean All boolean values can be entered as 1/0 or true/false.
Method All HTTP methods actions are returned in the <method> tag in the successful response. You can override the HTTP method in the request string when necessary.

Photobucket Conventions

Photobucket provides specific URL structures that can be used by applications, supports specific media types, and requires that requests be encoded in a specific manner. The Photobucket web site also has certain structural conventions that pertain to object encoding.

Supported Media Types 

Photobucket supports image and video media types. The accepted media types are:

URL Structures 

Photobucket provides "special" URL prefaces that you should use for various types of display and linking. The following table pertains to images and videos, lists the sub-domain preface, and provides a description of how it should be used.

Sub-domain Description
http://s123...

"s" before the sub-domain links to an album or full view (browseurl) in a browser. "s" links display HTML for a full web browser to view only. Using the "s" link is strongly discouraged.

http://g123...

"g" before the sub-domain links to a group album or full view (browseurl) in a browser. "g" links display HTML for a full web browser to view only. Using the "g" link is strongly discouraged.

http://i123...

"i" before the sub-domain links directly to an image. You may want to replace "i" with "mob", "mobth", or "w", depending on your application.

http://gi123...

"gi" before the sub-domain links directly to an image. You may want to replace "g" with "mob", "mobth", or "w", depending on your application.

http://vid123...

"vid" before the sub-domain links directly to a video.

http://gvid123...

"gvid" before the sub-domain links directly to a video in a group album.

http://w123...

"w" before the sub-domain loads images assets, the slide show core, and individual slide shows.

http://mob123...

"mob" before the sub-domain resizes images to 240x240.

http://mobth123...

"mobth" before the sub-domain links to a thumbnail 75x75.

http://feed123..

"feed" before the sub-domain links directly to an RSS feed. See Photobucket RSS Feeds.

http://gfeed123..

"gfeed" before the sub-domain links directly to a group album RSS feed. See Photobucket RSS Feeds.

Request Encoding

The following conventions must be observed when sending requests:

Example Multipart Encoded POST Upload Request

Object Identifiers

The Photobucket web site structure is:

User name > User album > Sub-albums > Sub-sub-albums, etc.

The user name is ALSO the main user album name.

For example, imagine a Photobucket user, pbapi. This user has three sub-albums, sub1, sub2, and sub3, and one sub-album, sub4 in album sub1. The user has media in these albums, image1, image2, and video1. SO:

User Name= pbapi

User Album = pbapi

Albums = sub1, sub2, sub3, and sub1/sub4

Media = image1 in the user album, image2 in album sub1, and video1 in album sub1/sub4

Additionally, group albums have their own "group hash value" or Group ID in their URLs. The Group ID is a short, all-caps string on the URL for a group. For example, the URL for the featured group album "Woof" is:

http://gs275.photobucket.com/groups/jj285/20IF1LMOT/?featuredgroupalbum=Woof

where 20IF1LMOT is the Group ID.

Get Album Request Examples
Get Media Request Examples

More examples are provided in the FAQ. See the topic What is the [identifier] in the Methods, and why does it look the way it does.

Alternative Identifier Specifications

Due to incompatibilities with some libraries, encoding slashes (/ to %2F) are not supported in the URL. In situations where slashes must be encoded, it is difficult to sign and make requests to albums and media objects. An alternative identifier specification has been devised as a work-around.

Put '!' in the URI in place of the identifier. The code assumes you are specifying "!" in the parameters (querystring or post).

If you put "!" in the first position (noted as ‘identifier’ in the documentation), the parameter is "id". E.g., /user/!/url?id=pbapi or /album/!?id=pbapi%2Fsecond

If you put "!" in the second position (noted as ‘actionIdentifier’ in the documentation), the parameter is "aid". E.g., /user/!/tag/!?id=pbapi&aid=tagname or /group/!/contributor/!?id=FFCGKTE2&aid=pbapi

Current User Identifier

When a user is logged in, some actions automatically support working on the current logged in user. To do this, specify "-" as the identifier.

Users: All actions (except register and suggest).

Albums: All actions (specifies user's root album).

 

Published 2-September-09. See developer.photobucket.com for additional resources.