cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X

how to write the code on the service for get a Open API data ?

SH_KIM
11-Garnet

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>

 

1 ACCEPTED SOLUTION
3 REPLIES 3

Thanks for your help.

VladimirN
24-Ruby II
(To:SH_KIM)

You're welcome.

Top Tags