Portal API to support creating an active user and setting their password

Idea created by Mark.ODonohue Employee on Jun 20, 2018
    New
    Score12

    The Current API Portal 4.2 allows Portal API call to create a user.   But it is not possible to enable the user, or to set their initial password.  These currently have to be done via the email and user link work flow. 

     

    The customer would like an enhancement to be able to create the user in an enabled state and to be able to set their initial password. 

     

    Here are samples of the current calls and result from the failed change password attempt by admin: 

     

     

    1. Create new developer and associate to organization created
    curl --insecure -H "Content-Type:application/json" -H "Authorization: bearer xxxx-***" -X POST -d '{
    "Uuid": "***-xx-xx-xx",
    "FirstName": "org",
    "LastName": "dev",
    "Username": "orgdevnew",
    "Email": "newdev@example.com",
    "RoleUuid": "00000006-0006-0006-0006-000000000006",
    "OrganizationUuid": "xx-xx-xx",
    "ChangePassword": false,
    "OldPassword": null,
    "NewPassword": "password",
    "NotifyUser": false,
    "Status": "ENABLED",
    "Locale": "en"
    }' https://apim-ssg.***.xx:9443/portal/Users

     

    2. Update newly created developer with password (PUT API is failing here)

    curl --insecure -H "Content-Type:application/json" -H "Authorization: bearer xx-xx-xx-xx" -X PUT -d '{
    "Uuid": "***-***-***",
    "ChangePassword": true,
    "Email": "newdev@example.com",
    "NewPassword": "XXXX",
    "FirstName": "org",
    "OldPassword": "XXXX",
    "Username": "orgdevnew",
    "LastName": "dev",
    "RoleUuid": "00000006-0006-0006-0006-000000000006",
    "Status": "ENABLED",
    "RoleType": "EXTERNAL"
    }' "https://apim-ssg.***.xx:9443/portal/Users('{752b873b-41f3-4b9b-8aba-b056cab982e5}')"

    Error:
    {
    "error": {
    "code": "ServerErrorException",
    "message": {
    "lang": "en-US",
    "value": "Internal Server Error"
    }
    }
    }