How to change the response content type in ION API Swagger Documentation

Hi All,

Good Day :).

I working on Sales force Integration, while going through the Sales force Rest API documentation i have seen there is option of supported formats JSON or XML.

I have configured Sales force  suite in ION Gateway and while testing the Swagger documentation i saw response content type only application/json.

Can any one suggest me, how i could change it to application/xml format ?





  • Hello All,

    Any inputs on the above query.
  • In reply to 1753258:

    If you want your API to provide XML as response, first of all the API should be capable of that. Usually the target supports multiple type of response types and they are expressed in the documentation. And the client can indicate its preference on their request. The target will try to respect that, if its able to support it. This is how it generally works on the REST world.

    So the simple answer to your question: This is controlled by the API provider and it must be specified via the swagger documentation.

    If the target is not able to deliver in the format you expect, then you can consider using a transformation policy on the response (or Request) layer tin the ION API gateway o convert XML to JSON or vice versa. If you are calling the API from a ION doc flow, then the ION API connection point also has options to convert XML to JSON automatically..

  • In reply to Vignesh:

    Thank you for your suggestions Vignesh.

    Can i please let me know the few points.

    1). If the target has provided the updated swagger documentation what are all further steps ? i mean how do we update that in ION Gateway.
    2). where we could see/apply the Transformation Policy in ION Gateway.

  • In reply to 1753258:

    HI Satish,

    As Vignesh mentioned earlier, even though the output of the target API is JSON, ION can convert it into XML automatically when we select BOD From JSON  option in the connection point as shown below.



    Ravikiran S

  • In reply to RaviKiran:

    HI RaviKiran, thanks for reply.

    This has been resolved already.

  • I would use JSON but as the others have suggested ION can automatically convert to JSON.