Forcing Appian log in screen when using HTTP Web API

Certified Associate Developer

Hi,

In my application I am sending emails with task/record links. The user can click on the link and the link takes him to the task/record or Appian login page, based on whether the user is logged in.

I got a new requirement to count the number of clicks from email to Appian, without using any other technology outside Appian.

For this, I came up with two Web API endpoints, first GET with link to itself in the email sent. GET returns HTML website with automatic POST page that utilizes second WebAPI, which runs a counting smart service and returns the original task/record link.

This solution works only if user is already logged in into Appian, otherwise an ugly error is returned to the user, see below. My question is, is there some way to force the Appian Log in page in case no valid session is found when trying to use the GET API and then redirect him back to it - with the GET API being linked from an email.

Thanks 

error: 

"error":"APNX-1-4187-000","message":"Authentication failed. Please check your credentials and try again.","title":"An Error Has Occurred"}

  Discussion posts and replies are publicly visible