アプリケーション取得 GET
一意の識別子を指定して、特定のアプリケーションの詳細を取得します。
エンドポイント
GET https://api.pocketalert.app/v1/applications/{tid}認証
必須
リクエストに次のいずれかのヘッダーを含めてください:
リクエスト
パスパラメータ
| パラメータ | 型 | 必須 | 説明 |
|---|---|---|---|
tid | string | ✅ | アプリケーションの一意の識別子 |
ヘッダー
| ヘッダー | 必須 | 説明 |
|---|---|---|
Token | ✅ | API キー |
Authorization | ✅ | Bearer <jwt-token> |
リクエストの例
bash
curl -X GET "https://api.pocketalert.app/v1/applications/sozb3yswlwoqdd1l1msi1nnh" \
-H "Token: your-api-key"javascript
const tid = 'sozb3yswlwoqdd1l1msi1nnh';
const response = await fetch(`https://api.pocketalert.app/v1/applications/${tid}`, {
headers: {
'Token': 'your-api-key'
}
});
const application = await response.json();
console.log(application);python
import requests
tid = 'sozb3yswlwoqdd1l1msi1nnh'
response = requests.get(
f'https://api.pocketalert.app/v1/applications/{tid}',
headers={'Token': 'your-api-key'}
)
print(response.json())php
$tid = 'iemkz2tlbakj4lgns961ohx0o';
$response = Http::withHeaders([
'Token' => 'your-api-key',
])->get('https://api.pocketalert.app/v1/applications/'.$tid);
return $response->json();レスポンス
成功時のレスポンス
200 OK
アプリケーションオブジェクトを返します
| フィールド | 型 | 説明 |
|---|---|---|
tid | string | アプリケーションの一意の識別子 |
name | string | アプリケーション名 |
is_active | boolean | アプリケーションが有効かどうか |
created_at | string | 作成日時 |
json
{
"tid": "sozb3yswlwoqdd1l1msi1nnh",
"name": "Production Monitoring",
"is_active": true,
"created_at": "18.09.2023 02:29:02"
}エラーレスポンス
| ステータス | 説明 |
|---|---|
401 | 認証エラー — トークンが無効または未指定です |
404 | 見つかりません — アプリケーションが存在しません |