You're viewing documentation for version 3. Find version 4 here.

PhotoShelter Developer

Response

By default, response data are returned as JSON objects. Alternatively, you can choose to receive responses in XML format by setting format=xml in the request.

The envelope

Response data are contained within a simple envelope:

JSON

{
	"status": "ok",
	"data": {
		...
	}
}

XML


<PhotoShelterAPI version="3.0">
<status>ok</status>
	<data>
		...
    </data>
</PhotoShelterAPI>

Data key

The data key points to the main part of the response, which contains the data that you requested. Note that all output records have top-level keys. These keys are capitalized and indicate the record type returned (e.g. Image or Gallery).

For example, a call to the /psapi/v3/image/{image_id} endpoint can return:

JSON

{
	"status":"ok",
	"data": {
		"Image": { 
			"image_id": ...,
			"file_name": ...,
			"file_size": ...,
			"height": ...,
			"width": ...,
			"screen_height": ...,
			"screen_width": ...,
			"screen_height_max": ...,
			"screen_width_max": ...,
			"thumb_height": ...,
			"thumb_width": ...,
			"focal_point_x": ...,
			"focal_point_y": ...
		}
	}
}

XML


<PhotoShelterAPI version="1.0">
	<status>ok</status>
	<data>
		<Image>
			<image_id>...</image_id>
			<file_name>...</file_name>
			<file_size>...</file_size>
			<height>...</height>
			<width>...</width>
			<screen_height>...</screen_height>
			<screen_width>...</screen_width>
			<screen_height_max>...</screen_height_max>
			<screen_width_max>...</screen_width_max>
			<thumb_height>...</thumb_height>
			<thumb_width>...</thumb_width>
			<focal_point_x>...</focal_point_x>
			<focal_point_y>...</focal_point_y>
		</Image>
	</data>
</PhotoShelterAPI>