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:

  • Response:

    • 200 OK:

    • 400 Bad Request:

    • 500 Internal Server Error:

3. Donate USDC

  • Endpoint: /api/donate/usdc

  • Method: POST

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

  • Request Body:

  • Response:

    • 200 OK:

    • 400 Bad Request:

    • 500 Internal Server Error:

4. Donate BARK

  • Endpoint: /api/donate/bark

  • Method: POST

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

  • Request Body:

  • Response:

    • 200 OK:

    • 400 Bad Request:

    • 500 Internal Server Error:

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:

  2. MintNftResponse

    • Type: object

    • Properties:

      • message (string): Success message.

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

    • Example:

  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:

  4. DonationResponse

    • Type: object

    • Properties:

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

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

    • Example:

  5. ErrorResponse

    • Type: object

    • Properties:

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

    • Example:

Tags

  • NFT: Operations related to NFT minting.

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

Last updated