how to write the code on the service for get a Open API data ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
how to write the code on the service for get a Open API data ?
Hello everyone
I want get data from open api.
I wrote the sample code with javascript in visual studio and finished test.
But, I don't know how to migrate in a Thingworx platform.
Please let me know, how to migrate in a thingworx platform and what should I refer for program syntax.
best regrard.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>API 연습</title>
</head>
<body>
<h1>Open Api Test</h1>
<p></p>
<script
src="https://code.jquery.com/jquery-3.6.0.js"
integrity="sha256-H+K7U5CnXl1h5ywQfKtSj8PCmoN9aaq30gDh27Xc0jk="
crossorigin="anonymous"
></script>
<script>
$.ajax({
method : "GET",
url : "https://dapi.kakao.com/v3/search/book?target=title",
data : {query : "미움받을 용기" },
headers : {Authorization: "KakaoAK Myappkey"}
}).done(function (msg) {
console.log(msg);
console.log(msg.documents[0].title);
console.log(msg.documents[0].thumbnail);
$( "p" ).append( "<strong>" +msg.documents[0].title+ "</strong>" );
$( "p" ).append( "<img src=' "+msg.documents[0].thumbnail+ "'/>");
});
</script>
</body>
</html>
Solved! Go to Solution.
- Labels:
-
Solution Central
-
TWX Dev Portal
- Tags:
- javascript
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi,
A similar question was previously - "API documentation for JavaScript": https://community.ptc.com/t5/PTC-Education-Forum/API-documentation-for-JavaScript/td-p/515260
Some useful materials from "Help Center":
- "Best Practices for Coding in JavaScript": https://support.ptc.com/help/thingworx/platform/r9/en/index.html#page/ThingWorx/Help/Best_Practices_for_Developing_Applications/JavaScriptCodingBestPractices.html
- "Referencing Third-Party JavaScript Libraries and Files in Customized Widgets": https://support.ptc.com/help/thingworx/platform/r9/en/index.html#page/ThingWorx/Help/Best_Practices_for_Developing_Applications/visualization_ReferencingThirdPartyJSLibrariesFiles.html
- "Working with JSON Objects": https://support.ptc.com/help/thingworx/platform/r9/en/index.html#page/ThingWorx/Help/Best_Practices_for_Developing_Applications/workingwithjsonobjects.html
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi,
A similar question was previously - "API documentation for JavaScript": https://community.ptc.com/t5/PTC-Education-Forum/API-documentation-for-JavaScript/td-p/515260
Some useful materials from "Help Center":
- "Best Practices for Coding in JavaScript": https://support.ptc.com/help/thingworx/platform/r9/en/index.html#page/ThingWorx/Help/Best_Practices_for_Developing_Applications/JavaScriptCodingBestPractices.html
- "Referencing Third-Party JavaScript Libraries and Files in Customized Widgets": https://support.ptc.com/help/thingworx/platform/r9/en/index.html#page/ThingWorx/Help/Best_Practices_for_Developing_Applications/visualization_ReferencingThirdPartyJSLibrariesFiles.html
- "Working with JSON Objects": https://support.ptc.com/help/thingworx/platform/r9/en/index.html#page/ThingWorx/Help/Best_Practices_for_Developing_Applications/workingwithjsonobjects.html
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Thanks for your help.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
You're welcome.
