Description:

Returns a list of Members.

This assumes that members have first been uploaded via a POST request or web console otherwise no data will be returned and the value of the "totalRecordsFound" variable in metadata will be 0.

GET responses can be filtered out based on the Members parameters to narrow down the results. CompetitionLabs provides a fully queryable API.

Resource URL:

https://<apphost>.competitionlabs.com/api/<your-space-name>/members

Request headers

KeyValueRequired
X-API-KEY
Your unique API keyYes
Content-Type
application/jsonYes

Request URL parameters

Parameter
Type
Required
Description
space
StringYesThis is the space name which is linked to the account

Additional Query String Parameters:

You can use the query parameters along with the generic parameters.

Query parameters

Parameter
Type
Constraint
Usage
agregate
StringGet a list of unique member groups 
?_aggregateBy=groups
memberType
Enum

Determines a team or individual member type (you can find the Enum list in the Members overview model).

Case insensitive. 

?memberType=search_word 
name
String

The display name that is used on leader boards and public displays. Case insensitive. 

For lookup you would use "name.raw=search_word" because the field "name" is indexed to support more complex searches

?name.raw=search_word
memberRefId
StringThe reference to this member in your system. Case sensitive
?memberRefId=search_word
picture
String

Image to display with this member. Case sensitive.

Recommend storing external or internal CompetitionLabs member image

?memberRefId=search_word
groups
Array [String]A list of Strings of groups that the member belongs to. Case sensitive
?groups=search_word
metadata
Array [Object]Complex search applies, allows full search on a complex object of Metadata
?metadata.key=search_word
?metadata.value=search_number
created
DateTime

ISO8601 timestamp for when a Member was created. All records are stored in UTC time zone.

Works with simple dates or date and time, eg: created=2016-02-07, created=2018-08-23T14:23:09

?created=search_DateTime
id
StringUnique system identifier of a Member. Case sensitive
?id=search_string

EXAMPLE

Request
curl
--header "X-API-KEY: <your-api-key>"
--request GET https://app.competitionlabs.com/api/<your-space-name>/members
Response
{
    "meta": {
        "totalRecordsFound": 100000,
        "skip": 0,
        "limit": 20
    },
    "data": [
        {
            "jsonClass": "Member",
            "accountId": "AVQZ2zwdabc6FovVuxMQ",
            "memberType": "Individual",
            "name": "Member-Display-Name-5",
            "memberRefId": "my-custom-member-ref-5",
            "created": "2016-07-11T10:24:43.022+00:00",
            "id": "AVXZfM4OHz_hNiERp3x7"
        },
        {
            "jsonClass": "Member",
            "accountId": "AVQZ2zwdabc6FovVuxMQ",
            "memberType": "Individual",
            "name": "Member-Display-Name-3",
            "memberRefId": "my-custom-member-ref-3",
            "groups": [
                "my-customer-segment-VIP"
            ],
            "created": "2016-07-11T10:24:43.022+00:00",
            "id": "AVXZfM4OHz_hNiERp3x5"
        },
        {
            "jsonClass": "Member",
            "accountId": "AVQZ2zwdabc6FovVuxMQ",
            "memberType": "Individual",
            "name": "Member-Display-Name-7",
            "memberRefId": "my-custom-member-ref-7",
            "created": "2016-07-11T10:24:43.023+00:00",
            "id": "AVXZfM4PHz_hNiERp3x9"
        },
        ...
        ...
        ...
    ]
}
Request with Query string parameters
curl
--header "X-API-KEY: <your-api-key>"
--request GET https://app.competitionlabs.com/api/<your-space-name>/members?_limit=2&groups=my-customer-segment-VIP
Response for query string request
{
    "meta": {
        "totalRecordsFound": 4,
        "skip": 0,
        "limit": 2
    },
    "data": [
        {
            "jsonClass": "Member",
            "accountId": "AVQZ2zwdabc6FovVuxMQ",
            "memberType": "Individual",
            "name": "Member-Display-Name-3",
            "memberRefId": "my-custom-member-ref-3",
            "groups": [
                "my-customer-segment-VIP"
            ],
            "created": "2016-07-11T10:24:43.022+00:00",
            "id": "AVXZfM4OHz_hNiERp3x5"
        },
        {
            "jsonClass": "Member",
            "accountId": "AVQZ2zwdabc6FovVuxMQ",
            "memberType": "Individual",
            "name": "Member-Display-Name-1",
            "memberRefId": "my-custom-member-ref-1",
            "groups": [
                "my-customer-segment-VIP"
            ],
            "created": "2016-07-11T10:24:43.022+00:00",
            "id": "AVXZfM4OHz_hNiERp3x3"
        }
    ]
}


ERROR CODES

CodeHTTP StatusDescriptionExample

404Modifying the Resource URL parameters that are mandatory
Error Response 404
{
    "status": 404
}