NAME

ExposureManager::API - A programmable interface to ExposureManager uploads


INTRODUCTION

ExposureManager provides a programmable interface to galleries, photos, image uploads and processing. It is inspired by ReST (http://www.xml.com/pub/a/2004/12/01/restful-web.html), which makes it light-weight and easy to implement. All you need is a HTTP library and an XML or JSON library. Example code in Perl is provided to help you get a feel for it.


CONTENT TYPES

The API accepts both XML and JSON, and emits the same type as your input, with the exception of the file-upload URI. We only accept standard HTML upload there. We look at the accept and content-type headers to determine which format you want. If you're unable to set either, you can use a query parameter named format with a value of xml or json. This query param will take precedence over the http headers.


AUTHENTICATION

Since this API is not meant for public consumption, we require all interaction to be authenticated. You log the user in through the login URI. That will return a session cookie, as well as a session_id in the response. Any subsequent API call will either need to supply the session cookie, or a URL parameter with the name SID.


SECURITY

Use of https is recommended.


RESOURCES

Note: Variables in URIs or XML or JSON will be written as ${variable_name}.

The base URI for our API is https://www.exposuremanager.com/rest/.

API MAP

    URI:    https://www.exposuremanager.com/rest/
    METHOD: GET
    Output: A (terse) overview of the directly accessible resources.
            Currently the JSON output looks like this:
            {
               "resources" : {
                  "documentation" : "https://www.exposuremanager.com/api-doc/index.html"
                  "login" : {
                     "methods" : [ "POST" ],
                     "uri" : "https://www.exposuremanager.com/rest/login"
                  },
                  "account" : {
                     "method" : [ "GET" ],
                     "uri" : "https://www.exposuremanager.com/rest/account"
                  },
                  "upload" : {
                     "methods" : [ "GET", "POST" ],
                     "uri" : "https://www.exposuremanager.com/rest/upload"
                  },
                  "upload_locations" : {
                     "methods" : [ "GET" ],
                     "uri" : "https://www.exposuremanager.com/rest/upload_locations"
                  },
                  "uploadjobs" : {
                     "methods" : [ "GET", "POST" ],
                     "uri" : "https://www.exposuremanager.com/rest/uploadjobs"
                  },
                  "galleries" : {
                     "methods" : [ "GET" ],
                     "uri" : "https://www.exposuremanager.com/rest/galleries"
                  },
                  "outstanding_orders" : {
                     "methods" : [ "GET" ],
                     "uri" : "https://www.exposuremanager.com/rest/orders/outstanding"
                  }
               }
            }

LOGIN

GALLERIES

PHOTOS

UPLOADS

Direct uploads

Batched uploads

ORDERS

These resources allow you to list and fulfill optimized files required for pending orders.


EXAMPLE CODE

    use LWP::UserAgent;
    use XML::Simple;
    
    # construct ua
    my $ua = LWP::UserAgent->new();
    $ua->cookie_jar({ file => "t/rest_cookies.txt" });
    
    my $uri = 'https://www.exposuremanager.com/rest';
    
    # login
    my $resp = $ua->post($uri. '/login',
        Content_Type => 'application/xml',
        Content => q{
            <auth>
                <login>example</login>
                <password>secret</password>
            </auth>
        }
    );


SUPPORT

Please mail us at rest-api@support.exposuremanager.com for questions, comments and bug reports.


LICENSE and COPYRIGHT

© 2007-2011 ExposureManager. All rights reserved.


DISCLAIMER

THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.