| URL | Description |
|---|---|
| https://www.example.org | Production environment |
| https://www.test.example.org | Test environment |
Creates a new session.
Authenticates the user using the provided credentials and creates a new session.
| Name | Type | Constraints | Description |
|---|---|---|---|
| params | object | ||
| params.name | string | minLength="1" | Name of the user to create a session for. |
| params.password | string | minLength="1" | Password of the user to create a session for. |
| Name | Type | Constraints | Description |
|---|---|---|---|
| result | object | ||
| result.session_token | string | minLength="1" | Bearer token of the created session. |
| result?.validity | number | multipleOf="1" | Validity of the session token in seconds. |
| Code | Message | Description |
|---|---|---|
| 1 | InvalidCredentials | The provided credentials are invalid. |
{
"jsonrpc": "2.0",
"id": "1234567890",
"method": "Session.Login",
"params": {
"name": "admin",
"password": "123456"
}
}
{
"jsonrpc": "2.0",
"id": "1234567890",
"result": {
"session_token": "123456890",
"validity": 3600
}
}
Destroys an existing session.
| Name | Type | Constraints | Description |
|---|---|---|---|
| result | number | minimum="0", maximum="0" | Always '0'. |
| Code | Message | Description |
|---|---|---|
| 2 | NotFound | Session could not be found. |
{
"jsonrpc": "2.0",
"id": "1234567890",
"method": "Session.Logout"
}
{
"jsonrpc": "2.0",
"id": "1234567890",
"result": 0
}
Refreshs an existing session.
Refreshs an existing session so that it keeps alive and doesn't time out. This method does nothing but refreshing the timeout.
| Name | Type | Constraints | Description |
|---|---|---|---|
| result | number | minimum="0", maximum="0" | Always '0'. |
| Code | Message | Description |
|---|---|---|
| 2 | NotFound | Session could not be found. |
{
"jsonrpc": "2.0",
"id": "1234567890",
"method": "Session.KeepAlive"
}
{
"jsonrpc": "2.0",
"id": "1234567890",
"result": 0
}
Adds a new user.
| Name | Type | Constraints | Description |
|---|---|---|---|
| params | object | ||
| params.name | Name of the user to add. | ||
| params.name(0) | string | minLength="1" | |
| params.name(1) | number | multipleOf="1" | |
| params.email | Email of the user to add. | ||
| params?.address | array | Address of the user to add. | |
| params?.address[0] | number | minimum="1" | Address number. |
| params?.address[1] | string | minLength="1" | Name of the street. |
| params?.address[2] | string | enum="Street,Avenue,Boulevard" | Type of the street. |
| params?.address[3] | string | enum="NW,NE,SW,SE" | City quadrant of the address |
| params.password | string | minLength="1" | Password of the user to add. |
| Name | Type | Constraints | Description |
|---|---|---|---|
| result | number | minimum="0", maximum="0" | Always '0'. |
| Code | Message | Description |
|---|---|---|
| 3 | Already exists | A user with that name already exists. |
{
"jsonrpc": "2.0",
"id": "1234567890",
"method": "User.Add",
"params": {
"name": "user",
"email": "user@example.org",
"address": [
1600,
"Pennsylvania",
"Avenue",
"NW"
],
"password": "1234567890"
}
}
{
"jsonrpc": "2.0",
"id": "1234567890",
"result": 0
}
Deletes an existing user.
| Name | Type | Constraints | Description |
|---|---|---|---|
| params | |||
| params(0) | object | exclusive | |
| params(0).name | string | minLength="1", pattern="^(A|B)\-.*$" | Name of the user to delete. |
| params(1) | object | exclusive | |
| params(1).id | string | minLength="1" | Id of the user to delete. |
| Name | Type | Constraints | Description |
|---|---|---|---|
| result | number | minimum="0", maximum="0" | Always '0'. |
| Code | Message | Description |
|---|---|---|
| 2 | Not found | A user with that name could not be found. |
{
"jsonrpc": "2.0",
"id": "1234567890",
"method": "User.Delete",
"params": {
"name": "user"
}
}
{
"jsonrpc": "2.0",
"id": "1234567890",
"result": 0
}
Returns all users.
This method returns an array with information about all existing users.
| Name | Type | Constraints | Description |
|---|---|---|---|
| result | array | List of all existing users. | |
| result[] | object | Information about a user. | |
| result[].name | string | minLength="1" | Name of the user. |
| result[].email | string | format="email" | Email of the user. |
| result[].address | array | Address of the user to add. | |
| result[].address[0:number] | number | minimum="1" | Address number. |
| result[].address[1:street_name] | string | minLength="1" | Name of the street. |
| result[].address[2:street_type] | string | enum="Street,Avenue,Boulevard" | Type of the street. |
| result[].address[3:direction] | string | enum="NW,NE,SW,SE" | City quadrant of the address |
{
"jsonrpc": "2.0",
"id": "1234567890",
"method": "User.GetAll"
}
{
"jsonrpc": "2.0",
"id": "1234567890",
"result": [
{
"name": "user",
"email": "user@example.org",
"address": [
1600,
"Pennsylvania",
"Avenue",
"NW"
]
}
]
}