PUT /api/:space/account/rule-action-helper/:id

Description:

Update an Action Helper by Id. 

The Action helper that needs to be updated its Id has to exist in the Request body field.

Any Put body Parameters that are excluded in the Request body field will be considered as empty and updated with an empty field

Resource URL:

https://<apphost>.competitionlabs.com/api/<your-space-name>/account/rule-action-helper/<id>

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

idStringYesAction helper identifier retrieved from GET RuleActionHelper resource

Put body parameters

Parameter
Type
Required
Description
name
String

Yes

The name of the Action Helper, for example; Win, Bet etc.
key
StringYes

A unique key that represents an action helper, for example win, bet

description
StringOptional

The description of the action helper for your reference

system
BooleanOptional

A boolean value (true/false) that represents the Action Helpers state. A system reserved entry (set to true) cannot be deleted.

unitOfMeasureType
StringYesA type of unit of measure, eg. Currency, Mass, Time and etc. 
metadata
Array [Object]Optional

A list of MetaData

IdStringYesUnique system identifier of an Action Helper

EXAMPLE

Request
curl
--header "X-API-KEY: <your-api-key>"
--header "Content-Type: application/json"
--request PUT https://app.competitionlabs.com/api/<your-space-name>/account/rule-action-helper/2_ds83EBQIubPjUx1Bn5
-d '{ "name": "bet", "key": "bet", "description": "bet", "unitOfMeasureType": "Distance", "id": "2_ds83EBQIubPjUx1Bn5", "metadata": [{ "jsonClass": "Metadata", "key": "key", "value": "1" }]}''
Response
{
    "meta": {
        "time": "2020-05-08T08:35:28.260Z"
    },
    "data": {
        "jsonClass": "RuleActionHelper",
        "name": "bet",
        "key": "bet",
        "description": "bet",
        "accountId": "auyNjGYBZ-qHKtWicaaa",
        "system": false,
        "unitOfMeasureType": "Distance",
        "metadata": [],
        "created": "2020-05-08T08:35:28.121+0000",
        "id": "2_ds83EBQIubPjUx1Bn5"
    }
}

ERROR CODES

CodeHTTP StatusDescriptionExample

404Inserting the Id in the Request URL parameter
Error Response 404
{
    "status": 404
}

503Updating without the Id parameter
Error Response 503
{
    "status": 503
}
1001400


  • Name parameter was excluded;
  • Key parameter was excluded;
Error Response 400
{
    "errors": [
        {
            "message": "Malformed JSON body.",
            "code": 1001,
            "status": 400
        }
    ]
}
1007404
A record with requested id for action helper was not found
Error Response 404
{
    "errors": [
        {
            "message": "A record with requested id [l-TwTW0BBZeE7Tj3bRM4] for rules-action-helper was not found.",
            "code": 1007,
            "status": 404
        }
    ]
}
1002404
  • The parameter Name can not be empty;
  • The parameter Key can not be empty;
Error Response 404
{
    "errors": [
        {
            "message": "Please enter a name for the rules action helper.",
            "code": 1002,
            "status": 404
        }
    ]
}
Error Response 404
{
    "errors": [
        {
            "message": "Please enter a key for the rules action helper.",
            "code": 1002,
            "status": 404
        }
    ]
}
</