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

强颜欢笑 提交于 2019-12-11 17:58:23

问题


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


回答1:


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.


来源:https://stackoverflow.com/questions/17604929/what-are-requirements-to-handler-of-push-callback-of-foursquare-api

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!