Your First API Request

The first thing to know about version v2 is that it's a REST API. If you want to learn more about what that means in the SmugMug context, you can read this first.

Now, let's start using the API by fetching the User object for an example user.

If you load that URI in a web browser, you'll get back an interactive web page showing the response content. This is our Live API Browser. You can use this interactive tool to browse and explore the SmugMug API right inside your web browser. In an application though, you'll probably want to receive the response as JSON instead, which is what the Accept header is for.

Here is the response as JSON:

Here's a run-down of some notable components of this response:

Response.Uri This is the URI you requested
Response.LocatorType This tells you how many objects are in the response (Object means you get one object; Objects means an array of objects)
Response.Locator This is the data type of the object or objects in the response
Response.User This is the meat of the response: the User object itself
Response.User.Uris These are the available URIs related to this user