Troubleshooting XML data

General Profile Sources is a great way to manage your users within Interact, but there can be a few hiccups along the way.

The first thing the API endpoint does is validate the XML data against the schema. If the data file does not pass the validation process then the API will return a relevant error message. This means that the response from the API usually provides a good error message that should direct you on where to look for problems in the XML.

We would advise that, before sending the XML file to your Interact instance, you validate the XML file against the schema yourself. This will potentially help to resolve a number of validation problems before sending the data file to Interact.

The text below shows an error response from the API

{
  "Message":"The request is invalid.",
  "ModelState":{
    "UMILogicError":["The file is invalid compared to the schema. The element 'users' has incomplete content. List of possible elements expected: 'user'."]
  }
}

The JSON here has a ModelState.UMILogicError with the error text that describes the actual error. If you're using PowerShell script to implement this then the display on the screen isn't quite as nice but it still shows the relevant messages.

13271327

Listed below is some common errors we've seen with customers producing the XML and what to do to resolve the problem

UMI MessageWhat does this meanHow to resolve
The file is invalid compared to the schema. The required attribute 'username' is missing.This means that an element in the XML has a mandatory attribute called 'username' which is missing.
The attribute here is 'username' but this could be any mandatory attribute.
Check your elements that should have the specified attribute (this is detailed in the schema file available here)
The file is invalid compared to the schema. The element 'user' has incomplete content. List of possible elements expected: 'additionalfields'.This means that there is an element in the XML (in this case 'user') that is missing a mandatory child element (in this case 'additionalfields')Check that each element has at a minimum the required child elements within it. This is also detailed in the schema file.
The domain specified does not match the domain provided in the XML.This means that the domain attribute in the syncoptions element in the XML does not match the name of the profile source as defined in InteractMake sure that the name of the profile source in Interact matches the domain attribute in the syncoptions element.
Authorization has been denied for this request.This usually means that the authtoken specified in the Profile Source in Interact does not match the X-ApiKey header value in the POST to the APIMake sure that the POST request that is sending the XML data to Interact has a header named X-ApiKey and that it's value matches the authorisation token against the Profile Source Interact
The file is invalid compared to the schema. The 'UserCount' attribute is invalid - The value '' is invalid according to its datatype
'http://www.w3.org/2001/XMLSchema:integer' - The string '' is not a valid Integer value.
This usually means the Schema is specifying a particular data type for an attribute, but the data in the XML file does not match it. In this case UserCount should be an integer, but the value being passed is an empty string which is not validMake sure that all the data types are valid and match against the schema