Page 1 of 1
[Postman] Unexpected token : yes but where ?!
Posted: Thu Sep 27, 2018 8:39 am
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 :

Re: [Postman] Unexpected token : yes but where ?!
Posted: Thu Sep 27, 2018 11:28 am
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
Re: [Postman] Unexpected token : yes but where ?!
Posted: Thu Sep 27, 2018 12:14 pm
by djuste
Hello,
Thanks for your reply. Unfortunately, it still doesn't work, I have the same answer...
Then I'm reading again this doc.
Re: [Postman] Unexpected token : yes but where ?!
Posted: Thu Sep 27, 2018 12:19 pm
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.
Re: [Postman] Unexpected token : yes but where ?!
Posted: Thu Sep 27, 2018 12:39 pm
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.
Re: [Postman] Unexpected token : yes but where ?!
Posted: Thu Sep 27, 2018 1:29 pm
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.
Re: [Postman] Unexpected token : yes but where ?!
Posted: Thu Sep 27, 2018 2:03 pm
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 !
Is TM1 so difficult for newbies ? I have worked for 15 years on webapps and Java developments...
Re: [Postman] Unexpected token : yes but where ?!
Posted: Thu Sep 27, 2018 2:32 pm
by djuste
Re: [Postman] Unexpected token : yes but where ?!
Posted: Thu Sep 27, 2018 6:44 pm
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.
Re: [Postman] Unexpected token : yes but where ?!
Posted: Fri Sep 28, 2018 12:29 am
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.