dsjpqpdm620596 2011-05-09 21:42
浏览 74
已采纳

通过Foursquare Api V2获取user_id

I'm working on a foursquare integration for a social good website, and I have everything working as I want it to, however I want to retrieve and store users foursquare user_id's so others can search for their friend. I've been searching all day, but I can't seem to find an end point, am I missing something? Or does this has to be done through user search? What is then best to use, as I have their email, and full name.

I am using jmathai's foursquare-async php libary. I think it should be easy but I just can't figure it out.

  • 写回答

1条回答 默认 最新

  • dongnang8192 2011-05-10 07:59
    关注

    I've found the solution. To get an users' details you should use the end point "users/self". I had tried this before but got an error message. I think that was related to something else now.

    After authenticating two lines are simply enough:

    <?php       
    $fsObj->get("/users/self");  
    print_r($creds->response);  
    ?php>
    

    This gives an json array containing all relevant information on the user, including last checkins, name, and id. 'self' can here also be replaced by any user id you're authorized for on that moment.

    For more information I'd recommend to visit Foursquare Api website

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥35 引用csv数据文件(4列1800行),通过高斯-赛德尔法拟合曲线,在选取(每五十点取1点)数据,求该数据点的曲率中心。
  • ¥20 程序只发送0X01,串口助手显示不正确,配置看了没有问题115200-8-1-no,如何解决?
  • ¥15 Google speech command 数据集获取
  • ¥15 vue3+element-plus页面崩溃
  • ¥15 像这种代码要怎么跑起来?
  • ¥15 安卓C读取/dev/fastpipe屏幕像素数据
  • ¥15 pyqt5tools安装失败
  • ¥15 mmdetection
  • ¥15 nginx代理报502的错误
  • ¥100 当AWR1843发送完设置的固定帧后,如何使其再发送第一次的帧