Claim Member Award by Reference ID POST api/v1/:space/members/reference/:memberRefId/award/:awardId/award

Description:

Claims an Award for a given Member Reference ID. This is only applicable when an award needs to be claimed.

Request Headers

KeyValueRequired
X-API-KEY
Your unique API key

Yes

Request URL Parameters

ParameterTypeRequiredDescription
space
StringYesThis is the space name linked to the account
memberRefId
StringYesMember reference ID. You can only retrieve members with member ref Id's from APP API GET Members
awardId
StringYes
Award reference ID. You can retrieve an award ref id using GET Messages public API endpoint and querying the prize.

EXAMPLE GET /api/v1/:space/members/:memberId/messages?prize.memberId=:memberId

The response prize id is the awardId that is needed for the Request URL

POST Body Parameters

empty post body - no body required

EXAMPLE

Request
curl   
--header "X-API-KEY: <your-api-key>"
--header "Content-Type: application/json"
--request POST https://gateway.competitionlabs.com/api/v1/test_space/members/reference/tester/award/1AE8_GwB9hDCDt3Z7Arn/award
-d '{}'
Response
{
    "data": {
        "accountId": "AV8mpBQQybvwgeEgJ4j1",
        "memberId": "LUM76mQB2PHH2q3dU8_n",
        "reward": {
            "jsonClass": "Reward",
            "entityId": "g2WL8GQBc6w1fNEAgeCA",
            "rewardRank": "3",
            "rewardName": "3",
            "value": 700,
            "rewardType": "aBqEYWIB74iUEvQwVWPb",
            "description": "",
            "delay": 0,
            "memberAcknowledgmentRequired": true,
            "metadata": [],
            "accountId": "AV8mpBQQybvwgeEgJ4j1",
            "pointInTime": "2018-07-31T13:33:51.880+00:00",
            "created": "2018-07-31T13:33:51.895+00:00",
            "id": "hmWL8GQBc6w1fNEAgeCX",
            "translations": {}
        },
        "claimed": true,
        "entityId": "g2WL8GQBq6w1fNEAgeCB",
        "pointInTime": "2018-07-31T13:33:51.880+00:00",
        "created": "2018-08-01T22:15:46.142+00:00",
        "id": "KXeP92QB3jZTQhfcrhre"
    }
}

ERROR CODES

CodeHTTP StatusDescriptionExample
1007404
  • The X-API-KEY is incorrect
  • Incorrect space name
  • Incorrect award Id
  • Incorrect member ref Id
Error Response 404
{
    "errors": [
        {
            "message": "No key found for value - [a0b1234567890350155588cb7ca]",
            "code": 1007,
            "status": 404
        }
    ]
}
Error Response 404
{
    "errors": [
        {
            "message": "No account found for space name - [test]",
            "code": 1007,
            "status": 404
        }
    ]
}
Error Response 404
{
    "errors": [
        {
            "message": "A record with requested id was not found.",
            "code": 1007,
            "status": 404
        }
    ]
}
1019404Member ref Id does not exist
Error Response 404
{
    "errors": [
        {
            "message": "Member with ID rhTTOW0BXLSj87dDV7zoa not found",
            "code": 1019,
            "status": 404
        }
    ]
}
7002400Award already claimed
Error Response 409
{
    "errors": [
        {
            "message": "Award already claimed.",
            "code": 7002,
            "status": 409
        }
    ]
}
7003403
Award has expired
Error Response 403
{
    "errors": [
        {
            "message": "Award has expired.",
            "code": 7003,
            "status": 403
        }
    ]
}

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

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