Retrieving data from ACTIVE Net Insights

To retrieve data from ACTIVE Net insights, your system needs to:

    1. Call the API using the HTTP GET method with the required request parameters.

    2. Parse the JSON-formatted response.

 

This chapter includes the following sections:

Preparing your request URL

Note that if you have enabled enhanced-security ACTIVENet System APIs, to make API requests using both the API key and a digital signature, refer here.

 

To prepare the request URL for an API call, refer to the following template.

 

The request URL consists of the following fields:

 

{https}://{host address}/{service name}/{resource name}?{request parameter strings 1}&{request parameter strings 2}&api_key={your API key}

 

Item Description
https HTTPS protocol
host address

The address of the API server:

 

api.amp.active.com/

service name
 

The Insights Data APIs service name:

You can determine your API service name from your AUI address, for example:

 

If your AUI address is:

 

https://anprod.active.com/orgtest/servlet/processPortalLogin.sdi

 

then your service name is ANETGateway/rest/anet-insightsapi/

 

If your AUI address is:

 

https://anprodca.active.com/orgtest/servlet/processPortalLogin.sdi

 

then your service name is ANETGateway/rest/anet-insightsapi-ca/

resource name Resource name
 
Refer to the List of Insights Data APIs page to view the supported parameters of each API.
request parameter strings Mandatory and optional request parameters can be specified to filter the response records.
your API key

Your organization’s API key, for example:

1234567890xn3xnteudxsavw

You must specify a valid API key in the API call request.

For clarity, it is recommended that the API key is listed last in the parameter list.

 

Note:

§         Use / to separate the host address, organization ID, API version, resource path and name.

§         Use ? to separate the full API path and request parameters.

§         Use & to separate the optional request parameters. Note that optional request parameters do not have to be listed in a specific order.

§         Use = to separate parameter names and parameter values.

§         Use , to separate multiple parameter values for one parameter name (note that only specific parameters can accept more than one value).

 

For example:

 

§         Refer to the List of Insights Data APIs to view API specifications for the required API.

o        To retrieve summary information for customers whose first name are John and last name are Smith:

      The required API to retrieve customer information is customers

      For the first name filter,  firstName=John

      For the last name filter, lastName=Smith

§         Your service name is ANETGateway/rest/anet-insightsapi/

§         Your API key is specified as api_key=1234567890xn3xnteudxsavw

 

The request URL is:

 

https://api.amp.active.com/ANETGateway/rest/anet-insightsapi/customers?firstName=John&lastName=Smith&api_key=1234567890xn3xnteudxsavw

 

Request parameters

To see the available request parameters for an API, refer to each individual API specifications.

API request parameters can either be mandatory or optional:

 

Mandatory request parameters:

Mandatory request parameters must be specified in the URL path of your API request.

 

Example: To call the Membership Statistics API, you must specify the requested start date and end date in the URL path.

 

Example URL:

 

https://api.amp.active.com/ANETGateway/rest/anet-insightsapi/membershipStats?startDate=2017-01-01&endDate=2017-01-02&statisticsCategory=inBranch&api_key=1234567890xn3xnteudxsavw

 

Only memberships whose transferred-in dates are between 2017-01-01 and 2017-01-02 will be returned.

 

• Optional request parameters:

You can include several optional request parameters in the URL to filter the response results.

 

Example: To call the Membership Statistics API, you can specify the following optional request parameters:

 

Membership packages under Site IDs 101 and 102: siteId=101,102

 

Example URL:

 

https://api.amp.active.com/ANETGateway/rest/anet-insightsapi/membershipStats?startDate=2017-01-01&endDate=2017-01-02&siteId=101,102&statisticsCategory=inBranch&api_key=1234567890xn3xnteudxsavw

 

Only memberships in sites 101 and 102, and whose transferred-in dates are between 2017-01-01 and 2017-01-02 will be returned.

 

Note:

URL parameters may require special characters; for the corresponding escape string, refer to the table below:

Character Escape String Character Escape String
Space

%20

#

%23

$ %24 % %25
&

%26

@ %40
` %60 / %2F
: %3A ; %3B
< %3C = %3D
%3E ? %3F
[ %5B \ %5C
] %5D ^ %5E
{ %7B | %7C
} %7D ~ %7E
%22

%27

+ %2B , %2C

Receiving API responses

Once you make a request to the API with the required parameters, you will receive an API response.

A successful request returns the HTTP 200 OK status code and a JSON-formatted response body.

 

{

    "page": 1,

    "pageSize": 1,

    "pageRowCount": 1,

    "filteredRowCount": 1000,

    "totalRowCount": 10000,

    "data": [

        {

            "member_id": 0,

            "member_first_name": "XXXX",

            "member_last_name": "XXXX",

            "member_address_1": "XXXX",

            "member_address_2": "XXXX",

            "member_home_phone": "XXXX",

            "member_work_phone": "XXXX",

            "member_cell_phone": "XXXX",

            "member_state_province": "XXXX",

            "member_zip_postalcode": "XXXX",

            "member_city": "XXXX",

            "member_county": "XXXX",

            "member_customer_type": "XXXX",

            "member_date_of_birth": "2000/01/01",

            "member_email": "XXX@XXX.com",

            "member_age": 0,

            "member_since_date": "2000/01/01",

            "member_resident_status": "XXXX",

            "member_retired_status": "XXXX",

            "package_cancellation_date": "2000/01/01",

            "package_effective_date": "2000/01/01",

            "package_expiration_date": "2000/01/01",

            "suspended_from_date": "2000/01/01",

            "package_transfer_out_date": "2000/01/01",

            "package_transfer_in_date": "2000/01/01",

            "branch_transfer_out_date": "2000/01/01",

            "branch_transfer_in_date": "2000/01/01",

            "cancellation_reason": "XXXX",

            "suspended_to_date": "2000/01/01",

            "membership_id": 0,

            "package_category": "XXXX",

            "package_name": "XXXX",

            "package_retention_eligible": "XXXX",

            "package_site": "XXXX",

            "package_term": "XXXX",

            "membership_pass_number": "XXXX",

            "membership_pass_id": 0,

            "membership_status": "XXXX",

            "packagecategory_id": 0,

            "package_id": 0,

            "site_id": 0,

            "alternate_keys": [

                {

                    "alternate_key_value": "XXXX",

                    "alternate_key_type": "XXXX",

                    "alternate_key_status": "XXXX"

                }

            ]

        }

    ]

}

 

For more information on response fields, refer to the each individual API.

For more information about error handling, refer to Error handling.

 

Related topics

Getting Started Guide

Authentication

Common parameters

Error handling

Terms of Use