Resource functions
Collection functions
Search functions
IIIF
Metadata functions
User functions
System
Message functions
Plugin functions

new_user

Create a user record. Use the returned ID to then call save_user() with the user details.

Variable Description Data type Default value
$username The username of the user string N/A

Response

The actual value will be in the data.ref key of the payload.

If successful, a 200 HTTP status will be returned, otherwise 409 HTTP status with a data.ref value representing different scenarios:

  • false if that username already exists or there is a permissions isue
  • -2 if the user limit has been reached

Examples

New user created, use data.ref to get the new user ID (HTTP status - 200):

Array
(
    [status] => success
    [data] => {
"ref": 41
} )

Username already exists (HTTP status - 409):

Array
(
    "status": "fail",
    "data": {
        "ref": false
    }
)