The “TypeScript REST SDK” is the best way to incorporate KIBO’s APIs into our Application.To get started, we’ll create a new directory to hold the Application. We’ll direct the Terminal into the new directory and run “NPM” in it. The “TypeScript REST SDK” is the best way to incorporate KIBO’s APIs into our Application. To get started, we’ll create a new directory to hold the Application. We’ll direct the Terminal into the new directory and run “NPM” in it. Next, we’ll install “TypeScript”, “TS Node”, and the “REST SDK”. “TS Node” is a convenience that allows us to quickly run our “TypeScript” code. Next, we’ll install “TypeScript”, “TS Node”, and the “REST SDK”. “TS Node” is a convenience that allows us to quickly run our “TypeScript” code. Finally, we’ll create an index file to house our code. Finally, we’ll create an index file to house our code. We’ll open the new directory in a code editor. Following the code in the “readme” file, import the “Configuration” module. For this demonstration, we’ll be using the “Products API”.This API allows users to retrieve information about the Products in a Tenant. Next, we’ll import the “Products API” module. We’ll open the new directory in a code editor. Following the code in the “readme” file, import the “Configuration” module. For this demonstration, we’ll be using the “Products API”. This API allows users to retrieve information about the Products in a Tenant. Next, we’ll import the “Products API” module. All API clients can be accessed through the clients folder and will follow a similar structure to the “Postman” collection, also using the same credentials from our “Postman” instance.We discussed setting up and using “Postman” in a separate video. All API clients can be accessed through the clients folder and will follow a similar structure to the “Postman” collection, also using the same credentials from our “Postman” instance. We discussed setting up and using “Postman” in a separate video. Next, we’ll create a “new Configuration”. This Configuration will hold the necessary credentials to access the KIBO APIs. The “masterCatalog” and “catalog” fields are required. All other fields can be copied from the “Postman” environment or saved from the copied code from the “readme” file. It’s also possible to create a configuration from a ”.ENV” file, which is documented in the “readme”. For this demonstration, we’ll limit the amount of installed node packages. Next, we’ll create a new configuration. This configuration will hold the necessary credentials to access the kibo apis. The master catalog and catalog fields are required. Although Fields can be copied from the postman environment or save from the copied code from the readme file. It’s also possible to create a configuration from a DOT EnV file, which is documented in the readme. For this demonstration will limit the amount of installed node packages. With the created “configuration” and imported “Products API” module, we’ll create a new “productsClient” and pass in the “configuration”. With the “Client” created, we can utilize its methods to “getProduct” data. This “Client” provides the tools necessary to interact with the “Products API”. With the created configuration and imported products API module, will create a new products, client, and pass in the configuration. With the client created, we can utilize its methods to get product data. This client provides the tools necessary to interact with the products API. Using the “getProduct” method, pass any Product Code as a parameter and log the result. To run the code and view the Product Data, from the Terminal, run “TS Node” and the “index.ts” file. This will execute the code and display the Product Data in the console. Using the “getProduct” method, pass any Product Code as a parameter and log the result. To run the code and view the Product Data, from the Terminal, run “TS Node” and the “index.ts” file. This will execute the code and display the Product Data in the console. In the Terminal response, we can see that this Product is missing a “Full Description”. In the Terminal response, we can see that this Product is missing a “Full Description”. Let’s go ahead and update the Product. To execute a “POST” or “PUT” method, the body is passed in as an additional parameter. The TypeScript definitions will allow you to easily see the parameters, definitions, and all required fields.With the returned result from the “GET” of the Product, we’ll update the “Full Description” value. Let’s go ahead and update the Product. To execute a “POST” or “PUT” method, the body is passed in as an additional parameter. The TypeScript definitions will allow you to easily see the parameters, definitions, and all required fields. With the returned result from the “GET” of the Product, we’ll update the “Full Description” value. Next, use the same “productsClient” and its updated “product” method, passing in the “productCode” and the updated “product” body as the parameters. Next, use the same “productsClient” and its updated “product” method, passing in the “productCode” and the updated “product” body as the parameters. Execute the request and view the results of the updated Product. This demonstrates how to use the “TypeScript REST SDK” to interact with KIBO APIs. Execute the request and view the results of the updated Product. This demonstrates how to use the “TypeScript REST SDK” to interact with KIBO APIs.

