> ## Documentation Index
> Fetch the complete documentation index at: https://developer.quicko.com/llms.txt
> Use this file to discover all available pages before exploring further.

# API Based OAuth

API-based OAuth workflow that allows access without any redirection.

## API Based Workflow

The API-based workflow is a two-step process:

<Steps>
  <Step title="Generate OTP">
    Generate OTP for users using the Generate OTP endpoint. Users will obtain a One Time Password (OTP) on their registered email address with a validity of 10 minutes.

    | HTTP Method | Resource                                                  | Description                                             |
    | ----------- | --------------------------------------------------------- | ------------------------------------------------------- |
    | GET         | `{{your_oauth_app_authenticate}}/otp?username={username}` | API accepts username and sends OTP to registered email. |
  </Step>

  <Step title="Verify OTP">
    Provide the OTP and username (user's email) to verify the OTP. Obtain the `access_token` and use that with all subsequent requests.

    | HTTP Method | Resource                              | Description                                        |
    | ----------- | ------------------------------------- | -------------------------------------------------- |
    | POST        | `{{your_oauth_app_authenticate}}/otp` | API verifies the OTP and returns the access token. |
  </Step>
</Steps>

### Step 2

After obtaining the `access_token`, use it for all subsequent requests to access protected resources.

### Additional Information

* The OTP is valid for 10 minutes.
* Ensure to handle errors appropriately, such as invalid OTP or expired OTP.

***
