In the settings of the iFrame application for VKontakte, I specified the first request to the API :

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

screenshot

In the official users.get documentation , the exact same query returns:

 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 PHP script (also known as the "Address of the IFrame" in the settings), the following data is received 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, only data from city.id (1945522) comes in, while I need city.title (Bochum).

Of course, you can make a second call to the API and get through the database.getCitiesById (or the old getCities function) the desired name of the city ... but why doesn't it come right away?

  • one
    Show your request, is the version listed in the request? for the default is not the latest - Alexey Shimansky
  • I added a screenshot of the settings in my question: I have no other request than the above "First API Request" in the Application Settings, and I immediately parse $ data = json_decode ($ _ GET ['api_result'], true); $ me = $ data ['response'] [0]; print_r ($ me); - Alexander Farber

0