Skip to content

Can't upload attachments when filename has a space (Accounting API) #606

@jacksorjacksor

Description

@jacksorjacksor

SDK you're using (please complete the following information):

  • Xero.Api.SDK.Core v1.1.4
  • Xero.NetStandard.Oauth2 v11.1.1

Describe the bug
Calling the Accounting Api's .CreateInvoiceAttachmentByFileNameAsync() method will fail if the filename contains a space.

Exception message:
Xero API error calling CreateInvoiceAttachmentByFileName: The resource you're looking for cannot be found.

Various special characters are mentioned in the docs as unusable, but spaces are not mentioned. I was able to upload the file via the UI Portal, but the same file would fail when using the API.

To Reproduce

  1. Instantiate Accounting API.
  2. Call .CreateInvoiceAttachmentByFileNameAsync() with a filename which contains a space
  3. Receive exception

Expected behavior
File should be uploaded to invoice as attachment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions