I webhook possono essere registrati dai membri premium contro qualsiasi ORCID registrare nel registro. I passaggi sono:
Codifica l'URL
Codifica URL l'URL che desideri ORCID da chiamare quando il record dell'utente viene aggiornato. Ad esempio il seguente URL:
https://nowhere2.com/0000-0002-7465-2162/updated
diventa
https%3A%2F%2Fnowhere2.com%2F0000-0002-7465-2162%2Fupdated
Costruisci l'URL
Crea l'URL completo per il for ORCID Chiamata API che inizia con l'URL del ORCID registra quindi aggiungendo ‚√∫/webhook‚√π e l'URL che vuoi chiamare. Quindi dovrebbe apparire come https://api.sandbox.orcid.org/{ORCID}/webhook/{URL-CODIFICATO-WEBHOOK-URL}
Ad esempio, utilizzando l'URL del webhook sopra e il ORCID iD 0000-0002-7465-2162, l'URL completo è:
https://api.sandbox.orcid.org/0000-0002-7465-2162/webhook/https%3A%2F%2Fnowhere2.com%2F0000-0002-7465-2162%2Fupdated
Registra il webhook
Usa il tuo webhook‚ token di accesso per registrare il tuo webhook rispetto a quello dell'utente ORCID disco. Devi utilizzare una richiesta HTTP PUT, ma non dovresti includere nulla nel corpo della richiesta.
URL= https://api.sandbox.orcid.org/0000-0002-7465-2162/webhook/https%3A%2F%2Fnowhere2.com%2F0000-0002-7465-2162%2Fupdatedn HEADER: Accept: application/json HEADER: Authorization: Bearer [Your access token]n HEADER: Content-Length: 0n METHOD: PUT
La risposta dovrebbe essere 201, ma se la richiamata esisteva già, la risposta sarà 204.
HTTP/1.1 201nServer: nginx/1.1.19nConnection: keep-alive Location: https://api.sandbox.orcid.org/0000-0002-7465-2162/webhook/https%3A%2F%2Frequestb.in%2Fz57lzcz5