Admin

An administrator account.

Properties

Property Description
uid The username of the administrator.
email The contact email of the administrator.
webshops A list of webshops that the administrator can modify.

Methods

count

Takes a filter object and returns the number of administrators found, as an integer.

Parameters

A filter object specifying which administrators to count. See Filter objects on the page List selection.

Example

The request below returns the number of administrators with the email address "viktor@example.com".

API Console
Admin.count(
  {
    "/email": "viktor@example.com"
  }
)
JSON
{
  "jsonrpc": "2.0",
  "method":  "Admin.count",
  "id":      1,
  "params":  [{"/email": "viktor@example.com"}],
}
Response
1

get

Fetches information about an administrator account.

Parameters

Parameter Description
uid The unique identifier of an administrator account.
query Which info to return. See Query language.

Example

API Console
Admin.get(13012, ["uid", "username"])
Response
{"uid": 13012, "username": "viktor"}

getSchema

Fetches the JSON Schema which can be used for client-side validation.

Parameters

The unique identifier of an administrator account or null for a new account.

list

Returns an array of objects representing languages.

Parameters

Parameter Description
query Which info to return. See Query language.
selection Which themes to list. See List selection.

create

Create a new administrator and return the assigned username and authentication token.

Parameters

Parameter Description
email E-mail uniquely used to identify the administrator to be created.

Returns

An object with username and token. token can be used to make a new request authenticated as that administrator.

Example

API Console
Admin.create("foo@example.com")
Response
{
  "username": "foo@example.com",
  "token": "YWRtaW47MTM5NDc5MjgwOTtlOWQ3ZDc3MTdlYzNiZTEzZTBlMTEyOGMzODFlMmU3ZQ=="
}

login

Authenticates an administrator and returns an authentication token. After a successful login, the user is authenticated for subsequent calls on the same connection (WebSocket). For separate HTTP connections, the authentication token must be passed as a URI parameter for the authentication to be acknowledged.

Parameters

Parameter Description
username string
password string

Returns

An authentication token that can be used in subsequent API connections.

Example

API Console
Admin.login("viktor", "x6E8wsoiwu")
Response
"YWRtaW47MTM5NDc5MjgwOTtlOWQ3ZDc3MTdlYzNiZTEzZTBlMTEyOGMzODFlMmU3ZQ=="