Unable to invoke POST WEBAPI from PostMan

Hi reader!

I configured an post API (whose purpose is to write in database from outside Appian) which works well when I test it inside Appian. When I try to invoke the API outside Appian (that is through PostMan), it throws Error 500 - Internal Server Error. I have used basic authentication in PostMan Authentication. The user possessing this credential, is being made as the Administrator of API, data store and other required objects. 

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer

    Hi writer!

    Without seeing the way you've configured your API its hard for me to say exactly what's going on, but I would definitely recommend reading over how Appian allows for API authentication to see if you're doing something wrong. I'm not 100% certain of this, but a cursory reading of it make me think that it's not possible to hit an Appian WEBAPI from Postman if you're using user credentials.

    Personally, I can say that when I test my WEBAPIs from Postman, I use the bearer token authentication type. For the token value, I use a key that was generated when I linked my service account with my API. You can see how to do that here. This means that I don't provide the credentials for my service account (by which I mean the user that is making the API call from postman) but rather link that user with an API token, and then use that token in Postman.

    Also, if you do decide to give this a try, I would recommend saving the generated API key somewhere on your computer. Once generated it can't be viewed within Appian again, so you need to keep a copy locally on your machine (you could always just memorize the key, but I am nowhere near smart enough to do something like that!)

    Assuming the URL, endpoint, and body of your request are all accurate in Postman, I would be surprised if your request still returned a 500 error after swapping to using an API key. If it does please let me know, I'm happy to help troubleshoot!

Reply
  • 0
    Certified Lead Developer

    Hi writer!

    Without seeing the way you've configured your API its hard for me to say exactly what's going on, but I would definitely recommend reading over how Appian allows for API authentication to see if you're doing something wrong. I'm not 100% certain of this, but a cursory reading of it make me think that it's not possible to hit an Appian WEBAPI from Postman if you're using user credentials.

    Personally, I can say that when I test my WEBAPIs from Postman, I use the bearer token authentication type. For the token value, I use a key that was generated when I linked my service account with my API. You can see how to do that here. This means that I don't provide the credentials for my service account (by which I mean the user that is making the API call from postman) but rather link that user with an API token, and then use that token in Postman.

    Also, if you do decide to give this a try, I would recommend saving the generated API key somewhere on your computer. Once generated it can't be viewed within Appian again, so you need to keep a copy locally on your machine (you could always just memorize the key, but I am nowhere near smart enough to do something like that!)

    Assuming the URL, endpoint, and body of your request are all accurate in Postman, I would be surprised if your request still returned a 500 error after swapping to using an API key. If it does please let me know, I'm happy to help troubleshoot!

Children
No Data