Analytics

Members

`Memberships` collection response

Memberships

array

Membership Object

id

string

token

string

state

string

member_email

string

member_token

string

member_username

string

banned_at

string

activated_at

string

last_report_created_at

string

last_report_viewed_at

string

last_report_run_at

string

last_day_engaged

string

last_day_api_engaged

string

last_day_in_app_engaged

string

total_days_engaged

string

last_exploration_created_at

string

last_exploration_updated_at

string

Links

Paginated resources will contain a set of links to the previous page and next page of results.

  • next_page
  • prev_page

Pagination

page

integer

per_page

integer

count

integer

total_pages

integer

total_count

integer

{
    "pagination": {
        "page": 1,
        "per_page": 1000,
        "count": 1000,
        "total_pages": 8,
        "total_count": 7335
    },
    "members": [
        {
            "id": 12,
            "token": "728f6328ea67",
            "member_email": "member_one@company.com",
            "member_token": "3d309a5a98c8",
            "banned_at": null,
            "activated_at": "2010-04-10T14:43:40Z",
            "last_report_created_at": "2016-08-04T12:03:40Z",
            "last_report_edited_at": "2016-10-04T17:10:00Z",
            "last_report_viewed_at": "2016-10-04T17:10:00Z",
            "last_report_run_at": "2016-09-14T10:31:00Z",
            "last_exploration_created_at": null,
            "last_exploration_updated_at": null,
            "total_days_engaged": 4
        },
        {
            "id": 17,
            "token": "123f6328ea67",
            "member_email": "member_two@company.com",
            "member_token": "e84d2748t6af",
            "banned_at": "2020-09-10T00:30:00Z",
            "activated_at": "2010-04-10T14:43:40Z",
            "last_report_created_at": null,
            "last_report_edited_at": "2016-10-04T17:10:00Z",
            "last_report_viewed_at": "2016-10-04T17:10:00Z",
            "last_report_run_at": "2016-09-14T10:31:00Z",
            "last_exploration_created_at": "2020-08-04T11:13:40Z",
            "last_exploration_updated_at": null,
            "total_days_engaged": 1
        },
        ...
    ],
    "_links": {
        "next_page": {
            "href": "/batch/{workspace}/members?page=2&per_page=1000"
        },
        "prev_page": {
            "href": "/batch/{workspace}/members?page=1&per_page=1000"
        }
    }
}

List members for an account

To return a paginated list of all members for a given Workspace, send a GET request. Each page has 1000 members.

URL Params

workspace

required
string Workspace username
Query Params

per_page

integer The number of objects to return per_page. Example: per_page=100. Note: per_page must be greater than 0 and less than 1000.
Responses

200

Memberships collection response

401

Unauthorized

404

Workspace not found

GET /batch/{workspace}/members

curl --location --request GET 'https://app.mode.com/batch/{workspace}/members' \
     --header "Content-Type: application/json" \
     --header "Accept: application/json" \
     --header "Authorization: {bearer_token}"
require 'http'

decoded_token = "#{token}:#{access_key}:#{access_secret}"
encoded_token = Base64.strict_encode64(decoded_token)
bearer_token  = "Bearer #{encoded_token}"

headers = {
  content_type: 'application/json',
  accept: 'application/json',
  authorization: bearer_token
}

response = HTTP.headers(headers)
               .get('https://app.mode.com/batch/{workspace}/members')
puts response
from urllib2 import Request, urlopen
from base64 import b64encode

decoded_token = token + ':' + access_key + ':' + access_secret
encoded_token = b64encode(decoded_token.encode('utf-8'))
bearer_token  = 'Bearer ' + encoded_token.decode('utf-8')

request = Request("https://app.mode.com/batch/{workspace}/members")

request.add_header("Authorization", bearer_token)
request.add_header("Accept", "application/json")
request.add_header("Content-Type", "application/json")

response = urlopen(request)
response_body = response.read()

print(response_body)
var request = new XMLHttpRequest();

var decoded_token = token + ':' + access_key + ':' + access_secret;
var encoded_token = btoa(decoded_token);
var bearer_token  = 'Bearer ' + encoded_token;

request.open('GET', 'https://app.mode.com/batch/{workspace}/members');
request.withCredentials = true;

request.setRequestHeader('Authorization', bearer_token);
request.setRequestHeader('Content-Type', 'application/json');
request.setRequestHeader('Accept', 'application/json');

request.onreadystatechange = function () {
  if (this.readyState === 4) {
    console.log('Status:', this.status);
    console.log('Headers:', this.getAllResponseHeaders());
    console.log('Body:', this.responseText);
  }
};

request.send();