refreshApi - n1lby73/industrial-IOT GitHub Wiki

Overview

The Refresh Token API endpoint allows users to refresh their access token by providing a valid refresh token. This action generates a new access token, granting continued access to protected resources.

Endpoint URL

  • URL: https://industrialiot.onrender.com/api/refresh
  • Method:POST

Authentication

This endpoint requires a valid refresh token with appropriate JWT configurations.

Request Parameters

  • Headers:

    • Authorization: Bearer <REFRESH_TOKEN>
  • Body Parameters: None

Responses

  • Success Response:

    • Status Code: 200 OK
    • Response Body:
      {
          "access_token": "<NEW_ACCESS_TOKEN>"
      }
      • Description: Successful token refresh response containing a new access token.
  • Error Responses:

    • Status Code: 401 Unauthorized

      • Response Body:
        {
          "error": "Missing Authorization Header"
        }
      • Description: Indicates the absence of the Authorization header.
    • Status Code: 401 Unauthorized

      • Response Body:
        {
          "message": "invalid token",
          "error": "<ERROR_DETAILS>"
        }
      • Description: Indicates an invalid refresh token.

Usage

  1. Request Method: POST
  2. Endpoint URL: https://industrialiot.onrender.com/api/refreshjwt
  3. Header: Include the Authorization header with the refresh token in the format: Bearer <REFRESH_TOKEN>
⚠️ **GitHub.com Fallback** ⚠️