views:

104

answers:

2

I am new to FreshBooks (not only the API) and I want to use it for some automatically generated invoices. I was trying to run some of the source code examples (the PHP and JS libraries in particular): http://developers.freshbooks.com/api/samplecode/

The problem is that I get an error message: "Connection error"

Do I need to set up anything else in the example files besides my API and token obtained from the FreshBooks site?

I am running the examples from a local server but I don't believe that's the problem.

+1  A: 

Hello Tuzo,

This is Shey from the FreshBooks dev. team, I'd love to help you with the problem. Can you paste the offending code here? Or if you like, you can email the code to me at [email protected], just mention my name in the subject and I'll take a look at it.

Cheers!

Shey Sewani

Shey Sewani
Hello! Thanks for the reply! It was me actually who asked the question (Tuzo just added the FreshBooks tag - thank you, Tuzo!), and I'm going to send you the code to the email provided right now.
Hristo
+1  A: 

I'm going to post Mr. Sewani's answer here, because I believe it can be useful to other people as well:

Sorry that you are having trouble with that library. I just tried myself and I get the same error from the Javascript+PHP library. I have checked that the servers are working properly, so I am quite convinced it is a bug in the library. Sorry that we led you astray there. I'll take a closer look and re-evaluate which libraries we list in the docs.

If you are comfortable switching languages, I would particularly recommend the Python or Ruby ones I mentioned before, as we have a number of people using those successfully.

Hopefully, the PHP and/or JS libraries will be fixed soon so the API can be used with these programming languages.

Hristo
So the problem is an existing defect. It would be great if you could update the answer if you hear back that it is fixed or there is some other work around.
Tuzo