Akord docs
  • Introduction
    • 👋About Akord
    • 🌇Akord–Arweave Sunsetting FAQs
    • Page
  • API & DEV TOOLS
    • 🕺Simple API upload
    • 🤓Learn
      • Akord protocol
        • Tags
        • Vault
          • Fields
          • Functions
            • vault:init
            • vault:update
            • vault:archive
            • vault:restore
        • Membership
          • Fields
          • Functions
            • membership:invite
            • membership:accept
            • membership:reject
            • membership:revoke
            • membership:change-role
            • membership:update
        • Node
          • Fields
          • Functions
            • node:create
            • node:update
            • node:move
            • node:revoke
            • node:restore
            • node:delete
      • Publishing a website
        • Troubleshooting website publishing
      • Technical Litepaper
      • End-to-end encryption
      • Bundling
    • 🏗️Build
      • REST API
        • Authentication
        • Rate limits
        • Timeouts
        • Webhooks
        • Examples
          • Simple uploads
          • Multipart uploads
      • SDK – AkordJS
        • Usage
        • Modules
          • Auth
          • Vault
          • Membership
          • Folder
          • Stack (file)
          • Manifest
          • Note
          • Memo (message)
          • Batch
        • Examples
      • CLI
        • Quick start
        • Login
        • Vaults
        • Files and stacks
        • Memos / messages
        • Folders
        • Memberships
      • Arweave Gateway – AKRD
  • App
    • 💻Product guides
      • Signing up
        • Akord Wallet
        • Recovery phrase explained
      • Akord Vaults
        • Vault types explained
        • Creating a vault
        • Vault info
      • File management
        • Uploading files
        • File info
        • Sort/filter, folders & batch actions
        • File versioning
      • Add manifest
      • Sharing files
      • Media gallery
      • Invites
      • Messaging
      • Notes
      • Timeline
      • Storage
        • Monitoring usage
        • Top ups
        • Blockchain transactions
      • Account
        • Reveal recovery phrase
        • Change password
        • Account deletion
Powered by GitBook
On this page

Was this helpful?

  1. API & DEV TOOLS
  2. Build
  3. SDK – AkordJS
  4. Modules

Note

create(vaultId, content, name)

  • vaultId (string, required)

  • content (string, required) - note text content, ex: stringified JSON

  • name (string, required) - note name

  • options (NoteCreateOptions, optional) - parent id, mime type, etc.

  • returns Promise<{ noteId, transactionId }> - Promise with new note id & corresponding transaction id

example
const { noteId } = await akord.note.create(vaultId, "# Hello World", "Hello World note");

const { noteId } = await akord.note.create(
  vaultId,
  JSON.stringify({ name: "My first JSON note" }),
  "My first JSON note",
  { parentId: parentId, mimeType: "application/json" }
);

uploadRevision(noteId, name, content)

  • noteId (string, required)

  • content (string, required) - note text content, ex: stringified JSON

  • name (string, required) - note name

  • options (NoteOptions, optional) - mime type, etc.

  • returns Promise<{ transactionId }> - Promise with corresponding transaction id

example
const { transactionId } = await akord.note.uploadRevision(noteId, "# Hello World bis", "Hello World note bis");

move(noteId, parentId)

  • noteId (string, required)

  • parentId (string, optional) - new parent folder id

  • returns Promise<{ transactionId }> - Promise with corresponding transaction id

example
// create new folder
const { folderId } = await akord.folder.create(vaultId, "new folder");
// move the note to newly created folder
const { transactionId } = await akord.note.move(noteId, folderId);

revoke(noteId)

  • noteId (string, required)

  • returns Promise<{ transactionId }> - Promise with corresponding transaction id

example
const { transactionId } = await akord.note.revoke(noteId);

restore(noteId)

  • noteId (string, required)

  • returns Promise<{ transactionId }> - Promise with corresponding transaction id

example
const { transactionId } = await akord.note.restore(noteId);

delete(noteId)

  • noteId (string, required)

  • returns Promise<{ transactionId }> - Promise with corresponding transaction id

example
const { transactionId } = await akord.note.delete(noteId);

get(noteId, options)

  • noteId (string, required)

  • returns Promise<Note> - Promise with the note object

example
const note = await akord.note.get(noteId);

listAll(vaultId, options)

  • vaultId (string, required)

  • returns Promise<Array<Note>> - Promise with all notes within given vault

example
const notes = await akord.note.listAll(vaultId);

list(vaultId, options)

  • vaultId (string, required)

  • returns Promise<{ items, nextToken }> - Promise with paginated notes within given vault

example
// retrieve first 100 notes for the vault
const { items } = await akord.note.list(vaultId);

// retrieve first 20 notes for the vault
const { items } = await akord.note.list(vaultId, { limit: 20 });

// iterate through all notes
let token = null;
let notes = [];
do {
  const { items, nextToken } = await akord.note.list(vaultId, { nextToken: token });
  notes = notes.concat(items);
  token = nextToken;
} while (token);

getVersion(noteId, index)

Get note text version by index, return the latest version by default

  • noteId (string, required)

  • index (number, optional) - note version index

  • returns Promise<{ name: string, data: string }> - Promise with note name & data string text

example
// get the latest note version
const { name: fileName, data: noteText } = await akord.note.getVersion(noteId);

// get the first note version
const { name: fileName, data: noteText } = await akord.note.getVersion(noteId, 0);

Last updated 1 year ago

Was this helpful?

options (, optional)

options (, optional)

options (, optional)

🏗️
GetOptions
ListOptions
ListOptions