Login
Register
All Activity
Questions
Unanswered
Tags
Users
Ask a Question
Welcome to the Developer Q&A for the
MultiChain
blockchain platform.
Please feel free to ask questions about the platform to receive answers from the MultiChain developers or other members of the community.
Related questions
Can people combine multiple commands in one sentence?Thanks.
List all transactions for an asset
Streaming API for all transactions
How to use Multichain's one wallet for multiple addresses
Can we define different transaction types with different set of miners for each?
4,157
questions
4,370
answers
5,718
comments
Most popular tags
multichain
streams
assets
stream
transactions
json-rpc
blockchain
wallet
permissions
error
address
raw-transactions
asset
mining
node
api
issue
multichain-explorer
nodes
connect
multichaind
multisig
transaction
smart-filters
metadata
private-key
atomic-exchange
multichain-cli
multichain-web-demo
data
connection
performance
blocks
demo
web
json
database
storage
native-currency
bitcoin
private-blockchain
network
fee
smart-contracts
wallets
signrawtransaction
off-chain
exchange
multiple-nodes
getnewaddress
Can people define one Java model for all the MultiChain’s reply?Thanks.
+1
vote
When I call MultiChain API command, is there any uniform format for MultiChain’s reply? So I can define one Java model for all the results. Or is it different format for different API command?
api
asked
Jul 5, 2016
by
Helen
Please
log in
or
register
to add a comment.
Please
log in
or
register
to answer this question.
1 Answer
0
votes
The responses are all in JSON format, so if you find a Java library for decoding JSON, it should make the MultiChain API quite easy to use.
answered
Jul 7, 2016
by
MultiChain
Thanks. I have 2 further questions.
1) For all the MultiChain API command, when we get the reply. After decoding JSON, I am considering the unified Java object for the response. Is it possible?
No matter whether we get success or failure result, we will always have the field “result”, “error” and “id”? Is the understanding right?
2) Is it possible to have a unified Java object for the MultiChain request?
I am think all the request needs and only needs these field ”method”,”params” ,”id” ,”chain_name”. Is it correct? Thanks.
I'm not sure what you mean by "unified Java object". But you should always have the field "id", and a "result" or "error" depending on whether the call was successful.
Hi Helen,
Yes it's possible to create a generic pojo to request data and read data.
The request pojo it's easy and needs only the params that you described, the response pojo it's a bit more complex but if you use generics should not be hard to do it.
Please
log in
or
register
to add a comment.
...