An administrator account.
| Property | Type | Description |
|---|---|---|
| uid | string | The username of the administrator. |
| string | The contact email of the administrator. | |
| companyRegistrationNumber | string | Company registration number. |
| nin | string | National identification number (or equivalent) in administrator's country. |
| company | string | Company name. |
| firstName | string | First name. |
| lastName | string | Last name. |
| address | string | Address, e.g. street and number. |
| postcode | string | Postcode. |
| town | string | Post town. |
| country | string | Country as two-letter ISO 3166-1 alpha-2, e.g. 'SE'. |
| phone | string | Phone number. |
| webshops | array | A list of webshops that the administrator can modify. |
Takes a filter object and returns the number of administrators found, as an integer.
A filter object specifying which administrators to count. See Filter objects on the page List selection.
The request below returns the number of administrators with the email address "viktor@example.com".
Admin.count({
"/email": "viktor@example.com"
})
Fetches information about an administrator account.
| Parameter | Description |
|---|---|
| uid | The unique identifier of an administrator account. |
| query | Which info to return. See Query language. |
Admin.get(13012, [
"uid",
"username"
])
Fetches the JSON Schema which can be used for client-side validation.
The unique identifier of an administrator account or null for a new account.
Returns an array of objects representing languages.
| Parameter | Description |
|---|---|
| query | Which info to return. See Query language. |
| selection | Which themes to list. See List selection. |
Create a new administrator and return the assigned username and authentication token.
| Parameter | Description |
|---|---|
| E-mail uniquely used to identify the administrator to be created. |
An object with username and token. token can be used to make a new request authenticated as that administrator.
Admin.create("foo@example.com")
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.
| Parameter | Description |
|---|---|
| username | string |
| password | string |
An authentication token that can be used in subsequent API connections.
Admin.login("viktor", "x6E8wsoiwu")