Simple curl command fails with 40010 code

74 views
Skip to first unread message

Doug Ramirez

unread,
Oct 15, 2015, 10:06:29 AM10/15/15
to FreshBooks API (not monitored)
I am trying to execute a simple curl command to test out the FreshBooks API.  Here is the command (note that I've removed my token and my company name):

curl -u {my toekn}:X -X POST -d '<?xml version="1.0" encoding="utf-8"?><request method="staff.list"></request>' https://{my company name}-billing.freshbooks.com/api/2.1/xml-in

Here's what's returned:

<?xml version="1.0" encoding="utf-8"?>
<response xmlns="http://www.freshbooks.com/api/" status="fail">
  <error>Your XML is not formatted correctly.</error>
  <code>40010</code>
</response>

I've quadruple checked everything and can't for the life of me figure out why this won't work.  I know I'm authenticated, and I know that the XML is well-formed.  Any help is greatly appreciated.

Doug
Reply all
Reply to author
Forward
0 new messages