SYNTAX For any adapter (Java or Javascript): mfpdev adapter call [/[--file|-f ] [--type|-t get|post] [--id|-i] [--secret|-s] [--server [--runtime ]] ] For Javascript adapters only: mfpdev adapter call [/ [""] [--type|-t get|post] [--id|-i] [--secret|-s] [--server [--runtime ]] For Java adapters only: mfpdev adapter call [/ [--form|-fp ] [--header|-h ] [--query|-q ] [--type|-t get|post] [--id|-i] [--secret|-s] [--server [--runtime ]] ] DESCRIPTION Calls the procedure of an adapter that is deployed on a MobileFirst Server. You can use the adapter call command in interactive mode or in direct mode. You can use form, header and query parameters to call a Java adapter's procedure in direct mode only. To do this, add the flag for the parameter type and pass the object of the parameters, if needed. In direct mode, any string parameters must have their quotation marks escaped with a backslash (\), even if the string object is within an Array or Object object. It is not necessary to escape string parameters in interactive mode. To use "PATH parameters" in direct mode, you add them to the adapter/procedure path. See the examples for more information. OPTIONS --file|-f: The JSON file that contains the required arguments. --type|-t: Indicates the request type. Javascript adapters: GET or POST. Java adapters: GET, POST, PUT or DELETE. If the type is not specified, the call uses GET by default. You cannot pass the type in a JSON file. Query parameters for JavaScript adapters. --form|-fp: (Java adapters and direct mode use only) The form parameters to pass to the procedure in the form "key:value". The adapter must be able to accept the specified "key:value" pair. Each "key:value"" pair must include quotation marks, and multiple "key:value" pairs must be separated by a comma. For example: --form "username:user" --header|-h:(Java adapters and direct mode use only) The header parameters to pass to the procedure. The adapter must be able to accept the specified "key:value" pair. Each "key:value"" pair must include quotation marks, and multiple "key:value" pairs must be separated by a comma. For example: --header "password:pass" --query|-q:(Java adapters and direct mode use only) The query parameters to pass to the procedure. The header parameters to pass to the procedure. The "key:value" pair. Each "key:value"" pair must include quotation marks, and multiple "key:value" pairs must be separated by a comma. For example: "--query "date:01/01/2016" --id|-i : Oauth Confidential Client ID. Must be a valid Confidential Client ID that has been configured on the MobileFirst Server with the MobileFirst Operations Console. The default Confidential Client ID is 'test'. --secret|-s : Oauth Confidential Client secret. Must be a valid Confidential Client secret that has been configured on the MobileFirst Server with the MobileFirst Operations Console. The default Confidential Client secret is 'test'. --server : The name of the server profile for the MobileFirst Server that hosts the adapter. The default is the default server profile, as specified with the 'mfpdev server add' or 'mfpdev server edit' commands. For a list of available servers, run 'mfpdev server info'. --runtime: The name of the server runtime that the adapter is running on. EXAMPLES Interactive mode: $ mfpdev adapter call Displays a series of prompts, depending on the adapter. For example, a call to a Java adapter will display prompts for "key:value" pairs for the --form, --header, and --query parameters. Use the up and down arrow keys on your keyboard to move through the selections, and press the Enter key to select. Direct mode: POST method: $ mfpdev adapter call adapterName/procedure/{path_parameter} -fp "username:user1" --type post To use the path parameters, add them to the adapter/procedure path. Replace the {path_parameter} with your value. For example: Before: myAdapter/users/{username} After: myAdapter/users/StanLee Java adapter with multiple "key:value" pairs for the --form parameter: $ mfpdev adapter call "adapterName/procedure/{pathParameter}" --form "first:John,middle:Allen,last:Smith" --header "Date:01/01/2015" --query "index:6" --type post $ mfpdev adapter call adapterName/procedure --form "first:John,middle:Allen,last:Smith" --type post $ mfp adapter call adapterName/procedure \"stringParameter\", 2, true. With a JSON file: $ mfp adapter call adapterName/procedure --file ./myArgs.json JSON file: [ "world" ] JSON file for a Java adapter: { "FORM":{"username":"user","password":"pass"}, "QUERY":{"index":6}, "HEADER":{"Date":"01/01/2015"} }