You are not logged in.

#1 Oct 30/2009 2:45 pm

jberesford
Member
Registered: Oct 30/2009
Posts: 11

Cannot add clients or items via the API. We can get clients fine.

Getting this error response
Missing request element
When trying to create.item or create.client

We have been able to get the list, etc. but cannot create.

We have been using the sample XML from the doc, first without change then striping down but always gets the same 'Missing request element'

I am not sure what is missing.
The brackets removed but here is the XML.
?xml version="1.0" encoding="utf-8"?
REQUEST method="item.create"
  ITEM
    NAME>Fuzzy Slippers</NAME
    DESCRIPTION>Extra soft</DESCRIPTION
    UNIT_COST>59.99</UNIT_COST
    QUANTITY>1</QUANTITY
    INVENTORY>10</INVENTORY
  /ITEM
/REQUEST

What is different with create vs list and get?
What does this mean?
Staff have access to the API calls listed below if the Invoices tab is enabled for staff.
In the Item doc and similar for clients
Staff have access to the API calls listed below if the Clients tab is enabled for staff. Each staff member can create clients, and view and edit clients that they are assigned to.

What am I missing in our item.create????

Offline

 

#2 Oct 30/2009 4:12 pm

Fresh Owen
Staff
Registered: Feb 2/2009
Posts: 33

Re: Cannot add clients or items via the API. We can get clients fine.

Hi jberesford, and welcome to the forums!

XML is a case-sensitive language. Compare:

Code:

$ curl https://******.freshbooks.com/api/2.1/xml-in --data '<REQUEST method="item.create">
>   <ITEM>
>     <NAME>Fuzzy Slippers</NAME>
>     <DESCRIPTION>Extra soft</DESCRIPTION>
>     <UNIT_COST>59.99</UNIT_COST>
>     <QUANTITY>1</QUANTITY>
>     <INVENTORY>10</INVENTORY>
>   </ITEM>
> </REQUEST>
> '

<?xml version="1.0" encoding="utf-8"?>
<response xmlns="http://www.freshbooks.com/api/" status="fail">
  <error>Missing request element.</error>
</response>

Code:

$ curl https://*******.freshbooks.com/api/2.1/xml-in --data '<request method="item.create">
>   <item>
>     <name>Fuzzy Slippers</name>
>     <description>Extra soft</description>
>     <unit_cost>59.99</unit_cost>
>     <quantity>1</quantity>
>     <inventory>10</inventory>
>   </item>
> </request>
> '

<?xml version="1.0" encoding="utf-8"?>
<response xmlns="http://www.freshbooks.com/api/" status="ok">
  <item_id>4</item_id>
</response>

Your XML is fine, other than that!

Hope that helps,


Owen

Any insufficiently-advanced magic is indistinguishable from technology.

Offline

 

#3 Oct 30/2009 4:15 pm

jberesford
Member
Registered: Oct 30/2009
Posts: 11

Re: Cannot add clients or items via the API. We can get clients fine.

I found out a little while ago that it needs to be lower case.  I just straight copied the XML from the doc. So the doc on their web site is wrong.

Thanks

Offline

 

#4 Oct 30/2009 4:16 pm

Fresh Owen
Staff
Registered: Feb 2/2009
Posts: 33

Re: Cannot add clients or items via the API. We can get clients fine.

Can you give me a link to the docs you were copying? I can probably have that fixed -- broken docs are a bad thing. smile

-o


Owen

Any insufficiently-advanced magic is indistinguishable from technology.

Offline

 

#5 Oct 30/2009 6:33 pm

jberesford
Member
Registered: Oct 30/2009
Posts: 11

Re: Cannot add clients or items via the API. We can get clients fine.

ALL of the doc has tags in caps. Every example that I have seen.

http://developers.freshbooks.com/api/vi … ent.create
http://developers.freshbooks.com/api/view/items/

I didn't see any in lower case.

Offline

 

#6 Nov 2/2009 10:13 am

Fresh Owen
Staff
Registered: Feb 2/2009
Posts: 33

Re: Cannot add clients or items via the API. We can get clients fine.

Huh, that's weird. They're written in lowercase in the docs source, and I only see lowercase elements on those pages. Can you send us a screenshot? It's probably a bug in the CMS, and if I can see what's going on I might be able to get it fixed.

Cheers,


Owen

Any insufficiently-advanced magic is indistinguishable from technology.

Offline

 

#7 Nov 2/2009 10:26 am

jberesford
Member
Registered: Oct 30/2009
Posts: 11

Re: Cannot add clients or items via the API. We can get clients fine.

Ok, but I need some techincal answers first.

Our QuickBooks add-on, the Shopping Cart Integrator will be expanded to create Customers, Items, Invoices, Payments and Estimates in FreshBooks from QuickBooks.
See http://www.aaatex.com/QuickBooks_Shoppi … r_Cart.htm

We need some place to store internal data that the client cannot see. Where can we put internal info???

Also I do not see a place to upload or attached an image.  I even tried clicking on email. No attached or upload button that I can see.

How can I send the image to you???

Jack

Offline

 

#8 Nov 2/2009 1:01 pm

Fresh Grace
The Invoice of Reason
Registered: Jul 21/2008
Posts: 887

Re: Cannot add clients or items via the API. We can get clients fine.

Hi jberesford,

You can store internal notes (not visible to clients) in the <notes> tag when you create or update a client. 

Regarding the image, you can send it over to support@freshbooks.com.  Even better if you include a link to this forum thread. smile

Offline

 

#9 Nov 2/2009 1:07 pm

jberesford
Member
Registered: Oct 30/2009
Posts: 11

Re: Cannot add clients or items via the API. We can get clients fine.

Has been sent.  So notes is not visible to the client. Is that true for the transactions as well?

Offline

 

#10 Nov 3/2009 5:50 pm

Fresh Grace
The Invoice of Reason
Registered: Jul 21/2008
Posts: 887

Re: Cannot add clients or items via the API. We can get clients fine.

Hmmm, not sure what you mean, jberesford.

Notes for transactions not being visible to clients?  Are you talking about the notes when you enter a payment for an invoice?

Offline

 

#11 Nov 3/2009 5:56 pm

jberesford
Member
Registered: Oct 30/2009
Posts: 11

Re: Cannot add clients or items via the API. We can get clients fine.

I am asking you what field can I use in lists like customers or transactions like invoices, payments, estimates that can be set but no seen by clients. This is based on your reply 'You can store internal notes (not visible to clients) in the <notes> tag when you create or update a client. '

Offline

 

#12 Nov 4/2009 9:42 am

Fresh Grace
The Invoice of Reason
Registered: Jul 21/2008
Posts: 887

Re: Cannot add clients or items via the API. We can get clients fine.

Ahh, I see.

There's actually no field for internal notes on invoices, payments or estimates.  The internal notes only exist for clients.

Offline

 

#13 Nov 4/2009 9:56 am

jberesford
Member
Registered: Oct 30/2009
Posts: 11

Re: Cannot add clients or items via the API. We can get clients fine.

I'm confused.
Your doc for invoices has
Notes (Optional)
NOTES>Due upon receipt./NOTES

These notes are or are not seen by clients???
but from above you wrote
You can store internal notes (not visible to clients) in the <notes> tag when you create or update a client. 

So Notes for Clients are NOT seen by clients but Notes for Invoices, etc. are seen by clients.

Jack

Offline

 

#14 Nov 4/2009 1:30 pm

Fresh Grace
The Invoice of Reason
Registered: Jul 21/2008
Posts: 887

Re: Cannot add clients or items via the API. We can get clients fine.

jberesford wrote:

So Notes for Clients are NOT seen by clients but Notes for Invoices, etc. are seen by clients.

I can see how that can be confusing... but you got it!

The notes for invoices are the notes that are visible at the bottom of the invoice.

The notes for clients are internal notes that cannot be seen by clients.

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2008 PunBB