Additional Examples

From i4a API Wiki
Jump to navigation Jump to search

Filtering on Member Type and Expiration Date using the API

The i4a system can be configured to use the Individual Database Model or the Organizational Database Model. The simplest way to determine the database model is to check for the presence of Manage Organizations on the Membership dropdown menu in the i4a system. If it is present, the system is configured to use the Organizational Database Model, and if it is absent, it is using the Individual Database Model.

Selecting a Data Source to use with the API

Here are two views that can be used with the API, and contain membership information. This is not a complete list of all available views. Contact i4a for support if you are not able to get what you need using the views or tables in the examples provided.

  • ams_contactinformation_membertype - Includes the "membertype" field which contains the record's Member Type if it is populated. The "paidthru" field contains the record's Expiration Date. Records with a member type and a future expiration date are current members. Use this with the individual database model only.
  • ams_contactinformation_corptype - Includes the "corptype" field which contains the record's Member Type if it is populated. The "corpexpiration" field contains the record's Expiration Date. Records with a member type and a future expiration date are current members. Use this with the organizational database model only.


Below are some examples specific to each database model:

Individual Database Model Examples

The examples below uses the view ams_contactinformation_membertype. This view should only be used with the i4a Individual Database Model:

  • /i4a/api/json/view.ams_contactinformation_membertype/membertype=Regular:isActive=1/<authkey> - This example's only purpose is to show how you could filter for a specific member type using this view. The search string "Regular" should be replaced by the name of a member type that exists in the database you are querying. Returns a json packet that contains all active database records where the member type is Regular. Current and expired members would be returned in this example.
  • /i4a/api/json/view.ams_contactinformation_membertype/membertype is not null/<authkey> - Returns a json packet that contains all matching records that have a member type. Current and expired members would be returned in this example.

Organizational Database Model Examples

The following example uses the view ams_contactinformation_corptype. This view should only be used with the i4a Organizational Database Model.

  • /i4a/api/json/view.ams_contactinformation_corptype/corptype=Regular:isActive=1/<authkey> - This example's only purpose is to show how you could filter for a specific member type using this view. In this specific view, the member type field is called corptype. The search string "Regular" should be replaced by the name of a member type that exists in the database you are querying. Returns a json packet that contains all active database records where the member type is Regular.