AppSuite API仕様
AppSuite API共通仕様
desknet's NEO APIの共通的な仕様に関しては、desknet's NEO共通API仕様 > 共通仕様 をご覧ください。
モジュール名
部品識別子/部品名
[アプリケーション設定 > API設定]で「部品識別子でデータの取得、設定を行う」に設定している場合、部品値の取得/指定時に、部品名ではなく部品識別子を使用します。
- 部品の値を取得する場合、部品識別子が設定された部品のみ取得対象になります。
- 部品の値を指定する場合、設定された部品識別子を使用して部品を特定します。
リクエスト
| パラメーター名 | 指定する値 | 説明 |
| app_id | [アプリケーション] |
必ず指定してください。
以下のいずれかの方法でアプリケーションを指定します。
|
データ一覧API
概要
アプリケーションのデータを一覧取得します。
リクエスト
| パラメーター名 | 指定する値 | 説明 |
| action | list_data | 固定値 |
| app_id | [アプリケーション] | AppSuite API共通仕様をご覧ください。 |
| fields | [部品設定JSON] |
レスポンスで取得する部品を指定します。 省略した場合、前の部品から順番に最大50件の部品の値を取得します。(この件数に"\\permissions"は含まれませんが、"revision"は含まれます。) JSONのオブジェクトの配列で指定します。各要素でfield_nameかfield_aliasのどちらかを指定する必要があります。 |
| filter | [絞り込み条件] | 指定した場合、その条件でデータが絞り込まれます。JSON形式で指定します。絞り込み条件を指定する際の書式は、絞り込み条件をご覧ください。 |
| keyword | [キーワード] | 指定した場合、そのキーワードでデータが絞り込まれます。絞り込み時に検索対象となる部品は以下の通りです。(キーワード検索の対象となる部品タイプではない部品は除きます。)
|
| sort_field_id | [部品のID] | 並び順のキーになる部品を指定します。部品のIDは[アプリケーション設定 > 部品管理]にて確認できます。 |
| sort_order | [asc | desc] | sort_field_idで指定した部品の値をどの順序で並べ替えるかを指定します。ascにすると昇順、descにすると降順になります。省略すると、昇順になります。 |
| offset | [開始位置] | 何件目から取得するか(先頭は0)を指定します。省略すると、先頭から取得します。 |
| limit | [取得件数上限] |
最大何件取得するかを指定します。省略すると、最大5000件取得します。
|
レスポンス
| キー | 値 | 説明 |
| list | [データ一覧] |
データの一覧情報がitemに設定されます。データ一件のJSON形式はデータ参照APIのrecordとほぼ同じです。 データ参照APIとの違いに関しては、部品別の機能対応表の一覧形式の画面に表示できる部品タイプをご覧ください。 |
実行例
- curl(bash)
- PowerShell
- Python
- JavaScript
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":"担当"},{"field_alias":"customer"}]' \
--data-urlencode 'filter={"item":[{"field_id":"105","operator":"=","value":"-1 months:*"}]}' \
--data-urlencode keyword=山田 \
-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":"担当"},{"field_alias":"customer"}]'
'filter' = '{"item":[{"field_id":"105","operator":"=","value":"-1 months:*"}]}'
'keyword' = '山田'
'sort_field_id' = '101'
'sort_order' = 'asc'
'offset' = '0'
'limit' = '100'
}
$response.Content
import json
import httpx
URL = "https://local.yourdomain/cgi-bin/dneo/appsr.cgi"
ACCESS_KEY = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
headers = {
"X-Desknets-Auth": ACCESS_KEY,
}
fields = [
{ "field_name": "担当" },
{ "field_alias": "customer" },
]
filter = {
"item": [
{ "field_id": "105", "operator": "=", "value": "-1 months:*" },
],
}
payload = {
"action": "list_data",
"app_id": "@sample_app",
"fields": json.dumps(fields),
"filter": json.dumps(filter),
"keyword": "山田",
"sort_field_id": "101",
"sort_order": "asc",
"offset": "0",
"limit": "100",
}
response = httpx.post(URL, headers=headers, data=payload)
print(response.json())
const url = 'https://local.yourdomain/cgi-bin/dneo/appsr.cgi';
const access_key = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx';
const headers = {
'X-Desknets-Auth': access_key,
};
const fields = [
{ field_name: '担当' },
{ field_alias: 'customer' },
];
const filter = {
item: [
{ field_id: '105', operator: '=', value: '-1 months:*' },
],
};
const payload = {
action: 'list_data',
app_id: '@sample_app',
fields: JSON.stringify(fields),
filter: JSON.stringify(filter),
keyword: '山田',
sort_field_id: '101',
sort_order: 'asc',
offset: '0',
limit: '100',
};
fetch(url, {
method: 'POST',
headers,
body: new URLSearchParams(payload),
})
.then(response => {
return response.json();
})
.then(json => {
console.log(json);
});
データ件数取得API
概要
リクエスト
| パラメーター名 | 指定する値 | 説明 |
| action | count_data | 固定値 |
| app_id | [アプリケーション] | AppSuite API共通仕様をご覧ください。 |
| fields | [部品設定] |
キーワード検索の対象の部品を指定します。詳細はkeywordの説明をご覧ください。 書式はデータ一覧APIと同じです。 |
| filter | [絞り込み条件] | 指定した場合、その条件で絞り込んだ件数を取得します。JSON形式で指定します。絞り込み条件を指定する際の書式は、絞り込み条件をご覧ください。 |
| keyword | [キーワード] |
指定した場合、そのキーワードで絞り込んだ件数を取得します。絞り込み時に検索対象となる部品は以下の通りです。(キーワード検索の対象となる部品タイプではない部品は除きます。)
|
レスポンス
| キー | 値 | 説明 |
| allcnt | [データ件数] | アプリケーションのデータの件数です。条件を指定した場合はそれで絞り込まれた件数になります。 |
実行例
- curl(bash)
- PowerShell
- Python
- JavaScript
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=山田
$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' = '山田'
}
$response.Content
import json
import httpx
URL = "https://local.yourdomain/cgi-bin/dneo/appsr.cgi"
ACCESS_KEY = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
headers = {
"X-Desknets-Auth": ACCESS_KEY,
}
fields = [
{ "field_alias": "customer" },
]
filter = {
"item": [
{ "field_id": "105", "operator": "=", "value": "-1 months:*" },
],
}
payload = {
"action": "count_data",
"app_id": "@sample_app",
"fields": json.dumps(fields),
"filter": json.dumps(filter),
"keyword": "山田",
}
response = httpx.post(URL, headers=headers, data=payload)
print(response.json())
const url = 'https://local.yourdomain/cgi-bin/dneo/appsr.cgi';
const access_key = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx';
const headers = {
'X-Desknets-Auth': access_key,
};
const fields = [
{ field_alias: 'customer' },
];
const filter = {
item: [
{ field_id: '105', operator: '=', value: '-1 months:*' },
],
};
const payload = {
action: 'count_data',
app_id: '@sample_app',
fields: JSON.stringify(fields),
filter: JSON.stringify(filter),
keyword: '山田',
};
fetch(url, {
method: 'POST',
headers,
body: new URLSearchParams(payload),
})
.then(response => {
return response.json();
})
.then(json => {
console.log(json);
});
データ参照API
概要
リクエスト
| パラメーター名 | 指定する値 | 説明 |
| action | get_data | 固定値 |
| app_id | [アプリケーション] | AppSuite API共通仕様をご覧ください。 |
| data_id | [データID] | 必ず指定してください。取得対象となるデータのデータIDを指定します。 |
| load_rel_list | [on | off] | onまたは省略した場合、参照データ一覧の値が実際の値になります。offにした場合、参照データ一覧の値が空になります。 |
レスポンス
| キー | 値 | 説明 |
| allow_write | [データの変更権] | このデータを変更できる場合にon、そうでない場合にoffになります。 |
| allow_delete | [データの削除権] | このデータを削除できる場合にon、そうでない場合にoffになります。 |
| revision | [リビジョン番号] | このデータのリビジョン番号(データの同時変更による競合を防ぐために使用)です。 |
| val | [部品値] | 部品値のJSONオブジェクト値を参照してください。 |
| deny_write | on | この部品値を変更できない場合、この項目が出力されます。この部品値が変更できる場合、deny_write自体出力されません。 |
| type | [計算結果タイプ] | 計算した結果のタイプが設定されます。(部品が自動計算の場合のみ) |
| hint | [計算エラー内容] | 計算エラーの場合、エラー内容が設定されます。(部品が自動計算の場合のみ) |
| error | [エラーコード] |
部品値がエラーの場合、以下のエラーコードが設定されます。
|
| 部品 | 値の書式 |
| 文字(一行)/文字(複数行)/ラジオボタン/プルダウン/数値/リッチテキスト/ID | 値がそのまま設定されます。 |
| チェックボックス/リストボックス | 選択値がタブ区切りで設定されます。 |
| 日付 | 値がyyyy-MM-dd形式で設定されます。 |
| 時刻 | 値が00:00:00からの経過秒数で設定されます。 |
| 日時 | 値がyyyy-MM-ddTHH:mm形式で設定されます。 |
| 添付ファイル |
|
| 自動計算 | 計算結果の値が設定されます。 |
| ユーザー選択/ユーザー |
|
| 組織選択 |
|
| 表部品 |
|
| 参照データ一覧 | 表部品と同じ書式です。「部品識別子/部品名」については、自身のアプリケーションの設定が適用されます。 |
実行例
- curl(bash)
- PowerShell
- Python
- JavaScript
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
import httpx
URL = "https://local.yourdomain/cgi-bin/dneo/appsr.cgi"
ACCESS_KEY = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
headers = {
"X-Desknets-Auth": ACCESS_KEY,
}
payload = {
"action": "get_data",
"app_id": "@sample_app",
"data_id": "1",
}
response = httpx.post(URL, headers=headers, data=payload)
print(response.json())
const url = 'https://local.yourdomain/cgi-bin/dneo/appsr.cgi';
const access_key = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx';
const headers = {
'X-Desknets-Auth': access_key,
};
const payload = {
action: 'get_data',
app_id: '@sample_app',
data_id: '1',
};
fetch(url, {
method: 'POST',
headers,
body: new URLSearchParams(payload),
})
.then(response => {
return response.json();
})
.then(json => {
console.log(json);
});
データダウンロードAPI
概要
リクエスト
レスポンス
実行例
- curl(bash)
- PowerShell
- Python
- JavaScript
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
import httpx
URL = "https://local.yourdomain/cgi-bin/dneo/appsuite.cgi"
ACCESS_KEY = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
headers = {
"X-Desknets-Auth": ACCESS_KEY,
}
payload = {
"action": "download_data_file",
"app_id": "1",
"field_id": "104",
"id": "1",
}
response = httpx.post(URL, headers=headers, data=payload)
with open("documents.zip", "wb") as fp:
fp.write(response.content)
const fs = require('fs')
const url = 'https://local.yourdomain/cgi-bin/dneo/appsuite.cgi';
const access_key = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx';
const headers = {
'X-Desknets-Auth': access_key,
};
const payload = {
action: 'download_data_file',
app_id: '1',
field_id: '104',
id: '1',
};
fetch(url, {
method: 'POST',
headers,
body: new URLSearchParams(payload),
})
.then(response => {
return response.arrayBuffer();
})
.then(buffer => {
fs.writeFile('documents.zip', Buffer.from(buffer), err => {
if (err) {
console.log('fail');
}
else {
console.log('success');
}
});
});
データ追加API
概要
リクエスト
| パラメーター名 | 指定する値 | 説明 |
| action | insert_data | 固定値 |
| app_id | [アプリケーション] | AppSuite API共通仕様をご覧ください。 |
| relookup_key_field | [部品ID] |
複写部品に値を複写する場合、キー部品の部品IDを指定してください。(複数指定可能) また、ここで指定したキー部品をパラメータ({{部品識別子/部品名}})に含めてください。 |
| auto_action | [on | off] | offを指定した場合、当APIを使用してデータ変更時に自動処理(データの追加・変更時の処理)が実行されなくなります。onまたは省略した場合、自動処理は実行されます。 |
| {{部品識別子/部品名}} | [部品値] |
部品ごとの値を設定します。部品のタイプごとの値の書式は以下です。
|
| {{表部品}}行.{{添付ファイル}} | [ファイル] | 表部品の指定した行(0開始)の添付ファイル部品にアップロードします。その際、リクエストをマルチパートで送信する必要があります。 |
レスポンス
| キー | 値 | 説明 |
| ID | [データID] | 追加されたデータのデータIDです。 |
実行例
- curl(bash)
- PowerShell
- Python
- JavaScript
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}}=山田花子' \
--data-urlencode '{{details}}=[{"use":"滞在費","price":"10000"},{"use":"接待費","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}}' = '山田花子'
'{{details}}' = '[{"use":"滞在費","price":"10000"},{"use":"接待費","price":"8000"}]'
}
$response.Content
import json
import httpx
URL = "https://local.yourdomain/cgi-bin/dneo/appsr.cgi"
ACCESS_KEY = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
headers = {
"X-Desknets-Auth": ACCESS_KEY,
}
details = [
{ "use": "滞在費", "price": "10000" },
{ "use": "接待費", "price": "8000" },
]
payload = {
"action": "insert_data",
"app_id": "@sample_app",
"relookup_key_field": "101",
"{{charge}}": "1",
"{{customer}}": "山田花子",
"{{details}}": json.dumps(details),
}
response = httpx.post(URL, headers=headers, data=payload)
print(response.json())
const url = 'https://local.yourdomain/cgi-bin/dneo/appsr.cgi';
const access_key = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx';
const headers = {
'X-Desknets-Auth': access_key,
};
const details = [
{ use: '滞在費', price: '10000' },
{ use: '接待費', price: '8000' },
];
const payload = {
action: 'insert_data',
app_id: '@sample_app',
relookup_key_field: '101',
'{{charge}}': '1',
'{{customer}}': '山田花子',
'{{details}}': JSON.stringify(details),
};
fetch(url, {
method: 'POST',
headers,
body: new URLSearchParams(payload),
})
.then(response => {
return response.json();
})
.then(json => {
console.log(json);
});
- curl(bash)
- PowerShell
- Python
- JavaScript
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}}=山田花子' \
-F '{{document}}=@documents.zip' \
--form-string '{{details}}=[{"use":"滞在費","price":"10000"},{"use":"接待費","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('山田花子')
$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":"滞在費","price":"10000"},{"use":"接待費","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
import json
import httpx
URL = "https://local.yourdomain/cgi-bin/dneo/appsr.cgi"
ACCESS_KEY = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
headers = {
"X-Desknets-Auth": ACCESS_KEY,
}
details = [
{ "use": "滞在費", "price": "10000" },
{ "use": "接待費", "price": "8000" },
]
payload = {
"action": "insert_data",
"app_id": "@sample_app",
"{{charge}}": "1",
"{{customer}}": "山田花子",
"{{details}}": json.dumps(details),
}
with open("documents.zip", "rb") as fp_zip, open("receipt.png", "rb") as fp_png:
response = httpx.post(URL, headers=headers, data=payload, files={
"{{document}}": fp_zip,
"{{details}}0.{{document}}": fp_png,
})
print(response.json())
const fs = require('fs');
const url = 'https://local.yourdomain/cgi-bin/dneo/appsr.cgi';
const access_key = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx';
const headers = {
'X-Desknets-Auth': access_key,
};
const fp_zip = fs.readFileSync('documents.zip');
const fp_png = fs.readFileSync('receipt.png');
const details = [
{ use: '滞在費', price: '10000' },
{ use: '接待費', price: '8000' },
];
const payload = new FormData();
payload.append('action', 'insert_data');
payload.append('app_id', '@sample_app');
payload.append('{{charge}}', '1');
payload.append('{{customer}}', '山田花子');
payload.append('{{document}}', new Blob([fp_zip]), 'documents.zip');
payload.append('{{details}}', JSON.stringify(details));
payload.append('{{details}}0.{{document}}', new Blob([fp_png]), 'receipt.png');
fetch(url, {
method: 'POST',
headers,
body: new URLSearchParams(payload),
})
.then(response => {
return response.json();
})
.then(json => {
console.log(json);
});
データ変更API
概要
リクエスト
| パラメーター名 | 指定する値 | 説明 |
| action | update_data | 固定値 |
| app_id | [アプリケーション] | AppSuite API共通仕様をご覧ください。 |
| data_id | [データID] | 必ず指定してください。変更対象となるデータのデータIDを指定します。 |
| relookup_key_field | [部品ID] | データ追加APIと同様です。 |
| auto_action | [on | off] | offを指定した場合、当APIを使用してデータ変更時に自動処理(データの追加・変更時の処理)が実行されなくなります。onまたは省略した場合、自動処理は実行されます。 |
| {{revision}} | [リビジョン番号] | 必ず指定してください。指定した値とデータのリビジョン番号が一致するか検証されます。0を指定すると、検証されません。 |
| {{部品識別子/部品名}} | [部品値] |
以下を除き、データ追加APIと同様です。
|
| {{添付ファイル}}.del_attachment_id | [添付ファイルシステムID] | 添付ファイル部品の指定したIDの添付ファイルを削除します。 |
| {{表部品}}行.{{添付ファイル}} | [ファイル] | 表部品の指定した行(0開始)の添付ファイル部品にアップロードします。その際、リクエストをマルチパートで送信する必要があります。 |
| {{表部品}}行.{{添付ファイル}}.del_attachment_id | [添付ファイルシステムID] | 表部品の指定した行(0開始)の添付ファイル部品の指定したIDの添付ファイルを削除します。 |
レスポンス
| キー | 値 | 説明 |
| ID | [データID] | 変更したデータのデータIDです。 |
実行例
- curl(bash)
- PowerShell
- Python
- JavaScript
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":"滞在費","price":"10000"},{"use":"接待費","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'
'data_id' = '1'
'{{revision}}' = '1'
'{{charge}}' = '1'
'{{details}}' = '[{"data_id":"1","use":"滞在費","price":"10000"},{"use":"接待費","price":"8000"}]'
}
$response.Content
import json
import httpx
URL = "https://local.yourdomain/cgi-bin/dneo/appsr.cgi"
ACCESS_KEY = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
headers = {
"X-Desknets-Auth": ACCESS_KEY,
}
details = [
{ "data_id": "1", "use": "滞在費", "price": "10000" },
{ "use": "接待費", "price": "8000" },
]
payload = {
"action": "update_data",
"app_id": "@sample_app",
"data_id": "1",
"{{revision}}": "1",
"{{charge}}": "1",
"{{details}}": json.dumps(details),
}
response = httpx.post(URL, headers=headers, data=payload)
print(response.json())
const url = 'https://local.yourdomain/cgi-bin/dneo/appsr.cgi';
const access_key = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx';
const headers = {
'X-Desknets-Auth': access_key,
};
const details = [
{ data_id: '1', use: '滞在費', price: '10000' },
{ use: '接待費', price: '8000' },
];
const payload = {
action: 'update_data',
app_id: '@sample_app',
data_id: '1',
'{{revision}}': '1',
'{{charge}}': '1',
'{{details}}': JSON.stringify(details),
};
fetch(url, {
method: 'POST',
headers,
body: new URLSearchParams(payload),
})
.then(response => {
return response.json();
})
.then(json => {
console.log(json);
});
- curl(bash)
- PowerShell
- Python
- JavaScript
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 data_id=1 \
--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":"滞在費","price":"10000"},{"use":"接待費","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)
$data_id = New-Object System.Net.Http.StringContent('1')
$data_id.Headers.Clear()
$data_id.Headers.Add('Content-Disposition', 'form-data; name="data_id"')
$formData.Add($data_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":"滞在費","price":"10000"},{"use":"接待費","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
import json
import httpx
URL = "https://local.yourdomain/cgi-bin/dneo/appsr.cgi"
ACCESS_KEY = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
headers = {
"X-Desknets-Auth": ACCESS_KEY,
}
details = [
{ "data_id": "1", "use": "滞在費", "price": "10000" },
{ "use": "接待費", "price": "8000" },
]
payload = {
"action": "update_data",
"app_id": "@sample_app",
"data_id": "1",
"{{revision}}": "1",
"{{charge}}": "1",
"{{document}}.del_attachment_id": "10",
"{{details}}": json.dumps(details),
"{{details}}0.{{document}}.del_attachment_id": "10",
}
with open("documents.zip", "rb") as fp_zip, open("receipt.png", "rb") as fp_png:
response = httpx.post(URL, headers=headers, data=payload, files={
"{{document}}": fp_zip,
"{{details}}0.{{document}}": fp_png,
})
print(response.json())
const fs = require('fs');
const url = 'https://local.yourdomain/cgi-bin/dneo/appsr.cgi';
const access_key = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx';
const headers = {
'X-Desknets-Auth': access_key,
};
const fp_zip = fs.readFileSync('documents.zip');
const fp_png = fs.readFileSync('receipt.png');
const details = [
{ data_id: '1', use: '滞在費', price: '10000' },
{ use: '接待費', price: '8000' },
];
const payload = new FormData();
payload.append('action', 'udpate_data');
payload.append('app_id', '@sample_app');
payload.append('data_id', '1');
payload.append('{{revision}}', '1');
payload.append('{{charge}}', '1');
payload.append('{{document}}', new Blob([fp_zip]), 'documents.zip');
payload.append('{{document}}.del_attachment_id', '10');
payload.append('{{details}}', JSON.stringify(details));
payload.append('{{details}}0.{{document}}', new Blob([fp_png]), 'receipt.png');
payload.append('{{details}}0.{{document}}.del_attachment_id', '10');
fetch(url, {
method: 'POST',
headers,
body: new URLSearchParams(payload),
})
.then(response => {
return response.json();
})
.then(json => {
console.log(json);
});
データ削除API
概要
リクエスト
| パラメーター名 | 指定する値 | 説明 |
| action | delete_data | 固定値 |
| app_id | [アプリケーション] | AppSuite API共通仕様をご覧ください。 |
| data_id | [データID] | 削除対象となるデータのデータIDを指定します。複数のデータを削除する場合、データIDをカンマで区切るか、複数のパラメーターで指定してください。 |
レスポンス
| キー | 値 | 説明 |
| delete_count | [削除件数] | 実際に削除されたデータの件数です。 |
実行例
- curl(bash)
- PowerShell
- Python
- JavaScript
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
import httpx
URL = "https://local.yourdomain/cgi-bin/dneo/appsr.cgi"
ACCESS_KEY = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
headers = {
"X-Desknets-Auth": ACCESS_KEY,
}
payload = {
"action": "delete_data",
"app_id": "@sample_app",
"data_id": "1,2",
}
response = httpx.post(URL, headers=headers, data=payload)
print(response.json())
const url = 'https://local.yourdomain/cgi-bin/dneo/appsr.cgi';
const access_key = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx';
const headers = {
'X-Desknets-Auth': access_key,
};
const payload = {
action: 'delete_data',
app_id: '@sample_app',
data_id: '1,2',
};
fetch(url, {
method: 'POST',
headers,
body: new URLSearchParams(payload),
})
.then(response => {
return response.json();
})
.then(json => {
console.log(json);
});
- curl(bash)
- PowerShell
- Python
- JavaScript
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
import httpx
URL = "https://local.yourdomain/cgi-bin/dneo/appsr.cgi"
ACCESS_KEY = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
headers = {
"X-Desknets-Auth": ACCESS_KEY,
}
payload = "action=delete_data&app_id=@sample_app&data_id=1&data_id=2"
response = httpx.post(URL, headers=headers, data=payload)
print(response.json())
const url = 'https://local.yourdomain/cgi-bin/dneo/appsuite.cgi';
const access_key = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx';
const headers = {
'X-Desknets-Auth': access_key,
};
const payload = 'action=delete_data&app_id=@sample_app&data_id=1&data_id=2';
fetch(url, {
method: 'POST',
headers,
body: payload,
})
.then(response => {
return response.json();
})
.then(json => {
console.log(json);
});
アプリケーションラベル一覧API
概要
リクエスト
| パラメーター名 | 指定する値 | 説明 |
| action | list_applabels | 固定値 |
レスポンス
| キー | 値 | 説明 |
| id | [ラベルID] | 各ラベルのIDです。 |
| name | [ラベル名] | 各ラベルの名前です。 |
| color | [ラベルの色] | 各ラベルの色です。設定された色に応じて、blue,green,yellow,pink,red,grayのいずれかになります。 |
| parent_id | [ラベルID] | 各ラベルの親ラベルのIDです。親ラベルがない場合、空になります。 |
実行例
- curl(bash)
- PowerShell
- Python
- JavaScript
curl 'https://local.yourdomain/cgi-bin/dneo/appsr.cgi' \
-H 'X-Desknets-Auth: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' \
-d action=list_applabels
$response = Invoke-WebRequest -Uri 'https://local.yourdomain/cgi-bin/dneo/appsr.cgi' `
-Headers @{'X-Desknets-Auth'='xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'} `
-Method Post `
-Body @{
'action' = 'list_applabels'
}
$response.Content
import httpx
URL = "https://local.yourdomain/cgi-bin/dneo/appsr.cgi"
ACCESS_KEY = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
headers = {
"X-Desknets-Auth": ACCESS_KEY,
}
payload = {
"action": "list_applabels",
}
response = httpx.post(URL, headers=headers, data=payload)
print(response.json())
const url = 'https://local.yourdomain/cgi-bin/dneo/appsr.cgi';
const access_key = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx';
const headers = {
'X-Desknets-Auth': access_key,
};
const payload = {
action: 'list_applabels',
};
fetch(url, {
method: 'POST',
headers,
body: new URLSearchParams(payload),
})
.then(response => {
return response.json();
})
.then(json => {
console.log(json);
});
アプリケーション一覧API
概要
リクエスト
| パラメーター名 | 指定する値 | 説明 |
| action | list_apps | 固定値 |
| label_id | [ラベルID | all | self | favorite] |
ラベルIDを指定すると、そのラベルに属するアプリケーションのみ取得します。省略すると、すべてのアプリケーションを取得します。 その他に以下の値を指定できます。
|
| keyword | [キーワード] | 指定すると、そのキーワードをアプリケーション名もしくは説明に含むアプリケーションのみ取得します。 |
| offset | [開始位置] | 何件目から取得するか(先頭は0)を指定します。省略すると、先頭から取得します。 |
| limit | [取得件数上限] |
最大何件取得するかを指定します。省略すると、最大5000件取得します。
|
レスポンス
| キー | 値 | 説明 |
| id | [アプリケーションID] | 各アプリケーションのIDです。 |
| name | [アプリケーション名] | 各アプリケーションの名前です。 |
| app_status | [アプリケーションのステータス] |
各アプリケーションのステータスに応じて以下の値が設定されます。
|
| overview_text | [説明] | 各アプリケーションの説明から抽出したテキスト情報です。256文字まで設定されます。 |
| portal_icon | [ポータル画面用のアイコンのURL] | ポータル画面用のアイコンのURLです。 |
| pallet_menu_icon | [パレットメニュー用のアイコンのURL] | パレットメニュー用のアイコンのURLです。 |
実行例
- curl(bash)
- PowerShell
- Python
- JavaScript
curl 'https://local.yourdomain/cgi-bin/dneo/appsr.cgi' \
-H 'X-Desknets-Auth: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' \
-d action=list_apps \
-d label_id=3 \
--data-urlencode keyword=在庫 \
-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_apps'
'label_id' = '3'
'keyword' = '在庫'
'offset' = '0'
'limit' = '100'
}
$response.Content
import httpx
URL = "https://local.yourdomain/cgi-bin/dneo/appsr.cgi"
ACCESS_KEY = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
headers = {
"X-Desknets-Auth": ACCESS_KEY,
}
payload = {
"action": "list_apps",
"label_id": "3",
"keyword": "在庫",
"offset": "0",
"limit": "100",
}
response = httpx.post(URL, headers=headers, data=payload)
print(response.json())
const url = 'https://local.yourdomain/cgi-bin/dneo/appsr.cgi';
const access_key = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx';
const headers = {
'X-Desknets-Auth': access_key,
};
const payload = {
action: 'list_apps',
label_id: '3',
keyword: '在庫',
offset: '0',
limit: '100',
};
fetch(url, {
method: 'POST',
headers,
body: new URLSearchParams(payload),
})
.then(response => {
return response.json();
})
.then(json => {
console.log(json);
});
アプリケーション詳細API
概要
アプリケーションの基本情報および作成済み部品の一覧情報を取得します。
リクエスト
| パラメーター名 | 指定する値 | 説明 |
| action | get_app | 固定値 |
| app_id | [アプリケーション] | AppSuite API共通仕様をご覧ください。 |
レスポンス
| キー | 値 | 説明 |
| id | [アプリケーションID] | アプリケーションのIDです。 |
| name | [アプリケーション名] | アプリケーションの名前です。 |
| app_status | [アプリケーションのステータス] |
アプリケーションのステータスに応じて以下の値が設定されます。
|
| overview | [説明] | アプリケーションの説明です。HTMLソースが設定されます。 |
| portal_icon | [ポータル画面用のアイコンのURL] | ポータル画面用のアイコンのURLです。 |
| pallet_menu_icon | [パレットメニュー用のアイコンのURL] | パレットメニュー用のアイコンのURLです。 |
| fields | [部品一覧] | 作成済み部品の一覧情報がitemに設定されます。部品一件のJSON形式については、部品情報のJSONオブジェクト値を参照してください。 |
| キー | 値 | 説明 |
| id | [部品ID] | 各部品のIDです。 |
| name | [部品名] | 各部品の部品名です。 |
| field_alias | [部品識別子] | 各部品の部品識別子です。 |
| is_ref | [on | off] | 参照部品の場合にon、参照部品ではない場合にoffになります。 |
| readonly | [on | off] | 読み込み専用の部品の場合にon、値を変更可能な部品の場合にoffになります。 |
| system | [on | off] | システム部品の場合にon、システム部品ではない場合にoffになります。参照部品の場合、参照先部品がシステム部品かどうかが設定されます。 |
| type | [部品タイプ] |
各部品の部品タイプです。部品のタイプごとに設定される値は以下です。
|
| options | [選択肢] | 選択肢がタブ区切りで設定されます。参照部品の場合、参照先部品の選択肢が設定されます。 |
| allow_other | [on | off] | 「選択肢にない値の入力を許可する」がオンの場合にon、オフの場合にoffになります。参照部品の場合、参照先部品が選択肢にない値の入力を許可しているかどうかが設定されます。 |
| time_unit | [入力時間単位] | 入力時間単位が分単位で設定されます。参照部品の場合、参照先部品の入力時間単位が設定されます。 |
| child | [表部品内の部品 | 参照データ一覧内の部品] | 表部品内の部品または参照データ一覧内の部品の一覧情報がlist > itemに設定されます。 |
実行例
- curl(bash)
- PowerShell
- Python
- JavaScript
curl 'https://local.yourdomain/cgi-bin/dneo/appsr.cgi' \
-H 'X-Desknets-Auth: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' \
-d action=get_app \
-d app_id=@sample_app
$response = Invoke-WebRequest -Uri 'https://local.yourdomain/cgi-bin/dneo/appsr.cgi' `
-Headers @{'X-Desknets-Auth'='xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'} `
-Method Post `
-Body @{
'action' = 'get_app'
'app_id' = '@sample_app'
}
$response.Content
import httpx
URL = "https://local.yourdomain/cgi-bin/dneo/appsr.cgi"
ACCESS_KEY = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
headers = {
"X-Desknets-Auth": ACCESS_KEY,
}
payload = {
"action": "get_app",
"app_id": "@sample_app",
}
response = httpx.post(URL, headers=headers, data=payload)
print(response.json())
const url = 'https://local.yourdomain/cgi-bin/dneo/appsr.cgi';
const access_key = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx';
const headers = {
'X-Desknets-Auth': access_key,
};
const payload = {
action: 'get_app',
app_id: '@sample_app',
};
fetch(url, {
method: 'POST',
headers,
body: new URLSearchParams(payload),
})
.then(response => {
return response.json();
})
.then(json => {
console.log(json);
});
