Create System Admins

Pagedip has special account roles that give users access to different functionality within the Pagedip Platform. One of these roles is known as sysadmin and it is important that there is at least one account within Pagedip with this role. Sysadmins have more privileges in the Pagedip instance, such as the ability to edit the default themes that all users have access too.

Create the First System Admin

Let's create the first sysadmin account with a POST request to the Pagedip API. You will need to send a standard x-www-form-urlencoded request with name, password, email, tos and sysadmin fields.

Here is an example request using curl:

curl -X POST http://localhost:8080/api/account \
    -d "name=$USERNAME" \
    -d "password=$PASSWORD" \
    -d "email=$EMAIL" \
    -d "tos=yes" \
    -d "sysadmin=true"

Or using Invoke-WebRequest in Powershell:

$params = @{"name"="$USERNAME";
 "password"="$PASSWORD";
 "email"="$EMAIL";
 "tos"="yes";
 "sysadmin"="true";
}

Invoke-WebRequest -Uri http://localhost:8080/api/account -Method POST -Body $params

Creating Additional System Admins

Once the first sysadmin is in the system, more sysadmin accounts can be created using the credentials of another sysadmin.

curl -X POST http://localhost:8080/api/account \
    -u "$SYSADMIN_USER:$SYSADMIN_PASS"
    -d "name=$USERNAME" \
    -d "password=$PASSWORD" \
    -d "email=$EMAIL" \
    -d "tos=yes" \
    -d "sysadmin=true"
$params = @{"name"="$USERNAME";
 "password"="$PASSWORD";
 "email"="$EMAIL";
 "tos"="yes";
 "sysadmin"="true";
}

$basicauth = "$SYSADMIN_USER:$SYSADMIN_PASS"
$bytes = [System.Text.Encoding]::ASCII.GetBytes($basicauth)
$base64 = [System.Convert]::ToBase64String($bytes)
$headers = @{ Authorization = "Basic $base64" }

Invoke-WebRequest -Uri http://localhost:8080/api/account -Method POST -Body $params -Headers $headers