Insights Data Activity APIs

The following APIs are available:

Activity Enrollees API

The Activity Enrollees API returns all activity enrollees for your specified parameters.

 

Path:  `/activityenrollees`

Verb:  `GET`

 

The following table describes the query parameters used for the GET method.

Parameter Type Required Description
page int   Index page
default: 1 (the first page)
pageSize int   Number of records per page
default: 100
activityId int   Requested activity ID
activitycategoryId int   Requested activity category ID

The response body of the GET method is formatted in JSON:

Key Type Description
page int Requested page number
pageSize int Number of records per page
pageRowCount string Number of records on the Index page
filteredRowCount string Number of filter results by query parameters
data array List of customer records

The following table describes the data returned by the API:

Key Description
activity_category The activity category of the activity

activity_department

Activity Department
activity_name Activity Name

activity_id

Activity ID
activity_number Activity Number  

activity_type

Activity Type
center Center of the activity

customer_addr1

Aaddress1 of the customer
customer_addr2 Aaddress1 of the customer

customer_cell_phone

Cell phone number of the customer
customer_city City of the customer

customer_email

Email of the customer
customer_first_name First name of the customer

customer_home_phone

Home phone number of the customer
customer_id Customer ID

customer_last_name

Last name of the customer
customer_state State for the customer

customer_zip_code

Zipcode of the customer
end_date End date of the activity

end_time

End time of the activity
customer_gender Customer gender

season

Season of the activity

site

Site of the activity
start_date Start date of the activity

start_time

End time of the activity
sub_category Sub-category of the activity

term

Activity child season (term)

transaction_type

The transaction type of the activity transaction

Responses

This API will retrieve multiple records per API call depending on the specified request parameters.  

One record will contain all information of a matching activity.

Example request

**GET**

https://api.amp.active.com/ANETGateway/rest/anet-insightsapi/activityenrollees?activityId=1234&api_key=xxx

Example response

```json

{

    "page": 1,

    "pageSize": 1,

    "pageRowCount": 1,

    "filteredRowCount": 1000,

    "totalRowCount": 10000,

    "data": [

        {

        "activity_category": "xxx",

        "activity_department": "xxx",

        "activity_name": "xxx",

        "activity_id": "1234",

        "activity_number": "1234",

        "activity_type": "xxx",

        "center": "xxx",

        "customer_addr1": "xxx",

        "customer_addr2": "xxx",

        "customer_cell_phone": "1234567890",

        "customer_city": "xxx",

        "customer_email": "xxx",

        "customer_first_name": "xxx",

        "customer_home_phone": "1234567890",

        "customer_id": 1234,

        "customer_last_name": "xxx",

        "customer_state": "xxx",

        "customer_zip_code": "12345",

        "end_date": "2000-01-01",

        "end_time": "09:00",

        "customer_gender": "M/F",

        "season": "xxxx",

        "site": "xxxx",

        "start_date": "2000-01-01",

        "start_time": "09:00",

        "sub_category": "xxxx",

        "term": "xxxx",

        "transaction_type": "xxxx"

        }

    ]

}

```

 

Activity Enrollments API

The Activity Enrollments API returns customers who enrolled, withdrew, waitlisted, removed from a waitlist or enrolled in a trail class during the specified date and time range.

 

Path:  `/activityEnrollments`

Verb:  `GET`

 

The following table describes the query parameters used for the GET method.

Parameter Type Required Description
page_number int   Index page
default: 1 (the first page)
total_records_per_page int   Number of records per page
default: 100
maximum: 32768
activity_id string   Requested activity IDs. Use commas to separate activity IDs.
transaction_before_date datetime yes

Customers who enrolled, withdrawn, waitlisted, waitlist removed, enrolled trail class on or before this specified date and time are returned (HH:MM is optional).

transaction_after_date datetime yes Customers who enrolled, withdrawn, waitlisted, waitlist removed, enrolled trail class on or after this specified date and time are returned (HH:MM is optional).

The response body of the GET method is formatted in JSON. The headers section is as follows:

Key Type Description
total_records int The total number of unfiltered records
total_records_per_page int The total unfiltered records per page (by default, 100 records are returned per page)
total_pages int Calculated number of pages based on total_records and total_record_per_page

filtered_records

int The total number of filtered records (This applies to any additional filtering beyond date period. If no additional filters are provided or the API does not support additional filtering then total_records will be returned)
filtered_page int The total number of filtered pages (same as above but for pages)
page_records int The total number of records on the current page

page_number

int The current page number
last_sync_date datetime The date and time when the Insights database was last synchronized. for the calling organization. UTC time.

The following table describes the data returned by the API:

Key Type Description
activity_id  int  ID of the activity. 
activity_name  String  Name of the activity. 
enrollment_status  String  The enrollment status of the customer: 'Enrolled', 'Withdrawn', 'Waitlisted', 'Waitlist Removed' or 'Trial'. 
first_name  String  First name of the customer. 
last_name  String  Last name of the customer. 
customer_id  int  ID of the customer. 
customer_date_modified  Datetime  The most recent date and time when the customer's information was modified. 
customer_email  String  Email address of the customer. 
receipt_number  BigDecimal  Receipt number of the last transaction. 
has_active_membership  boolean  Whether the customer has an active membership. 
trial_class_date  Datetime  The meeting date of the trial class enrollment. 
last_transaction_date  Datetime  Date of the customer’s last transaction. 
withdraw_date  Datetime  The date and time when the customer withdrew from the activity. 
total_fee  BigDecimal  The total fee amount for the activity. 
total_paid  BigDecimal  The total amount paid for the activity. 
total_due  BigDecimal  The total due amount for the activity. 
date_registered  Datetime  The date and time the customer enrolled in the activity. 

Responses

This API will retrieve multiple records per API call depending on the specified request parameters.

One record will contain all information of a matching activity enrollment.

Example request

**GET**

https://api.amp.active.com/ANETGateway/rest/anet-insightsapi/activityEnrollments?transaction_after_date=2017-10-01 09:09&transaction_before_date=2017-11-01&api_key=xxx

Example response

{

    "headers": {

        "response_code": "0000",

        "response_message": "Successful",

        "page_info": {

            "total_records": 11,

            "total_records_per_page": 2,

            "total_page": 6,

            "filtered_records": 11,

            "filtered_page": 6,

            "page_records": 2,

            "page_number": 1,

            "last_sync_date": "2019-05-15 02:15:05.6"

        }

    },

    "body": [

        {

            "activity_id": 3500,

            "activity_name": "xxx",

            "enrollment_status": "xxx",

            "first_name": "xxx",

            "last_name": "xxx",

            "customer_id": 4226,

            "customer_date_modified": "2017-02-13 01:28:54",

            "receipt_number": 1001309.005,

            "last_transaction_date": "2017-10-16 07:12:25",

            "total_fee": 150,

            "total_paid": 150,

            "total_due": 0,

            "date_registered": "2017-10-16 07:12:25",

            "quantity": 1,

            "has_active_membership": false,

            "payers": [

                {

                    "payer_first_name": "xxx",

                    "payer_last_name": "xxx",

                    "payer_email": "",

                    "payer_customer_id": 4226

                }

            ]

        },

        {

            "activity_id": 3503,

            "activity_name": "xxx",

            "enrollment_status": "Enrolled",

            "first_name": "xxx",

            "last_name": "xxx",

            "customer_id": 4226,

            "customer_date_modified": "2017-02-13 01:28:54",

            "receipt_number": 1001317.005,

            "last_transaction_date": "2017-10-19 04:34:31",

            "total_fee": 45,

            "total_paid": 45,

            "total_due": 0,

            "date_registered": "2017-10-19 04:34:31",

            "quantity": 1,

            "has_active_membership": false,

            "payers": [

                {

                    "payer_first_name": "xxx",

                    "payer_last_name": "xxx",

                    "payer_email": "",

                    "payer_customer_id": 4226

                }

            ]

        }

    ]

}

 

Related topics

Getting Started Guide

Authentication

Retrieving data from ACTIVE Net Insights

Common parameters

Error handling