Error 40120 on Time Entry Create

185 views
Skip to first unread message

Spetz83

unread,
Jun 4, 2012, 12:16:11 PM6/4/12
to FreshBooks API
Hi,

I am getting the following response when attempting to create a time
entry using the API:

<response xmlns="http://www.freshbooks.com/api/" status="fail">
<error>Invalid node: project_id.</error>
<code>40120</code>
<field>project_id</field>
</response>

The XML that I am sending to the system looks like this:
<request method="time_entry.create">
<time_entry>
<project_id>
1120
</project_id>
<task_id>
98
</task_id>
<hours>
3
</hours>
<notes>
Some notes here.
</notes>
</time_entry>
</request>

I really need to know what is going on here. I know that project ID is
correct because I can use it successfully to retrieve a list of hours
for that project.

As far as I can tell, Freshbooks has not provided a list of error
codes and what they mean yet. I found one other thread requesting this
back in February and the response was that the list was not final.

Any help will be greatly appreciated.

Thanks

Tom

Sébastien Atoch

unread,
Jun 4, 2012, 7:47:18 PM6/4/12
to freshbo...@googlegroups.com
Hi Tom, 

Maybe you should try to get rid of the carriage return between the XML tags.
It may confuse the parser somehow.
Sebastien - 


<request method="time_entry.create"> 
   <time_entry> 
     <project_id>1120</project_id> 
     <task_id>98</task_id> 
     <hours>3</hours> 
     <notes>Some notes here.</notes> 
   </time_entry> 
</request> 

Spetz83

unread,
Jun 5, 2012, 1:28:31 PM6/5/12
to FreshBooks API
Thanks for the suggestion. That doesn't work though. I would be sad if
their parser didn't ignore whitespace though.

Sébastien Atoch

unread,
Jun 5, 2012, 1:40:19 PM6/5/12
to freshbo...@googlegroups.com
Your markup looks valid.
Another idea :  a permission issue ?  Some users are not allowed to track time (see Settings / Permissions)
Also did you try with another project ?

@Freshbooks : I would also like to get a list of errors code, even if it's not final.

Nox Dineen (FreshBooks)

unread,
Jun 5, 2012, 2:43:34 PM6/5/12
to freshbo...@googlegroups.com
Sebastien is right, the XML looks correct. Could you email a...@freshbooks.com with your account info and specify which user's API credentials you're using for the time_entry.create attempt?

I can't give you the complete error code list (yet!), but I can at least give you some general guidelines:

- Starts with '1' - General error
- Starts with '2' - Authentication error
- Starts with '3' - Authorization error
- Starts with '4' - Validation error
- Starts with '5' - Processing error

Cheers,
Nox  :)

Spetz83

unread,
Jun 5, 2012, 2:50:38 PM6/5/12
to FreshBooks API
The create method works now.... I didn't change anything though so it
isn't clear what is going on.

This api has been public facing for over a year... how long does it
take to post a list of error codes? You could at least post what you
have and add on to the list as more become available.

People have been asking for the error codes since at least February.
The errors that are returned do not provide much useful information
either.

Thanks for the attempt at help though.

Tom

On Jun 5, 1:43 pm, "Nox Dineen (FreshBooks)" <n...@freshbooks.com>
wrote:
Reply all
Reply to author
Forward
0 new messages