IODOCS configuration for POST webservices with ajax request

197 views Asked by At

I want to POST below JSON string as part of request body in I/O DOC.

{"Name":"ABCD","Alias":"PS","Date":"20140604","Status":"New","PdfPath":"/folder1/app.pdf"}

What will be the configuration of endpoint? I am using below endpoint configuration, but it is not working.

{
  "endpoints": [
  {
    "name": "Information",
    "methods": [
      {
        "MethodName":"Add Product",
        "Synopsis": "Used to add Product for TEST purpose. This service is called internally, hence this helppage serves as a mockup for the internal call",
        "HTTPMethod":"POST",
        "URI":"/ServiceHost/test.svc/add-testService",
        "RequiresOAuth":"N",
        "parameters":[

          {
            "Name":"Name",
            "Default":"A",
            "Type":"enumerated",
            "EnumeratedList": ["A","B","C"],
            "DefaultValue":"N/A",
            "IsMandatory":"Yes",

            "Description":"This refers to the name."
          },

          {
            "Name":"Alias",

            "Default":"AB",

            "Type":"string",
            "DefaultValue":"N/A",
            "IsMandatory":"Yes",

            "Description":"This refers to the code."
          },

          {
            "Name":"Date",

            "Default":"",

            "Type":"string",
            "DefaultValue":"N/A",
            "IsMandatory":"Yes",

            "Description":"This refers to the date."
          },
          {
            "Name":"Status",
            "Default":"",

            "Type":"string",

            "DefaultValue":"New",
            "IsMandatory":"No",

            "Description":"This refers to the status."
          },

          {
            "Name":"PdfPath",
            "Default":"",

            "Type":"string",
            "DefaultValue":"Empty String",
            "IsMandatory":"No",

            "Description":"This refers to the full pdf path."
          }
        ]

      }
    ]
  }
]
}
1

There are 1 answers

0
ArunkumarB On

You need to use Type as textarea. This would create request body where you can post your inputs. To be more specific you could mention the type of the input that you would POST using content-type parameter.

    "contentType": "application/xml",
    "type": "textarea",

I think this would solve ur problem