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

Class: CountryService

BLACKBAUD.api.CountryService Provides methods for getting state and country information from the CRM using calls to the BBIS REST services.

new CountryService(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 96

Methods

getAddressCaptions(countryId, successCallback, failureCallback)

Returns the internationalized address captions associated with a specified country.

Parameters
Name Type Description
countryId String The Id of a country whose address captions should be returned.
successCallback function The function to call if the request succeeds. The function will be passed an object with the following properties:
  • AddressLines : The caption for the address lines.
  • City : The caption for the city.
  • State : The caption for the state.
  • PostCode : The caption for the postal code.
failureCallback function The function to call if the request fails.

API.js, line 171

getCountries(successCallback, failureCallback)

Returns a list of all active countries alphabetized by their description.

Parameters
Name Type Description
successCallback function The function to call if the request succeeds. The function will be passed an array of objects with the following properties:
  • Id : The Id of a country.
  • Abbreviation : The abbreviation of a country.
  • Description : The description of a country.
failureCallback function The function to call if the request fails.

API.js, line 128

getStates(countryId, successCallback, failureCallback)

Returns a list of states associated with a specified country, alphabetized by their description.

Parameters
Name Type Description
countryId String The Id of a country whose states should be returned.
successCallback function The function to call if the request succeeds. The function will be passed an array of objects with the following properties:
  • Id : The Id of a state.
  • Abbreviation : The abbreviation of a state.
  • Description : The description of a state.
failureCallback function The function to call if the request fails.

API.js, line 149