[Postman] Unexpected token : yes but where ?!

Post Reply
djuste
Posts: 10
Joined: Mon Sep 17, 2018 2:12 pm
OLAP Product: Don't know...
Version: 11.0.6
Excel Version: 2013

[Postman] Unexpected token : yes but where ?!

Post by djuste »

Hello,

I've been trying using Postman, sending a simple request to a TM1 server.

On Postman, I put :
URL = vvd-tm1ana:12355/api/v1/ExecuteMDX

In headers, I set those params :
Content-Type = application/x-www-form-urlencoded
Authorization = CAMNamespace ZGItdGVzdC03YmE6QGhSd2V0KioqKjIwMTc6QkVSQ1k= [this sequence was built by encoding, it works fine]

In Pre-request Script, I put :
{
"MDX" : "SELECT {[Parametre].[ETAPE_BUDGET_COUR],[Parametre].[CHEMIN_PJ_FE]} ON 1, {[Mesure_Parametrage].[NUM]} ON 0 FROM [Parametrage_Application]"
}

But Postman indicates a syntax error... I don't see where, as this MDX request works fine. I surely forgot something or miswrote it...

Could anyone help me ? Thanks.

Hoping that could help, I join this screen copy :
Image
bgregs
Posts: 77
Joined: Wed Sep 12, 2018 11:19 am
OLAP Product: TM1 / Planning Analytics
Version: 2.0
Excel Version: 2016

Re: [Postman] Unexpected token : yes but where ?!

Post by bgregs »

You're missing part of your "ExecuteMDX" statement. Try something like "ExecuteMDX?$expand=Cells" and then post your MDX.

This link provides a good example using PostMan: https://www.ibm.com/support/knowledgece ... st_api.pdf
djuste
Posts: 10
Joined: Mon Sep 17, 2018 2:12 pm
OLAP Product: Don't know...
Version: 11.0.6
Excel Version: 2013

Re: [Postman] Unexpected token : yes but where ?!

Post by djuste »

bgregs wrote: Thu Sep 27, 2018 11:28 am You're missing part of your "ExecuteMDX" statement. Try something like "ExecuteMDX?$expand=Cells" and then post your MDX.

This link provides a good example using PostMan: https://www.ibm.com/support/knowledgece ... st_api.pdf
Hello,

Thanks for your reply. Unfortunately, it still doesn't work, I have the same answer... :(

Then I'm reading again this doc.
bgregs
Posts: 77
Joined: Wed Sep 12, 2018 11:19 am
OLAP Product: TM1 / Planning Analytics
Version: 2.0
Excel Version: 2016

Re: [Postman] Unexpected token : yes but where ?!

Post by bgregs »

I'm sorry, but without any code and/or any explanations of what you have and haven't tried, all I can do is recommend the IBM documentation.
djuste
Posts: 10
Joined: Mon Sep 17, 2018 2:12 pm
OLAP Product: Don't know...
Version: 11.0.6
Excel Version: 2013

Re: [Postman] Unexpected token : yes but where ?!

Post by djuste »

bgregs wrote: Thu Sep 27, 2018 12:19 pm I'm sorry, but without any code and/or any explanations of what you have and haven't tried, all I can do is recommend the IBM documentation.
No problem bgregs, I know you're doing your best.

What should I have provided to you ? I have not developped any Java code or something else... IBM support advised me using Postman and won't help more...

If you want something, please let me know.
dr.nybble
MVP
Posts: 160
Joined: Wed Aug 17, 2011 3:51 pm
OLAP Product: TM1
Version: 10.2.2
Excel Version: Excel 2007

Re: [Postman] Unexpected token : yes but where ?!

Post by dr.nybble »

I am not very familiar with Postman, but should your JSON payload not be in the body?

Pre-request script should be Javascript code.
djuste
Posts: 10
Joined: Mon Sep 17, 2018 2:12 pm
OLAP Product: Don't know...
Version: 11.0.6
Excel Version: 2013

Re: [Postman] Unexpected token : yes but where ?!

Post by djuste »

dr.nybble wrote: Thu Sep 27, 2018 1:29 pm I am not very familiar with Postman, but should your JSON payload not be in the body?

Pre-request script should be Javascript code.
It seems you are definitely right. It can not work as I use Postman in the correct way. I'm not out of the inn ! :lol:

Is TM1 so difficult for newbies ? I have worked for 15 years on webapps and Java developments...
djuste
Posts: 10
Joined: Mon Sep 17, 2018 2:12 pm
OLAP Product: Don't know...
Version: 11.0.6
Excel Version: 2013

Re: [Postman] Unexpected token : yes but where ?!

Post by djuste »

djuste wrote: Thu Sep 27, 2018 2:03 pm It can not work as I use Postman in the correct way. I'm not out of the inn ! :lol:
It can not work as I DON'T use Postman in the correct way. :D :lol: :mrgreen:
tomok
MVP
Posts: 2831
Joined: Tue Feb 16, 2010 2:39 pm
OLAP Product: TM1, Palo
Version: Beginning of time thru 10.2
Excel Version: 2003-2007-2010-2013
Location: Atlanta, GA
Contact:

Re: [Postman] Unexpected token : yes but where ?!

Post by tomok »

djuste wrote: Thu Sep 27, 2018 2:03 pm Is TM1 so difficult for newbies ? I have worked for 15 years on webapps and Java developments...
To be fair, you are not really using TM1. You are using Postman to access data from TM1 via the REST API. Almost no one, except app developers like yourself, would ever dream of using the REST API. TM1 comes with several different front-ends that users use to interact with the tool. The REST API is for people that want to write their own front ends or integrate with another app.
Tom O'Kelley - Manager Finance Systems
American Tower
http://www.onlinecourtreservations.com/
babytiger
Posts: 78
Joined: Wed Jul 31, 2013 4:32 am
OLAP Product: Cognos TM1, EP, Analyst
Version: 10.2.2
Excel Version: 2013
Location: Sydney AU

Re: [Postman] Unexpected token : yes but where ?!

Post by babytiger »

dr.nybble wrote: Thu Sep 27, 2018 1:29 pm I am not very familiar with Postman, but should your JSON payload not be in the body?
Pre-request script should be Javascript code.
Yes, in this case, the MDX query statement should be part of "Body".
djuste wrote: Thu Sep 27, 2018 2:03 pm Is TM1 so difficult for newbies ? I have worked for 15 years on webapps and Java developments...
I have worked as an accountant in the finance department for over 20 years, but I still find it difficult to my own taxes. It just takes time to get your head around a matter. In this case, it is not TM1, but rather on how to operate a third party software, Postman.
MK
Post Reply