You are here: Photobucket API Help > Examples

Examples

The Examples section provides end-to-end code samples for various common tasks. Each task may have code samples in multiple languages. Each sample provides a description of the tasks being performed, the prerequisites (if any), and the methods that are used. Methods can be viewed in the Methods book.

The most common tasks performed on the Photobucket site are:

Values for Examples

The following values are used in all examples:

As well, each example provides raw code and API code. For example:

Ping: GET /ping

Raw Request Example

  1. <timestamp> = 1208289833
  2. <nonce> = cc09413d20742699147d083d755023f7
  3. <method> = GET
  4. <url> = http://api.photobucket.com/ping
  5. <params> (None)
  6. <paramstring> = oauth_consumer_key=1020304&oauth_nonce=cc09413d20742699147d083d755023f7&oauth_signature_method=HMAC-SHA1&oauth_timestamp=1208289833&oauth_version=1.0
  7. <base> = GET&http%3A%2F%2Fapi.photobucket.com%2Fping&oauth_consumer_key%3D1020304%26oauth_nonce%3Dcc09413d20742699147d083d755023f7%26oauth_signature_method%3DHMAC-SHA1%26oauth_timestamp%3D1208289833%26oauth_version%3D1.0 8.
  8. <signature> = 2j4y6ocB4d4tTxDoHaNulKpA46c=
  9. <authedurl> = http://api.photobucket.com/ping?oauth_consumer_key=1020304&oauth_nonce=cc09413d20742699147d083d755023f7&oauth_signature=2j4y6ocB4d4tTxDoHaNulKpA46c%3D&oauth_signature_method=HMAC-SHA1&oauth_timestamp=1208289833&oauth_version=1.0

Raw Response Example

<?xml version="1.0" encoding="UTF-8"?>

<response>

   <status>OK</status>

   <content>

      <pong>(read)</pong>

      <request>

         <oauth_consumer_key>1020304</oauth_consumer_key>

         <oauth_nonce> cc09413d20742699147d083d755023f7</oauth_nonce>

         <oauth_signature>2j4y6ocB4d4tTxDoHaNulKpA46c=</oauth_signature>

         <oauth_signature_method>HMAC-SHA1</oauth_signature_method>

         <oauth_timestamp>1208289833</oauth_timestamp>

         <oauth_version>1.0</oauth_version>

      </request>

   </content>

   <format>xml</format>

   <method>GET</method>

   <timestamp>1208289833</timestamp>

</response>

API Example (PHP)

$resp = $api->ping()->get()->getResponseString();

 

Published 25-June-10. See developer.photobucket.com for additional resources.