How to use the cURL command to get asset information?

Try this:

curl http://localhost:4000/api/ --user rpc:1234 -H 'Content-Type: application/json; charset=UTF-8' -H 'Accept: application/json, text/javascript' --data-binary '{"jsonrpc":"2.0","id":0,"method":"get_asset_info","params": {"assets": ["CP_ASSET_NAME"]}}' 

Where:

  • URL - API server accessible to your client (in this case, localhost)

  • user - default user name (rpc, can be any other name) to access counterparty daemon (by default stored in counterparty-server.conf and counterparty-server.testnet.conf)

  • password - password (1234, should be a more complex one) for the rpc user (by default it stored in the counterparty config file(s))

  • H - HTML headers

  • data-binary - data passed to Counterparty API

  • method: get_asset_info function - gets information on an asset name (see Counterparty API)

  • parameters: for this method requires asset <NAME>, which specifies queried asset name (use a real asset name such as XCP)