B2COPY API utilizza l'autorizzazione bearer-token. Chiama il metodo di accesso 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.
Presupposto
Per ottenere i token è necessario essere già registrati nell'Back Office e avere le credenziali per accedervi.
Endpoint
POST [host]/api/v2/signinCorpo richiesta
| Nome | Type | Obbligatorio | Descrizione |
|---|---|---|---|
| string | Yes | The email address used to access the Back Office. | |
| password | string | Yes | The password used to access the Back Office. |
curl --location --request POST 'https://host.name/api/v2/signin' \
--data-raw '{
"email": "[email protected]",
"password": "Secret123"
}'Risposta
La risposta restituisce una coppia di token di accesso e aggiornamento, ciascuno con una stringa di 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"
}
}