Page 1 of 1

TM1 Rest API - tm1.Execute return 278 error

Posted: Mon Jun 17, 2019 4:09 am
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

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

Posted: Mon Jun 17, 2019 12:58 pm
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 6048 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

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

Posted: Mon Jun 17, 2019 1:07 pm
by danz
Spot on! Thanks very much Mike