Inherits from NSObject
Declared in APSUsers.h

Overview

Represents a user account. The REST object of this class contains the following fields:

  • created_at (NSString): Creation date for this user object.
  • custom_fields (NSString/NSDictionary): User defined fields.
  • email (NSString): User’s email address.
  • external_accounts (NSDictionary[]): List of external accounts associated with this user.
  • first_name (NSString): User’s first name.
  • id (NSString): User’s ID, generated by APS.
  • last_name (NSString): User’s last name .
  • photo (APSPhotos): Primary photo for this user.
  • role (NSString): User’s role.
  • updated_at (NSString): Last update time for this user object.
  • username (NSString): User’s login name.
For more details about the underlying REST object, see the ACS API Docs.

Tasks

Class Methods

create:withBlock:

Creates a new user.

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

Parameters

data

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

  • email (NSString): User’s email address.
  • username (NSString): User’s login name.
  • password (NSString): User’s password. (required)
  • password_confirmation (NSString): Copy of user’s password for confirmation. (required)
  • first_name (NSString): User’s first name.
  • last_name (NSString): User’s last name.
  • photo (APSPhotos): New photo to attach as the primary photo for the user.
  • photo_id (NSString): ID of an existing photo to attach as the primary photo for the user.
  • tags (NSString): Comma separated list of tags for this user.
  • custom_fields (NSString/NSDictionary): User defined fields.
  • acl_name (NSString): Name of an ACLs to associate with this object.
  • acl_id (NSString): ID of an ACLs to associate with this object.
  • role (NSString): String representation of user role, for example, “teacher”.
  • template (NSString): Send a congratulation email to notify that the user has been created successfully.
  • confirmation_template (NSString): If “New User Email Verification” is enabled for the application, APS sends a confirmation email to the user.

handler

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

  • users (APSUsers[]): Single-element array containing user record for the new user.

Discussion

Creates a new user.

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

Declared In

APSUsers.h

create:withBlock:progressBlock:

Creates a new user.

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

Parameters

data

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

  • email (NSString): User’s email address.
  • username (NSString): User’s login name.
  • password (NSString): User’s password. (required)
  • password_confirmation (NSString): Copy of user’s password for confirmation. (required)
  • first_name (NSString): User’s first name.
  • last_name (NSString): User’s last name.
  • photo (APSPhotos): New photo to attach as the primary photo for the user.
  • photo_id (NSString): ID of an existing photo to attach as the primary photo for the user.
  • tags (NSString): Comma separated list of tags for this user.
  • custom_fields (NSString/NSDictionary): User defined fields.
  • acl_name (NSString): Name of an ACLs to associate with this object.
  • acl_id (NSString): ID of an ACLs to associate with this object.
  • role (NSString): String representation of user role, for example, “teacher”.
  • template (NSString): Send a congratulation email to notify that the user has been created successfully.
  • confirmation_template (NSString): If “New User Email Verification” is enabled for the application, APS sends a confirmation email to the user.

handler

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

  • users (APSUsers[]): Single-element array containing user record for the new user.

progressHandler

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

Discussion

Creates a new user.

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

Declared In

APSUsers.h

login:withBlock:

Log a user in using their ACS credentials.

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

Parameters

data

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

  • login (NSString): Email address or username of the user to login.
  • password (NSString): User’s password.

handler

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

Discussion

Log a user in using their ACS credentials.

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

Declared In

APSUsers.h

logout:withBlock:

Log out a user.

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

Parameters

data

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

  • device_token: If specified, all push subscriptions associated with this device token are canceled.

handler

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

Discussion

Log out a user.

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

APSUsers.h

query:withBlock:

Custom query of Users objects 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 User 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:

  • users (APSUsers[]): List of users matching the query parameters.

Discussion

Custom query of Users objects with sorting and paginating.

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

Declared In

APSUsers.h

remove:withBlock:

User must already be logged in to his account in order to delete it.

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

Parameters

data

Unused.

handler

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

Discussion

User must already be logged in to his account in order to delete it.

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

APSUsers.h

requestResetPassword:withBlock:

Send an email to a user to recover lost password.

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

Parameters

data

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

  • email (NSString): Email address. (required)
  • subject: The default subject of the password reset email is “Password reset request for {{your app name}}”.
  • template: If you wish to use your custom email body.

handler

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

Discussion

Send an email to a user to recover lost password.

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

Declared In

APSUsers.h

resendConfirmation:withBlock:

If you enabled new user account email verification in your App settings, all new users will receive an email containi

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

Parameters

data

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

  • email (NSString): Email must match user’s registered email. (required)
  • confirmation_subject (NSString): The default subject of the email verification is “Email Verification Instructions for {{your app name}}”.
  • confirmation_template: If you wish to use your custom email body.

handler

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

Discussion

If you enabled new user account email verification in your App settings, all new users will receive an email containi

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

Declared In

APSUsers.h

search:withBlock:

Returns the list of users that have been added to the app, sorted by search relevancy.

+ (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.
  • q: Space-separated list of keywords, used to perform full text search on first name, last name, email address, username and tags fields.
  • response_json_depth: Nested object depth level counts in response json.

handler

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

Discussion

Returns the list of users that have been added to the app, sorted by search relevancy.

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

Declared In

APSUsers.h

show:withBlock:

Shows public user information.

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

Parameters

data

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

  • user_id (NSString): User ID of the user to show.
  • user_ids (NSString): Comma-separated list of user IDs to show.
  • response_json_depth (NSNumber): Nested object depth level counts in response json.
  • show_user_like (NSBoolean): If set to true the User 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:

  • users (APSUsers[]): List of user profiles.

Discussion

Shows public user information.

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

Declared In

APSUsers.h

showMe:withBlock:

Shows both public and private user information about the user who is currently logged in.

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

Parameters

data

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

  • 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.

Discussion

Shows both public and private user information about the user who is currently logged in.

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

APSUsers.h

update:withBlock:

Any of the same parameters as create can be used to update the current user.

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

Parameters

data

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

  • email (NSString): Email address.
  • username (NSString): User name.
  • password (NSString): Password.
  • password_confirmation (NSString): Password.
  • first_name (NSString): First name.
  • last_name (NSString): First name.
  • photo (APSPhotos): New photo to assign as the user’s primary photo.
  • photo_id (NSString): ID of an existing photo to use as the user’s primary photo.
  • tags (NSString): Comma separated tags, overwrites the existing tags.
  • custom data fields (NSString): User-defined data.
  • acl_name (NSString): Name of an ACLs to associate with this object.
  • acl_id (NSString): ID of an ACLs to associate with this object.

handler

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

  • users (APSUsers[]): Single-element array containing the updated user object.

Discussion

Any of the same parameters as create can be used to update the current user.

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

APSUsers.h

update:withBlock:progressBlock:

Any of the same parameters as create can be used to update the current user.

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

Parameters

data

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

  • email (NSString): Email address.
  • username (NSString): User name.
  • password (NSString): Password.
  • password_confirmation (NSString): Password.
  • first_name (NSString): First name.
  • last_name (NSString): First name.
  • photo (APSPhotos): New photo to assign as the user’s primary photo.
  • photo_id (NSString): ID of an existing photo to use as the user’s primary photo.
  • tags (NSString): Comma separated tags, overwrites the existing tags.
  • custom data fields (NSString): User-defined data.
  • acl_name (NSString): Name of an ACLs to associate with this object.
  • acl_id (NSString): ID of an ACLs to associate with this object.

handler

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

  • users (APSUsers[]): Single-element array containing the updated user object.

progressHandler

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

Discussion

Any of the same parameters as create can be used to update the current user.

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

APSUsers.h