<iframe src="https://www.googletagmanager.com/ns.html?id=GTM-M74D8PB" height="0" width="0" style="display:none;visibility:hidden">
Loading
Skip to NavigationSkip to Main Content
0D51Y0000ATw0abSQBOkta Classic EngineAdministrationAnswered2023-09-01T06:37:07.000Z2021-02-15T18:08:46.000Z2021-02-22T20:48:48.000Z
Create user via Api - erroring

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

 

  1. {"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
  2. [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.

  • SathishK.23283 (Customer)

    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"))

    Expand Post
  • 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"

    }

    ]

    }

    Expand Post
  • 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":[]}

     

    Expand Post
This question is closed.
Loading
Create user via Api - erroring