Web API to receive values from external system

I need to receive the values from external system to update into Appian database. So i have used start process in web api to get those values and update accordingly. Through postman i was able to start the process with provided values from external system but when i'm try to trigger from mule service it not able to trigger and sometimes it shows 401 authentication problem. User who try to start the process is also available in appian environment. Please help on this how get those data from mule service.

  Discussion posts and replies are publicly visible

  • Hi Ganga,
    what is the authentication mechanism you have passed when you test this API in postman? Can you please check same in the mule while passing credentials?
  • 0
    A Score Level 1
    in reply to Shanmukha

    i given basic authorization in postman i.e appian user credentials and i follwed the same but in mule service its not able to login with appian environment and its cause the issue it seems

  • Try creating third party credential and use it to invoke your web API. Make sure to set security for third party user.
  • 0
    A Score Level 2
    in reply to gangatharan
    Hi Ganga,

    I'm not good with Mule, But may be we need to generate a certificate using and then Import it through Admin Console > Integration> Client Certificates. Please let us know how you resolved this issue.
  • Hey Ganga,

    To call a Appian Web- Api from outer systems needs to pass basic + preemptive authentication. If there is any way to enable preemptive authentication from mule please try with same. And try to check logs if you can find where it is failing, In my case it was failing while host name verification while calling from java so i have written a method to override hostname verification (P.S.- it was only for testing not suggested in Prod env)
  • 0
    Certified Lead Developer

    Hi  couple of factors to consider here, in order to resolve this issue.

    1. You must have a service account/user in your Appian environment of type Basic User

    2. Navigate to WEB-API security, and provide Viewer permission to this user or his respective group (recommend)

    3. Provide Viewer permission to this user or his respective group (recommend) under process model security (which will be triggered by this Web - API)

    4. Configure this API endpoint in mule service, and enable preemptive authentication and the mode of authentication should be Http Basic Authentication (where you need to provide this Appian service account/user and his respective password)

    5. Provide the body content for your request, as it's not a GET call.

    6. Test your request.

    If you have followed above mentioned steps in sequence, you should be able to communicate to Appian.

    Hope this helps.

  • 0
    A Score Level 1
    in reply to gangatharan
    Hi Ganga,
    As other folks mentioned all the things. I would like to ask you. Please check the logs in the Mule when you exactly try to connect the service. Sometimes Http and Https makes some confusion when you try to access outside Web API's. Having said that did you connect any other external systems like Appian from Mule. If yes then could you please share those details if possible so that we can figure out the issue.
  • 0
    A Score Level 1
    in reply to Shanmukha
    Thanks. This is the first time mule interacting with Appian and they got html response with login page while triggering. We also given basic authorization but shows login page with status code 200
  • 0
    A Score Level 1
    in reply to aloks0189
    Thanks for the detail explanation and we followed the same approach but still it gives login page as response with status code 200, by giving basic authorization also it shows only login page and not able to login from mule service.
  • +1
    Certified Lead Developer
    in reply to gangatharan

     FIrst of all we are not supposed to get the HTML Page as a response when you are making a call to an API. 

    This can happen in only following cases:

    1. Mule system might be trying to open the endpoint URL (either internally or via some User Intercation). Let's say, i have a link and upon click i need to Authenticate Appian, so instead of Authenticating via API Call it might be trying to Open this URL, if so, you will expect an HTML Response. May i know, are you passing preemptive as true.

    2. Are you working with Mule 3.7.x or the previous version, because The new HTTP Requester in Mule ESB 3.6.0 does not support preemptive authentication but it does starting from version Mule 3.7.x

    3. Your Endpoint might have some Typo (means some mistake in it's endpoint url) so you need to cross check that as well.


    I believe point- 1 & 2 might be the actual reason behind the issue you are currently facing.


    Resolution:
    ---------------------
    If you are working with lower version of Mule (i.e. less than 3.7.x ) then i recommend upgrading your Mule System.


    Hope this will help.