Inherits from NSObject
Declared in APSPhotos.h

Overview

The Photos API lets you upload, resize and manage photos for your application. The REST object of this class contains the following fields:

  • acls (NSString): Single-element array containing the ACLs associated with this photo object, if any.
  • collections (APSPhotoCollections[]): Single-element array containing the collection this photo is a part of, if any.
  • content_type (NSString): MIME content-type for this photo.
  • created_at (NSString): Creation date for this photo object.
  • custom_fields (NSDictionary): User defined fields.
  • filename (NSString): Filename of the original photo.
  • id (NSString): Generated ID for this photo.
  • md5 (NSString): MD5 hash of the original image data.
  • processed (NSBoolean): True if this photo has been processed and is available for download.
  • ratings_average (NSNumber): Average rating for this object.
  • ratings_count (NSNumber): Total number of reviews for this object that include a rating.
  • ratings_summary (NSDictionary): Breakdown of the number of reviews that specified a given rating value.
  • reviews (APSReviews[]): List of reviews for this object.
  • reviews_count (NSNumber): Total number of reviews for this object.
  • size (NSNumber): Original image size in bytes.
  • tags (NSString[]): List of tags for this photo.
  • title (NSString): Photo title, if specified.
  • updated_at (NSString): Last update time for this photo object.
  • urls (NSDictionary): A hash containing image URLs for the photo at different sizes.
  • user (APSUsers): User object for the photo’s owner.
For more details about the underlying REST object, see the ACS API Docs.

Tasks

Class Methods

create:withBlock:

Create a photo using the given photo binary attachment.

+ (void)create:(NSDictionary *)data withBlock:(APSResponseHandler)handler

Parameters

data

Method parameters specified as an NSDictionary with the following key-value pairs:

  • photo (NSURL/NSData): The attached binary file. (required)
  • title (NSString): Photo title.
  • collection_name (NSString): Name of the PhotoCollections to add this photo to.
  • collection_id (NSString): ID of the PhotoCollections to add this photo to.
  • tags (NSString): Comma separated list of tags to associate with this photo.
  • custom_fields (NSDictionary): User-defined fields to add to this photo.
  • acl_name (NSString): Name of an ACLs to associate with this photo object.
  • acl_id (NSString): ID of an ACLs to associate with this photo object.
  • user_id (NSString): User ID to create the photo on behalf of.
  • photo_sizes (NSString/NSDictionary): User-defined photo sizes.
  • photo_sync_sizes[]: Synchronous photo sizes to upload.

handler

Callback to handle the server response. See the Callback section in APSClient. The response data returns the following method-specific properties:

  • photos (APSPhotos[]): Single-element array containing the newly-created photo object.

Discussion

Create a photo using the given photo binary attachment.

To use this method, a user must be logged in before calling this method.

For more details about the underlying REST method, see the ACS API Docs.

Declared In

APSPhotos.h

create:withBlock:progressBlock:

Create a photo using the given photo binary attachment.

+ (void)create:(NSDictionary *)data withBlock:(APSResponseHandler)handler progressBlock:(APSProgressHandler)progressHandler

Parameters

data

Method parameters specified as an NSDictionary with the following key-value pairs:

  • photo (NSURL/NSData): The attached binary file. (required)
  • title (NSString): Photo title.
  • collection_name (NSString): Name of the PhotoCollections to add this photo to.
  • collection_id (NSString): ID of the PhotoCollections to add this photo to.
  • tags (NSString): Comma separated list of tags to associate with this photo.
  • custom_fields (NSDictionary): User-defined fields to add to this photo.
  • acl_name (NSString): Name of an ACLs to associate with this photo object.
  • acl_id (NSString): ID of an ACLs to associate with this photo object.
  • user_id (NSString): User ID to create the photo on behalf of.
  • photo_sizes (NSString/NSDictionary): User-defined photo sizes.
  • photo_sync_sizes[]: Synchronous photo sizes to upload.

handler

Callback to handle the server response. See the Callback section in APSClient. The response data returns the following method-specific properties:

  • photos (APSPhotos[]): Single-element array containing the newly-created photo object.

progressHandler

Callback to handle the progress of the request. See the Callback section in APSClient.

Discussion

Create a photo using the given photo binary attachment.

To use this method, a user must be logged in before calling this method.

For more details about the underlying REST method, see the ACS API Docs.

Declared In

APSPhotos.h

query:withBlock:

Perform custom query of photos with sorting and paginating.

+ (void)query:(NSDictionary *)data withBlock:(APSResponseHandler)handler

Parameters

data

Method parameters specified as an NSDictionary with the following key-value pairs:

  • page (NSNumber): Request page number, default is 1.
  • per_page (NSNumber): Number of results per page, default is 10.
  • limit (NSNumber): Instead of using page and per_page for pagination, you can use limit and skip to do your own pagination.
  • skip (NSNumber): Number of records to skip.
  • where (NSDictionary): Constraint values for fields.
  • order (NSString): Sort results by one or more fields.
  • sel (NSDictionary): Selects the object fields to display.
  • show_user_like (NSBoolean): If set to true, each Photo object in the response includes “current_user_liked: true” if the current user has liked the object.
  • unsel (NSDictionary): Selects the object fields NOT to display.
  • response_json_depth (NSNumber): Nested object depth level counts in response json.

handler

Callback to handle the server response. See the Callback section in APSClient. The response data returns the following method-specific properties:

  • photos (APSPhotos[]): List of photos matching the query parameters.

Discussion

Perform custom query of photos with sorting and paginating.

For more details about the underlying REST method, see the ACS API Docs.

Declared In

APSPhotos.h

remove:withBlock:

Deletes a photo to which you have update access.

+ (void)remove:(NSDictionary *)data withBlock:(APSResponseHandler)handler

Parameters

data

Method parameters specified as an NSDictionary with the following key-value pairs:

  • photo_id (NSString): ID of the photo to delete. (required)
  • user_id (NSString): User ID to delete the Photo object on behalf of.

handler

Callback to handle the server response. See the Callback section in APSClient.

Discussion

Deletes a photo to which you have update access.

To use this method, a user must be logged in before calling this method.

For more details about the underlying REST method, see the ACS API Docs.

Declared In

APSPhotos.h

search:withBlock:

Searches for photos with sorting and paginating.

+ (void)search:(NSDictionary *)data withBlock:(APSResponseHandler)handler

Parameters

data

Method parameters specified as an NSDictionary with the following key-value pairs:

  • page (NSNumber): Request page number, default is 1.
  • per_page (NSNumber): Number of results per page, default is 10.
  • limit (NSNumber): Instead of using page and per_page for pagination, you can use limit and skip to do your own pagination.
  • skip (NSNumber): Number of records to skip.
  • response_json_depth (NSNumber): Nested object depth level counts in response JSON.

handler

Callback to handle the server response. See the Callback section in APSClient. The response data returns the following method-specific properties:

  • photos (APSPhotos[]): List of photos matching the search parameters.

Discussion

Searches for photos with sorting and paginating.

For more details about the underlying REST method, see the ACS API Docs.

Declared In

APSPhotos.h

show:withBlock:

Returns the information for the identified photo.

+ (void)show:(NSDictionary *)data withBlock:(APSResponseHandler)handler

Parameters

data

Method parameters specified as an NSDictionary with the following key-value pairs:

  • photo_id (NSString): ID of the photo to show. (required)
  • response_json_depth (NSNumber): Nested object depth level counts in response JSON.
  • show_user_like (NSBoolean): If set to true the Photo object in the response will include “current_user_liked: true” if the current user has liked the object.

handler

Callback to handle the server response. See the Callback section in APSClient. The response data returns the following method-specific properties:

  • photos (APSPhotos[]): Single-element array containing the identified photo.

Discussion

Returns the information for the identified photo.

For more details about the underlying REST method, see the ACS API Docs.

Declared In

APSPhotos.h

update:withBlock:

Updates the photo attachment, the collection that the photo belongs to, or other photo properties.

+ (void)update:(NSDictionary *)data withBlock:(APSResponseHandler)handler

Parameters

data

Method parameters specified as an NSDictionary with the following key-value pairs:

  • photo_id (NSString): ID of the photo to update. (required)
  • photo (NSURL/NSData): New photo to associate with this object, attached as a binary file. (required)
  • title (NSString): Photo title.
  • collection_name (NSString): Name of the PhotoCollections to add this photo to.
  • collection_id (NSString): ID of the PhotoCollections to add this photo to.
  • tags (NSString): Comma separated list of tags to associate with this photo.
  • custom_fields (NSDictionary): User-defined fields to add to this photo.
  • acl_name (NSString): Name of an ACLs to associate with this photo object.
  • acl_id (NSString): ID of an ACLs to associate with this photo object.
  • photo_sizes (NSString/NSDictionary): User-defined photo sizes.
  • photo_sync_sizes: Synchronous photo sizes to upload.
  • user_id (NSString): User ID to update the Photo object on behalf of.

handler

Callback to handle the server response. See the Callback section in APSClient. The response data returns the following method-specific properties:

  • photos (APSPhotos[]): Single-element array containing the updated photo.

Discussion

Updates the photo attachment, the collection that the photo belongs to, or other photo properties.

To use this method, a user must be logged in before calling this method.

For more details about the underlying REST method, see the ACS API Docs.

Declared In

APSPhotos.h

update:withBlock:progressBlock:

Updates the photo attachment, the collection that the photo belongs to, or other photo properties.

+ (void)update:(NSDictionary *)data withBlock:(APSResponseHandler)handler progressBlock:(APSProgressHandler)progressHandler

Parameters

data

Method parameters specified as an NSDictionary with the following key-value pairs:

  • photo_id (NSString): ID of the photo to update. (required)
  • photo (NSURL/NSData): New photo to associate with this object, attached as a binary file. (required)
  • title (NSString): Photo title.
  • collection_name (NSString): Name of the PhotoCollections to add this photo to.
  • collection_id (NSString): ID of the PhotoCollections to add this photo to.
  • tags (NSString): Comma separated list of tags to associate with this photo.
  • custom_fields (NSDictionary): User-defined fields to add to this photo.
  • acl_name (NSString): Name of an ACLs to associate with this photo object.
  • acl_id (NSString): ID of an ACLs to associate with this photo object.
  • photo_sizes (NSString/NSDictionary): User-defined photo sizes.
  • photo_sync_sizes: Synchronous photo sizes to upload.
  • user_id (NSString): User ID to update the Photo object on behalf of.

handler

Callback to handle the server response. See the Callback section in APSClient. The response data returns the following method-specific properties:

  • photos (APSPhotos[]): Single-element array containing the updated photo.

progressHandler

Callback to handle the progress of the request. See the Callback section in APSClient.

Discussion

Updates the photo attachment, the collection that the photo belongs to, or other photo properties.

To use this method, a user must be logged in before calling this method.

For more details about the underlying REST method, see the ACS API Docs.

Declared In

APSPhotos.h