Issue with API IVR Auth with Account #

Hi,

I am having issues with an API IVR path not understanding account numbers with leading zeros. All other account numbers are returning data correctly but every time I use an account number that contains leading zeros, the API path is not acknowledging and it fails.

API to run token using account #: 12345678 = OKAY
API to run token using account #: 00045678 = FAIL

Is there a formula or way to configure the path so that it corrects this problem? I'm hoping this is something simple. Thanks for the support.

I don't know what tools you're using or where this is happening, but generically, it sounds like you're using a number data type somewhere you should be using a string. The value 00045678 as a number is 45678 because numbers do not have leading zeros.

Hi @Tim, I am in architect using the expression Flow.vAccountNumber when I enter the account number in the IVR path. I then use that ToString(Flow.vAccountNumber) to run my token but it's not recognizing the account number.
image

image

Can you confirm how the value is being malformed? What value is your service receiving? What value does Flow.vAccountNumber have after the data entry but before the input step where tostring is called on it?

@Tim, I see that is my token that is not working. Is there a way that I can configure my token to include leading zeros?

First example returned true:
image
Second example failed:
image

What's the error you're getting?

@Tim, see below response.
{
"message": "Processing the Request Body Template resulted in invalid JSON.",
"code": "internal.server.error",
"status": 500,
"messageParams": {},
"contextId": "e27fcf37-cba6-45c7-b243-a1054d7f1809",
"details": [
{
"errorCode": "ACTION.PROCESSING"
}
],
"errors": [
{
"message": "Invalid numeric value: Leading zeroes not allowed\n at [Source: (String)"{\n "client_id": "ivr",\n "client_secret": "",\n "account_number": 00228893\n }"; line: 4, column: 22]",
"code": "INTERNAL_SERVER_ERROR",
"status": 500,
"messageParams": {},
"details": [],
"errors": []
}
]
}

Try configuring your contract to use a string instead of a number.

@Tim, it's configured as a string. Should I update my input contract to integer?

image

I tried it and it returned successful so let me update my flow with this updated version.

@Tim, the update worked! Thanks for the support. If you can, can you take a look at my other post about grabbing data in the body on an email. I never got a response there. :upside_down_face:

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.