Integrations: Passing parameters in the body of a HTTP POST request

I am attempting to set up an Integration in Appian (v18.2) to retrieve data using an HTTP POST request.  The parameters are being sent as Text in the body of the request which is set as Multipart Form Data.  The request completes without error, but the no data is returned.  This is the same result obtained when the request is sent without any parameters.  It seems as the passed parameters are not being recognized.

When the request is set up the same way in Postman, the expected data is returned.

Any ideas as to why this is not working / how to get this working in Appian?

 

Regards

  Discussion posts and replies are publicly visible

  • When looking at the HTTP requests generated by Postman and the Appian integration, the differences are as follows:

    1) The multipart/form-data boundaries are different:

    Postman: ----WebKitFormBoundary7MA4YWxkTrZu0gW
    Appian: TnQmfygKfP801A_kE1bGL-7YAFk_k6gl9


    2) Appian adds the following to the header:

    Content-Length: 1278
    Connection: Keep-Alive
    User-Agent: Appian
    Accept-Encoding: gzip,deflate


    3) Appian adds the following for each parameter passed in the body of the request:

    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
  • 0
    Certified Senior Developer
    It's difficult to know what the issue is without knowing what the source system looks like/expects.

    I assume your body is formatted something like the following:

    a!toJson(
    {
    "createTransactionRequest": {
    "merchantAuthentication": {
    "name": cons!AUTHORIZE_DOT_NET_API_LOGIN_ID,
    "transactionKey": cons!AUTHORIZE_DOT_NET_TRANSACTION_KEY
    },
    "transactionRequest": {
    "transactionType": "authCaptureTransaction",
    "amount": "100.00",
    "payment": {
    "creditCard": {
    "cardNumber": "5424000000000015",
    "expirationDate": "1220",
    "cardCode": "999"
    }
    }
    }
    }
    }
    )

    Referenced from the Integration Tutorial: docs.appian.com/.../Integration_Tutorial.html

    The above tutorial shows Appian working with a POST request passing parameters within the body (tested working for both querying and modifying data). However, it seems as though there is some configuration issue/mismatch from the API as Appian cannot retrieve the data in a similar manner as seen in the above example.

    I will outline some things to double check along with alternatives, hopefully they are helpful.

    When using a POST request to retrieve data with an Integration be sure to pay attention to the Usage value. The Usage value should be set to the "Queries data" option. When selecting POST for the Method value Appian automatically sets the Usage value to "Modifies data."

    The only other option I see is implementing a GET version of the request both in Appian and for the API.
  • Thanks for taking the time to respond.

    The Usage value is set to 'Queries Data'.

    The Content Type of the body is set to Multipart Form Data.

    This particular Web API does not work when the parameters are passed as 'Parameters' (in Appian or Postman), only when they are passed in the request body (which works with Postman). The API is only provided as a POST method. I will try to get more details about the 'expectations' of the API from the service provider.