기기 업데이트 PUT
기기의 이름이나 설정을 업데이트합니다.
엔드포인트
PUT https://api.pocketalert.app/v1/devices/{tid}인증
필수
요청에 다음 헤더 중 하나를 포함하세요:
요청
경로 파라미터
| 파라미터 | 타입 | 필수 | 설명 |
|---|---|---|---|
tid | string | ✅ | 기기 고유 식별자 |
헤더
| 헤더 | 필수 | 설명 |
|---|---|---|
Token | ✅ | API 키 |
Authorization | ✅ | Bearer <jwt-token> |
본문 파라미터
| 파라미터 | 타입 | 필수 | 설명 |
|---|---|---|---|
name | string | ✅ | 새로운 기기 이름 |
요청 예시
bash
curl -X PUT "https://api.pocketalert.app/v1/devices/9dc24hqldvv2bfx2nlc6r" \
-H "Token: your-api-key" \
-H "Content-Type: application/json" \
-d '{"name": "My iPhone"}'javascript
const tid = '9dc24hqldvv2bfx2nlc6r';
const response = await fetch(`https://api.pocketalert.app/v1/devices/${tid}`, {
method: 'PUT',
headers: {
'Token': 'your-api-key',
'Content-Type': 'application/json'
},
body: JSON.stringify({ name: 'My iPhone' })
});python
import requests
tid = '9dc24hqldvv2bfx2nlc6r'
response = requests.put(
f'https://api.pocketalert.app/v1/devices/{tid}',
headers={'Token': 'your-api-key'},
json={'name': 'My iPhone'}
)
print(response.json())php
$tid = '9dc24hqldvv2bfx2nlc6r';
$response = Http::withHeaders([
'Token' => 'your-api-key',
])->put('https://api.pocketalert.app/v1/devices/'.$tid, [
'name' => 'My iPhone',
]);
return $response->json();응답
성공 응답
200 OK
기기가 성공적으로 업데이트되었습니다
json
{
"data": "success"
}오류 응답
| 상태 | 설명 |
|---|---|
401 | 인증 실패 — 토큰이 잘못되었거나 누락됨 |
404 | 찾을 수 없음 — 기기가 존재하지 않음 |
400 | 잘못된 요청 — 요청 본문이 올바르지 않음 |