Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/278.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python instagram.bind.InstagramAPIError与instagram实时API订阅有关_Python_Instagram - Fatal编程技术网

Python instagram.bind.InstagramAPIError与instagram实时API订阅有关

Python instagram.bind.InstagramAPIError与instagram实时API订阅有关,python,instagram,Python,Instagram,引发InstagramAPIError(状态代码、内容对象['meta']['error\U type'],内容对象['meta']['error\U message'])) instagram.bind.InstagramAPIError:(400)APISubscriptionError响应无效 我的代码有什么问题?Instagram向您的回调url发送一个GET请求,该请求需要使用hub.challenge参数进行响应,如果您使用PHP,该参数将在实际的GET流中转换为hub\u chal

引发InstagramAPIError(状态代码、内容对象['meta']['error\U type'],内容对象['meta']['error\U message'])) instagram.bind.InstagramAPIError:(400)APISubscriptionError响应无效


我的代码有什么问题?

Instagram向您的回调url发送一个GET请求,该请求需要使用
hub.challenge
参数进行响应,如果您使用PHP,该参数将在实际的GET流中转换为
hub\u challenge
(我花了很长时间才弄清楚)

您可以在此处阅读其他人讨论此问题的内容:

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'
)