Freeagent & Spendmap

Hello,

Just wondering if any one has had any experience in interfacing Freeagent &
Spendmap (http://www.spendmap.com/), or any other non-API software?

I’ve got the API working in Google Playground but I’m not sure how/or if
its possible to POST from Spendmap or a bridge file of some sort to
Freeagent. Any help/pointers would be greatly appreciated.

Regards,
Karl

Hi Karl,

Sorry but at this time it’s not possible to create multiple bills in one
request. Instead you can make a series of requests, one for each bill you
wish to create.

Regards,
Harry

Regards,
Harry MillsOn Thu, Jun 20, 2013 at 12:22 PM, Karl Sayle karlsayle@gmail.com wrote:

Hi all,

Just another quick question, is it possible to POST multiple Bills with
one Curl execution? If not, what the best way to achieve this?

Thanks again,

Karl


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.
For more options, visit https://groups.google.com/groups/opt_out.

Hi Karl,

The formatting shouldn’t matter as long as it’s correct JSON – which yours
is.

Looking at your curl request the only problem I can spot is that the data
passed to the -d option is not quoted. I’d suggest quoting the whole JSON
content and escaping the inner quotes (e.g. -d “{"bill": …}”).
Alternatively, you can put the data in a file and specify it as a path to
curl like this: -d @/path/to/file.

Let me know if this fixes your problem.

Regards,
IoanOn Wednesday, 19 June 2013 16:13:42 UTC+1, Karl Sayle wrote:

Hi Loan,

Here the complete line im entering into Curl:

curl -X POST https://api.sandbox.freeagent.com/v2/bills -H
“Authorization: Bearer XX(CORRECTCODEENTEREDHERE)XX” -H “Accept:
application/json” -H “Content-Type: application/json” -d { “bill”:{
“contact”:"https://api.sandbox.freeagent.com/v2/contacts/1835/
",“category”:“https://api.sandbox.freeagent.com/v2/categories/285/",“reference”:“curlpost”,“dated_on”:“2013-06-17”,“due_on”:“2013-07-14”,“total_value”:“10000.0”,“sales_tax_rate”:"20.0
}}

Also, when using Curl do I enter as above, ie on one line or formatted on
to separate lines?

Thanks,
Karl

The attachment worked perfectly! Thank you very, very much!!

This will work even better as we can now reference the attachment that has
been spat out of Excel!

Thanks for the help, much appreciated!

Hi Loan,

Here the complete line im entering into Curl:

curl -X POST https://api.sandbox.freeagent.com/v2/bills -H “Authorization:
Bearer XX(CORRECTCODEENTEREDHERE)XX” -H “Accept: application/json” -H
“Content-Type: application/json” -d { “bill”:{
“contact”:“https://api.sandbox.freeagent.com/v2/contacts/1835/",“category”:“https://api.sandbox.freeagent.com/v2/categories/285/”,“reference”:“curlpost”,“dated_on”:“2013-06-17”,“due_on”:“2013-07-14”,“total_value”:“10000.0”,“sales_tax_rate”:"20.0
}}

Also, when using Curl do I enter as above, ie on one line or formatted on
to separate lines?

Thanks,
Karl

Hi again,

Thanks Harry.

I’ve now created an Excel file to parse the export from Spendmap. The
output can then be saved as a batch file and executed to run each Curl line
and in turn, POST the Bills to FA.

So the whole process consists of:

  1. Run export in Spendmap
  2. Import Spendmap export into Excel parsing file
  3. Copy/export parsed content into Notepad
  4. Save as a batch file
  5. Execute batch file

Although this is ALOT quicker than manually creating the Bills, I would
like to automate the process further still. So does anyone know of a way to
automate the above process? Or any part of it? Perhaps using a macro of
some sort.

Thanks again for all the help.

Hi Karl,

Could you post an example of the data you are trying to POST? From the logs
I see some POSTs to /v2/bills that are failing due to the “bill” parameter
not being present. Please take a look at the documentationhttps://dev.freeagent.com/docs/bills#create-a-billfor more information on the format of data we expect. You can pass this
data in using the curl -d option.

Regards,
IoanOn Wednesday, 19 June 2013 15:38:08 UTC+1, Karl Sayle wrote:

UPDATE

We’ve gone down the Curl route and have managed to connect to the API and
GET information but we’re receiving ‘Error 500’ when POSTing. Once a
solution is found our plan is to parse the Spendmap export using Excel and
then somehow automate the execution of the parsed information through Curl.

Again if anyone has any pointers/experience on any of these aspects please
let us know.

Hi all,

Just another quick question, is it possible to POST multiple Bills with one
Curl execution? If not, what the best way to achieve this?

Thanks again,
Karl

UPDATE

We’ve gone down the Curl route and have managed to connect to the API and
GET information but we’re receiving ‘Error 500’ when POSTing. Once a
solution is found our plan is to parse the Spendmap export using Excel and
then somehow automate the execution of the parsed information through Curl.

Again if anyone has any pointers/experience on any of these aspects please
let us know.