NullException
NullException

Reputation: 4510

instagram.bind.InstagramAPIError with Instagram real time API subscriptions

import uuid                                                           
import traceback                                                      
from instagram.client import InstagramAPI                             

api = InstagramAPI(                                                   
    client_id     = 'YYYYYYYY',        
    client_secret = 'XXXXXXXX',    
)                                                                     

verify_token = uuid.uuid4().hex                                       

api.create_subscription(                                              
    object       = 'tag',                                             
    object_id    = 'lol',                                             
    aspect       = 'media',                                           
    verify_token = verify_token,                                      
    callback_url = 'http://www.callback_handlers_proxy.com/instagram/consumer'
)

raise InstagramAPIError(status_code, content_obj['meta']['error_type'], content_obj['meta']['error_message']) instagram.bind.InstagramAPIError: (400) APISubscriptionError-Invalid response

What's wrong with my code here?

Upvotes: 0

Views: 659

Answers (1)

brandonscript
brandonscript

Reputation: 73015

Instagram sends you a GET request to your callback url which needs to respond with the hub.challenge parameter, which if you're using PHP, gets converted to hub_challenge in the actual GET stream (took me forever to figure that one out).

You can read about others discussing the problem here: https://groups.google.com/forum/#!topic/instagram-api-developers/p3g3gHc890s

Upvotes: 2

Related Questions