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

add file content to API response #460

Open
ambu550 opened this issue Dec 19, 2023 · 1 comment
Open

add file content to API response #460

ambu550 opened this issue Dec 19, 2023 · 1 comment

Comments

@ambu550
Copy link

ambu550 commented Dec 19, 2023

First of all, I would like to thank you for the convenient tool.
Got some idea.

To test, I need to get the file content (in my case it’s an Excel file) from the letter
It is advisable to receive it immediately via API with a minimum number of requests

how it is now:
1. Request a list of letters in the mailbox GET /api/v1/mailbox/{name} to find out the ID of the letter
2. Request the contents of the letter GET /api/v1/mailbox/{name}/{id} to find out the link to the file
3. Request a file (point 2 can be skipped if we know that there is only one file)

Sentence_1:

in response
GET /api/v1/mailbox/{name}/{id} add to attachment file/s content/s

example_1
inbucker_ex

Flaw:
if the file is large and most users do not need it in response, it will load the API
first you still need to find out the email ID (an extra step)

Sentence_2:

new endpoint
GET /api/v1/mailbox/{name}/data

will display an array with all letters from a given mailbox + all data on letters (JSONMessageV1 in which JSONMessageAttachmentV1 but with a file)

Flaw:
essentially duplicating code

Sentence_3:

endpoints
GET /api/v1/mailbox/{name}
and/or
GET /api/v1/mailbox/{name}/{id}

add a parameter that expands the answer

This will be the most work, but more versatile.

What do you think about this feature & sentences?

@jhillyerd
Copy link
Collaborator

jhillyerd commented Jan 17, 2024

Apologies for the very slow response, I read this before the holidays and then it got lost in my inbox.

Regarding Sentence_2, it doesn't feel very REST like to me.

My preference would be a request parameter as mentioned in Sentence_3.

One piece of info that may help you, we have an (until now) undocumented feature where you can use the id of latest to fetch the most recent message in a mailbox, which might save you a step.

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

No branches or pull requests

2 participants