TM1 Rest API - tm1.Execute return 278 error

Post Reply
danz
Posts: 6
Joined: Mon Jun 10, 2019 2:47 am
OLAP Product: TM1
Version: PA2
Excel Version: Office365

TM1 Rest API - tm1.Execute return 278 error

Post by danz » Mon Jun 17, 2019 4:09 am

I recently started learning REST and been going through IBM Planning Analytics TM1 REST API pdf file.

I run following request in Postman and receive 278 error.
POST /api/v1/Cubes('Metrics cube-Sales')/Views('Metrics cube-Sales')/tm1.Execute?$expand=Cells

Code: Select all

{
    "error": {
        "code": "278",
        "message": "The content type specified is not supported. Please use JSON (application/json; charset=utf-8) as the content type."
    }
}
While GET /api/v1/Cubes('Metrics cube-Sales')/Views('Metrics cube-Sales') returns result.

Any idea where has gone wrong?

Thanks in advance.

TM1 PA2.0.6

User avatar
Mike Cowie
Site Admin
Posts: 444
Joined: Sun May 11, 2008 7:07 pm
OLAP Product: TM1, MSAS
Version: Anything thru 11.x
Excel Version: 2003 - 2016
Location: Alabama, USA
Contact:

Re: TM1 Rest API - tm1.Execute return 278 error

Post by Mike Cowie » Mon Jun 17, 2019 12:58 pm

Hi danz:

I know many TM1 error messages aren't that helpful, but in this case it is telling you exactly what you need to do. You need to add a Header in Postman for Content-Type and specify the value it's asking for:
content-type-example.jpg
content-type-example.jpg (10.5 KiB) Viewed 490 times
This header is part of the request that makes its way to TM1 and lets it know how the contents of your request body are formatted. Yes, that's also the format it's expecting, but you need to explicitly say that in the header that you're sending.

Hope that helps!
Mike

danz
Posts: 6
Joined: Mon Jun 10, 2019 2:47 am
OLAP Product: TM1
Version: PA2
Excel Version: Office365

Re: TM1 Rest API - tm1.Execute return 278 error

Post by danz » Mon Jun 17, 2019 1:07 pm

Spot on! Thanks very much Mike

Post Reply