Connecting external API into Thingworx
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Connecting external API into Thingworx
Hello,
I am trying to connect external API into Thingworx. But i am unable to receive responses. I attached my code here. and i upload my result also. Please help me to do that.
Code:
var params = {
proxyScheme: undefined /* STRING */,
headers: { 'grant_type':'*****','client_id':'******','client_secret':'******','resource':'*******'},
ignoreSSLErrors: true,
useNTLM: undefined /* BOOLEAN */,
workstation: undefined /* STRING */,
useProxy: undefined /* BOOLEAN */,
withCookies: undefined /* BOOLEAN */,
proxyHost: undefined /* STRING */,
url: "https://******", /* STRING */
timeout: 6000,
proxyPort: undefined /* INTEGER */,
password: undefined /* STRING */,
domain: undefined /* STRING */,
username: undefined /* STRING */
};
// result: JSON
var result = Resources["ContentLoaderFunctions"].GetJSON(params);
- Labels:
-
Coding
-
Connectivity
-
Design
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Did you test the API call before with a more "raw" tool like Postman or Curl?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hello,
It's working perfectly in postman... But I am unable to get response from thingworx... Please help me to do that...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hello,
How to pass our body into params region because when i am executing the services it is taking url alone or it is printing header section alone. I need to get access token as a output. I passed my url and i declared input values like grant_type,client_id inside the content. if i run these things i am unable to access token. My url is working fine in postman. please help me to resolve this issues.
Thank you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Headers it's not body it's HTTP Call Headers.
If you need to add body, you should use other HTTP Methods (Post or Put) they have the content parameter.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hii,
Whenever i am executing my services, i am getting an output like connection reset. I attached my screenshots below. My url and credentials are perfectly working in postman. Please help me to do that.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Can you share a postman screenshot with the service call configuration.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi,
can you get the output for the above issue.I am also working on similar to your code.I am also getting the same issue
Thanks,
karthik