AboutContactLogin

Index

Overview

The Zenfolio API includes methods that provide information about objects. Methods can also be used to update objects.

To invoke a method, you need to prepare an HTTP request in one of the supported formats, and send it to a special URL. The response you receive contains the result of the API call or, in the case of an error, the error description. You can find a comprehensive list of the Zenfolio API methods and objects in the Reference section.

The Zenfolio API supports two formats for sending requests: SOAP and JSON-RPC. Regardless of the data format, you should always send the API requests to the following URL:

http://api.zenfolio.com/api/1.7/zfapi.asmx

When submitting API requests, your application has to identify itself by providing a unique user agent string. The exact format of the user agent string is up to the developer, but it should provide enough information to identify the application and its version. In particular, you should never try to masquerade your application as a Web browser using a browser User-Agent string.

There are two ways to provide the user agent string. First, you can add the X-Zenfolio-User-Agent header to all HTTP requests, for example:

POST /api/1.7/zfapi.asmx HTTP/1.1<cr><lf>
Host: api.zenfolio.com<cr><lf>
User-Agent: Acme PhotoEdit plugin for Zenfolio v1.0<cr><lf>
X-Zenfolio-User-Agent: Acme PhotoEdit plugin for Zenfolio v1.0<cr><lf>
Content-Type: text/xml; charset=utf-8<cr><lf>
Content-Length: 223<cr><lf>
<cr><lf>
[request body]

Alternatively, you can add the zf_ua cookie as shown below:

POST /api/1.7/zfapi.asmx HTTP/1.1<cr><lf>
Host: api.zenfolio.com<cr><lf>
User-Agent: Acme PhotoEdit plugin for Zenfolio v1.0<cr><lf>
Cookie: zf_ua=Acme%20PhotoEdit%20plugin%20for%20Zenfolio%20v1.0;<cr><lf>
Content-Type: text/xml; charset=utf-8<cr><lf>
Content-Length: 223<cr><lf>
<cr><lf>
[request body]

Whenever possible, you should also duplicate the user agent string in the standard HTTP User-Agent header as shown in the examples above.