A
A
Alexander Farber2016-05-14 17:49:44
In contact with
Alexander Farber, 2016-05-14 17:49:44

Why "First API Request" users.get returns city.id but not city.title?

Hello, I created an iFrame application for the VKontakte network and indicated as the First request to the API :

method=users.get&user_ids={viewer_id}&fields=sex,city,photo_big&format=JSON&v=5.52

aa82fd163e074c73b1e3a2104725b4c7.png
In the official documentation , users.get returns exactly the same request:
response: [{
    id: 597xxxxx,
    first_name: 'Alexander',
    last_name: 'Farber',
    city: {
        id: 1945522,
        title: 'Bochum'
    },
    photo_50: 'http://cs5344.vk....1265/e_9ae5906d.jpg',
    verified: 0
}]

But in my script (aka "IFrame Address") I get the following data via HTTP GET:
[api_result] => {"response":[{
    "uid":597xxxxx,
    "first_name":"Alexander"
    ,"last_name":"Farber",
    "sex":2,
    "city":1945522,
    "photo_big":"http:\/\/cs5344.vk.me\/u59751265\/a_047c17e7.jpg"
}]}

That is, as you can see above, only city.id (1945522) data comes in, while I need city.title (Bochum).
Of course, you can make a second call to the API and get the desired city name through database.getCitiesById (or the old getCities function) ... but why doesn't it come right away?
Thanks

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ilya, 2016-05-14
@FireGM

Well, apparently, the version of the requested api is not in the first request. For 3.8, it really returns only the city id, without the title

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question