The Company added a Task type a few years ago called “Update” using the Keap web interface. In the V2 API, the type field is an enum, which conflicts with the idea that users can add types. Will type remain an enum going forward, or will it revert to string? I am unable to retrieve tasks for a user when any of their tasks contain a type that is not an enum member. There isn’t a graceful fallback for this condition. Example:
As indicated in the server response sample, I used GET.
The larger issue here is that when the API retrieves Tasks data from the db (on Keap’s end) and it does not conform to the enum called “type”, the endpoint fails. You may have tested it, but did any of your tasks have a type other than one of the following? “EMAIL” “CALL” “APPOINTMENT” “FAX” “LETTER” “OTHER”
Admin users are allowed to add new “types” in the Infusionsoft web interface. This makes either forcing “type” into an enum (on Keap’s end) contraindicated, or being able to add new “types” is contraindicated.
No worries. I’m wondering what the way forward is.
For now I have to support 2 APIs in my backend C# application and in some cases 2 sets of DTOs depending on the version of the API I use for each given method. So far, Tasks is the only method where I need to use v1.
I recommend that you raise a Support Ticket regarding this issue.
From what I am seeing in the documentation, in REST v1 it allows a String to be passed without any restriction. But in REST v2 they need to match the supplied Enum. Seems to me that whoever developed or tested the endpoint did not realise about the custom types.
Apparently, a whole load of new REST v2 endpoints should have been released by now. Maybe they have corrected that issue in that update.
I used Postman and the REST V2 API for the task, and got that error w/o passing any filter, and the error triggered immediately, so I would say it’s not patched in the V2 endpoints, and is currently a bug.
I think you are right about it not being finished at this point. And Marion pointed out a 500 error that shouldn’t occur with no parameters. I will put in a ticket.
To clarify, I’m not getting a 500 error, I’m getting the 400 bad request still. The 400 error started immediately after I created a task w/ the action type of UPDATE.
Oh OK. That makes sense. I was referring to your comment about using Postman without a filter, which does give a 500: https://api.infusionsoft.com/crm/rest/v2/tasks
{
“code”: 500,
“message”: “An unexpected error occurred”,
“status”: “Internal Server Error”,
“details”: [
{
“domain”: “task”,
“resource”: “GET /rest/v2/tasks”
}
]
}
I have tried to create 3 support tickets. Two a few days ago, and 1 again today. They don’t seem to register. View My Tickets shows nothing. I am going to call in.