Blackbaud Internet Solutions > REST API (Advanced Donation Form and Images) > 3.0 > Class: UserService

Class: UserService

BLACKBAUD.api.UserService Provides methods for retrieving information about the currently logged in BBIS user from the CRM using calls to the BBIS REST services.

new UserService(options)

Parameters
Name Type Description
options Object An object literal containing one or more of the following optional properties:
  • url : The URL of the BBIS site from which the data will be retrieved. This value is optional when accessed from a BBIS page. The default value will be the BBIS URL of the current page.
  • crossDomain : Indicates the BBIS url specified is from a separate domain than the current page. When True, the class will handle the complexities of making cross domain requests to retrieve data. The default value is False.

API.js, line 353

Methods

getProfile(successCallback, failureCallback)

Returns profile information for the current user. If the user is not logged in, then it may be populated based on the current email-recipient information.

Parameters
Name Type Description
successCallback function The function to call if the request succeeds. The function will be passed an object with the following properties:
  • Addresses : An array of objects describing the addresses of the current user. The objects have have the following properties:
    • City : The address's city.
    • Country : The address's country.
    • Id : The Id of the address.
    • IsPrimary : Boolean indicating if the address is the user's primary address.
    • PostalCode : The address's postal code.
    • State : The address's state.
    • StreedAddress : The address's street address.
    • Type : The Id of the type of the address.
  • EmailAddresses : An array of objects describing the email addresses of the current user. The objects have have the following properties:
    • EmailAddress : The email address.
    • Id : The Id of the email address.
    • IsPrimary : Boolean indicating if the email address is the user's primary email address.
    • Type : The Id of the type of the email address.
  • FirstName : The first name of the current user.
  • LastName : The last name of the current user.
  • Phone : The phone number of the current user.
  • Title : The title of the current user.
failureCallback function The function to call if the request fails.

API.js, line 409