GET /api/:space/account/reward-types

Description:

Returns a list of unit of measure types.

Resource URL:

https://<apphost>.competitionlabs.com/api/<your-space-name>/account/reward-types

Request headers

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

Request URL parameters

Parameter
Type
Required
Description
space
StringYes

This is the space name which is linked to the account

EXAMPLE

Request
curl
--header "X-API-KEY: <your-api-key>"
--request GET https://app.competitionlabs.com/api/test_space/account/reward-types
Response
{
    "meta": {
        "totalRecordsFound": 5,
        "skip": 0,
        "limit": 20
    },
    "data": [
        {
            "jsonClass": "RewardType",
            "name": "test metadata",
            "key": "test-metadata",
            "description": "",
            "accountId": "0sn4DmUBkPH_lz9GgxBM",
            "system": false,
            "unitOfMeasureType": "Other",
            "metadata": [
                {
                    "jsonClass": "Metadata",
                    "key": "Question",
                    "value": ""
                }
            ],
            "created": "2019-11-18T10:52:28.375+0000",
            "id": "tackfm4BHOph6SG8cyRX"
        },
        {
            "jsonClass": "RewardType",
            "name": "Badge",
            "key": "badge",
            "description": "",
            "accountId": "0sn4DmUBkPH_lz9GgxBM",
            "system": true,
            "metadata": [],
            "created": "2018-08-06T11:21:34.411+0000",
            "id": "1cn4DmUBkPH_lz9GixDL"
        },
        {
            "jsonClass": "RewardType",
            "name": "Points",
            "key": "points",
            "description": "",
            "accountId": "0sn4DmUBkPH_lz9GgxBM",
            "system": true,
            "metadata": [],
            "created": "2018-08-06T11:21:34.426+0000",
            "id": "1sn4DmUBkPH_lz9GixDa"
        },
        {
            "jsonClass": "RewardType",
            "name": "Money",
            "key": "money",
            "description": "money in €",
            "accountId": "0sn4DmUBkPH_lz9GgxBM",
            "system": false,
            "unitOfMeasureType": "Currency",
            "metadata": [],
            "created": "2018-08-07T11:23:15.993+0000",
            "id": "vTMgFGUBcRECKmD5dCuZ"
        },
        {
            "jsonClass": "RewardType",
            "name": "Free Spin Reward",
            "key": "free-spin-reward",
            "description": "Free Spin Reward",
            "accountId": "0sn4DmUBkPH_lz9GgxBM",
            "system": false,
            "unitOfMeasureType": "Other",
            "metadata": [],
            "created": "2018-11-01T12:56:02.990+0000",
            "id": "bddYz2YBzBBc36LhTkeu"
        }
    ]
}

ERROR CODES

CodeHTTP StatusDescriptionExample
1007404
  • The X-API-KEY is incorrect
  • Incorrect space name
  • Replacing the word "types" will be considered as a Unit Of Measure 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 [type] for unit-of-measures was not found.",
            "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
}