Dataswyft API Platform: Developers Docs
WebsiteGitHubSlackLogin
  • About Dataswyft
    • Community & Support
  • Learn about Dataswyft Platform
    • Decentralized Data Servers
    • Personal Data Account
      • HMIC Permissions
      • Namespaces
      • Single Sign-On
    • Data Wallet
      • Data Wallet Canvas and Solutions
      • CheckD Data Wallet: Release Notes
    • Dataswyft One
      • Compute Tools
  • Build on Dataswyft Platform
    • Dataswyft One APIs
      • Data API
        • Filtering, Querying & Transforming Data
        • Data Debit
      • File Storage API
      • Computations API
      • Postman Collection
    • Integrating with Data Wallets
    • Getting Started
      • Quick Start
      • Developers Portal
        • Updating and Submitting an Application
        • Deleting an Application
        • Application Statuses
      • Application Example - React
        • 1. Environment Setup
        • 2. Create Main Structure
        • 3. Main Page & Routing
        • 4. User Authentication
        • 6. CRUD Operations
        • 5. Component Pages
  • Deploy
    • Application Review
    • Rating Assurance & Certification
    • Live Application Ratings
  • Knowledge Base
    • Security Practices
    • FAQ
    • Glossary of Terms
  • Dataswyft
Powered by GitBook
On this page

Was this helpful?

  1. Build on Dataswyft Platform
  2. Advanced Topics
  3. User Journeys
  4. Password Management
  5. Guides
  6. JavaScript

5. Data Debits

Last updated 3 years ago

Was this helpful?

Data Debits

Get all the Data Debits

The are 2 ways to fetch data debits:

  1. With default options.

Response:

  • Array<>: An array of Data Debits.

Example:

try {
    const result = await hat.dataDebits().getAllDefault();

    if (result.parsedBody) {
        // result.parsedBody contains an array of Data Debits.
    }
} catch (error) {
    // Failed to fetch Data Debits.
}

2. With custom options.

Parameters

Type

options

Object

Response:

Example:

// In custom options you can specify the following parameters: "ordering", "orderBy", "take", "skip"
const options = {
    ordering: "descending",
    orderBy: "name"
};

try {
    const result = await hat.dataDebits().getAll(options);

    if (result.parsedBody) {
        // result.parsedBody contains an array of Data Debits.
    }
} catch (error) {
  // Failed to fetch Data Debits.
}

Get a Data Debit with a specific ID

Parameters

Type

DataDebitId

string

Example:

try {
    const result = await hat.dataDebits().getById("your-data-debit-id");

    if (result.parsedBody) {
        // result.parsedBody contains the data debit.
    }
} catch (e) {
  // Failed to get Data Debit by ID...
}

Get Data Debit values

Parameters

Type

DataDebitId

string

Response:

  • DataDebitValues: The Data Debit values bundle.

Response type:

interface DataDebitValues<T> {
  bundle: { [endpoint: string]: Array<HatRecord<T>> };
}

Example:

try {
    const result = await hat.dataDebits().getDataDebitValues("your-data-debit-id");

    if (result.parsedBody) {
        // result.parsedBody contains the bundle.
    }
} catch (error) {
  // Failed to get Data Debit values...
}

Array<>: An array of Data Debits.

Response: : The Data Debit object.

DataDebit
DataDebit
DataDebit