Registration using API won't return generated password

Any issue about Cyclos 4 scripting and Webservices

Moderators: hugo, alexandre, rmvanarkel

Post Reply
ithacash
Posts: 3
Joined: Tue Nov 24, 2015 10:18 am
Location: Ithaca, NY
Contact:

Registration using API won't return generated password

Post by ithacash »

I'm creating a user via the API operation register. I have set the test configuration to accept a generated password type that I created.

I've tried different sub-parameters for the "passwords" parameter using the documentation. Here is the API payload I'm sending:

Code: Select all

{
    "operation": "register",
    "params": {
        "name": "API Test",
        "username": "apitest",
        "creationdate": "11/22/2015",
        "addresses": [
            {
                "addressLine1": "blah",
                "city": "blah",
                "country": "BL",
                "region": "AH",
                "zip": "00000",
                "currentDistance": "0.0",
                "defaultAddress": true,
                "hidden": false,
                "located": true,
                "location": {
                    "class": "org.cyclos.model.utils.LatLongDTO",
                    "latitude": "00.000000",
                    "longitude": "-00.000000"
                },
                "name": "Address 1"
            }
        ],
        "mobilePhones": {
            "rawNumber": "0000000000",
            "name": "blah"
        },
        "skipActivationEmail": true,
        "group": {
            "internalName": "api_test_group"
        },
        "email": "blah@blah.com",
        "passwords": [
            {  
                "type": {
                    "internalName": "api_test_password",
                    "passwordMode": "GENERATED"
                }
            }
        ]
    }
}
And here is what's returned (notice the "generatedPasswords" list is empty):

Code: Select all

{
  "result": {
    "class": "org.cyclos.model.users.users.UserRegistrationResult",
    "status": "EMAIL_VALIDATION",
    "rootUrl": "https://communities.cyclos.org/blah",
    "user": {
      "class": "org.cyclos.model.users.users.UserVO",
      "shortDisplay": "apitest",
      "display": "API Test",
      "id": "7762070814183742783"
    },
    "generatedPasswords": [],
    "principalsData": [
      {
        "class": "org.cyclos.model.users.users.UserPrincipalData",
        "principalType": {
          "class": "org.cyclos.model.access.principaltypes.PrincipalTypeVO",
          "nature": "BUILT_IN",
          "global": true,
          "internalName": "username",
          "id": "7762070814178012479",
          "name": "Login name"
        },
        "principal": "apitest",
        "channels": [
          {
            "class": "org.cyclos.model.access.channels.ChannelVO",
            "global": true,
            "internalName": "webServices",
            "id": "7762070814178012735",
            "name": "Web services"
          }
        ]
      }
    ]
  }
}
---
Shane
Ithacash Sys/Web Dev
shane@ithacash.com

Post Reply