# JSON-API connection problems

**URL:** <https://forums.counterparty.io/t/json-api-connection-problems/51>\
**Category:** Counterparty\
**Created:** [February 3, 2014, 2:04pm UTC](https://forums.counterparty.io/t/json-api-connection-problems/51 "2014-02-03T14:04:59Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![cryptrol](https://avatars.discourse-cdn.com/v4/letter/c/b5ac83/32.png) [@cryptrol](https://forums.counterparty.io/u/cryptrol)\
**Post date:** [February 3, 2014, 2:04pm UTC](https://forums.counterparty.io/t/json-api-connection-problems/51/1 "2014-02-03T14:04:59Z")

</div>

I am working on a web. frontend for counterparty and having problems connecting to the RPC server. The response I am getting from the RPC object is   
  
[tt]Incorrect response id (request id: 1, response id:[/tt]  
  
  
I have the daemon listening on default port 4000 and rpc username and password set in the counterpartyd.conf file.  
Am I missing something ? I am connecting from the localhost.

---

<div class="post-metadata">

**Author:** ![robby\_dermody](https://yyz2.discourse-cdn.com/flex004/user_avatar/forums.counterparty.io/robby_dermody/32/226_2.png) [@robby\_dermody](https://forums.counterparty.io/u/robby_dermody)\
**Post date:** [February 3, 2014, 7:35pm UTC](https://forums.counterparty.io/t/json-api-connection-problems/51/2 "2014-02-03T19:35:12Z")

</div>

> [@](#):
>
> I am working on a web. frontend for counterparty and having problems connecting to the RPC server. The response I am getting from the RPC object is   
>   
> [tt]Incorrect response id (request id: 1, response id:[/tt]  
>   
>   
> I have the daemon listening on default port 4000 and rpc username and password set in the counterpartyd.conf file.  
> Am I missing something ? I am connecting from the localhost.

---

<div class="post-metadata">

**Author:** ![cryptrol](https://avatars.discourse-cdn.com/v4/letter/c/b5ac83/32.png) [@cryptrol](https://forums.counterparty.io/u/cryptrol)\
**Post date:** [February 4, 2014, 2:20am UTC](https://forums.counterparty.io/t/json-api-connection-problems/51/3 "2014-02-04T02:20:16Z")

</div>

Thanks xnova, I may be using a PHP json RPC library which does not support the 2.0 spec, and does not correctly encodes the payload.  
Will try to find another.  
  
  
Thank you again.

---

<div class="post-metadata">

**Author:** ![cryptrol](https://avatars.discourse-cdn.com/v4/letter/c/b5ac83/32.png) [@cryptrol](https://forums.counterparty.io/u/cryptrol)\
**Post date:** [February 4, 2014, 11:09am UTC](https://forums.counterparty.io/t/json-api-connection-problems/51/4 "2014-02-04T11:09:17Z")

</div>

I have successfully built a front end that uses the get\_balances and get\_address JSON-RPC API calls (will make it public as soon as I get more functionalities).  
I had to write my own json-rpc library using curl and basic auth since none of what I was able to find worked for me.  
If someone finds a PHP JSON-RPC library which works with counterparty please report it, since I don’t want to reinvent the wheel and this must have been done a thousand of times.

---

<div class="post-metadata">

**Author:** ![l8orre](https://avatars.discourse-cdn.com/v4/letter/l/45deac/32.png) [@l8orre](https://forums.counterparty.io/u/l8orre)\
**Post date:** [February 5, 2014, 3:13am UTC](https://forums.counterparty.io/t/json-api-connection-problems/51/5 "2014-02-05T03:13:49Z")

</div>

Hey Guys, I seem to have an issue with the proper jsonrpc lib …  
&nbsp; &nbsp;   
 edit - the bugs with setuptools were related to s.t. weird in the python setuptools and pip, not to jsonrpc.  
  
now I still have to find out which jsonrpc counterpartyd is using …  
  
any hints would be appreciated&nbsp; ??? (went over to the technical thread)

---

<div class="post-metadata">

**Author:** ![cryptrol](https://avatars.discourse-cdn.com/v4/letter/c/b5ac83/32.png) [@cryptrol](https://forums.counterparty.io/u/cryptrol)\
**Post date:** [February 5, 2014, 5:16am UTC](https://forums.counterparty.io/t/json-api-connection-problems/51/6 "2014-02-05T05:16:20Z")

</div>

You may double check if you have all the dependencies installed.  
Although you are on bleeding edge Ubuntu, that’s asking for problems&nbsp; ???   
By the way you should start a new post since this is unrelated to the JSON-RPC API and may find better answers elsewhere.  
  
  
Good luck.

---

<div class="post-metadata">

**Author:** ![robby\_dermody](https://yyz2.discourse-cdn.com/flex004/user_avatar/forums.counterparty.io/robby_dermody/32/226_2.png) [@robby\_dermody](https://forums.counterparty.io/u/robby_dermody)\
**Post date:** [February 6, 2014, 8:04am UTC](https://forums.counterparty.io/t/json-api-connection-problems/51/7 "2014-02-06T08:04:54Z")

</div>

[quote author=cryptrol link=topic=27.msg140#msg140 date=1391530157]  
I have successfully built a front end that uses the get\_balances and get\_address JSON-RPC API calls (will make it public as soon as I get more functionalities).  
I had to write my own json-rpc library using curl and basic auth since none of what I was able to find worked for me.  
If someone finds a PHP JSON-RPC library which works with counterparty please report it, since I don’t want to reinvent the wheel and this must have been done a thousand of times.  
[/quote]  
  
  
If you do find one that works, as well as have an example of a working API call to counterpartyd using PHP, please post it here and I’ll get it into the API docs.

---

<div class="post-metadata">

**Author:** ![robby\_dermody](https://yyz2.discourse-cdn.com/flex004/user_avatar/forums.counterparty.io/robby_dermody/32/226_2.png) [@robby\_dermody](https://forums.counterparty.io/u/robby_dermody)\
**Post date:** [February 28, 2014, 12:29pm UTC](https://forums.counterparty.io/t/json-api-connection-problems/51/8 "2014-02-28T12:29:13Z")

</div>

Added a PHP example here: [http://counterpartyd.readthedocs.org/en/develop/API.html#php-example](http://counterpartyd.readthedocs.org/en/develop/API.html#php-example)  
  
  
(thanks to cryptrol that posted something like it originally on BCT!)
