Il B2COPY API utilizza l'autorizzazione bearer-token. Chiama il metodo di accesso riportato di seguito per ottenere una coppia di token di accesso/aggiornamento, quindi includi il token di accesso nell'intestazione Authorization: Bearer <token> di ogni richiesta successiva.
Prerequisito
Per ottenere i token è necessario essere già registrati nel Back Office ed avere le credenziali per accedervi.
Punto finale
POST [host]/api/v2/signinRichiedi corpo
| Nome | Digitare | Obbligatorio | Descrizione |
|---|---|---|---|
| stringa | Sì | L'indirizzo email utilizzato per accedere a Back Office. | |
| password | stringa | Sì | La password utilizzata per accedere a Back Office. |
curl --location --request POST 'https://host.name/api/v2/signin' \
--data-raw '{
"email": "username@example.com",
"password": "Secret123"
}'Risposta
La risposta restituisce una coppia di token di accesso e di aggiornamento, ciascuno con una stringa token e timestamp createdAt / expiresAt.
{
"2faRequired": false,
"accessToken": {
"token": "eyJ0eXAiOiJKV1Qi…",
"createdAt": "2024-01-01T00:00:00+00:00",
"expiresAt": "2024-01-01T00:00:00+00:00"
},
"refreshToken": {
"token": "eyJ0eXAiOiJKV1Qi…",
"createdAt": "2024-01-01T00:00:00+00:00",
"expiresAt": "2024-01-01T00:00:00+00:00"
}
}