REST API Rule Attach

Post Reply
dan.kelleher
Community Contributor
Posts: 128
Joined: Wed Oct 14, 2009 7:46 am
OLAP Product: TM1
Version: 9.4
Excel Version: 11
Location: London

REST API Rule Attach

Post by dan.kelleher »

Hi All,

I've worked out how to validate the existing or new rule for a cube, but can't find where in the documentation it shows how to attach. Does anyone know the function?

request:

Code: Select all

api/v1/Cubes('xxx')/tm1.CheckRules
body (blank to check existing rule):

Code: Select all

{"Rules": "this is an error"}
response:

Code: Select all

{
    "@odata.context": "../$metadata#Collection(ibm.tm1.api.v1.RuleSyntaxError)",
    "value": [
        {
            "LineNumber": 1,
            "Message": "Syntax error on or before: \"\nthis is an error\n missing left square bracket \" "
        }
    ]
}
Thanks,

Dan
dan.kelleher
Community Contributor
Posts: 128
Joined: Wed Oct 14, 2009 7:46 am
OLAP Product: TM1
Version: 9.4
Excel Version: 11
Location: London

Re: REST API Rule Attach

Post by dan.kelleher »

Managed to figure it out:

PATCH request:

Code: Select all

api/v1/Cubes('xxx')
Body:

Code: Select all

{"Rules": "this is an error"}
Response:

Code: Select all

{
    "@odata.context": "$metadata#Cubes/$entity",
    "@odata.etag": "W/\"e8d228a6c97159561df48d9ecf2a4c71a1a657b6\"",
    "Name": "xxx",
    "Rules": "this is an error",
    "DrillthroughRules": null,
    "LastSchemaUpdate": "2021-05-15T22:41:39.227Z",
    "LastDataUpdate": "2021-05-17T17:31:54.785Z",
    "Attributes": {
        "Caption": "xxx"
    }
}
Post Reply