Fetcch
  • 🟠What is Fetcch?
  • 🚅Pull Payments Layer
    • 🔭Overview
    • ❓How it works?
      • 👮Specification
      • 🎒How is it stored?
      • 🌊Pull Payments Flow
    • 🔐Security
      • 🎒Storage
      • ⛓️Cross Chain
    • ⚔️Use Pull Payments
  • 🆔Universal Identity Layer
    • 🔭Overview
    • ❓How it works?
      • 👮Specifications
      • 🎒How is it stored?
      • 🌊Identity Flow
    • 🔐Security
      • 🎒Storage
    • ⚔️Use Fetcch Identity
  • 🏗️Data Structures
    • 📖Address Books
      • 🔭Overview
      • 🎒Storage
  • 💻How to integrate?
    • ✈️Quickstart
    • ⛷️SDK Quickstart
    • 🔓Blockchain
    • ✨Guides
      • 🙇Authentication
      • 😁Identity
        • How to resolve identity?
        • How to create identity?
        • How to update identity?
      • 🤌Transaction Requests
        • How to get transaction requests?
        • How to create transaction request?
        • How to build transaction?
        • How to resolve transaction request?
      • 🫂Address Books
        • How to get address books?
        • How to create address books?
        • How to share address book?
        • How to accept address book request?
      • ⚙️Utility
        • How to sign messages?
          • EVM
          • Solana
          • Aptos
          • EIP-6492 Compatible Signatures
        • How to generate & verify proofs for identity?
    • 📖API Reference
      • ☢️Troubleshooting Errors
      • 🟢OpenAPI Specs
  • 🐧Open Source
    • 📸@fetcch/resolve-names
  • 🥶FAQs
    • FAQs
Powered by GitBook
On this page
  1. How to integrate?
  2. Guides

Authentication

User signature is required to fetch data

PreviousGuidesNextIdentity

Last updated 1 year ago

Arrange Data

First, you need to arrange data which will be used to generate message

{
    "owner": "string" // can be address or DID
}

Generate a message

Generate Access Tokens

Sign the above message using the appropriate address and arrange data in below format

{
    "owner": "string",
    "signature": "string",
    "timestamp": "number"
}

timestamp can't be older than 5 minutes

Authenticate

To authenticate, just include the received accessToken in headers as authorization in format bearer ${accessToken}

signature is the obtained by signing the above generated message and timestamp is also given in the response of

💻
✨
🙇
this
  • Arrange Data
  • Generate a message
  • POSTGenerate Message to read data
  • Generate Access Tokens
  • POSTAuthenticate the signature
  • Authenticate

Generate Message to read data

post
Authorizations
Body
ownerstringOptional
Responses
200Success
application/json
400Error
application/json
401Error
application/json
post
POST /v1/authentication/generate-message HTTP/1.1
Host: sandbox-api.fetcch.xyz
secret-key: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 16

{
  "owner": "text"
}
{
  "status": "text",
  "data": {
    "message": "text",
    "timestamp": 1
  },
  "timestamp": "2025-05-12T03:51:55.258Z"
}

Authenticate the signature

post
Authorizations
Body
ownerstringOptional
signaturestringOptional
timestampintegerOptional
Responses
200Success
application/json
400Error
application/json
401Error
application/json
post
POST /v1/authentication HTTP/1.1
Host: sandbox-api.fetcch.xyz
secret-key: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 49

{
  "owner": "text",
  "signature": "text",
  "timestamp": 1
}
{
  "status": "text",
  "data": {
    "accessToken": "text",
    "expiry": "2025-05-12T03:51:55.258Z"
  },
  "timestamp": "2025-05-12T03:51:55.258Z"
}