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

Add Service Definition using rest api

pyadav1
1-Newbie

Add Service Definition using rest api

Hi,

I am not able to add inputs while adding a new  service using below rest calls. Can you please check what I am missing in below code :

URI - http://172.16.0.92:80/Thingworx/Things/mcfThing1/Services/AddServiceDefinition


Body -

{

"name":"myService1",

"input": {

"name":"input1",

"type":"STRING"

}

}

Regards,

Pradeep

2 REPLIES 2

Please look onto this document: Create a service dynamically

Hi Carles,

Thanks for your prompt response and this document is very useful. Below json body sending for AddServiceDefinition. Still it doesn't create input parameters. Please suggest

{

                "isAllowOverride": false,

                "isOpen": false,

                "sourceType": "Unknown",

                "parameterDefinitions": {

                    "cmd": {

                        "name": "cmd",

                        "aspects": {

                            "defaultValue": "00"

                        },

                        "description": "",

                        "baseType": "STRING",

                        "ordinal": 1

                    }

                },

                "name": "Test222",

                "aspects": {

                    "isAsync": false

                },

                "isLocalOnly": false,

                "description": "",

                "isPrivate": false,

                "sourceName": "",

                "category": "",

                "resultType": {

                    "name": "result",

                    "aspects": {},

                    "description": "",

                    "baseType": "NOTHING",

                    "ordinal": 0

                }

            }

Announcements