对Foursquare API的Push Callback的处理程序有什么要求?[英] What are requirements to handler of Push Callback of Foursquare API?

本文是小编为大家收集整理的关于对Foursquare API的Push Callback的处理程序有什么要求?的处理/解决方法,可以参考本文帮助大家快速定位并解决问题,中文翻译不准确的可切换到English标签页查看源文。

问题描述

foursquare api的推送回调的处理程序有什么要求?

  • http动词4SQ用什么来拨打电话?
  • 它将哪些参数/信息发送到我的服务器?
  • 我的服务器应该回复什么?

令人惊讶的是,我在 https://developer.foursquare.com/overview/

更新:

好吧,由于没有人回答,所以我决定将任何终点的东西插入DB.结果回调永远不会到达我的服务器. Foursquare Push控制台说我的服务器返回502 Bad Gateway,这不是. Foursquare后端是否有可能忽略回调URL中的端口号?我的URL看起来像这个

https://api.hostmane.com:8443/api/handle_4sq_push

推荐答案

好吧,似乎Foursquare没有API团队的任何人负责与开发人员进行沟通.我也给他们发送了电子邮件,但没有人回答.

所以这是我的发现:

  • foursquare后端不使用呼叫url中的端口号.我认为这是一个错误.因此,请确保您在端口443上听.
  • 这是带有form-url编码参数的http帖子.
  • 传递了三个参数:checkin( json中的此对象), user(这个对象在JSON中),secret(从您的应用程序的设置).
  • 您的服务器应该使用错误代码200.

本文地址:https://www.itbaoku.cn/post/2090884.html

问题描述

What are requirements for handler of Push Callback of Foursquare API?

  • What http verb 4sq uses to make a call ?
  • What parameters/information does it send to my server ?
  • What my server should reply ?

Surprisingly I don't see answers on these questions at https://developer.foursquare.com/overview/

Update:

Well, since nobody replied I decided to insert to DB whatever comes to my end-point. Turned out callbacks never reach my server. Foursquare Push Console says my server returns 502 Bad Gateway which it doesn't. Is it possible that Foursquare backend ignores port number in callback URL ? My url looks like this

https://api.hostmane.com:8443/api/handle_4sq_push

推荐答案

Well, seems like Foursquare doesn't have anyone from API team responsible for communicating with developers. I sent them email as well but nobody replied.

So here are my findings:

  • Foursquare backend doesn't use port number from call-back url. I think it's a bug. So make sure you're listening on port 443.
  • It's HTTP POST with form-url-encoded parameters.
  • There are three parameters passed: checkin (this object in json), user (this object in json), secret (Push Secret from settings of your app).
  • Your server is supposed to reply with error code 200.