def show_cart_contents(): "Grab some cart and user information" user_resp = etsy.get( 'users/__SELF__/') # __SELF__ is replaced with oauth'd userid by API cart_resp = etsy.get('users/__SELF__/listings/') print(cart_resp) return render_template('carts.html', carts=cart_resp.data, user=user_resp.data, logout_url=url_for('logout'))
def get_all_transactions_for_listing(listing_id): resp_url = "https://openapi.etsy.com/v2/listings/" + listing_id + "/transactions" resp = etsy.get(resp_url) #print "TEST" + str(resp.data.shop_id) print(resp.data) stringified = json.dumps(resp.data) return stringified
def get_receipt(receipt_id): resp_url = "https://openapi.etsy.com/v2/receipts/" + receipt_id resp = etsy.get(resp_url) #print "TEST" + str(resp.data.shop_id) print(resp.data) stringified = json.dumps(resp.data) #print (stringified) return stringified
def get_user_profile(user_id): resp_url = "https://openapi.etsy.com/v2/users/" + user_id + "/profile" resp = etsy.get(resp_url) #print "TEST" + str(resp.data.shop_id) print(resp.data) stringified = json.dumps(resp.data) #print (stringified) return stringified
def get_shop_transactions(shop_id): resp_url = "https://openapi.etsy.com/v2/shops/" + shop_id + "/transactions" resp = etsy.get(resp_url) #print "TEST" + str(resp.data.shop_id) print(resp.data) stringified = json.dumps(resp.data) #print (stringified) return stringified
def get_thumbnails(listing_id): resp_url = "https://openapi.etsy.com/v2/listings/" + listing_id + "/images" resp = etsy.get(resp_url) #print "TEST" + str(resp.data.shop_id) print(resp.data) stringified = json.dumps(resp.data) #print (stringified) return stringified
def home_page(): resp = etsy.get('https://openapi.etsy.com/v2/users/__SELF__/profile') print("RESPONSE 2 status = ") stringified = json.dumps(resp.data) print(stringified) return render_template('index.html', token=session['etsy_token'], user_data=stringified)
def get_listings(): resp = etsy.get('https://openapi.etsy.com/v2/users/__SELF__/shops') #print "TEST" + str(resp.data.shop_id) print(resp.data) stringified = json.dumps(resp.data) #print (stringified) return stringified return render_template('index.html', token=session['etsy_token'], user_data=stringified)