Not signed in (Sign In)

The Intervals Forum

Categories

Welcome Guest!
Want to take part in these discussions? If you have an account, sign in now.
If you don't have an account, apply for one now.

API

bulk delete via API calls

Bottom of Page

1 to 4 of 4

  1.  
    • CommentAuthort. sonuyi
    • CommentTimeJun 19th 2012
     
    Is there any way to perform a bulk delete of objects via the API (specifically for expenses)?

    thanks
    -T
    •  
      CommentAuthorjreeve
    • CommentTimeJun 19th 2012
     
    T,

    The API does not have any single action that can accommodate a bulk delete. The recommended solution is to call the API once using the DELETE method for each expense that is to be deleted.

    The documentation for the expense resource is available at Intervals API Documentation: Project Expenses

    In this scenario, you could use the Expense resource to retrieve a list of expenses. Parse the list for the IDs and then make a DELETE request for each ID to be deleted:
    DELETE https://api.myintervals.com/expense/{ID}/

    Assuming no errors, the server will respond with 200 OK.
    • CommentAuthort. sonuyi
    • CommentTimeJun 20th 2012
     
    thanks for taking the time to answer J. I was looking for a way to save on API calls given the 6K limit, no worries.
    Thanks,
    -T
    •  
      CommentAuthorcameron
    • CommentTimeJul 26th 2012
     
    For T, and anyone else:

    To clarify, we have deliberately not implemented bulk delete. There are two reasons for this:

    1. There are many access considerations that take place each time something is deleted. Adding bulk delete might make dealing with error messages more complicated.
    2. But the primary reason we have cut down on this is to cut down on accidental deletions. It's bad enough to delete one resource accidentally, but to delete them all might be devastating to a company. We want to require every action taken through the API to be as purposeful as possible, and cut down the chance for mistakes as much as is possible.

    Hope that explains things.

    Cameron