Ⓜ️
Matar
  • ✍️About Matar
  • 📁Concept
    • 📄Understanding Matar
  • 📁Matar For Communities
    • 📄Hosting on Matar
    • 📄Trial Pilot
    • 📄Community Management
  • 📁🚀 Get Started
    • 📄Language Selection
    • 📄Organization Onboarding
    • 📄Signing Up
  • 📁Matar Features
    • 📄Browsing the App
    • 📄View Questions
    • 📄Changing Subjects
    • 📄Answer Questions
    • 📄Ask a Question
    • 📄Share a Question
    • 📄Like an Answer
    • 📄See Liked Answers
    • 📄Dislike an Answer
    • 📄See Recorded Questions
    • 📄See Recorded Answers
    • 📄Troubleshooting
    • 📄Version
    • 📄FAQ
  • 📁Developer Reference
    • 🗄️Architecture
      • 📄Overview
      • 📄Backend
      • 📄Frontend
      • 📄API Layer
    • 📜Guides
      • 📄Add/delete posts
    • 🛠️API
      • 📄API Flow
      • 📁User Login
        • 📄Login
        • 📄Submit OTP
        • 📄Get Current User
        • 📄Edit User
        • 📄Logout
      • 📄Organization Selection
      • 📄Language and Categories
      • 📄Activity Types
      • 📁Posts
        • 📄Post a New Question
        • 📄Delete a Post
        • 📄Post Activity Type
        • 📄Post Information
        • 📄Post GPT Processing
    • 📶DB Tables and Structure
      • 📄Matar DB tables
      • 📄Code Structure
    • 💻Backend Code
      • 📄Response on a Post from AI
      • 📄Post Sorting
      • 📄User Registration
      • 📄Org Based Code
    • 💻Frontend Code
      • 📄Overview
      • 📄Setting up Project
      • 📄Project Structure
      • 📄Code Directories
        • 📄Broadcast Directory
        • 📄Core Directory
        • 📄Data Directory
        • 📄di Directory
        • 📄domain/repository Directory
        • 📄model Directory
        • 📄retrofit Directory
        • 📄ui Directory
          • 📄dialog
          • 📄features
          • 📄service
  • 🤝Support
Powered by GitBook
On this page
  • Submit the Generated OTP.
  • Params
  1. Developer Reference
  2. API
  3. User Login

Submit OTP

PreviousLoginNextGet Current User

Last updated 1 year ago

Submit the generated OTP for user verification.


Submit the Generated OTP.

Params

Body Parameter ⬇️

Body Parameter
Data Type
Description

phone_number (required)

String

Phone Number for sending OTP. Add 91 before your number.

name (required)

String

Name for Account Login.

action (required)

String

Provide action name which is 'send_otp'

otp (required)

String

Provide the received OTP on your mobile number. This is generated from Login API endpoint.


Sample Request ⬇️ (Body Parameter)

curl --location 'https://matar.in.ngrok.io/api/v1/login' \
--header 'Content-Type: application/json' \
--data '{
    "phone_number": "919743256789",
    "name": "Sri",
    "action": "submit_otp",
    "otp": "48793"
}'

Responses ⬇️

Status Code: 🟢200 (200 denotes 'ok')

{
    "access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJmcmVzaCI6dHJ1ZSwiaWF0IjoxNjkyNzg2Njg1LCJqdGkiOiJiMjZmNTk2ZC1kOTYwLTQ2ZWMtYmFmNi1jNzkzMGQ5MzUxMjAiLCJ0eXBlIjoiYWNjZXNzIiwic3ViIjoiMzk1MDFUIiwibmJmIjoxNjkyNzg2Njg1LCJleHAiOjE2OTM2NTA2ODV9.iGXVYlasw8UL7UTRUR69lTlznivrpRJdODyTGIza7Og",
    "refresh_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJmcmVzaCI6ZmFsc2UsImlhdCI6MTY5Mjc4NjY4NSwianRpIjoiOTE5NzcwN2YtN2NmNi00MzMzLWE1OTUtZGQ0M2EzNWMwZTVlIiwidHlwZSI6InJlZnJlc2giLCJzdWIiOiIzOTUwMVQiLCJuYmYiOjE2OTI3ODY2ODUsImV4cCI6MTY5Nzk3MDY4NX0.4xvD7-O1HcW6yoV3cBsV2cn3VY38Y56lp656kNBQpOA"
}

Status Code: 🔴400 (400 denotes 'Bad request')

{
    "message": "Invalid OTP"
}

Response Parameters Description:

The access token requests secure access to the Matar resources whereas a refresh token just helps you re-validate a user without them having to re-enter their login credentials multiple times.

Access token expiry period: 10 days.

Refresh token expiry period: 60 days.

📁
🛠️
📁
📄
Drawing
API: -
https://matar.in.ngrok.io/api/v1/login