The Auth endpoints sign in representatives and phone channels and return a JWT, and they handle password resets. None of them needs an existing token. Send the returned token as Authorization: Bearer {token} on every other AnswerPal API call.
/api/Auth/loginusername, password and hostname. Returns { "token": "..." }./api/Auth/phone-loginphoneNumber and the Twilio accountSid of the customer. Returns a phone token and the channel’s default language./api/Auth/request-password-resetemail and hostname. Always answers 200 OK when both fields are filled in./api/Auth/reset-passwordtoken from the e-mail and a newPassword. Answers 204 No Content.username (string, required)password (string, required)hostname (string, required)app.answerpal.eu. The representative must belong to the customer with that host name.token (string)POST /api/Auth/login
Content-Type: application/json
{
"username": "agent@example.com",
"password": "correct horse battery staple",
"hostname": "app.answerpal.eu"
} 200 OK
Content-Type: application/json
{
"token": "eyJhbGciOi..."
} Used by the phone runtime of a phone channel. The phone number must belong to a phone channel that is not deleted, of the customer whose Twilio account has this Account SID.
phoneNumber (string, required)accountSid (string, required)token (string)phoneDefaultLanguage (string or null)nld. null when the channel has none; the language then follows the called number.POST /api/Auth/phone-login
Content-Type: application/json
{
"phoneNumber": "+3225550100",
"accountSid": "ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
} 200 OK
Content-Type: application/json
{
"token": "eyJhbGciOi...",
"phoneDefaultLanguage": "nld"
} A password reset takes two calls. The first sends an e-mail with a reset link to the representative; the link holds a one-time token. The second sets the new password with that token.
email (string, required)hostname (string, required)The answer is 200 OK whether or not a representative matches, so the call does not reveal which addresses have an account. The token is valid for 4 hours and can be used once.
token (GUID, required)newPassword (string, required)On success the answer is 204 No Content and the token is removed. A password that does not meet the rule, or a token that is unknown, used or expired, gives 400 Bad Request.
POST /api/Auth/request-password-reset
Content-Type: application/json
{
"email": "agent@example.com",
"hostname": "app.answerpal.eu"
} POST /api/Auth/reset-password
Content-Type: application/json
{
"token": "00000000-0000-0000-0000-000000000000",
"newPassword": "N3w-password!"
} Tokens are signed JWTs. Every call checks the issuer, the audience, the lifetime and the signature. Send the token in the Authorization header; the real-time hubs (/chatHub, /ticketHub) also accept it as the access_token query parameter.
subCustomerID, CustomerRepIDTimeZone, Locale, CountryUTC, en-US and US when not set.role, RolejtisubPhoneAuth.CustomerID, ChannelID, PhoneNumberjti200 OK204 No Content400 Bad Request401 UnauthorizedNo. They issue or recover credentials, so they work without a token. Every other endpoint needs the token they return.
12 hours, for representative tokens and phone tokens alike. Sign in again to get a new one.
At least 8 characters, with at least 3 of these 4: a digit, a lowercase letter, an uppercase letter, a symbol.
So that the answer does not reveal whether an e-mail address has an account. When a representative matches, the e-mail with the reset link is sent.
AnswerPal: AI-powered customer service solutions to elevate your support and communication effortlessly.
For all support, sales, and partnership inquiries, email us at info@answerpal.eu
AnswerPal
Bisschoppenhoflaan 380
2100 Antwerp
Belgium
+32.36416685
BE 0862.692.858