Appian Web API call from external system throws 500 error

Hello All, 

We are trying to call appian web-api from  node.js application. When we tried to call the same webapi from postman it is working fine, however when i try to call it from node.js it is failing with 500 error(error: Sorry, your request cannot be processed) . This error is not user specified. We tried searching through server.log, web-api-details.csv , we couldnt find anything. 

1) Did anyone has faced this issue?

2) Do anyone know if we can see the payload which we receive into appian ?

3) what are all the scenarios for which appian will throw 500 error ?

  Discussion posts and replies are publicly visible

  • There might be some error in the webapi code like null pointer exception.
  • Hi , Could this be Cross - origin issue ?? refer here. 

    1.Try to add the host name to apian Administration Console.

    2. Kindly check if the user account used for authentication is still active.

    3. Check if  the authentication is done correctly I.e. Using Http Basic authentication

    4. Also do check logs/design_errors.csv for any expression evaluation errors .

  • 0
    Certified Lead Developer
    Hi,
    Generally, there are two reasons in Appian to throw a 500 error for Web API's:
    1. If there is any error in your web API expression.
    2. if the result of your Web API expression is not an HTTP Response Object.
    But since it is working fine with postman. So the two options does not apply to your case.
    The only probable cause could be that node.js might require a Standard Form Based Login instead of a HTTP basic authentication. So you might need to set up a SSO(Single Sign On) between Appian and your node.js server.
    Another cause could be 'Cross Origin Requests'. You might need to configure the Allowed Origins in Admin Console for your node.js server to make a cross origin request to Appian.
  • Hi!!

    Please can you tell me how are you calling an appian web api from postman? I want to call a web api from swagger, I create a API in swagger but I don't know how to call the web api.

    can you help me? thanks a lot!!
  • Specify the Web API URL as shown in the screenshot.
    Click on Authorization and select authentication type(e.g Basic Auth) and provide the appian credentials under username and password fields.
    Click on Body and input the request (e.g if format is raw, then can use JSON data)
    Click on Send Button to get the response


    In Swagger Editor, if the server URL (i.e web api url) and basic authorisation is specified in Swagger API, 
    Click on Authorise button and provide appian credentials
    Click on Try it Out button and input the request by clicking on Edit Button.
    Click on Execute then you will find the curl command ,Request URL and server Response code.
    If you face any CORS issue, please add the URL in CORS Allowed Origin under Admin Console page and try executing from Swagger API.If it does not from Swagger Editor then use the curl command and run in the terminal.You will be able to get the response from WEB API