Closed trek-boldly-go closed 10 months ago
Feel free to review my code yourself if you don't think the error is within BlueBubbles: https://github.com/mautrix/imessage/blob/b6b94a72a82d37468cd58db4058d254c76a5e220/imessage/bluebubbles/api.go#L618C1-L722C2
I think this is a documentation issue (my fault) on how to send multipart messages. Actually, we don't even have it implemented into the BlueBubbles App yet.
Basically, the endpoint you used (/api/v1/attachment
) was the endpoint to send an attachment. Just a single one, and it sends the attachment right away.
There is a different endpoint to use for multipart. The flow goes like this:
POST /api/v1/attachment/upload
to upload all your attachments
POST /api/v1/message/multipart
to send the uploaded attachments
This should be the corresponding Postman Request: https://documenter.getpostman.com/view/765844/UV5RnfwM#d31dc599-5fe3-44d2-9872-cf64598a4fac
If you are just implementing sending attachments (1 at a time), you use this endpoint: https://documenter.getpostman.com/view/765844/UV5RnfwM#614127f4-d6af-41d7-998b-777747c641d7
@zlshames That helps clear up quite a bit. I see the upload returns a hash only, is that what you call the UUID of the attachment?
@trek-boldly-go yes that is the UUID that you use in the subsequent multipart request
I am building a bridge between BlueBubbles and Beeper so I am using the BlueBubbles REST API.
I am getting an error back from the SendMultipartMessage endpoint
{{host}}/api/v1/message/multipart?password={{password}}
I upload the attachment using the endpoint
{{host}}/api/v1/message/attachment?password={{password}}
and get a response back like:So I parse the response and basically get out
response.Data.Attachments[0].GUID
, which I use as the UUID in my multipart message request:I am only getting an error back from the endpoint:
But you can clearly see the id matches between the first response and the second response.
While digging through your code to figure out what I might be missing, I found that you have a loop to go over the parts of the request, but one of the lines inside the loop doesn't use the loop var
i
but instead a hardcoded0
:https://github.com/BlueBubblesApp/bluebubbles-server/blob/4a36b7da39c8f71adaa8717f05a8b96516fad6cc/packages/server/src/server/api/interfaces/messageInterface.ts#L548
This probably isn't causing my issue which I still need help with, but I wanted to bring it to your attention.
Am I using the IDs incorrectly? Do I need to program in a wait time or something?