Data for Account

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/GA2HGBJIJKI6O4XEM7CZWY5PS6GKSXL6D34ERAJYQSPYA6X6AI7HYW36/data/user-id"

JavaScript Example Request

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

server.accounts()
  .accountId("GAKLBGHNHFQ3BMUYG5KU4BEWO6EYQHZHAXEWC33W34PH2RBHZDSQBD75")
  .call()
  .then(function (account) {
    return account.data({key: 'user-id'})
  })
  .then(function(dataValue) {
    console.log(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": "MTAw"
}

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.