Example #1
0
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'))
Example #2
0
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
Example #3
0
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
Example #4
0
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
Example #5
0
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
Example #6
0
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
Example #7
0
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)
Example #8
0
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)