Troca o endpoint de um aparelho (service worker, sem login)
POST/api/push/subscriptions/renew
- Auth
- Öffentlich
- API-Schlüssel:
- Kein API-Schlüssel möglich
Die Beschreibungen der Endpoints stammen aus der API-Spezifikation und sind vorerst auf Portugiesisch. Die Oberfläche drumherum ist übersetzt.
Para o `pushsubscriptionchange` do service worker, que não tem token: troca o endpoint e as chaves de uma inscrição existente, provada pelo endpoint antigo e pelo `auth` antigo dela. Qualquer outra coisa (endpoint desconhecido, removido ou `auth` errado) dá o mesmo 404. O endpoint novo precisa ser de um serviço de push de navegador (Google, Mozilla, Apple, Microsoft). Não usa `X-CommunityId`. Limite de 30 trocas por hora por IP (429).
Request-Body application/json
| Name | Typ | Beschreibung |
|---|---|---|
oldEndpointPflicht | string | |
oldAuthPflicht | string | |
endpointPflicht | string | |
keysPflicht | object | |
keys.p256dhoptional | string | |
keys.authoptional | string | |
vapidKeyIdoptional | string |
Antworten
| Status | Beschreibung |
|---|---|
200 | Inscrição atualizada. |
400 | Requisição inválida — falha de validação. |
404 | Recurso não encontrado. |
409 | Conflito com o estado atual do recurso. |
429 | Mais de 30 trocas por hora a partir do mesmo IP. O cabeçalho `Retry-After` diz em quantos segundos tentar de novo. |
500 | Erro interno do servidor. |
curl-Beispiel
curl -X POST "https://api.memberfy.net/api/push/subscriptions/renew" \
-H "Content-Type: application/json" \
-d '{"oldEndpoint":"string","oldAuth":"string","endpoint":"string","keys":{}}'