I am using the following curl -
curl --location 'https://hooks.slack.com/services/XXXXX/YYYYYY/ZZZZZZ' \
--header 'Content-Type: application/json' \
--data '{
"text": "Hola!",
"blocks": "[{\"type\":\"section\",\"text\":{\"type\":\"mrkdwn\",\"text\":\"foo\"}}]",
"attachments": "[{\"color\":\"#FF0000\",\"blocks\":[{\"type\":\"section\",\"text\":{\"type\":\"mrkdwn\",\"text\":\"doo\"}}]}]"
}'
This only send the blocks and not the attachments.
Not sure why you would be using attachments, as blocks are the preferred method. You should also really be using the chat.postmessage API, as webhooks are inherently insecure.
Here is an example of using CURL with webhooks and an attachment: https://stackoverflow.com/questions/46435795/syntax-help-adding-attachments-to-slack-incoming-webhooks