Question

Creating an assyst User via API

  • 17 October 2022
  • 2 replies
  • 297 views

Userlevel 3
Badge +8

Hi All, 

Wondering if anyone has been able to set up an API that creates an assyst User. We’re looking to get the correct JSON code syntax to create an assystUser, however we keep hitting the following error: 

“Invoke-RestMethod : roleJob Title is required.server.validation.errors.mandatoryUserRolecom.axiossystems.assyst.dto.userConfiguration.AssystUserDtomandatoryUserRoleshortCodeShortcode is 
required.server.validation.errors.mandatoryShortCodecom.axiossystems.assyst.dto.userConfiguration.AssystUserDtomandatoryShortCodeservDeptService Department is 
required.server.validation.errors.mandatoryServDeptcom.axiossystems.assyst.dto.userConfiguration.AssystUserDtomandatoryServDeptnameName is 
required.server.validation.errors.mandatoryNamecom.axiossystems.assyst.dto.userConfiguration.AssystUserDtomandatoryNameA complex validation error has been detected by the 
application.rest.exceptions.ComplexValidationExceptionComplexValidationException”

 

Our current JSON code is set out as such: 

{

        "assystUser":{

            "resolvingParameters" : [{

                "parameterName" : "shortCode",

                "parameterValue" : "kevin.test@test.com"

            }],

            "resolvingParameters" : [{

                "parameterName" : "Name",

                "parameterValue" : "Kevin Test"

            }]

            "userRole":{

                "resolvingParameters" : [{

                    "parameterName" : shortCode,

                    "parameterValue" : "NOT USED"

                }],

                    "resolvingParameters" : [{

                    "parameterName" : "shortCode",

                    "parameterValue" : "NOT USED"

                }]

            },                        

            "servDept":{

                "resolvingParameters" : [{

                    "parameterName" : "ID",

                    "parameterValue" : 187

                }],

                    "resolvingParameters" : [{

                    "parameterName" : "Name",

                    "parameterValue" : "ACL"

                }]

 

Any suggestions gratefully received! 


2 replies

Userlevel 1
Badge +1

Yes it is possible. We are using it for synchronizing assyst-User with activeDirectories.

Try using “role” insted of “userRole”.

And for creating are Shortcode and Name-Field are required.

Userlevel 4
Badge +12

Just an update on this one. We managed to get to the bottom of it. We needed to remove the surrounding “assystUser”:{}. I believe this was implied in the uri 

POST http://[SERVER IP]:[PORT]/assystREST/v2/assystUsers

{
"shortCode" : "kevin.test@test.com",
"name" : "Kevin Test",
"role": {
"resolvingParameters" : [
{
"parameterName" : "shortCode",
"parameterValue" : "TEST"
},
{
"parameterName" : "name",
"parameterValue" : "TEST"
}
]
},
"servDept": {
"resolvingParameters" : [
{
"parameterName" : "shortCode",
"parameterValue" : "TESTERS"
},
{
"parameterName" : "name",
"parameterValue" : "Testers"
}
]
}
}

 

Reply