Getting 415 response on Create Task API Call

Hi, I’m trying to add a task to a deal using the API and Zapier (Custom Actions)

If I test the request using Postman, everything is perfect and it creates the Task.

But when I use the exact same JSON Body as request, I get a 415 status returned.

Any help would be appreciated, because I can’t see where I’m going wrong.

{
    "result": {
        "request": {
            "method": "POST",
            "url": "https://api.brevo.com/v3/crm/tasks",
            "querystring": null,
            "headers": {
                "Accept": "application/json",
                "Content-Type": "application/json"
            },
            "body": "{\"name\":\"Enquiry Call\",\"taskTypeId\":\"663234c9dacea7410f9ec1a1\",\"date\":\"2024-06-20T15:00:00+01:00\",\"dealsIds\":[\"6671a0d05e6bfa138d0f3578\"]}",
            "data": {
                "name": "Enquiry Call",
                "taskTypeId": "663234c9dacea7410f9ec1a1",
                "date": "2024-06-20T15:00:00+01:00",
                "dealsIds": [
                    "6671a0d05e6bfa138d0f3578"
                ]
            }
        },
        "response": {
            "status": 415,
            "headers": {},
            "body": "{\n    \"message\": \"\"\n}",
            "data": {
                "message": ""
            }
        }
    }
}

hey @ahudavert can you help with this?

@Mauricio maybe you would know more about this?

Hello @Titanify , Could you share with us your curl request payload? Thanks.

I’m using Zapier Custom Actions, so not sure where I would get that from.

any help please @Mauricio? I’ve tried several times, also just using the API Call action in Zapier, but they all return 415 code.

never mind, found the issue, I should not add the header « Content-Type » to the request.

But all other API request I’m adding that header, and it works fine :man_shrugging:

1 Like