The UI on GadgetKeeper allows for three basic operations on methods:
A REST API tool, such as API Explorer provides additional operations for methods, such as get/set method details, etc. See Method Operations with REST API for more information.
Create MethodA new method for a "thing" can be created by clicking "New" in the "Methods" section of the thing. A dialog box opens with the following settings |
|||
Field | Required | Description | Dialog |
---|---|---|---|
Name |
x |
Method name.
|
|
Type | x |
Method type:
|
|
Request Data Type |
Method request data type (input argument to script function) | ||
Response Data Type | Method response data type (return argument from script function) | ||
Private | If set, then method can be only called from methods/function/triggers of the same thing. | ||
Description | Method description. | ||
|
|||
Code Method ScriptAll script methods must have a script function provided for it, as explained in Method Script. The name of the function must be the same as the method's name |
|||
Call MethodMethods can be called to perform any of the possible interactions on GadgetKeeper, plus they can interact with external services, such as Twitter. There are many ways to call or execute a method, as explained in Create and Execute Method. They can be called by UI , REST API, script function, or dashboard widget. The "Call method" dialog box on the UI is explained here. To open the dialog box for "Call Method":
|
|||
Field | Required | Description | Dialog |
Arguments |
If an input (Request) argument is required for the method's script function, it must be entered in the text area with the same "Request Data Type" that was defined in the Create/Edit Method dialog box |
|
|
Result |
If an output (Response) argument is returned from the method's script function, it will show up in the "Result" text area after "Call" is clicked to execute the script function. The returned value will have the same "Response Data Type" that was defined in the Create/Edit Method dialog box |
||
|