From 64641a8a075aae9bda16dad539c1aea2160f28e4 Mon Sep 17 00:00:00 2001 From: Andres Buritica Date: Mon, 28 Jul 2014 00:55:56 -0700 Subject: [PATCH 1/2] Return the value for error code, type and message when no meta in response --- instagram/bind.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/instagram/bind.py b/instagram/bind.py index 85214e90..4e7eedc4 100644 --- a/instagram/bind.py +++ b/instagram/bind.py @@ -130,7 +130,7 @@ def _do_api_request(self, url, method="GET", body=None, headers=None): if content_obj.get('code') == 420 or content_obj.get('code') == 429: error_message = content_obj.get('error_message') or "Your client is making too many request per second" raise InstagramAPIError(content_obj.get('code'), "Rate limited", error_message) - raise InstagramAPIError(content_obj.has_key('code'), content_obj.has_key('error_type'), content_obj.has_key('error_message')) + raise InstagramAPIError(content_obj.get('code'), content_obj.get('error_type'), content_obj.get('error_message')) api_responses = [] status_code = content_obj['meta']['code'] From c5fb9a9e087b420eaa699d1b9d7d5bae0e76ac23 Mon Sep 17 00:00:00 2001 From: Andres Buritica Date: Wed, 30 Jul 2014 21:57:31 -0700 Subject: [PATCH 2/2] subscription POST and DELETE require signed header --- instagram/client.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/instagram/client.py b/instagram/client.py index 2d67a673..ad479e27 100644 --- a/instagram/client.py +++ b/instagram/client.py @@ -224,12 +224,14 @@ def _make_subscription_action(method, include=None, exclude=None): accepts_parameters.extend(include) if exclude: accepts_parameters = [x for x in accepts_parameters if x not in exclude] + signature = False if method == 'GET' else True return bind_method( path="/subscriptions", method=method, accepts_parameters=accepts_parameters, include_secret=True, - objectify_response=False + objectify_response=False, + signature=signature, ) create_subscription = _make_subscription_action('POST')