コンテンツへスキップ

アプリケーション取得 GET ​

一意の識別子を指定して、特定のアプリケーションの詳細を取得します。

エンドポイント ​

GET https://api.pocketalert.app/v1/applications/{tid}

認証 ​

必須

リクエストに次のいずれかのヘッダーを含めてください:

  • Token: <your-api-key> — API キーから取得できます
  • Authorization: Bearer <jwt-token> — ログインから取得できます

リクエスト ​

パスパラメータ ​

パラメータ型必須説明
tidstring✅アプリケーションの一意の識別子

ヘッダー ​

ヘッダー必須説明
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

アプリケーションオブジェクトを返します

フィールド型説明
tidstringアプリケーションの一意の識別子
namestringアプリケーション名
is_activebooleanアプリケーションが有効かどうか
created_atstring作成日時
json
{
  "tid": "sozb3yswlwoqdd1l1msi1nnh",
  "name": "Production Monitoring",
  "is_active": true,
  "created_at": "18.09.2023 02:29:02"
}

エラーレスポンス ​

ステータス説明
401認証エラー — トークンが無効または未指定です
404見つかりません — アプリケーションが存在しません

Pocket Alert ドキュメント