Post

2 followers Follow
0
Avatar

Bulk API actions?

Hey, I've been using the APIv2 Query language to get counts of objects like timesheet.  eg:

API Type: POST

URL: https://api2.clarizen.com/v2.0/services/data/query

{
"q" : "SELECT COUNT() AS Ct FROM Timesheet"
}

 

My question is, are their other bulk functions ie. DELETE

ie. 

{
"q" : "DELETE FROM Timesheet WHERE (add condition)"
}

 

Andy Johnston (AU) Not planned

Please sign in to leave a comment.

2 comments

0
Avatar

Hello Andy,

No, that is not possible. /services/data/query is for getting data, not updating it in any way. 

However, it is definitely possible to achieve what you're after. Steps:

1) Get the list of objects you want to delete using https://api.clarizen.com/V2.0/services/data/Query

2) A single object can be deleted using https://api.clarizen.com/V2.0/services/data/objects

3) Multiple delete requests can be combined into one using https://api.clarizen.com/V2.0/services/bulk/Execute

The third step is only necessary to improve performance by reducing the number of trips to the server.

I hope this answers your question.

Roland

Roland Pumputis 0 votes
Comment actions Permalink
0
Avatar

Thanks Roland - I figured that might be the case, but I thought I'd ask anyway.  I've got Azure which does call loops in the way you described (to build a bulk delete request) but I wanted to see if there was a faster way using a SQL'ish query.

Andy Johnston (AU) 0 votes
Comment actions Permalink