Hi,
Uploading a statement through the API is slightly different to other
requests in that it’s submitted as a url-encoded form post rather than as
JSON or XML. The only field that should be submitted is the statement field
which should contain the URL encoded file that you wish to upload. As the
docs at FreeAgent Developer Dashboard say, an OXF format
is strongly preferred.
Regards,
Harry MillsOn Tue, Apr 2, 2013 at 7:04 AM, binay.kumar@webequator.com wrote:
Hi,
I want to know what are the data fields to send for upload a bank
statement, Freeagent does not mention in Doc
please brief me about uploading a bank statement.Thanks
On Monday, July 23, 2012 3:07:12 PM UTC+5:30, Graeme Boyd wrote:
Hi James,
The data is sent essentially as a form parameter. Include the statement
data as a url encoded parameter “statement”, don’t convert it to JSON or
XML.For example:
curl -H “Authorization: Bearer XXXXXXXXX”
-H “Accept: application/json”
–data-urlencode statement@statement.csv
-X POST
https://api.freeagent.com/v2/**bank_transactions/statement?**
bank_account=https://api.**freeagent.com/v2/bank_**accounts/123https://api.freeagent.com/v2/bank_transactions/statement?bank_account=https://api.freeagent.com/v2/bank_accounts/123If you’re not familiar with the statement@statement.csv above, from the
Curl docs:“name@filename
This will make curl load data from the given file (including any
newlines), URL-encode that data and pass it on in the
POST. The name part gets an equal sign appended, resulting in
name=urlencoded-file-content. Note that the name is
expected to be URL-encoded already.”The same will work for OFX statements. Another potential caveat is to
watch what headers you’re sending the server. Many other API calls require
the Content-Type to be set to application/xml or application/json, but in
this case that will probably prevent the upload from being understood. In
my above example, curl is setting the Content-Type
to application/x-www-form-**urlencoded transparently.Kind regards,
Graeme
On 20 July 2012 20:23, James Lawrence jlaw...@googlemail.com wrote:
Hi there, according to the API documentation it should be possible to
upload a statement in OFX or CSV format ( https://dev.freeagent.com/**
docs/bank_transactions#upload-a-bank-account-statement-to-a-
certain-bank-accounthttps://dev.freeagent.com/docs/bank_transactions#upload-a-bank-account-statement-to-a-certain-bank-account).
Unfortunately after playing around with a few hours, I can’t work out how
to send the “statement” data.Is it sent as JSON/XML, if so then as what type? (I attempted sending it
as JSON as a byte and that failed), or is it sent as HTTP form data?I’d be glad of any advice. Many thanks!
–
You received this message because you are subscribed to the Google
Groups “FreeAgent API” group.
To view this discussion on the web visit https://groups.google.com/d/**
msg/freeagent_api/-/**RD3PaZrJXAwJhttps://groups.google.com/d/msg/freeagent_api/-/RD3PaZrJXAwJ
.To post to this group, send email to freeag...@googlegroups.com**.
To unsubscribe from this group, send email to freeagent_ap…@**
googlegroups.com.
For more options, visit this group at http://groups.google.com/**
group/freeagent_api?hl=enhttp://groups.google.com/group/freeagent_api?hl=en
.–
Graeme Boyd
Senior Software EngineerWeb. freeagent.com http://www.freeagent.com/ Blog. The FreeAgent Blog - FreeAgent
Twitter. @freeagent https://twitter.com/#!/freeagent Facebook.
Facebook http://facebook.com/freeagentapp40 Torphichen Street, Edinburgh, EH3 8JB
FreeAgent Central Ltd. Registered in sunny Scotland SC316774–
You received this message because you are subscribed to the Google Groups
“FreeAgent API” group.
To unsubscribe from this group and stop receiving emails from it, send an
email to freeagent_api+unsubscribe@googlegroups.com.
To post to this group, send email to freeagent_api@googlegroups.com.
Visit this group at http://groups.google.com/group/freeagent_api?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.