# Get started with CoinDaddy Public Server

**URL:** <https://forums.counterparty.io/t/get-started-with-coindaddy-public-server/1922>\
**Category:** Support\
**Created:** [March 22, 2016, 12:21pm UTC](https://forums.counterparty.io/t/get-started-with-coindaddy-public-server/1922 "2016-03-22T12:21:05Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![JPJA](https://yyz2.discourse-cdn.com/flex004/user_avatar/forums.counterparty.io/jpja/32/1324_2.png) [@JPJA](https://forums.counterparty.io/u/JPJA)\
**Post date:** [March 22, 2016, 12:21pm UTC](https://forums.counterparty.io/t/get-started-with-coindaddy-public-server/1922/1 "2016-03-22T12:21:05Z")

</div>

@jdogresorg

I tried to connect to the public counterparty server - [https://coindaddy.io/public-development-servers](https://coindaddy.io/public-development-servers) - with the sample PHP script. Got error:

`Warning: strpos() expects parameter 1 to be string, array given in /home/xcpprjbs/public\_html/dex/JsonRPC/src/JsonRPC/Client.php on line 319

Fatal error: Class ‘JsonRPC\AccessDeniedException’ not found in /home/xcpprjbs/public\_html/dex/JsonRPC/src/JsonRPC/Client.php on line 320`

I used this JsonRPC library : [https://github.com/fguillot/JsonRPC](https://github.com/fguillot/JsonRPC)

I’m not that familiar with PHP. Should the script be installed? I only uploaded the folder.

---

<div class="post-metadata">

**Author:** ![JPJA](https://yyz2.discourse-cdn.com/flex004/user_avatar/forums.counterparty.io/jpja/32/1324_2.png) [@JPJA](https://forums.counterparty.io/u/JPJA)\
**Post date:** [March 22, 2016, 1:24pm UTC](https://forums.counterparty.io/t/get-started-with-coindaddy-public-server/1922/2 "2016-03-22T13:24:06Z")

</div>

After adding `require 'JsonRPC/src/JsonRPC/AccessDeniedException.php';` it prints this error:

`Warning: strpos() expects parameter 1 to be string, array given in /home/xcpprjbs/public\_html/dex/JsonRPC/src/JsonRPC/Client.php on line 319

Fatal error: Uncaught exception ‘JsonRPC\AccessDeniedException’ with message ‘Response: Array’ in /home/xcpprjbs/public\_html/dex/JsonRPC/src/JsonRPC/Client.php:320 Stack trace: #0 /home/xcpprjbs/public\_html/dex/JsonRPC/src/JsonRPC/Client.php(350): JsonRPC\Client-\>handleHttpErrors(Array) #1 /home/xcpprjbs/public\_html/dex/JsonRPC/src/JsonRPC/Client.php(211): JsonRPC\Client-\>doRequest(Array) #2 /home/xcpprjbs/public\_html/dex/index.php(12): JsonRPC\Client-\>execute(‘get\_running\_inf…’) #3 {main} thrown in /home/xcpprjbs/public\_html/dex/JsonRPC/src/JsonRPC/Client.php on line 320`

---

<div class="post-metadata">

**Author:** ![loon3](https://yyz2.discourse-cdn.com/flex004/user_avatar/forums.counterparty.io/loon3/32/1018_2.png) [@loon3](https://forums.counterparty.io/u/loon3)\
**Post date:** [March 22, 2016, 1:28pm UTC](https://forums.counterparty.io/t/get-started-with-coindaddy-public-server/1922/3 "2016-03-22T13:28:01Z")

</div>

Use the library here [http://jsonrpcphp.org/](http://jsonrpcphp.org/)

---

<div class="post-metadata">

**Author:** ![jdogresorg](https://yyz2.discourse-cdn.com/flex004/user_avatar/forums.counterparty.io/jdogresorg/32/1349_2.png) [@jdogresorg](https://forums.counterparty.io/u/jdogresorg)\
**Post date:** [March 22, 2016, 3:00pm UTC](https://forums.counterparty.io/t/get-started-with-coindaddy-public-server/1922/4 "2016-03-22T15:00:47Z")

</div>

Thanks loon… I was just about to point him to [jsonrpcphp.org](http://jsonrpcphp.org)… but looks like your on top of it 😉

---

<div class="post-metadata">

**Author:** ![JPJA](https://yyz2.discourse-cdn.com/flex004/user_avatar/forums.counterparty.io/jpja/32/1324_2.png) [@JPJA](https://forums.counterparty.io/u/JPJA)\
**Post date:** [March 23, 2016, 3:12pm UTC](https://forums.counterparty.io/t/get-started-with-coindaddy-public-server/1922/5 "2016-03-23T15:12:05Z")

</div>

Good news! Did some more testing and CoinDaddy’s example script works from my local computer (I use XAMPP to run PHP).

When running on the web server I still get error  
`Fatal error: Uncaught exception 'JsonRPC\AccessDeniedException'`  
It may be that CoinDaddy blocks the web host I’m using (namecehap)?

I used [https://github.com/fguillot/JsonRPC](https://github.com/fguillot/JsonRPC) but will try [http://jsonrpcphp.org](http://jsonrpcphp.org) whenever that’s needed. Thanks for the tip!

---

<div class="post-metadata">

**Author:** ![JPJA](https://yyz2.discourse-cdn.com/flex004/user_avatar/forums.counterparty.io/jpja/32/1324_2.png) [@JPJA](https://forums.counterparty.io/u/JPJA)\
**Post date:** [March 23, 2016, 7:48pm UTC](https://forums.counterparty.io/t/get-started-with-coindaddy-public-server/1922/6 "2016-03-23T19:48:23Z")

</div>

Here’s the example code with `pre` tags and `print_r` for more human friendly output:

```auto
<pre lang="php"><?php
require 'JsonRPC/src/JsonRPC/Client.php'; //https://github.com/fguillot/JsonRPC
use JsonRPC\Client;
$client = new Client('http://public.coindaddy.io:4000/api/');
$client->authentication('rpc', '1234');
</pre>
`print("<pre>");`
<pre lang="php">
$result = $client->execute('get_balances', array('filters' => array('field' => 'address', 'op' => '==', 'value' => '1NFeBp9s5aQ1iZ26uWyiK2AYUXHxs7bFmB')));
print("get_balances result:\n");
print_r($result);

$result2 = $client->execute('get_running_info');
print("get_running_info result:\n");
print_r($result2);
</pre>
`print("</pre>");`
<pre lang="php">
?></pre>

```
