NWMS PHP API Client

  • HOME
  • NWMS PHP API Client
API 30.08.2025

NWMS API Authentication Guide


The NWMS API uses Bearer Token Authentication based on Laravel Sanctum. You must include a valid token with each request to protected endpoints.

Step 1: Obtain Access Token


Send a POST request to /api/login:

POST /api/login
Content-Type: application/json

{
  "email": "your@email.com",
  "password": "your_password"
}

Successful response:

{
  "access_token": "1|your_generated_token",
  "token_type": "Bearer"
}

Step 2: Use the Token


For all authenticated requests, add the following HTTP header:

Authorization: Bearer 1|your_generated_token

In Swagger UI, click the Authorize button and paste the token like this:

Bearer 1|your_generated_token

Logout


To revoke the current token:

POST /api/logout
Authorization: Bearer 1|your_generated_token

Notes


  1. Tokens are tied to the authenticated user.
  2. Revocable and secure per-session tokens.
  3. Access to data is restricted by user role and domain/shop scope.