GET /api/:space/achievements/:id

Description:

Returns achievement information for the specified achievement identifier

Resource URL:

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

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
id
StringYesAchievement identifier retrieved from GET Achievements resource

EXAMPLE

Request
curl
--header "X-API-KEY: <your-api-key>"
--header "Content-Type: application/json"
--request GET https://app.competitionlabs.com/api/tester/achievements/vj4bYWUBeag0_3vrTqkW
Response
{
    "data": {
        "jsonClass": "Achievement",
        "name": "test",
        "accountId": "QmTaPGUBsZyUBGOR_u9A",
        "description": "test",
        "initialState": 0,
        "icon": "TWTbPGUBsZyUBGORFe_T",
        "ruleSets": [
            {
                "jsonClass": "RuleSet",
                "priority": 1,
                "scope": "achievement",
                "action": "member.achievement",
                "conditions": [
                    {
                        "jsonClass": "MainConditionSet",
                        "matchCondition": "All",
                        "mustEvaluateTo": true,
                        "rules": [
                            {
                                "jsonClass": "MainRule",
                                "fact": "event.count",
                                "operator": ">=",
                                "constant": "0",
                                "id": "2rPvzGUBOmEkXOJniWMX"
                            }
                        ]
                    }
                ]
            }
        ],
        "deprecated": false,
        "dependantOn": [],
        "minimumShouldMatch": 0,
        "scheduling": {
            "scheduleType": "Once",
            "every": [],
			"scheduleOccurrencesLimit": 1,
            "startDate": "2018-08-22T10:06:00.000+00:00",
            "onlyAggregateOnActiveDays": false
        },
        "achievementLiveStatus": "Test",
        "category": [],
        "memberGroups": [],
        "metadata": [],
        "created": "2018-08-22T10:08:24.086+00:00",
        "id": "vj4bYWUBeag0_3vrTqkW",
        "translations": {},
        "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 [NswEVGcB4wBRS3KFW0GFa] for achievements 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
        }
    ]
}

404The Request URL is incorrect
Error Response 404
{
    "status": 404
}

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