Executing APIs

The Thing-IF SDK for JavaScript supports two classes, ThingIFAPI and APIAuthor, to execute the Thing Interaction Framework APIs.

Usually, use the ThingIFAPI class to execute APIs. The sample code in this guide also uses the ThingIFAPI class. Use the APIAuthor class if you want to execute the Thing Interaction Framework APIs with the app administrator's privilege.

ThingIFAPI

The ThingIFAPI class is designed to use the features of Thing Interaction Framework in the same way as Android and iOS.

An instance of ThingIFAPI stores a target thing of APIs. You can operate the target thing by calling methods of the instance from the mobile app.

APIAuthor

The APIAuthor class is unique to the Thing-IF SDK for JavaScript. For using this class, see the JSDoc.

You need to specify a target thing every time you execute a method because the APIAuthor class does not store a target thing. You need to use the APIAuthor class when the user who executes an API is not the owner of the target thing. Especially, this applies to maintenance operation by the administrator, for example.