API Documentation

This documentation provides an overview of the API's capabilities, the structure of requests and responses, and the components involved. This should be useful for developers interacting with the BARK protocol via the API.

Introductions: BARK Actions Server API


Overview

The BARK "Solana" Actions Server API allows interaction with the BARK protocol on the Solana blockchain. The API includes endpoints for minting NFTs, processing donations in SOL, USDC, and BARK and SPL tokens, and provides transaction management functionality.

Base URLs

  • Production: https://api.actions.barkprotocol.net/v1

  • Development: http://localhost:3000/v1

Endpoints

1. Mint NFT

  • Endpoint: /api/mint

  • Method: POST

  • Description: Mints a new BARK NFT with custom metadata.

  • Request Body:

    {
      "name": "NFT Name",
      "symbol": "NFTSYMBOL",
      "uri": "https://example.com/metadata.json"
    }
  • Response:

    • 200 OK:

      {
        "message": "NFT minted successfully",
        "transactionId": "TransactionIDHere"
      }
    • 400 Bad Request:

      {
        "message": "Invalid request data"
      }
    • 500 Internal Server Error:

      {
        "message": "Server error during minting"
      }

2. Donate SOL

  • Endpoint: /api/donate/sol

  • Method: POST

  • Description: Processes a donation of SOL to the specified treasury address.

  • Request Body:

    {
      "account": "SolPublicKey",
      "amount": "10",
      "priority": "High"
    }
  • Response:

    • 200 OK:

      {
        "message": "You sent 10 SOL!",
        "transactionId": "TransactionIDHere"
      }
    • 400 Bad Request:

      {
        "message": "Invalid input"
      }
    • 500 Internal Server Error:

      {
        "message": "Server error during donation processing"
      }

3. Donate USDC

  • Endpoint: /api/donate/usdc

  • Method: POST

  • Description: Processes a donation of USDC to the specified treasury address.

  • Request Body:

    {
      "account": "SolPublicKey",
      "amount": "100",
      "priority": "Medium"
    }
  • Response:

    • 200 OK:

      {
        "message": "You sent 100 USDC!",
        "transactionId": "TransactionIDHere"
      }
    • 400 Bad Request:

      {
        "message": "Invalid input"
      }
    • 500 Internal Server Error:

      {
        "message": "Server error during donation processing"
      }

4. Donate BARK

  • Endpoint: /api/donate/bark

  • Method: POST

  • Description: Processes a donation of BARK tokens to the specified treasury address.

  • Request Body:

    {
      "account": "SolPublicKey",
      "amount": "5000",
      "priority": "Low"
    }
  • Response:

    • 200 OK:

      {
        "message": "You sent 5000 BARK!",
        "transactionId": "TransactionIDHere"
      }
    • 400 Bad Request:

      {
        "message": "Invalid input"
      }
    • 500 Internal Server Error:

      {
        "message": "Server error during donation processing"
      }

Components

Schemas

  1. MintNftRequest

    • Type: object

    • Properties:

      • name (string): The name of the NFT. Required.

      • symbol (string): The symbol for the NFT. Required.

      • uri (string): The URI pointing to the NFT metadata. Required.

    • Example:

      {
        "name": "NFT Name",
        "symbol": "NFTSYMBOL",
        "uri": "https://example.com/metadata.json"
      }
  2. MintNftResponse

    • Type: object

    • Properties:

      • message (string): Success message.

      • transactionId (string): The transaction ID of the mint operation.

    • Example:

      {
        "message": "NFT minted successfully",
        "transactionId": "TransactionIDHere"
      }
  3. DonateRequest

    • Type: object

    • Properties:

      • account (string): The public key of the sender's Solana account. Required.

      • amount (string): The amount of SOL, USDC, or BARK tokens to donate. Required.

      • priority (string): The priority level of the transaction. Required. (Values: VeryHigh, High, Medium, Low, Min)

    • Example:

      {
        "account": "SolPublicKey",
        "amount": "10",
        "priority": "High"
      }
  4. DonationResponse

    • Type: object

    • Properties:

      • message (string): Success message indicating the donation was processed.

      • transactionId (string): The transaction ID of the donation.

    • Example:

      {
        "message": "You sent 10 SOL!",
        "transactionId": "TransactionIDHere"
      }
  5. ErrorResponse

    • Type: object

    • Properties:

      • message (string): Error message indicating what went wrong.

    • Example:

      {
        "message": "Invalid input: ensure account is a valid public key and amount is a number"
      }

Tags

  • NFT: Operations related to NFT minting.

  • Donation: Operations related to donations in SOL, USDC, BARK, and SPL tokens.

Last updated