Changing data types

Scenario

Different external systems expect request data in different formats and return response data in different formats. The requestDatatype and responseDatatype fields in action.json control how the adapter formats outbound data and interprets inbound data.

These fields are set in action.json within the endpoint configuration at /adapter-home-dir/entities/.system.

Supported request datatypes

DatatypeDescription
JSONData is sent as a JSON object, stringified before being put on the wire.
XMLData is sent as XML. The adapter does not modify the XML — it must already be in the correct XML format when it arrives at the adapter.
PLAINData is sent as a plain text string. The adapter does not modify it.
FORMData is sent as form data. The adapter converts the provided object to form format.
URLENCODEData is URL-encoded and sent in the request body. For example: username=kahsjkdh&password=ahdahjd.
URLQUERYData is URL-encoded and appended to the URI as a query string rather than sent in the body. For example: ?username=kahsjkdh&password=ahdahjd.

Supported response datatypes

DatatypeDescription
JSONThe response is a stringified JSON object. The adapter parses it, runs schema translation, and returns the result.
XMLThe response is XML. The adapter returns it unchanged.
XML2JSONThe response is XML. The adapter converts it to JSON, runs schema translation, and returns the result.
PLAINThe response is a plain text string. The adapter returns it unchanged.
URLENCODEThe response is a URL-encoded string. The adapter decodes it to a JSON object, runs schema translation, and returns the result.