Authentication
Login

Login

API Documentation: Login

Overview

This API endpoint allows you to login to your Xellar MPC wallet account using User’s username & password.

  • HTTP Method: POST
  • Endpoint: /api/v1/auth/login

Request Body Parameters

  • username (required): User’s chosen username.
  • password(required): User’s chosen password.
  • expireDate (optional): The expiration date for the JWT token generated from the response.

Example Request Body

{
    "username": "user_username",
    "password": "user_password",
    "expireDate": "2024-10-02"
}

Request

Request Headers

  • x-client-secret (required): Client secret which was generated when register in Xellar MPC API Service Dashboard.

Example Request Syntax

curl -X POST -H "Content-Type: application/json" -H "x-client-secret: $YOUR_CLIENT_SECRET" -d '{
    "username": "user_username",
    "password": "user_password",
    "expireDate": "2024-10-02"
}' https://mpc.xellar.co/api/v1/auth/login

Response

The response will include a JSON object with the following properties:

  • status (number): The HTTP status code of the response (e.g., 200 for success).
  • message (string): A message providing additional information about the operation.
  • data (object): An object containing the access token (If account do not have an MPC wallet, the key is accessToken. Otherwise the key is walletToken).

Example Response (if account do not have an MPC wallet)

{
    "status": 200,
    "message": "ok",
    "data": {
        "accessToken": "your_access_token_here",
        "isWalletCreated": false
    }
}

Example Response (if account already have an MPC wallet)

{
    "status": 200,
    "message": "ok",
    "data": {
        "walletToken": "your_access_token_here",
        "isWalletCreated": true
    }
}