Get token
POST /Auth/login — OMS API · Authentication
Generates an access token (JWT) using the provided API username and password. This token is sent to all other endpoints in the Authorization: Bearer <token> header.
- The token duration is returned in the
expirefield; obtain a new one before it expires (do not call login on every request). - If your user is linked to multiple tenants (companies), send the
tenantfield; if not sent, the response will be HTTP 200,isSuccess: false,errorMesssage: "please select a tenant", and selectable tenants will be indata. - If username/password is incorrect, HTTP 401 is returned.
İstek gövdesi
tenant(string): Tenant (company) code. Mandatory if the user is linked to multiple tenants; can be left empty for single-tenant users.password(string, zorunlu): User's password.username(string, zorunlu): API username provided to you.
Yanıtlar
- 200: Request processed. Token is valid only if
isSuccess: true. - 400: Body validation failed (missing required field, type mismatch, or malformed JSON). Response is in ASP.NET Core
ValidationProblemDetailsformat; theerrorsfield indicates which fields are invalid. - 401: Incorrect username/password or user inactive/without role.
- 500: Unexpected server error. This response returns fields in PascalCase (unlike other responses) and includes
nullfields.
200 yanıt alanları
data(string[]): Tenant codes selectable by the user in theplease select a tenantcase. Returned only if not empty.token(string): Access token (JWT). Sent in subsequent requests asAuthorization: Bearer <token>.nullon failure.expire(string<date-time>): Token expiration time (UTC).isSuccess(boolean, zorunlu):trueif token was generated.statusCode(string): Unused; returnsnull.errorMesssage(string): Reason token was not generated:please select a tenant(multiple tenants, sendtenant),user does not have a tenant, or inactive/user without role message. Returned only if not empty.