0

API3

Was wondering if this would be a good forum to talk about the types of features we will see in API3.  It would be nice to be able to update multiple entries with in a given entity with a single update.  Working on our timecard deployment and timecard logic and in order to update the logic I need to pull 1 weeks worth of itemized data entries and apply updates to every entry in that week.  If the user worked on a few projects its no big deal but if they have worked on a handful of tasks the update time can be very slow.  It would be huge help to be able to update a handful of entries inside of an entity with one command rather than a loop of update commands.

 

-Romey

7件のコメント

  • 0
    Avatar
    Andy Geers

    For anybody hunting for API3, look in the "Documentation" box in the right hand column, under "Shotgun API"

  • 0
    Avatar
    Matt Daw

    Thanks Andy.  We "soft launched" the API v3 docs and all the other docs late last week.  Over the coming weeks, we'll be adding to the docs quite a bit before we make an offiical announcement that they are here as opposed to the older documentation site.  Let us know if you see anything in particular that is missing, confusing, etc.

  • 0
    Avatar
    Andy Geers

    Couple of questions after trying this out briefly:

    1. Have you permanently done away with the "attributes" method that let you find out what available fields there were on an entity type?

    2. Have you permanently done away with the "count" method? Any performance considerations in just running find with an empty "fields" list and then counting the resulting rows?

  • 0
    Avatar
    Andy Geers

    What also might be quite nice (because otherwise we'll have to manually implement this on top of the API) is an iterator equivalent of "find" that yields one row at a time rather than just returning the full list as an array, and then which uses paging behind the scenes so that it doesn't completely clobber Shotgun when iterating over large data sets. We've had problems in the past if you try and run an API query that could return large numbers of rows, but sometimes you do want to be able to access them.

  • 0
    Avatar
    Andy Geers

    Oh, ignore me - I see that it already does that! It just turns the resulting data into a list rather than iterating. Sorry!

  • 0
    Avatar
    Andy Geers

    Sorry for all the spams, but I've changed my mind again - I think we really could do with some kind of iterator approach. For example, our database cacher needs to run through *all* tasks in Shotgun (over 200,000 rows for us) and though it's nicely paged in the way that it's fetched from the DB, it still has to hold all of those rows in a single array when the script actually processes that data at the moment. It would be nice either to have an iterator, or explicit access to the paging functionality like in API v2.

  • 0
    Avatar
    KP

    API3 has now been in production for a while and API2 has been laid to rest and is no longer available nor supported. All of the documentation for the API is available here https://shotgunsoftware.zendesk.com/forums/48807-developer-api-info.

    To address the questions in this thread:

    • We have replaced the "attributes" method with schema_field_read() which gives you detailed information on all of the fields for a particular entity. You will find other schema-related methods in our method reference documentation as well.
    • Paging currently happens automatically under the hood for find() queries. But this is a good request especially for large data sets as you pointed out. We'll add it to the list of todos.
ログインしてコメントを残してください。