Xero - beautiful accounting software

Xero Developer Help Center

Xero Developer Community

Community > API Authentication >

401 Signature Invalid error downloading attachments when file name includes an apersand etc.

Started by Philip Slingsby -   in API Authentication

Hi

I have some PHP code that's using the standard XeroOAuth-PHP library.

When I try to download some attachments I receive a 401 error saying Signature Invalid. Other attachments download correctly with no change to the code or the credentials.

I'm guessing that the problem somehow relates to the handling of the URLs to the attachments that won't download. All the attachments that won't download include one of the characters & , ; - in their filenames, whereas any attachment that has none of those characters works fine.

Of course those characters are URL-encoded in the URLs I'm accessing to try and download the attachments, but could the encoding be somehow interfering with how the signature is generated?

Any suggestions?