Skip to content

Authorization

General Provisions

Endpoint: /api/Accounts/login

JWT standard (rfc7519) is used for agent authorization.

The agent contacts the authorization service to obtain a JWT token.

The JWT token has a limited lifetime and is valid for 24 hours, after which the JWT token is requested again.

Note:

The JWT token lifetime may actually be less than the scheduled time in the event of a revocation (blocking) of the token.

Obtaining a Token

To obtain a token, use the Auth method described in the XSD scheme Mixvel_Auth.xsd (included in the documentation kit).

The following parameters are transmitted in the request:

  • Login

  • Password

  • StructureUnitId (identifier of the structural unit, set in the Mixvel Web Agency) on the basis of which the agent is to be identified.

An agent can work simultaneously with several different Login credentials.

StructureUnitId is obtained from the Mixvel Web Agency Application from the Structure Unit settings with the tab «Data» and has the following format:

%Agent code%_% Structure unit unique identifier %, in detail:

Agent code: sequence (Agent number) in Mixvel in the range: [1..99999] (from 1 to 99999 inclusive).

Division unique identifier: a set of Latin letters from A to Z, without the letter O.

For example:

12345_MNPQR

The procedure for the application login obtaining and managing is described in the section.

Authentication by JWT Token

So as to work with all the methods of the Mixvel Web Service, the agent passes the JWT token received using the Auth method in the HTTP request header.

The Web Service validates the JWT token and either authorizes the operation or returns a corresponding error.

Reference Messages

Request

<?xml version="1.0" encoding="UTF-8"?>
<MixEnv:Envelope xmlns:MixEnv="https://www.mixvel.com/API/XSD/mixvel_envelope/1_06">
 <Header/>
  <Body id="ID1">
   <MessageInfo MessageId="0d92db5d-e830-46ff-8af0-9eb4bae192a9" TimeSent="2025-01-01T00:00:01Z"/>
    <AppData>
     <a:Auth xmlns:a="https://www.mixvel.com/API/XSD/mixvel_auth/1_01">
       <Login>testUser.auth@mixvel.com</Login>
       <Password>passWord1!</Password>
       <StructureUnitID>12036_ALPHA</StructureUnitID>
     </a:Auth>
    </AppData>
  </Body>
</MixEnv:Envelope>

Response

<?xml version="1.0" encoding="UTF-8"?>
<MixEnv:Envelope xmlns:MixEnv="https://www.mixvel.com/API/XSD/mixvel_envelope/1_06">
 <Header/>
  <Body id="ID1">
    <MessageInfo MessageId="703423d1-595c-49f5-98c2-5dcabe950276" ReplyTo="79b67a26-6fc3-41e3-8ac4-14e0ac0245c8" TimeSent="2025-01-01T00:00:01Z"/>
    <AppData>
      <auth:AuthResponse xmlns:auth="https://www.mixvel.com/API/XSD/mixvel_auth/1_01">
      <Token>eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IlRlc3QgQWdlbnQiLCJleHAiOjE2MDYzMTI4MDAsImlhdCI6MTYwNjMwOTIwMH0.xTPifj6i5Bf_Wl6sw6nOLL3jHDk-DeRozjv3YeuMFUphbkA9-NVqiPEs_7frD_ZVPEoXnoBNgBEc9sr8S53o5w</Token>
      </auth:AuthResponse>
    </AppData>
  </Body>
</MixEnv:Envelope>