Data for Account  [Go SDK]

This endpoint represents a single data associated with a given account.

Request

GET /accounts/{account}/data/{key}

Arguments

name notes description example
key required, string Key name user-id

curl Example Request

curl "https://frontier.testnet.digitalbits.io/accounts/GDFOHLMYCXVZD2CDXZLMW6W6TMU4YO27XFF2IBAFAV66MSTPDDSK2LAY/data/user-id"

JavaScript Example Request

var DigitalBitsSdk = require('xdb-digitalbits-sdk');
var server = new DigitalBitsSdk.Server('https://frontier.testnet.digitalbits.io');

server.accounts()
  .accountId("GDFOHLMYCXVZD2CDXZLMW6W6TMU4YO27XFF2IBAFAV66MSTPDDSK2LAY")
  .call()
  .then(function (account) {
    return account.data({key: 'user-id'})
  })
  .then(function(dataValue) {
    console.log(JSON.stringify(dataValue))
  })
  .catch(function (err) {
    console.log(err)
  })

Response

This endpoint responds with a value of the data field for the given account. See data resource for reference.

Example Response

{
  "value": "WERCRm91bmRhdGlvbg=="
}

Possible Errors

  • The standard errors.
  • not_found: A not_found error will be returned if there is no account whose ID matches the account argument or there is no data field with a given key.

Edit this doc in GitHub

THE FUTURE OF LOYALTY STARTS HERE

Stay up to date on the latest happenings at DigitalBits. Get the latest news.