|
Project Information
Members
Featured
Wiki pages
Links
|
Etsy is an online marketplace for buying and selling all things hand made. Etsy recently made a Developer API available at , Etsy's API the upcoming iOS5 SDK. It will not be released until the official release of iOS5, due to NDA restrictions. Etsy Cocoa is currently being redeveloped to work with v2 of the API. Disclaimer: EtsyCocoa is an independent project and is not affiliated with Etsy in anyway. Use of this code library is completely at your own risk (please read the licensing and understand arrangement). Change in the API may result in this code library to stop working, we will try and do out best to keep up.
v2 API ClientRecently Etsy announced v2 of the API. EtsyCocoa v2 is currently under development and is expected to be released early 2011. v1 API is now considered deprecated. Refer to Subversion repository for development progress. v2 Usage ExampleThe following usage example demonstrates querying Featured Listings, the request downloads and parses two levels of associations (Listing, ListingImage). Association queries mean lesser round trips to the servers, however they consume more memory and seem to take longer to run on the Etsy Servers. You should carefully decide how best to place your requests to Etsy. Init your EtsyCocoa API clientECAPIClient *etsyAPIClient = nil; etsyAPIClient = [[ECAPIClient alloc] initWithAppIdentifier:ETSY_TOUCH_APP_IDENTIFIER key:ETSY_TOUCH_CONSUMER_KEY sharedSecret:ETSY_TOUCH_SHARED_SECRET]; Remember the object placing the request must implement the ECResponseDelegate protocol. Create Filter ObjectsECFeaturedListingFilter *filter = [[ECFeaturedListingFilter alloc] init]; /* Download extended listing information for featured items */ ECListingFilter *listingFilter = [[ECListingFilter alloc] init]; /* Download images */ ECListingImageFilter *listingImageFilter = [[ECListingImageFilter alloc] init]; /* Use the same filter for main image and listing images */ listingFilter.mainImage = listingImageFilter; listingFilter.images = listingImageFilter; filter.listing = listingFilter; Note that EtsyCocoa v2 uses ARC. Create Request using Helper methodCreate a request object using the helper method, filter can be nil if you don't wish to use them. ECRequest *featuredRequest = [ECListingRequest findAllFeaturedListingRequest:ECLimitDefault offset:ECOffsetDefault filter:filter]; Place the request and assign the delegate to the object. All responses sent to the delegate are parsed as Cocoa objects. [etsyAPIClient makeAPIRequest:featuredRequest delegate:self]; |