1

我正在尝试将 instagram 实时照片更新https://instagram.com/developer/realtime/实施到我的 chicagoboss 应用程序中

当我请求具有以下内容的位置时

curl -F 'client_id=CLIENT-ID' \
     -F 'client_secret=CLIENT-SECRET' \
     -F 'object=location' \
     -F 'aspect=media' \
     -F 'object_id=1257285' \
     -F 'callback_url=http://YOUR-CALLBACK/URL' \
     https://api.instagram.com/v1/subscriptions/

我希望我的应用程序响应 instagram 服务器发送的 GET

http://my-website.com/subscribe/?hub.mode=subscribe&hub.challenge=15f7d1a91c1f40f8a748fd134752feb3&hub.verify_token=myVerifyToken

与 15f7d1a91c1f40f8a748fd134752feb3

这是我的代码现在的样子

src/controller/example_controller.erl

-module(example_controller, [Req]).
-compile(export_all).


% Get parameters 
subscribe('GET', []) ->
%Split into parameters to get verify_token 
% Set value of hub.challenge to Challenge variable    
RequestBody = string:tokens(binary_to_list(Req:request_body()), "&"),
cowboy_req:reply(200, Challenge).

任何有关如何执行此操作的建议或指示将不胜感激。

4

0 回答 0