Passa al contenuto principale

Autorizzazione

L'API di autorizzazione fornisce token per l'accesso sicuro alla piattaforma Meister1. Usa un access token per autenticare le richieste API, un refresh token per rinnovare la sessione e l'URL di grant SSO per consentire il login trasparente degli utenti.

AccessToken​

informazioni

L'accesso alle API richiede una chiave API. Generala nel portale clienti Meister1:

  1. Fai clic sul tuo nome utente in alto a destra.
  2. Apri Utenti e accessi.
  3. Scorri fino alla sezione API Keys e genera una nuova chiave.

Riceverai un ID chiave (clientId) e un secret (clientSecret). Il secret viene mostrato una sola volta al momento della creazione: conservalo in modo sicuro.

Esempio di richiesta​

curl --location 'https://app.meister1.com/auth/v1/token' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'clientSecret=<CLIENT_SECRET>' \
--data-urlencode 'clientId=<CLIENT_ID>' \
--data-urlencode 'grantType=client_credentials'

Esempio di risposta​

{
"accessToken": "eyJhbGciOi1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJ1c2VyfDF8NDE5NiIsI6MTYczOTYxOTY0Nyk1NzAzNjE5NjQ3fQ._w7VfOIVqEoVEHkmmr4uYhU",
"expiresIn": 36000,
"tokenType": "Bearer",
"refreshToken": "9b449928632c5877f.cik243fd-f5jdue612fed.ac4db1b6-27af-464d-867a-78ee21a0f.56048d69784"
}

RefreshToken​

Esempio di richiesta​

curl --location 'https://app.meister1.com/auth/v1/token' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'clientId=<EMAIL|USERNAME>' \
--data-urlencode 'grantType=refresh_token' \
--data-urlencode 'refreshToken=56a51ebws3f52.5914f61d-7d18-48b5-b9ea-c51d405791fe.f0b68e03-da10-4292-8154-8ee384b7e271.d982dws436d0ad34'

Esempio di risposta​

{
"accessToken": "eyJhbGciOIsInR5cCI6IkpXVCJ9.eyWIiOiJ1c2VyfDF8NDE5NiIscCI6NTczOTYxOTY0Nyk1NzAzNjE5NjQ3fQ._w7VfOIVqEoVEHkmmr4uYhU",
"expiresIn": 36000,
"tokenType": "Bearer",
"refreshToken": "92uk9926b6877f.f026-42d1-b8da-f5jdue612fed.ac4db1b6-867a-78ee21a0f.5fe2239048d69784"
}

URL Grant SSO​

Esempio di richiesta​

curl --location 'https://app.meister1.com/auth/v1/sso' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJ1c2VyfDF8ND4cCI6MTY5NTc2MTk1OTc5MCwiaWF0Ijojk1NzI1OTU5NzkwfQ.AaninWlbz4i807-azE9zxvEUkkkUrp3y40FZo' \
--data-urlencode 'backUrl=https://www.beispiel.de/home' \
--data-urlencode 'accountId=<ACCOUNT_ID>' \
--data-urlencode 'locale=de-de'

Esempio di risposta​

{
"grantUrl": "https://app.meister1.com/my/sso?token=72779b566415edd7185cbe87f2dw12a112fe1&userId=0001&timestamp=1695725988774&backUrl=https%3A%2F%2Fwww.beispiel.de%2Fhome&deepPath=%2Fcalculator%2FQ2FsY3YXRvcjoy",
"expiresIn": 15
}
attenzione

Il grantUrl è valido solo per 15 secondi.