Patch Wallet API
  • 👋Welcome to the Patch Docs
  • API
    • ▶️Overview
    • Go to Postman Collection
    • App Authentication
    • User Authentication
    • Resolver API
    • Kernel Account API
    • ENS Resolver (usr.id)
    • Networks Supported
    • Errors
  • Other
    • Admin
      • 🚧 🚧 🚧 Patch Maintenance 🚧 🚧 🚧
    • Other
      • 🏗️Request for Projects
      • Base Account API [DEPRECATED]
      • DustSweeper API [WIP]
      • Safe Account API
        • Accounts
        • Send Transactions
        • View Transaction Status
  • Protocol
Powered by GitBook
On this page
  • 1) Get a client_id and client_secret
  • 2) Request a Bearer token
  • 3) Call endpoints with Bearer token
  1. API

App Authentication

PreviousOverviewNextUser Authentication

Last updated 1 year ago

Do not require authentication:

Do require authentication:

Authenticated Patch API endpoints use to authenticate requests.

Get Started

  1. On , request a client_id and client_secret

  2. Request a Bearer token via the /v1/auth endpoint

  3. Provide the Bearer token in the Authorization header

1) Get a client_id and client_secret

On request a client_id and client_secret to access the service.

2) Request a Bearer token

Use the script below to get a Bearer token for your client_id and client_secret.

var myHeaders = new Headers();
myHeaders.append("Content-Type", "application/x-www-form-urlencoded");

var urlencoded = new URLSearchParams();
urlencoded.append("client_id", "demo-user-external");
urlencoded.append("client_secret", "k^yf57yg27MKo2SnuzwX");

var requestOptions = {
  method: 'POST',
  headers: myHeaders,
  body: urlencoded,
  redirect: 'follow'
};

fetch("https://paymagicapi.com/v1/auth", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));

3) Call endpoints with Bearer token

curl -H "Authorization: Bearer <your_bearer_token>" https://paymagicapi.com/v1

Bearer tokens expire every 60 minutes so a new one needs to be generated.

API requests are authenticated using the . To authenticate a request, provide the Bearer token in the Authorization header of the request:

Resolver API
Kernel Account API
OAuth 2.0 methods
Discord
Discord
Bearer Auth scheme