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 »

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: 482
Joined: Sun May 11, 2008 7:07 pm
OLAP Product: IBM TM1/PA, SSAS, and more
Version: Anything thru 11.x
Excel Version: 2003 - Office 365
Location: Alabama, USA
Contact:

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

Post by Mike Cowie »

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 4795 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
Mike Cowie
QueBIT Consulting, LLC

Are you lost without Print Reports in Planning Analytics for Excel (PAfE)? Get it back today, for free, with Print Reports for IBM Planning Analytics for Excel!
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 »

Spot on! Thanks very much Mike
Post Reply