Changing client on task by API

I’m remaking the integration for our website and I want to be able to create a task for a customer that may not already exist. The problem I’m facing is, the most important part of what I’m doing is that a task gets created, my plan to ensure this was to create the task for a dummy client, then either create the client or look them up, then change the client on the task to the created or looked up client.

Can’t seem to do that operation the the new API. Nor, does it seem, can we create a location for a client.

1 Like

Hey @waide.soper, best way to achieve this is to discover the client first. Use the Client Zone where for client_name and if you get a return user that client_id, otherwise you know you have to create the client first :slight_smile:

Hey Brad, I agree that this is the only way to do it, what I don’t like is, if anything fails, the last thing to happen is making the task. Any major error along the way could result in no task being created, and the client not getting work done.

A good practise is to use catch/try or other gracefull error state handling depending on the language you’re using.

If you’re using Zapier, you’ll be notified of any failures so that you can fix them and re-run the tasks.

Thanks for the advice Brad. To be honest, I was really posting here to highlight an issue with the API, that clients can’t be changed on tasks. I know how to try/catch/throw, I have fully developed a PHP class built around the current API, what I want now is some redundancy features, like being able to change some important things after they have been created.

OK That’s great you know how to handle that, from your post I wasn’t sure so prefer to err on the side of caution as well as address how to handle it for anyone else reading this thread.

Please feel free to submit any enhancement requests directly through AroFlo. Changing a client on a task after it has been created was outside the original scope and considered something that would be done by an Office User. There are quite a few situations like this where the API does not allow for what we would consider “workflow” that should be completed within AroFlo.