Interacting with the HIVE blockchain API using Postman

avatar

These days I've been playing around with the API of the Hive blockchain in order to retrieve different data available and maybe find some new use cases. As I am a QA-Testing Software Engineer I've tried to interact with the API by using the tools that I am most accustomed to and one of them is Postman. I've looked up in the documentation related to the JSON RPC API from the Hive Developer Portal and found some samples about the available endpoints and how to send data to them. For example, get_account_reputations can be invoked using curl with the following command: curl -s --data '{"jsonrpc":"2.0", "method":"condenser_api.get_accounts", "params":[["hiveio"]], "id":1}' https://api.hive.blog.

image.png

With the given sample, I've moved to Postman, and added the api.hive.blog endpoint and gave it a try. But unexpectedly I got back a "Parse error" and I kinda was stuck at this point. I've tried different ways to POST data to the API, and changed parameters, but I had the same results. When I had no more ideas I went to the Hive Developers Discord server and posted a question about the issue that I was facing. And fast and luckily enough I was guided to what the problem might be and what I needed to do to solve this: instead of having the Body parameters set as "x-www-form-urlencoded" (which is the Default) to have it as raw.

image.png

And magically it worked and I could POST data on the HIVE API using Postman. I've written this post as even if I searched for a solution to it by targeting hive.blog content, I could find the solution for it. Hopefully, this will help somebody else.

Posted Using LeoFinance Beta



0
0
0.000
4 comments