Desknet's NEO Common API Specifications
Common Specifications
Send and receive using HTTP. Character set of request and response are UTF-8.
Request may be sent as either GET or POST.
Request parameter is sent as query string (key=value&…). Non-ASCII character and some symbol should encode for URL. When sent data has file, request parameter should be sent as multi part.
When APIs are accessed multiple times, the second and subsequent APIs are processed one by one after the previous API has completed. If the number of APIs waiting to be processed exceeds 10, APIs will return HTTP429(Too Many Requests) for approximately 10 seconds.
URL
Specify module with the same path as the desknet's NEO URL. Replace file name to module of each API.
https://local.yourdomain/cgi-bin/dneo/zrconst.cgi
Authentication
Access key is needed to specify accessing user.
Method to send access key is following.
- Request parameter named access_key
- Request header named X-Desknets-Auth
Access key to send is following.
- Access key which is generated access key settings
- Access key which is generated login API
Response
Action result is returned as JSON. If action is succeed, status is set to ok and values of API sepecific form will be returned. If action is failed, status is set to ng and error information will be returned.
Key | Value | Description |
status | [ok | ng] | If action is succeed, it will be "ok", otherwise it will be "ng". |
errorno | [Error number] | A number for each error. It is set only when an error occurs. |
errormessage | [Error message] | This is a message indicating the content of the error. It is set only when an error occurs. |
errmsgadd | [Additional Information] | When an error related to a part occurs, the part name is set. |
Example
- curl
- PowerShell
curl https://local.yourdomain/cgi-bin/dneo/zrconst.cgi \
-H 'X-Desknets-Auth: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' \
-d action=list_users
Invoke-WebRequest -Uri https://local.yourdomain/cgi-bin/dneo/zrconst.cgi `
-Headers @{'X-Desknets-Auth'='xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'} `
-Method Post `
-Body @{
'action' = 'list_users'
}
- curl
- PowerShell
curl https://local.yourdomain/cgi-bin/dneo/zrconst.cgi \
--data-urlencode access_key=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx \
-d action=list_users
Invoke-WebRequest -Uri https://local.yourdomain/cgi-bin/dneo/zrconst.cgi `
-Method Post `
-Body @{
'access_key' = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
'action' = 'list_users'
}
Login API
Module
Overview
Authenticate the user and generate access key. It will be expired at 12 a.m. of 3 days after.
Request Parameter
Parameter Name | The Specified Value | Description |
action | login | Fixed value |
login_id | [Login ID] | Sepecify login ID of the user. |
password | [Password] | Sepecify password of the user. |
Response
Key | Value | Description |
access_key | [Access Key] | It is access key to authenticate on other API. It will be expired 3 days after. |
user_id | [User System ID] | It is system ID of the user. |
name | [Name] | It is name of the user. |
default_group_id | [Default Group System ID] | It is system ID of default group of the user. |
Example
- curl
- PowerShell
curl https://local.yourdomain/cgi-bin/dneo/dneor.cgi \
-d action=login \
-d login_id=yamada \
-d password=xxxxxxxxxx
$response = Invoke-WebRequest -Uri https://local.yourdomain/cgi-bin/dneo/dneor.cgi `
-Method Post `
-Body @{
'action' = 'login'
'login_id' = 'yamada'
'password' = 'xxxxxxxxxx'
}
$response.Content
Logout API
Module
Overview
Delete access key which have been generated on login API.
Request
Parameter Name | The Specified Value | Description |
action | logout | Fixed value |
Example
- curl
- PowerShell
curl https://local.yourdomain/cgi-bin/dneo/dneor.cgi \
-H 'X-Desknets-Auth: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' \
-d action=logout
$response = Invoke-WebRequest -Uri https://local.yourdomain/cgi-bin/dneo/dneor.cgi `
-Headers @{'X-Desknets-Auth'='xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'} `
-Method Post `
-Body @{
'action' = 'action=logout'
}
$response.Content
User List API
Module
Overview
Get a list of users.
Request
Parameter Name | The Specified Value | Description |
action | list_users | Fixed value |
group_id | [Group System ID | Private Group System ID] |
Sepecify it to get only users in the group or private group, otherwise get users regardless their group or private group.
|
name | [Name Or Nickname] |
Specify it to get only users that has sepecified value in name or nickname. |
offset | [Start Position] | Specify the number of items to get (0 at the beginning). If omitted, it will be acquired from the beginning. |
limit | [Maximum Number of Acquisitions] | Specify the maximum number of items to be acquired. |
Response
Key | Value | Description |
allcnt | Number of Users | It is number of users that is ignored range: limit, offset |
id | [User System ID] | It is system ID of each users. |
name | [Name] | It is name of each users. |
assigned_groups | [Assigned Group] | It is assigned group of each users. |
id | [Assigned Group System ID] | It is system ID of each assigned group of each users. |
name | [Assigned Group Name] | It is name of each assigned group of each users. |
is_default | [Default Group] | It is set on when the assigned group is default group, set off otherwise. |
Example
- curl
- PowerShell
curl https://local.yourdomain/cgi-bin/dneo/zrconst.cgi \
-H 'X-Desknets-Auth: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' \
-d action=list_users \
-d group_id=1 \
--data-urlencode name=Smith \
-d offset=0 \
-d limit=100
$response = Invoke-WebRequest -Uri https://local.yourdomain/cgi-bin/dneo/zrconst.cgi `
-Headers @{'X-Desknets-Auth'='xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'} `
-Method Post `
-Body @{
'action' = 'list_users'
'group_id' = '1'
'name' = 'Smith'
'offset' = '0'
'limit' = '100'
}
$response.Content
Group List API
Module
Overview
Get a list of groups.
Request
Parameter Name | The Specified Value | Description |
action | list_groups | Fixed value |
area | [public | private] | Specify private to get private groups of logined user, otherwise get groups. |
group_id | [Parent Group System ID] |
Specify it to get groups directly in the group, If omitted, it will get groups directly in the root. |
offset | [Start Position] | Specify the number of items to get (0 at the beginning). If omitted, it will be acquired from the beginning. |
limit | [Maximum Number of Acquisitions] | Specify the maximum number of items to be acquired. |
Response
Key | Value | Description |
allcnt | Number of Groups | It is number of groups that is ignored range: limit, offset |
id | [Group Or Private Group System ID] | It is system ID of each groups or private group. |
name | [Group Or Private Group Name] | It is name of each groups or private group. |
children | [Number of Child Groups] | It is number of child groups in each groups. |
Example
- curl
- PowerShell
curl https://local.yourdomain/cgi-bin/dneo/zrconst.cgi \
-H 'X-Desknets-Auth: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' \
-d action=list_groups \
-d group_id=1 \
-d offset=0 \
-d limit=100
$response = Invoke-WebRequest -Uri https://local.yourdomain/cgi-bin/dneo/zrconst.cgi `
-Headers @{'X-Desknets-Auth'='xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'} `
-Method Post `
-Body @{
'action' = 'list_groups'
'group_id' = '1'
'offset' = '0'
'limit' = '100'
}
$response.Content