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
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!
A 500 error is not returned in case the authentication is wrong, but when the expression code in the API fails.
But the expression code works well when tested in Appian Environment.
Then there must be something you are doing wrong in the request payload, check that you are passing correct body and params. If it were an issue with the authentication then it would have given you 401 Unauthorized, but 500 simply means there is a problem with the expression in API, if you are using process model to Write in DSE then check for it's security also.
No, I'm simply using the In-Built Write to Data Store WebAPI. It works well when I test it in Appian but not from PostMan
Did you check the tomcat-stdout log file for any details? Did you make sure that the payload used in PostMan works when used in Appian?