GetData

Get Data from a supported web3 storage provider

Description

Search the Storedat API directly for data. The difference between this method and the provider specific query methods is that this queries the Storedat API indexing system.

Only data uploaded through the CreateData method will be available to retrieve through this endpoint. Data previously or externally uploaded should be queried through the provider specific methods outlined prior in this section.

Arguments

Input
Description

groupId

The unique grouping id identifying the data you use to store your data. You can use this to group related data that you want to store together (i.e. NFT project metadata, content to a given entity). Should only include alphanumerical characters and the - character

metadata

An array of key/value pairs representing the metadata of your data

sort

Used to specify a sort order by block inclusion time.

limit

Optional field to specify the number of results to be returned. If omitted, all results under the given groupId will be returned

Response Details

Detail
Description

providerId

The identifier of the content provided by the underlying storage protocol i.e transactionID, CID

data

String representation of the data

Note: Data of the types listed below will be return as a string:

  • application/json

  • text/html

  • text/plain

All other MIME types will have data returned as the url pointing to that content on the underlying storage protocol

url

The url pointing to the content hosted on the underlying storage protocol

provider

The web3 storage solution the data is stored.

metadata

An array of key/value pairs representing the metadata of your data

creationTimestamp

The time of creation of your data

errorMessage

An error message if an issue occurs while mutating your data

Request Headers

Header
Description

client-id

An identifier representing you as a user of the API. This will be provided to you upon signing up for the beta program

Authorization

Your API Key required to be able to interact with this method. This will be provided to you upon signing up for the beta program

Sample Query

query {
  GetData(
    groupId: "your-group-id-here",
    sort: DESC,
    limit: 1
  ) {
    data
    providerId
    url
    creationTimestamp
    metadata {
      name
      value
    }
    provider
  }
}

Sample Response

{
  "data": {
    "GetData": [
      {
        "data": "{'perma': 'storedat'}",
        "providerId": "0pyv5KdH0MV1IhxXFRq7oiQkglslEIH1NrpNcFdAbv4",
        "url": "https://www.arweave.net/0pyv5KdH0MV1IhxXFRq7oiQkglslEIH1NrpNcFdAbv4",
        "creationTimestamp": "2022-12-09T05:54:22.575141+00:00",
        "metadata": [
          {
            "name": "key1",
            "value": "value1"
          },
          {
            "name": "key2",
            "value": "value2"
          }
        ],
        "provider": "ARWEAVE"
      }
    ]
  }
}

Last updated