Skip to main content

getOTP API Endpoint

Overview

The getOTP endpoint generates a One-Time Password (OTP) for a specific lift. This endpoint requires a valid API key for authorization.

Base URL

https://api-av5vhokaxq-uc.a.run.app

Endpoint

GET /api/lifts/:liftId/otp

Path Parameters

  • liftId (string): The ID of the lift for which the OTP is requested.

Request Headers

  • Authorization (string): The API key for accessing the endpoint. This should be included in the Authorization header.

Response

Success (200)

On a successful request, the response will contain the generated OTP.

  • Status Code: 200 OK
  • Response Body:
    {
    "otp": "timestamp_hash"
    }

Errors

  • Missing Authorization Header:

    • Status Code: 401 Unauthorized
    • Response Body:
      {
      "message": "Missing Authorization header. Access Denied"
      }
  • Invalid API Key:

    • Status Code: 401 Unauthorized
    • Response Body:
      {
      "message": "Invalid API Key. Access Denied"
      }
  • Lift Not Found:

    • Status Code: 404 Not Found
    • Response Body:
      {
      "message": "Lift not found"
      }
  • Internal Server Error:

    • Status Code: 500 Internal Server Error
    • Response Body:
      {
      "message": "Internal Server Error"
      }

Try it out!

We have set up an example lift for you to try

curl -X GET 'https://api-av5vhokaxq-uc.a.run.app/api/lifts/12345/otp' -H 'Authorization: Bearer 12345'