AppSuite API Specifications
AppSuite API Common Specifications
For common specifications of desknet's NEO API, please refer to: Desknet's NEO Common API Specifications > Common Specifications
Module
Part Identifier/Part Name
If "Get/set data with part identifier" is checked in [App Settings > API Settings], API will get/set data with part identifier, otherwise part name.
Request
Parameter Name | The Specified Value | Description |
app_id | [App] |
Be sure to specify it. Specify app either following forms.
|
Data List API
Overview
Get a list of app data.
Request
Parameter Name | The Specified Value | Description |
action | list_data | Fixed value |
app_id | [App ID | @App identifier] | Please refer to: AppSuite API Common Specifications |
fields | [Part Settings JSON] |
Specify parts to be acquired in the response. If omitted, the values of up to 50 parts will be acquired. Specify as JSON object array. Specify field_name or field_alias in each object item. |
filter | [Narrowing Conditions] | Specify it to the data will be narrowed down by that condition. For the format for specifying the narrowing condition, please refer to: Narrowing Conditions |
keyword | [Keyword] |
Specify it to the data will be narrowed down by that keyword. The parts that will be searched for when narrowing down are as follows.(Excludes parts that are not Part Types to Be Searched by Keyword.)
|
sort_field_id | [Part ID] | Specify the part that will be the key of the order. You can check the Part ID in [App Settings > Part Management]. |
sort_order | [asc | desc] | Specify the order in which the values of the parts specified by sort_field_id are sorted. asc means ascending order, desc means descending order. If omitted, the order is ascending. |
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. If omitted, a maximum of 5000 items will be acquired.
* Regardless of the value specified here, the maximum number of items that can be acquired is 5000.
|
Response
Key | Value | Description |
[Data] |
It is object of data of app. It is almost the same as record under data reference API. For the difference with the data reference API, please refer to: Part Types That Can Be Displayed on a List or Calendar Screen |
Example
- curl
- PowerShell
curl 'https://local.yourdomain/cgi-bin/dneo/appsr.cgi' \
-H 'X-Desknets-Auth: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' \
-d action=list_data \
--data-urlencode app_id=@sample_app \
--data-urlencode 'fields=[{"field_name":"Charge"},{"field_alias":"customer"}]' \
--data-urlencode 'filter={"item":[{"field_id":"105","operator":"=","value":"-1 months:*"}]}' \
--data-urlencode keyword=Smith \
-d sort_field_id=101 \
-d sort_order=asc \
-d offset=0 \
-d limit=100
$response = Invoke-WebRequest -Uri 'https://local.yourdomain/cgi-bin/dneo/appsr.cgi' `
-Headers @{'X-Desknets-Auth'='xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'} `
-Method Post `
-Body @{
'action' = 'list_data'
'app_id' = '@sample_app'
'fields' = '[{"field_name":"Charge"},{"field_alias":"customer"}]'
'filter' = '{"item":[{"field_id":"105","operator":"=","value":"-1 months:*"}]}'
'keyword' = 'Smith'
'sort_field_id' = '101'
'sort_order' = 'asc'
'offset' = '0'
'limit' = '100'
}
$response.Content
Data Count Acquisition API
Overview
Request
Parameter Name | The Specified Value | Description |
action | count_data | Fixed value |
app_id | [App ID | @App identifier] | Please refer to: AppSuite API Common Specifications |
fields | [Part Settings JSON] |
Specify the target part for keyword search. For details, see keyword explanation. The format is same as fields of data list API. |
filter | [Narrowing Conditions] | Specify it to the data will be narrowed down by that condition. For the format for specifying the narrowing condition, please refer to: Narrowing Conditions |
keyword | [Keyword] | Specify it to the data will be narrowed down by that keyword. The parts that will be searched for when narrowing down are as follows.(Excludes parts that are not Part Types to Be Searched by Keyword.)
|
Response
Key | Value | Description |
allcnt | [Number of Data] | The number of application data. If you specify a condition, the number will be narrowed down by that condition. |
Example
- curl
- PowerShell
curl 'https://local.yourdomain/cgi-bin/dneo/appsr.cgi' \
-H 'X-Desknets-Auth: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' \
-d action=count_data \
--data-urlencode app_id=@sample_app \
--data-urlencode 'fields=[{"field_alias":"customer"}]' \
--data-urlencode 'filter={"item":[{"field_id":"105","operator":"=","value":"-1 months:*"}]}' \
--data-urlencode keyword=Smith
$response = Invoke-WebRequest -Uri 'https://local.yourdomain/cgi-bin/dneo/appsr.cgi' `
-Headers @{'X-Desknets-Auth'='xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'} `
-Method Post `
-Body @{
'action' = 'count_data'
'app_id' = '@sample_app'
'fields' = '[{"field_alias":"customer"}]'
'filter' = '{"item":[{"field_id":"105","operator":"=","value":"-1 months:*"}]}'
'keyword' = 'Smith'
}
$response.Content
Data Reference API
Overview
Request
Parameter Name | The Specified Value | Description |
action | get_data | Fixed value |
app_id | [App ID | @App identifier] | Please refer to: AppSuite API Common Specifications |
data_id | [Data ID] | Be sure to specify it. Specify the data ID of the data to be acquired. |
Response
Key | Value | Description |
allow_write | [Update Right of Data] | on if this data can be modified, off otherwise. |
allow_delete | [Delete Right of Data] | on if this data can be deleted, off otherwise. |
val | [Part Value] | Please refer to: JSON Object Value of Part Value |
deny_write | on | deny_write is set to on if this part value cannot be changed, do not display deny_write otherwise. |
type | [Calculation Result Type] | The type of calculation result is set. (Only when parts are auto calculation) |
hint | [Calculation Error Content] | In case of a calculation error, the error content is set. (Only when parts are auto calculation) |
error | [Error Code] |
If the part value is an error, the following error code will be set.
|
Part | Value Format |
Text (1 Line), Text (Multi Line), Radio Button, Pull Down, Number, Rich Text, ID | The value is set as is. |
Check Box, List Box | Chosen values are set with tab delimiters. |
Date | The value is set in the format of yyyy-MM-dd. |
Time | The value is set in seconds since 00:00:00. |
Date/Time | The value is set in the format of yyyy-MM-ddTHH:mm. |
Attachment Files |
|
Auto Calculation | The value of the calculation result is set. |
Select User, User |
|
Select Group |
|
Table Part |
|
Reference List | No value is set. |
Example
- curl
- PowerShell
curl 'https://local.yourdomain/cgi-bin/dneo/appsr.cgi' \
-H 'X-Desknets-Auth: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' \
-d action=get_data \
--data-urlencode app_id=@sample_app \
-d data_id=1
$response = Invoke-WebRequest -Uri 'https://local.yourdomain/cgi-bin/dneo/appsr.cgi' `
-Headers @{'X-Desknets-Auth'='xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'} `
-Method Post `
-Body @{
'action' = 'get_data'
'app_id' = '@sample_app'
'data_id' = '1'
}
$response.Content
Data Download API
Overview
Request
Response
- curl
- PowerShell
curl 'https://local.yourdomain/cgi-bin/dneo/appsuite.cgi?action=download_data_file&app_id=1&field_id=104&id=1' \
-H 'X-Desknets-Auth: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' \
--output documents.zip
Invoke-WebRequest -Uri 'https://local.yourdomain/cgi-bin/dneo/appsuite.cgi?action=download_data_file&app_id=1&field_id=104&id=1' `
-Headers @{'X-Desknets-Auth'='xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'} `
-OutFile documents.zip
Data Addition API
Overview
Request
Parameter Name | The Specified Value | Description |
action | insert_data | Fixed value |
app_id | [App ID | @App identifier] | Please refer to: AppSuite API Common Specifications |
relookup_key_field | [Part ID] |
Specify part ID of key part. (Multiple entry available) Specify key part to be copy to related duplicate part value automatically. |
auto_action | [on | off] | Specify off to prevent to run the add/update actions with the API. Specify on or omit to run them. |
{{Part Identifier/Part Name}} | [Part Value] |
Specify value for part. Value format for part types is following.
|
{{Table Part}}Row.{{Attachment Files}} | [File] | Upload file to attachment files part of specified row (0 at the beginning) of the table part. Send with "multipart/form-data" at that time. |
Response
Key | Value | Description |
ID | [Data ID] | Data ID of the added data. |
Example
- curl
- PowerShell
curl 'https://local.yourdomain/cgi-bin/dneo/appsr.cgi' \
-H 'X-Desknets-Auth: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' \
-d action=insert_data \
--data-urlencode app_id=@sample_app \
-d relookup_key_field=101 \
-d relookup_key_field=112 \
--data-urlencode '{{charge}}=1' \
--data-urlencode '{{customer}}=Mary Smith' \
--data-urlencode '{{details}}=[{"use":"Hotel Expenses","price":"10000"},{"use":"Entertainment Expenses"","price":"8000"}]'
Invoke-WebRequest -Uri 'https://local.yourdomain/cgi-bin/dneo/appsr.cgi' `
-Headers @{'X-Desknets-Auth'='xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'} `
-Method Post `
-Body @{
'action' = 'insert_data'
'app_id' = '@sample_app'
'relookup_key_field' = '101'
'{{charge}}' = '1'
'{{customer}}' = 'Mary Smith'
'{{details}}' = '[{"use":"Hotel Expenses","price":"10000"},{"use":"Entertainment Expenses"","price":"8000"}]'
}
$response.Content
- curl
- PowerShell
curl 'https://local.yourdomain/cgi-bin/dneo/appsr.cgi' \
-H 'X-Desknets-Auth: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' \
--form-string action=insert_data \
--form-string app_id=@sample_app \
--form-string '{{charge}}=1' \
--form-string '{{customer}}=Mary Smith' \
-F '{{document}}=@documents.zip' \
--form-string '{{details}}=[{"use":"Hotel Expenses","price":"10000"},{"use":"Entertainment Expenses","price":"8000"}]' \
-F '{{details}}0.{{document}}=@receipt.png'
Add-Type -AssemblyName 'System.Net.Http'
$formData = New-Object System.Net.Http.MultipartFormDataContent
$action = New-Object System.Net.Http.StringContent('insert_data')
$action.Headers.Clear()
$action.Headers.Add('Content-Disposition', 'form-data; name="action"')
$formData.Add($action)
$app_id = New-Object System.Net.Http.StringContent('@sample_app')
$app_id.Headers.Clear()
$app_id.Headers.Add('Content-Disposition', 'form-data; name="app_id"')
$formData.Add($app_id)
$charge = New-Object System.Net.Http.StringContent('1')
$charge.Headers.Clear()
$charge.Headers.Add('Content-Disposition', 'form-data; name="{{charge}}"')
$formData.Add($charge)
$customer = New-Object System.Net.Http.StringContent('Mary Smith')
$customer.Headers.Clear()
$customer.Headers.Add('Content-Disposition', 'form-data; name="{{customer}}"')
$formData.Add($customer)
$document = New-Object System.Net.Http.StreamContent([System.IO.File]::OpenRead('./documents.zip'))
$document.Headers.Add('Content-Disposition', 'form-data; name="{{document}}"; filename="documents.zip"');
$document.Headers.Add('Content-Type', 'application/zip');
$formData.Add($document)
$details = New-Object System.Net.Http.StringContent('[{"use":"Hotel Expenses","price":"10000"},{"use":"Entertainment Expenses"","price":"8000"}]')
$details.Headers.Clear()
$details.Headers.Add('Content-Disposition', 'form-data; name="{{details}}"')
$formData.Add($details)
$detailsAdd = New-Object System.Net.Http.StreamContent([System.IO.File]::OpenRead('./receipt.png'))
$detailsAdd.Headers.Add('Content-Disposition', 'form-data; name="{{details}}0.{{document}}"; filename="receipt.png"');
$detailsAdd.Headers.Add('Content-Type', 'image/png');
$formData.Add($detailsAdd)
$headers = @{
'X-Desknets-Auth' = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
'Content-Type' = $formData.Headers.ContentType
}
$body = $formData.ReadAsByteArrayAsync().Result
$response = Invoke-WebRequest -Uri 'https://local.yourdomain/cgi-bin/dneo/appsr.cgi' -Headers $headers -Method Post -Body $body
$response.Content
Data Update API
Overview
Request
Parameter Name | The Specified Value | Description |
action | update_data | Fixed value |
app_id | [App ID | @App identifier] | Please refer to: AppSuite API Common Specifications |
data_id | [Data ID] | Be sure to specify it. Specify the data ID of the data to be changed. |
relookup_key_field | [Part ID] | Same as one of data addition API. |
auto_action | [on | off] | Specify off to prevent to run the add/update actions with the API. Specify on or omit to run them. |
{{revision}} | [Revision Number] | Be sure to specify it. It is verified whether the specified value and the revision number of the data match. If you specify 0, it is not verified. |
{{Part Identifier/Part Name}} | [Part Value] |
Same as one of data addition API except for following.
|
{{Attachment Files}}.del_attachment_id | [File System ID] | Delete the file with specfied file system ID. |
{{Table Part}}Row.{{Attachment Files}} | [File] | Upload file to attachment files part of specified row (0 at the beginning) of the table part. Send with "multipart/form-data" at that time. |
{{Table Part}}Row.{{Attachment Files}}.del_attachment_id | [File System ID] | Delete the file with specfied file system ID of specified row (0 at the beginning) of the table part. |
Response
Key | Value | Description |
ID | [Data ID] | Data ID of the added data. |
Example
- curl
- PowerShell
curl 'https://local.yourdomain/cgi-bin/dneo/appsr.cgi' \
-H 'X-Desknets-Auth: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' \
-d action=update_data \
--data-urlencode app_id=@sample_app \
-d data_id=1 \
--data-urlencode '{{revision}}=1' \
--data-urlencode '{{charge}}=1' \
--data-urlencode '{{details}}=[{"data_id":"1","use":"Hotel Expenses","price":"10000"},{"use":"Entertainment Expenses","price":"8000"}]'
$response = Invoke-WebRequest -Uri 'https://local.yourdomain/cgi-bin/dneo/appsr.cgi' `
-Headers @{'X-Desknets-Auth'='xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'} `
-Method Post `
-Body @{
'action' = 'update_data'
'app_id' = '@sample_app'
'relookup_key_field' = '101'
'{{revision}}' = '1'
'{{charge}}' = '1'
'{{details}}' = '[{"data_id":"1","use":"Hotel Expenses","price":"10000"},{"use":"Entertainment Expenses","price":"8000"}]'
}
$response.Content
- curl
- PowerShell
curl 'https://local.yourdomain/cgi-bin/dneo/appsr.cgi' \
-H 'X-Desknets-Auth: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' \
--form-string action=update_data \
--form-string app_id=@sample_app \
--form-string '{{revision}}=1' \
--form-string '{{charge}}=1' \
-F '{{document}}=@documents.zip' \
--form-string '{{document}}.del_attachment_id=10' \
--form-string '{{details}}=[{"data_id":"1","use":"Hotel Expenses","price":"10000"},{"use":"Entertainment Expenses","price":"8000"}]' \
-F '{{details}}0.{{document}}=@receipt.png' \
--form-string '{{details}}0.{{document}}.del_attachment_id=10'
Add-Type -AssemblyName 'System.Net.Http'
$formData = New-Object System.Net.Http.MultipartFormDataContent
$action = New-Object System.Net.Http.StringContent('update_data')
$action.Headers.Clear()
$action.Headers.Add('Content-Disposition', 'form-data; name="action"')
$formData.Add($action)
$app_id = New-Object System.Net.Http.StringContent('@sample_app')
$app_id.Headers.Clear()
$app_id.Headers.Add('Content-Disposition', 'form-data; name="app_id"')
$formData.Add($app_id)
$revision = New-Object System.Net.Http.StringContent('1')
$revision.Headers.Clear()
$revision.Headers.Add('Content-Disposition', 'form-data; name="{{revision}}"')
$formData.Add($revision)
$charge = New-Object System.Net.Http.StringContent('1')
$charge.Headers.Clear()
$charge.Headers.Add('Content-Disposition', 'form-data; name="{{charge}}"')
$formData.Add($charge)
$document = New-Object System.Net.Http.StreamContent([System.IO.File]::OpenRead('./documents.zip'))
$document.Headers.Add('Content-Disposition', 'form-data; name="{{document}}"; filename="documents.zip"');
$document.Headers.Add('Content-Type', 'application/zip');
$formData.Add($document)
$details = New-Object System.Net.Http.StringContent('[{"use":"Hotel Expenses","price":"10000"},{"use":"Entertainment Expenses","price":"8000"}]')
$details.Headers.Clear()
$details.Headers.Add('Content-Disposition', 'form-data; name="{{details}}"')
$formData.Add($details)
$detailsAdd = New-Object System.Net.Http.StreamContent([System.IO.File]::OpenRead('./receipt.png'))
$detailsAdd.Headers.Add('Content-Disposition', 'form-data; name="{{details}}0.{{document}}"; filename="receipt.png"');
$detailsAdd.Headers.Add('Content-Type', 'image/png');
$formData.Add($detailsAdd)
$detailsDelete = New-Object System.Net.Http.StringContent('10')
$detailsDelete.Headers.Clear()
$detailsDelete.Headers.Add('Content-Disposition', 'form-data; name="{{details}}0.{{document}}.del_attachment_id"')
$formData.Add($detailsDelete)
$headers = @{
'X-Desknets-Auth' = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
'Content-Type' = $formData.Headers.ContentType
}
$body = $formData.ReadAsByteArrayAsync().Result
$response = Invoke-WebRequest -Uri 'https://local.yourdomain/cgi-bin/dneo/appsr.cgi' -Headers $headers -Method Post -Body $body
$response.Content
Data Deletion API
Overview
Request
Parameter Name | The Specified Value | Description |
action | delete_data | Fixed value |
app_id | [App ID | @App identifier] | Please refer to: AppSuite API Common Specifications |
data_id | [Data ID] | Specify the data ID of the data to be deleted. Send as comma separated parameter or multiple parameters to delete the multiple data. |
Response
Example
- curl
- PowerShell
curl 'https://local.yourdomain/cgi-bin/dneo/appsr.cgi' \
-H 'X-Desknets-Auth: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' \
-d action=delete_data \
--data-urlencode app_id=@sample_app \
-d data_id=1,2
$response = Invoke-WebRequest -Uri 'https://local.yourdomain/cgi-bin/dneo/appsr.cgi' `
-Headers @{'X-Desknets-Auth'='xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'} `
-Method Post `
-Body @{
'action' = 'delete_data'
'app_id' = '@sample_app'
'data_id' = '1,2'
}
$response.Content
- curl
- PowerShell
curl 'https://local.yourdomain/cgi-bin/dneo/appsr.cgi' \
-H 'X-Desknets-Auth: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' \
-d action=delete_data \
--data-urlencode app_id=@sample_app \
-d data_id=1 \
-d data_id=2
$response = Invoke-WebRequest -Uri 'https://local.yourdomain/cgi-bin/dneo/appsr.cgi' `
-Headers @{'X-Desknets-Auth'='xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'} `
-Method Post `
-Body 'action=delete_data&app_id=@sample_app&data_id=1&data_id=2'
$response.Content