Mettre à jour une application PUT
Mettez à jour les informations d’une application existante.
Point de terminaison
PUT https://api.pocketalert.app/v1/applications/{tid}Authentification
Obligatoire
Incluez l’un de ces en-têtes dans votre requête :
Requête
Paramètres de chemin
| Paramètre | Type | Obligatoire | Description |
|---|---|---|---|
tid | string | ✅ | Identifiant unique de l’application |
En-têtes
| En-tête | Obligatoire | Description |
|---|---|---|
Content-Type | ✅ | application/json |
Token | ✅ | Votre clé API |
Authorization | ✅ | Bearer <jwt-token> |
Paramètres du corps
| Paramètre | Type | Obligatoire | Description |
|---|---|---|---|
name | string | ✅ | Nouveau nom de l’application |
Exemple de requête
bash
curl -X PUT "https://api.pocketalert.app/v1/applications/sozb3yswlwoqdd1l1msi1nnh" \
-H "Token: your-api-key" \
-H "Content-Type: application/json" \
-d '{
"name": "New Application Name"
}'javascript
const tid = 'sozb3yswlwoqdd1l1msi1nnh';
const response = await fetch(`https://api.pocketalert.app/v1/applications/${tid}`, {
method: 'PUT',
headers: {
'Token': 'your-api-key',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: 'New Application Name'
})
});
const result = await response.json();python
import requests
tid = 'sozb3yswlwoqdd1l1msi1nnh'
response = requests.put(
f'https://api.pocketalert.app/v1/applications/{tid}',
headers={
'Token': 'your-api-key',
'Content-Type': 'application/json'
},
json={'name': 'New Application Name'}
)
print(response.json())php
$tid = 'iemkz2tlbakj4lgns961ohx0o';
$response = Http::withHeaders([
'Token' => 'your-api-key',
])->put('https://api.pocketalert.app/v1/applications/'.$tid, [
'name' => 'Updated Name',
]);
return $response->json();Réponse
Réponse de succès
200 OK
Application mise à jour avec succès
json
{
"data": "success"
}Réponses d’erreur
| Statut | Description |
|---|---|
401 | Non autorisé — Jeton invalide ou manquant |
404 | Introuvable — L’application n’existe pas |
400 | Requête incorrecte — corps de requête invalide |