This was a interesting topic to discuss as it is related to typescript @Andrey_Gaweiler .
And, I see you are not getting the entire response as JSON, and you are getting the HTML as well. Can you send the header : Accept : application/json and then post the entire response here
I cannot reproduce it. I’ve tried a dozen things, and no luck.
That said, the more I look at your response, the more I think it is your browser or Ionic that is getting in the way. I do all my testing as javascript running in node on my Mac Desktop.
I would suggest the following two experiments:
Create a javascript file that makes the call suitable for running from node. Just hard code everything. See if that works. My suspicion is that it will. That would prove to me that your Cloud Orchestrator Account, the REST API, and your network are all working.
Create a web page (Non Ionic, just a straight up web page) that is empty, except for minimal text to display a result, and a simple Javascript that does your post. Display the results of the post somehow (Heck print it to the console and look at the page in Chrome). If that works, then it proves to me that Ionic is the problem. If that fails, then it is something in your browser.
Those are my best guesses right now.
Otherwise, we could try to do a Zoom session and I can see exactly what you are doing, as you do it. It might give us an idea. Otherwise, I am out of guesses and ideas.
Thank you very much! I used your advice and tested the same code by with access_token as value and not at first as access_token generated from post request. As a result I have got working GET request but not working POST StartJob. After that I went back and got the same access_token using access_token generated from post request.
earlier:
this.AccessTokenStr = 'Bearer ’ + JSON.stringify(JSON.parse(data.data).access_token);
working:
this.AccessTokenStr = 'Bearer ’ + JSON.parse(data.data).access_token;
Now both GET and POST requests work! The key was in sending right access_token. Without it other fields misbehaving like startInfo missing…; 200ok but wrong headers etc. The problem was that the response was not directly saying that access_token was wrong (like with additional “”,). Hope it helps.