Announcing the Saviynt Knowledge Exchange unifying the Saviynt forums, documentation, training,
and more in a single search tool across platforms. Read the announcement here.

InContact - CreateAccountJson giving error message

myasin
New Contributor
New Contributor

Hi,

Getting the below error when trying to use the default InContact createAccountJson included with the package. Any assistance would be greatly appreciated.

Error:

 "statusCode":400,"description":null,"status":"Failed"}]},"call1":{"headers":null,"message":{"error":"invalid_request","error_description":"Invalid agents[0].userName - String 'Dyasin' does not match regex pattern '^[a-zA-Z0-9.'_%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,30}$'."},"statusCode":400,"description":null,"status":"Failed"}}

createAccountJson:

{
"accountIdPath": "call1.message.agentResults[0].agentId",
"call": [
{
"name": "call1",
"connection": "acctAuth",
"showResponse": true,
"url": "https://api-na1.niceincontact.com/inContactAPI/services/v29.0/agents",
"httpMethod": "POST",
"httpParams": "{\"agents\":[{\"firstName\":\"${user.firstname}\",\"middleName\":\"${user.middlename}\",\"lastName\":\"${user.lastname}\",\"emailAddress\":\"${user.email}\",\"userName\":\"${user.username}\",\"userId\":\"${user.customproperty20}\",\"country\":\"${user.country}\",\"state\":\"${user.state}\",\"city\":\"${user.city}\"}]}",
"httpHeaders": {
"Authorization": "${access_token}",
"Accept": "application/json"
},
"httpContentType": "application/json",
"successResponses": {
"statusCode": [
200,
201
]
}
}
]
}

 

 

1 REPLY 1

rushikeshvartak
All-Star
All-Star

The regular expression `^[a-zA-Z0-9.'_%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,30}$` is a pattern used to match and validate email addresses. Let's break down the components of this regex:

1. `^`: This caret (^) symbol indicates the start of the string. It means that the regex pattern should start matching from the beginning of the input string.

2. `[a-zA-Z0-9.'_%+-]+`: This part of the regex matches the local part of the email address before the "@" symbol. Here's what each character inside the square brackets means:
- `a-z`: Matches any lowercase letter from 'a' to 'z'.
- `A-Z`: Matches any uppercase letter from 'A' to 'Z'.
- `0-9`: Matches any digit from '0' to '9'.
- `.'_%+-`: These are additional characters that are allowed in the local part of the email address. They are usually allowed in email addresses, although some special characters have certain restrictions or conventions.

The `+` following the square brackets means that one or more of these characters must be present in the local part of the email address.

3. `@`: This is a literal "@" symbol, which must be present in the email address.

4. `[a-zA-Z0-9.-]+`: This part of the regex matches the domain part of the email address, which comes after the "@" symbol. Here's what each character inside the square brackets means:
- `a-z`: Matches any lowercase letter from 'a' to 'z'.
- `A-Z`: Matches any uppercase letter from 'A' to 'Z'.
- `0-9`: Matches any digit from '0' to '9'.
- `.` and `-`: These are the only allowed special characters in the domain part of the email address. The dot (.) separates domain segments, and the hyphen (-) is allowed in domain names.

The `+` following the square brackets means that one or more of these characters must be present in the domain part of the email address.

5. `\.`: This backslash (\) is used to escape the dot (.) because a dot is a special character in regex. It matches a literal dot in the email address.

6. `[a-zA-Z]{2,30}`: This part of the regex matches the top-level domain (TLD), which is usually a two to six-letter code that represents the type of organization or country the email address is associated with. In this case, it allows for a TLD that consists of 2 to 30 alphabetic characters (letters). The `{2,30}` is a quantifier that specifies the minimum and maximum length of the TLD.

7. `$`: This dollar sign ($) indicates the end of the string, meaning that the regex pattern should stop matching at the end of the input string.

So, this regular expression ensures that the email address has a valid local part (with certain allowable characters) followed by an "@" symbol, a valid domain part (with only letters, digits, hyphens, and dots), and a valid TLD of 2 to 30 alphabetic characters. It's worth noting that email address validation can be quite complex, and this regex may not cover all edge cases or the full range of valid email address formats.

 

username needs to be in specific format


Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.