Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API: /contents returns empty when the file was created using binary #1536

Open
Denny-g6labs opened this issue Jan 13, 2025 · 2 comments
Open

Comments

@Denny-g6labs
Copy link

Denny-g6labs commented Jan 13, 2025

ACH Version

moov/ach:v1.37.5

What were you trying to do?

I'm calling files/create with either a json or a text/plain (binary data).

  1. When using JSON, all is fine.
  2. When using binary data, I can't call /contents afterwards with the id, because the response content of it is empty.

As a workaround I call the (first delete and to prevent getting an already exists error) create endpoint again with the returned json structure of the first create call (using binary), so afterwards I can use /contents. While doing that I realized that the following error was raised during the second call:
Batch numbers must be in ascending order, batch 24636 is less than or equal to the previous batch: 24640.
Then I added the query parameter "allowUnorderedBatchNumbers": True (Or unorderedBatchNumbers (deprecated)).

So I see two issues:

  1. Somehow the file with the generated id is not not registered properly when using binary, so I can't get the binary content back
  2. The batch order is not checked at all when using binary

What did you expect to see?

Getting the binary same content when using contents after a create call with binary content.

What did you see?

An empty response of the contents call.

How can we reproduce the problem?

  1. Call create API with binary file
  2. Call contents with the id of the response json field (id)
  3. The response content is empty but should contain the same thing as the input (1.)
@Denny-g6labs Denny-g6labs changed the title API: /contents returns empty when the file was created using binary API: /contents returns empty when the file was created using binary Jan 13, 2025
@adamdecaf
Copy link
Member

What do you mean "binary"? We don't accept raw bytes in that endpoint. The accepted formats are ASCII bytes (nacha format) or out JSON representation.

@DennyWeinberg
Copy link

I mean ASCII bytes in nacha format.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants