2 Replies Latest reply on Jul 27, 2017 6:47 AM by pyadav RSS
    pyadav Explorer

    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

      • Re: Add Service Definition using rest api
        carlesc Ninja

        Please look onto this document: Create a service dynamically

        • Re: Add Service Definition using rest api
          pyadav Explorer

          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

                          }

                      }