Planning Analytics

 View Only
Expand all | Collapse all

Using the ExecuteMDX command with the REST API in Cloud - error code 278 "Unsupported token..."

  • 1.  Using the ExecuteMDX command with the REST API in Cloud - error code 278 "Unsupported token..."

    Posted Thu November 28, 2019 02:01 AM
    I've been working/experimenting with the TM1 REST API lately and I've hit a bit of a snag when it comes to using the ExecuteMDX command.

    I've been using the Talend extension in Chrome to test out my REST queries with no issues, but in this case I get an error even though the code that I'm using appears to be coming straight from the TM1 REST API manual.

    The code that I'm running is as follows:
    https://a_Server.planning-analytics.ibmcloud.com/tm1/api/a_PA_Instance/api/v1/ExecuteMDX?$expand=Axes($expand=Hierarchies/$ref,Tuples($expand=Members/$ref)),Cells{"MDX": "select [}CubeAttributes].members on 0, [}Cubes].members on 1 from [}CubeAttributes]"}​
    Note that for the purpose of posting I've replaced the server name with "a_Server" and the PA instance with "a_PA_Instance"

    The code came from the tm1_rest_api.pdf

    Unfortunately I get the following error


    As I said, I've tried a few, really basic MDX queries, but I keep getting this error.  

    Has anything changed with the TM1 REST API that would impact this command?  In the past I didn't have this issue, although it was for an on-premise system.

    Thanks,

    ------------------------------
    Wayne
    ------------------------------

    #PlanningAnalyticswithWatson


  • 2.  RE: Using the ExecuteMDX command with the REST API in Cloud - error code 278 "Unsupported token..."

    Posted Fri November 29, 2019 12:34 AM
    Edited by System Test Fri January 20, 2023 04:42 PM
    Looks like you're trying to put the entire query into the url. REST queries have 4 key parts.

    1) Action: Post, Gets, Patch...
    2) headers: handles options and authentication
    2) URI: the endpoint and query your action is for
    3) the payload or body: this is where your mdx query goes. It's also where the response will be delivered.





    Ryan Clapp
    AWS Business Systems
    Sr. Manager

    Sent from my mobile device





  • 3.  RE: Using the ExecuteMDX command with the REST API in Cloud - error code 278 "Unsupported token..."

    Posted Mon December 02, 2019 10:51 AM
    You're right Ryan.  Once I put the MDX in the Body, it returned an expected result.  I think where I was going wrong was that I was referring to JavaScript code that I had previously written (using TM1 10.2.2)  which would combine everything.

    Now I have to test this out using the TM1 PAX API with REST.

    Thanks,
    Wayne

    ------------------------------
    Wayne
    ------------------------------