Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to parse the API result ??? #1

Open
WebberLai opened this issue Jun 20, 2017 · 1 comment
Open

Unable to parse the API result ??? #1

WebberLai opened this issue Jun 20, 2017 · 1 comment

Comments

@WebberLai
Copy link

Hi , I try to run the sample , but seems not working for new api result ???

I'm not sure why it shows nothing , I past the baseURLString to browser

It shows some data , but the "places[]" is empty

Thanks for your sample anyway 👍

@WebberLai
Copy link
Author

This is the data I got form postman , hope it helps

{
    "meta": {
        "code": 200,
        "requestId": "594881e49fb6b74d557a5b8f"
    },
    "response": {
        "warning": {
            "text": "There aren't a lot of results near you. Try something more general, reset your filters, or expand the search area."
        },
        "headerLocation": "Current map view",
        "headerFullLocation": "Current map view",
        "headerLocationGranularity": "unknown",
        "query": "food",
        "totalResults": 2,
        "suggestedBounds": {
            "ne": {
                "lat": 24.00056945891521,
                "lng": 120.57192668674054
            },
            "sw": {
                "lat": 23.982569440915192,
                "lng": 120.55226129075547
            }
        },
        "groups": [
            {
                "type": "Recommended Places",
                "name": "recommended",
                "items": [
                    {
                        "reasons": {
                            "count": 0,
                            "items": [
                                {
                                    "summary": "This spot is popular",
                                    "type": "general",
                                    "reasonName": "globalInteractionReason"
                                }
                            ]
                        },
                        "venue": {
                            "id": "4f7fe5b8e4b08004b3755a3a",
                            "name": "大村進昌咖啡烘焙館",
                            "contact": {
                                "phone": "+88648528297",
                                "formattedPhone": "+886 4 852 8297"
                            },
                            "location": {
                                "address": "大村鄉中正東路269巷271弄252號",
                                "lat": 23.996894131555454,
                                "lng": 120.56917790723786,
                                "labeledLatLngs": [
                                    {
                                        "label": "display",
                                        "lat": 23.996894131555454,
                                        "lng": 120.56917790723786
                                    }
                                ],
                                "distance": 932,
                                "cc": "TW",
                                "city": "Changhua",
                                "state": "Changhua",
                                "country": "臺灣",
                                "formattedAddress": [
                                    "大村鄉中正東路269巷271弄252號",
                                    "彰化縣, Changhua",
                                    "臺灣"
                                ]
                            },
                            "categories": [
                                {
                                    "id": "4bf58dd8d48988d16d941735",
                                    "name": "Café",
                                    "pluralName": "Cafés",
                                    "shortName": "Café",
                                    "icon": {
                                        "prefix": "https://ss3.4sqi.net/img/categories_v2/food/cafe_",
                                        "suffix": ".png"
                                    },
                                    "primary": true
                                }
                            ],
                            "verified": false,
                            "stats": {
                                "checkinsCount": 64,
                                "usersCount": 59,
                                "tipCount": 8
                            },
                            "price": {
                                "tier": 1,
                                "message": "Cheap",
                                "currency": "$"
                            },
                            "rating": 5.9,
                            "ratingColor": "FF9600",
                            "ratingSignals": 8,
                            "allowMenuUrlEdit": true,
                            "beenHere": {
                                "count": 0,
                                "marked": false,
                                "lastCheckinExpiredAt": 0
                            },
                            "photos": {
                                "count": 1,
                                "groups": [
                                    {
                                        "type": "venue",
                                        "name": "Venue photos",
                                        "count": 1,
                                        "items": [
                                            {
                                                "id": "54e31478498e037c33998c6b",
                                                "createdAt": 1424168056,
                                                "prefix": "https://igx.4sqi.net/img/general/",
                                                "suffix": "/48373051_yJ9BLxG3ouxAibHBMrWGQMM5_LZkWsucYr7IPV8lTOk.jpg",
                                                "width": 1920,
                                                "height": 1440,
                                                "user": {
                                                    "id": "48373051",
                                                    "firstName": "Yu Chien",
                                                    "lastName": "Huang",
                                                    "gender": "female",
                                                    "photo": {
                                                        "prefix": "https://igx.4sqi.net/img/user/",
                                                        "suffix": "/48373051-TIP3OJYQMJEP1TXI.jpg"
                                                    }
                                                },
                                                "visibility": "public"
                                            }
                                        ]
                                    }
                                ]
                            },
                            "hereNow": {
                                "count": 0,
                                "summary": "Nobody here",
                                "groups": []
                            },
                            "featuredPhotos": {
                                "count": 1,
                                "items": [
                                    {
                                        "id": "54e31478498e037c33998c6b",
                                        "createdAt": 1424168056,
                                        "prefix": "https://igx.4sqi.net/img/general/",
                                        "suffix": "/48373051_yJ9BLxG3ouxAibHBMrWGQMM5_LZkWsucYr7IPV8lTOk.jpg",
                                        "width": 1920,
                                        "height": 1440,
                                        "user": {
                                            "id": "48373051",
                                            "firstName": "Yu Chien",
                                            "lastName": "Huang",
                                            "gender": "female",
                                            "photo": {
                                                "prefix": "https://igx.4sqi.net/img/user/",
                                                "suffix": "/48373051-TIP3OJYQMJEP1TXI.jpg"
                                            }
                                        },
                                        "visibility": "public"
                                    }
                                ]
                            }
                        },
                        "tips": [
                            {
                                "id": "54ad2428498e6da0463108d0",
                                "createdAt": 1420633128,
                                "text": "Well, u won't wanna be there twice on holidays.",
                                "type": "user",
                                "canonicalUrl": "https://foursquare.com/item/54ad2428498e6da0463108d0",
                                "logView": true,
                                "agreeCount": 1,
                                "disagreeCount": 0,
                                "lastVoteText": "Upvoted Apr 6",
                                "lastUpvoteTimestamp": 1491523196,
                                "todo": {
                                    "count": 0
                                },
                                "user": {
                                    "id": "47208529",
                                    "firstName": "Huimin",
                                    "lastName": "Chi",
                                    "gender": "male",
                                    "photo": {
                                        "prefix": "https://igx.4sqi.net/img/user/",
                                        "suffix": "/X1NAA4DUU2HIJZYO.jpg"
                                    }
                                }
                            }
                        ],
                        "referralId": "e-3-4f7fe5b8e4b08004b3755a3a-0"
                    },
                    {
                        "reasons": {
                            "count": 0,
                            "items": [
                                {
                                    "summary": "This spot is popular",
                                    "type": "general",
                                    "reasonName": "globalInteractionReason"
                                }
                            ]
                        },
                        "venue": {
                            "id": "52bfd10411d2aabffaf5d2c4",
                            "name": "金典婚宴會館",
                            "contact": {},
                            "location": {
                                "lat": 23.999410462338954,
                                "lng": 120.55774002530856,
                                "labeledLatLngs": [
                                    {
                                        "label": "display",
                                        "lat": 23.999410462338954,
                                        "lng": 120.55774002530856
                                    }
                                ],
                                "distance": 978,
                                "cc": "TW",
                                "country": "臺灣",
                                "formattedAddress": [
                                    "臺灣"
                                ]
                            },
                            "categories": [
                                {
                                    "id": "4bf58dd8d48988d145941735",
                                    "name": "Chinese Restaurant",
                                    "pluralName": "Chinese Restaurants",
                                    "shortName": "Chinese",
                                    "icon": {
                                        "prefix": "https://ss3.4sqi.net/img/categories_v2/food/asian_",
                                        "suffix": ".png"
                                    },
                                    "primary": true
                                }
                            ],
                            "verified": false,
                            "stats": {
                                "checkinsCount": 5,
                                "usersCount": 5,
                                "tipCount": 0
                            },
                            "price": {
                                "tier": 1,
                                "message": "Cheap",
                                "currency": "$"
                            },
                            "allowMenuUrlEdit": true,
                            "beenHere": {
                                "count": 0,
                                "marked": false,
                                "lastCheckinExpiredAt": 0
                            },
                            "photos": {
                                "count": 1,
                                "groups": [
                                    {
                                        "type": "venue",
                                        "name": "Venue photos",
                                        "count": 1,
                                        "items": [
                                            {
                                                "id": "52bfd14911d2a95b1980ab0e",
                                                "createdAt": 1388302665,
                                                "prefix": "https://igx.4sqi.net/img/general/",
                                                "suffix": "/46815199_lOdwgo0WxjIOeLPKu03ciOkRFniMjZgqqVkDwRvOIHo.jpg",
                                                "width": 720,
                                                "height": 960,
                                                "user": {
                                                    "id": "46815199",
                                                    "firstName": "Chia Pei",
                                                    "lastName": "Wu",
                                                    "gender": "female",
                                                    "photo": {
                                                        "prefix": "https://igx.4sqi.net/img/user/",
                                                        "suffix": "/3OQGEDVAQ04GJ03B.jpg"
                                                    }
                                                },
                                                "visibility": "public"
                                            }
                                        ]
                                    }
                                ]
                            },
                            "hereNow": {
                                "count": 0,
                                "summary": "Nobody here",
                                "groups": []
                            },
                            "featuredPhotos": {
                                "count": 1,
                                "items": [
                                    {
                                        "id": "52bfd14911d2a95b1980ab0e",
                                        "createdAt": 1388302665,
                                        "prefix": "https://igx.4sqi.net/img/general/",
                                        "suffix": "/46815199_lOdwgo0WxjIOeLPKu03ciOkRFniMjZgqqVkDwRvOIHo.jpg",
                                        "width": 720,
                                        "height": 960,
                                        "user": {
                                            "id": "46815199",
                                            "firstName": "Chia Pei",
                                            "lastName": "Wu",
                                            "gender": "female",
                                            "photo": {
                                                "prefix": "https://igx.4sqi.net/img/user/",
                                                "suffix": "/3OQGEDVAQ04GJ03B.jpg"
                                            }
                                        },
                                        "visibility": "public"
                                    }
                                ]
                            }
                        },
                        "referralId": "e-3-52bfd10411d2aabffaf5d2c4-1"
                    }
                ]
            }
        ]
    }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant