kodingworks / otpwa

https://otpwa.com
9 stars 2 forks source link

Add Endpoint to Get QR #2

Closed arifwidianto08 closed 2 years ago

arifwidianto08 commented 2 years ago

Description

Convert the QR response from the Baileys to an image and create a new endpoint to Get it.

Proposal

Acceptance Criteria

Routes

A. OTP

1. GET OTP / Connection Status

URL : {{base_url}}/otp

Response :

a. Sucess - Disconnected
{
    "meta": {
        "message": "Your phone is still disconnected.",
        "statusCode": 200
    },
    "data": {
        "qr_image_url": null,
        "status": "disconnected"
    }
}
b. Sucess - Connected
{
    "meta": {
        "message": "Your phone is connected.",
        "statusCode": 200
    },
    "data": {
        "qr_image_url": "https://warung-io.s3.ap-southeast-1.amazonaws.com/qr.svg",
        "status": "connected"
    }
}

References