Email Invoices - 500 Internal Server Error

Hi

I’ve been trying to send invoices by email via the API today, but am
receiving a 500 Internal server error:

Array
(
[http_response_headers] => Array
(
[status] => HTTP/1.1 500 Internal Server Error
[Server] => nginx/1.4.1
[Date] => Fri, 12 Jul 2013 10:33:40 GMT
[Content-Type] => text/html; charset=utf-8
[Transfer-Encoding] => chunked
[Connection] => keep-alive
[Status] => 500 Internal Server Error
[X-Request-Id] => 638c8276db4119f8a84ab0a6a3982f30
[X-Runtime] => 0.970197
[X-Rev] => a313c75
[X-Host] => web2-gc
)

[http_response_body] => 500 Internal Server ErrorIf you are the administrator of this website, then please read this web application's log file and/or the web server's log file to find out what went wrong.
[http_response_status_code] => 500

)

I am passing in an empty email array for the invoice -

{“invoice”:{“email”:[]}}

Any help would be much appreciated.

Cheers
Iain

Thanks Nic

I was under the impression from this -
https://groups.google.com/forum/#!searchin/freeagent_api/send_email|sort:relevance/freeagent_api/Y28CSWxEnv4/cS1QUbDPPjAJ
if you pass in an empty email array it will use the default invoice
template and the email addresses of the contact and the FA user.

It works when I pass in the data as you suggested.

Thanks
IainOn Friday, July 12, 2013 11:47:43 AM UTC+1, Nic Wise wrote:

I think you need to provide a to, from, subject and body (check the
docs for required fields)

I just tried doing this in mobileAgent (my app), and it worked fine.

On 12 July 2013 11:40, <pols...@gmail.com <javascript:>> wrote:

Hi

I’ve been trying to send invoices by email via the API today, but am
receiving a 500 Internal server error:

Array
(
[http_response_headers] => Array
(
[status] => HTTP/1.1 500 Internal Server Error
[Server] => nginx/1.4.1
[Date] => Fri, 12 Jul 2013 10:33:40 GMT
[Content-Type] => text/html; charset=utf-8
[Transfer-Encoding] => chunked
[Connection] => keep-alive
[Status] => 500 Internal Server Error
[X-Request-Id] => 638c8276db4119f8a84ab0a6a3982f30
[X-Runtime] => 0.970197
[X-Rev] => a313c75
[X-Host] => web2-gc
)

[http_response_body] => 

500 Internal Server Error

If you are the administrator of this website, then please read this web
application’s log file and/or the web server’s log file to find out what
went wrong.
[http_response_status_code] => 500
)

I am passing in an empty email array for the invoice -

{“invoice”:{“email”:[]}}

Any help would be much appreciated.

Cheers
Iain


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_ap...@googlegroups.com <javascript:>.
To post to this group, send email to freeag...@googlegroups.com<javascript:>.

Visit this group at http://groups.google.com/group/freeagent_api.
For more options, visit https://groups.google.com/groups/opt_out.


Nic Wise
t. +44 7788 592 806 | @fastchicken
b. http://www.fastchicken.co.nz/

I think you need to provide a to, from, subject and body (check the
docs for required fields)

I just tried doing this in mobileAgent (my app), and it worked fine.On 12 July 2013 11:40, polstar35@gmail.com wrote:

Hi

I’ve been trying to send invoices by email via the API today, but am
receiving a 500 Internal server error:

Array
(
[http_response_headers] => Array
(
[status] => HTTP/1.1 500 Internal Server Error
[Server] => nginx/1.4.1
[Date] => Fri, 12 Jul 2013 10:33:40 GMT
[Content-Type] => text/html; charset=utf-8
[Transfer-Encoding] => chunked
[Connection] => keep-alive
[Status] => 500 Internal Server Error
[X-Request-Id] => 638c8276db4119f8a84ab0a6a3982f30
[X-Runtime] => 0.970197
[X-Rev] => a313c75
[X-Host] => web2-gc
)

[http_response_body] =>

500 Internal Server Error

If you are the administrator of this website, then please read this web
application’s log file and/or the web server’s log file to find out what
went wrong.
[http_response_status_code] => 500
)

I am passing in an empty email array for the invoice -

{“invoice”:{“email”:[]}}

Any help would be much appreciated.

Cheers
Iain


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.

Nic Wise
t. +44 7788 592 806 | @fastchicken
b. http://www.fastchicken.co.nz/

Hi!

It looks like you’re sending an empty array to the server, when I think you actually need to send an empty hash / dictionary.

Instead of this:

{“invoice”:{“email”:[]}}

try this:

{“invoice”:{“email”:{}}}

Thomas.On 12 Jul 2013, at 11:53, polstar35@gmail.com wrote:

Thanks Nic

I was under the impression from this - https://groups.google.com/forum/#!searchin/freeagent_api/send_email|sort:relevance/freeagent_api/Y28CSWxEnv4/cS1QUbDPPjAJ if you pass in an empty email array it will use the default invoice template and the email addresses of the contact and the FA user.

It works when I pass in the data as you suggested.

Thanks
Iain

On Friday, July 12, 2013 11:47:43 AM UTC+1, Nic Wise wrote:
I think you need to provide a to, from, subject and body (check the
docs for required fields)

I just tried doing this in mobileAgent (my app), and it worked fine.

On 12 July 2013 11:40, pols...@gmail.com wrote:

Hi

I’ve been trying to send invoices by email via the API today, but am
receiving a 500 Internal server error:

Array
(
[http_response_headers] => Array
(
[status] => HTTP/1.1 500 Internal Server Error
[Server] => nginx/1.4.1
[Date] => Fri, 12 Jul 2013 10:33:40 GMT
[Content-Type] => text/html; charset=utf-8
[Transfer-Encoding] => chunked
[Connection] => keep-alive
[Status] => 500 Internal Server Error
[X-Request-Id] => 638c8276db4119f8a84ab0a6a3982f30
[X-Runtime] => 0.970197
[X-Rev] => a313c75
[X-Host] => web2-gc
)

[http_response_body] => 

500 Internal Server Error

If you are the administrator of this website, then please read this web
application’s log file and/or the web server’s log file to find out what
went wrong.
[http_response_status_code] => 500
)

I am passing in an empty email array for the invoice -

{“invoice”:{“email”:[]}}

Any help would be much appreciated.

Cheers
Iain


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_ap...@googlegroups.com.
To post to this group, send email to freeag...@googlegroups.com.
Visit this group at http://groups.google.com/group/freeagent_api.
For more options, visit https://groups.google.com/groups/opt_out.


Nic Wise
t. +44 7788 592 806 | @fastchicken
b. http://www.fastchicken.co.nz/


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.