register membership

Description

Register a new user in your own client membership database.

URL

/VERSION/users.FORMAT

Available Format

JSON

HTTP Method

POST

Accepted Version

1

Require

Administrator authorization (if “Implicit Flow” option is unchecked in your app settings) or api_key.

Headers

Not applicable.

Parameters

  • access_token: (Required if your app doesn’t allow Implicit Flow) administrator access token.
  • api_key: (Required if access_token is not provided) client id.
  • username: (Required) username for your new user. Must be between 6 and 40 alphanumeric characters length.
  • pwd: (Required) password for the new user account. Must be between 6 and 40 characters length and it will be stored encrypted and never returned.
  • email: (Required) user email. Must be shorther than 255 characters. It must exists for reset-password purposes.
  • gender: (Optional) gender for your new user. Allowed values are ‘male’ or ‘female’. Default value is ‘undefined’.
  • birthday: (Optional) birthday date for the user profile. according to the ISO 8601 standard.
    • datetime (AAAA-MM-DDThh:mm:sszzzzzz) UTC
    • example: 1997-07-16T10:30:15.342+03:00
  • expiresin: (Optional) seconds from now until the new accreditation will be accessible. Default value is a permanent accreditation.

Example

https://api.topoos.com/1/users.json

curl -X POST -F "email=john22@doe.com" -F "pwd=johnpass22" -F "username=johndoe22" -F "api_key=a5e7bce0-0ac8-4dcc-8337-f7a3b8b30333"

Reply

JSON example reply when request success

{
    "id": "6f130be8-b3db-4f66-b355-c9ec2013fd20",
    "name": "johndoe",
    "email": "john@doe.com",
    "email_verified": false,
    "register": "2014-09-10T08:10:58.20+02:00",
    "provider": null,
    "profile": {
        "birthday": null,
        "gender": "UNDEFINED"
    },
    "ugroup": [],
    "accreditation": {
        "expirationtime": null,
        "client_id": "a5e7bce0-0ac8-4dcc-8337-f7a3b8b30333",
        "access_token": "d4cf5bd3-ea11-4b95-9360-41d658c2de2e",
        "refresh_token": null,
        "visibledevices": [{
            "id": 7697,
            "name": "a5e7bce0-0ac8-4dcc-8337-f7a3b8b30333",
            "model": 3,
            "islogical": true
        }]
    }
}

JSON Response when request error is returned

{
    code: 409
    description: "EXCEPTION_ALREADY_EXISTS"
}