Call DELETE API of my app from basic/Embeded action

I want to call a DELETE API of my application from an App Panel or through any app action. AS I could see the actions support only GET endpoints. Is there any way to do it other than having an GET api to delete a resource?

Hi @Erlil_Kanangasabai

To my knowledge, there is no possibility to perform DELETE from app action or embed app action at the moment.

You could add “Delete” functionality by exposing basic app action which will lead to your app, and a user can delete what’s needed from there.

Or, you could also use embedded app action, that could be like this

JSON scema

{
    "type": "object",
    "properties": {
        "blocks": {
            "type":"object",
            "properties":{
                "block_key_text":{
                    "$ref":"#/definitions/element-text",
                    "options":{
                        "markdown":true,
                        "value":"# Are you sure you want to delete this?"
                    }
                }
            }

        },
        "actions": {
            "type": "object",
            "properties": {
                "cancel_action": {
                    "$ref": "#/definitions/action-secondary",
                    "options": {
                        "label": "Cancel",
                        "handler": "cancel"
                    }
                },
                "submit_action": {
                    "$ref": "#/definitions/action-primary",
                    "options": {
                        "label": "Delete",
                        "handler": "request"
                    }
                }
            }
        }
    }
}

*but it’s not possible to change primary button color to red

@mykhailo,
Thank you so much. It helped us a lot. Is there anyway that we can hide the Primary action button based on get API response?
We want to show the delete button only if the logged in user has the delete access tin our API.
If we can hide the whole Embedded action also fine.

Hi @Erlil_Kanangasabai

To my knowledge, it’s not possible to show/hide embedded app action based on conditions at the moment.

1 Like