Edit history

Earlier versions of Webhook API ignores files attached in a POST request, newest first.

Current version | Edited by Rex
Changes
This code works exactly as expected when using a Discord webhook URL, but when used with Fluxer there is no file attached to the message.Removed: ### Environment (optional)Removed: Removed: _No response_Removed: ### Logs or screenshots (optional)[image](https://feedback.fluxer.com/p/436#f-435)[image](https://feedback.fluxer.com/p/436#f-436)Removed: Removed: ### ChecksRemoved: Removed: - ☑ I searched for existing issues and didn't find a duplicate.
Show

Webhook API ignores files attached in a POST request

Summary

While experimenting with the Fluxer webhook API I encountered what I believe to be a bug. I've been trying to send a message through a webhook where there is a file attached alongside the message. I haven't been able to find clear documentation on the expected headers Fluxer's webhook API wants, but my understanding is that the Fluxer webhook API closely mirrors that of the Discord webhook API (and that seems to work for almost everything). The Fluxer API still response with HTTP 200 (or 204) and indicates zero problems, yet the message that actually gets sent doesn't have any attachments on it.

Steps to reproduce

  1. Create a webhook within a channel
  2. Send a POST request with a file to attach to the webhook URL
  3. Observe the sent message with a lack of attachment AND the lack of error code
Here is my example code to reproduce the problem using Python (assuming a small test.txt file is already created):
# Python 3.xx
import requests, json

URL = "https://api.fluxer.app/webhooks/{id}/{token}?wait=true"

with open("test.txt", "rb") as file:
	files = {
		"payload_json": (None, json.dumps({"content": "Body Message"})),
		"file": ("test.txt", file)
	}
	response = requests.post(URL, files=files)
	print(response.status_code) # -> 200
	print(response.json()) # -> "attachments" is empty
This code works exactly as expected when using a Discord webhook URL, but when used with Fluxer there is no file attached to the message.

Logs or screenshots (optional)

image image
Original by Rex
Show

Webhook API ignores files attached in a POST request

Summary

While experimenting with the Fluxer webhook API I encountered what I believe to be a bug. I've been trying to send a message through a webhook where there is a file attached alongside the message. I haven't been able to find clear documentation on the expected headers Fluxer's webhook API wants, but my understanding is that the Fluxer webhook API closely mirrors that of the Discord webhook API (and that seems to work for almost everything). The Fluxer API still response with HTTP 200 (or 204) and indicates zero problems, yet the message that actually gets sent doesn't have any attachments on it.

Steps to reproduce

  1. Create a webhook within a channel
  2. Send a POST request with a file to attach to the webhook URL
  3. Observe the sent message with a lack of attachment AND the lack of error code
Here is my example code to reproduce the problem using Python (assuming a small test.txt file is already created):
# Python 3.xx
import requests, json

URL = "https://api.fluxer.app/webhooks/{id}/{token}?wait=true"

with open("test.txt", "rb") as file:
	files = {
		"payload_json": (None, json.dumps({"content": "Body Message"})),
		"file": ("test.txt", file)
	}
	response = requests.post(URL, files=files)
	print(response.status_code) # -> 200
	print(response.json()) # -> "attachments" is empty
This code works exactly as expected when using a Discord webhook URL, but when used with Fluxer there is no file attached to the message.

Environment (optional)

No response

Logs or screenshots (optional)

image image

Checks

  • ☑ I searched for existing issues and didn't find a duplicate.