Request Payload

Prev Next

Payload is simply the body that is sent out on the request to the other system.

  • If the payload is JSON, it will be translated based on the schema for the particular action.
  • The reason it is translated is when IAP refers to a field as X and the other system refers to it as Y, the adapter needs to put the value in X into Y before calling the other system so that the other system will understand the request.
  • The payload can also be plain text or xml in which case nothing will be done with it.
  • Other actions can be done based on the requestDatatype defined in the action.json file. These include encoding, encrypting, URL handling as a form, and translating from JSON to XML.

Example: A request payload

const reqObj = {
  payload: { garbage: 'need since post' },
  uriPathVars: [groupId, deviceId],
  uriQuery: { name: 'anyname' },
  uriOptions: { page: 2 },
  addlHeaders: { audit: 'turnOn' },
  authData: { domain: 'abc' },
  callProperties: {
    stub: true,
    request: {
      attempt_timeout = 60000
    }
  },
  filter: '[*name=doggie]',
  priority: 1,
  event: 'giveMeMyData'
};