This article explains how to pass an array attribute in the user profile when calling the identity-sources bulk-upsert method.
For example:
{
"entityType": "USERS",
"profiles": [
{
"externalId": "user1@example.com",
"profile": {
"userName": "user1@example.com",
"firstName": "user1",
"lastName": "user1",
"email": "user1@example.com",
"stringArray": ["test1","test2","test3"]
}
}
]
}
Passing "stringArray": ["test1","test2","test3"] results in the following error:
400 Bad Request
The request body was not well-formed
- Identity Source
- Bulk-Upsert
- Okta Classic Engine
- Okta Identity Engine (OIE)
To resolve this, follow the steps below:
- Pass the variable as a comma-delimited string, then in the profile mappings convert it to an array.
- The "
USERS" array would look something like this in the API call:{ "entityType": "USERS", "profiles": [ { "externalId": "user1@example.com", "profile": { "userName": "user1@example.com", "firstName": "user1", "lastName": "user1", "email": "user1@example.com", "stringArray": "test1,test2,test3" } } ] }
- The "
- In the profile mappings for the Custom Identity Source profile, use the following expression to convert the string to an array when mapping it to the Okta user attribute:
Arrays.flatten(appuser.stringArray)
