
User1593016304233861710 (nDuo) asked a question.
Hi, I've been successfully running various commands in Postman for my tennant but when I try and create a user I am getting the following errors
- {"errorCode":"E0000001","errorSummary":"Api validation failed: com.saasure.core.services.user.InvalidUserProfileException: Could not create user due to invalid profile: com.saasure.framework.validation.util.SimpleErrors: 2 errors\nField error in object 'newUser' on field 'officeApps': rejected value [null]; codes
- [platform.cvd.profile.property.constraint.violation.required.newUser.officeApps,platform.cvd.profile.property.constraint.violation.required.officeApps,platform.cvd.profile.property.constraint.violation.required]; arguments [officeApps]; default message [Required property is missing]\nField error in object 'newUser' on field 'windowsAllow': rejected value [null]; codes
Could someone advise me what the problem is?

I think this may be because there are 2 custom attributes, so I need to set a default value for these 2 attributes. I am not sure how this can be achieved.
windowsAllow , officeApps are the custom attributes I believe. you might have made that as Mandatory. You can uncheck these as an madatory attributes under profile Editor
Ok, that's helpful. I will try that. Could you also advise on the correct syntax in Python so that I can populate these fields. This is what I'm currently using:
import http.client
conn = http.client.HTTPSConnection("ouraddress.oktapreview.com")
payload = "{\n \"profile\": {\n \"firstName\": \"Isaac\",\n \"lastName\": \"Brock\",\n \"email\": \"isaac@ourcom.co.uk\",\n \"login\": \"isaac@ourcom.co.uk\"\n }\n}"
headers = {
'Accept': 'application/json',
'Content-Type': 'application/json',
'Authorization': 'SSWS myveryverylongtoken'
}
conn.request("POST", "/api/v1/users?activate=false", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
{
"profile": {
"firstName": "Kanna",
"lastName": "Vaani",
"email": "Kanan@dd.com,
"login": "vaan@dd.com"
}
}
I was thinking of something like adding:
\"officeApps\": \"Assigned\"n \"windowsAllow\": \"Assigned\"\n }
into the dictionary but I'm getting a syntax error.
I am still getting the same error:
I am assuming because the 2 mandatory values are not being set.
{
"errorCode": "E0000001",
"errorSummary": "Api validation failed: com.saasure.core.services.user.InvalidUserProfileException: Could not create user due to invalid profile: com.saasure.framework.validation.util.SimpleErrors: 2 errors\nField error in object 'newUser' on field 'officeApps': rejected value [null]; codes [platform.cvd.profile.property.constraint.violation.required.newUser.officeApps,platform.cvd.profile.property.constraint.violation.required.officeApps,platform.cvd.profile.property.constraint.violation.required]; arguments [officeApps]; default message [Required property is missing]\nField error in object 'newUser' on field 'windowsAllow': rejected value [null]; codes [platform.cvd.profile.property.constraint.violation.required.newUser.windowsAllow,platform.cvd.profile.property.constraint.violation.required.windowsAllow,platform.cvd.profile.property.constraint.violation.required]; arguments [windowsAllow]; default message [Required property is missing]",
"errorLink": "E0000001",
"errorId": "oaeF5mNacgnQmml4EyfjVeuLg",
"errorCauses": [
{
"errorSummary": "officeApps: Value for required property officeApps is missing"
},
{
"errorSummary": "windowsAllow: Value for required property windowsAllow is missing"
}
]
}
Hi, do you have any further suggestions re: the error messages I posted in the previous message?
1. Make those attributes as not mandatory one.
2. Include those in JSON as below,
{
"profile": {
"firstName": "Isaac",
"lastName": "Brock",
"email” : “kjjkkj@tghj.com<mailto:kjjkkj@tghj.com>”,
"login": “kjjkkj@tghj.com<mailto:kjjkkj@tghj.com>”,
“yourMandatoryAttribute1” : “hjjh”,
“yourMandatoryAttribute2” : “hjjh”
}
}
That's pretty much what I'm doing but I'm still getting "required property is missing"
[{"errorSummary":"Invalid value data type for property 'myAtt'"},{"errorSummary":"Invalid value data type for property 'myOtherAtt'"},{"errorSummary":"myAtt: Value for required property myAtt is missing"},{"errorSummary":"myOtherAtt: Value for required property myOtherAtt is missing"}]}
I've tried putting a string "Assigned", a boolean (true), and an integer (0 or 1) but all fail.
I put: yes
and that produced this error:
{"errorCode":"E0000003","errorSummary":"The request body was not well-formed.","errorLink":"E0000003","errorId":"oaeNk6kXKX8RNC3gqwwfSp7Fg","errorCauses":[]}
Hi, do you have any further suggestions on how to resolve this - or should I log it?