Sample - GET /api/:space/achievements/sample

Description:

Returns a list of sample achievements

Resource URL:

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

Request header

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

Request URL parameter

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

EXAMPLE

Request
curl
--header "X-API-KEY: <your-api-key>"
--header "Content-Type: application/json"
--request GET https://app.competitionlabs.com/api/tester/achievements/sample
Response
{
    "data": [
        {
            "jsonClass": "Achievement",
            "name": "Daily Login",
            "accountId": "8tznJ24BIQF2eta6-VjU",
            "description": "Daily login sample",
            "initialState": 1,
            "icon": "89znJ24BIQF2eta6-lgG",
            "ruleSets": [
                {
                    "jsonClass": "RuleSet",
                    "priority": 1,
                    "scope": "achievement",
                    "action": "member.achievement",
                    "conditions": [
                        {
                            "jsonClass": "MainConditionSet",
                            "matchCondition": "All",
                            "mustEvaluateTo": true,
                            "rules": [
                                {
                                    "jsonClass": "MainRule",
                                    "fact": "a",
                                    "operator": "==",
                                    "constant": "true",
                                    "subConditions": [
                                        {
                                            "jsonClass": "SubConditionSet",
                                            "matchCondition": "All",
                                            "mustEvaluateTo": true,
                                            "subRules": [
                                                {
                                                    "jsonClass": "SubRule",
                                                    "fact": "b",
                                                    "operator": "==",
                                                    "constant": "false"
                                                }
                                            ]
                                        }
                                    ]
                                }
                            ]
                        }
                    ]
                }
            ],
            "deprecated": false,
            "dependantOn": [],
            "minimumShouldMatch": 0,
            "scheduling": {
                "scheduleType": "Once",
                "scheduleOccurrencesLimit": 1,
                "every": [],
                "startDate": "2019-11-01T16:59:04.583+0000",
                "onlyAggregateOnActiveDays": false
            },
            "achievementLiveStatus": "Draft",
            "category": [
                "new"
            ],
            "memberGroups": [
                "new group"
            ],
            "metadata": [
                {
                    "jsonClass": "Metadata",
                    "key": "k1",
                    "value": "k1v1"
                },
                {
                    "jsonClass": "Metadata",
                    "key": "k1",
                    "value": "k1v2"
                },
                {
                    "jsonClass": "Metadata",
                    "key": "k2",
                    "value": "k2v1"
                }
            ],
            "created": "2019-11-01T16:59:04.583+0000",
            "id": "9NznJ24BIQF2eta6-lgH",
            "translations": {
                "af": [
                    {
                        "jsonClass": "Translation",
                        "fieldName": "label",
                        "text": "My Prestasie"
                    }
                ]
            },
            "translatableFields": [
                "name",
                "description"
            ]
        }
}

ERROR CODES

CodeHTTP StatusDescriptionExample
1007404
  • A record with requested id was not found
  • The X-API-KEY is incorrect
  • incorrect space name
Error Response 404
{
    "errors": [
        {
            "message": "A record with requested id was not found.",
            "code": 1007,
            "status": 404
        }
    ]
}
Error Response 404
{
    "errors": [
        {
            "message": "No key found for value - [123345567888edgddfgdrgd]",
            "code": 1007,
            "status": 404
        }
    ]
}
Error Response 404
{
    "errors": [
        {
            "message": "No account found for space name - [test]",
            "code": 1007,
            "status": 404
        }
    ]
}

401The X-API-KEY is missing
Error Response 401
{
    "status": 401
}