0

I'm trying to start up with a vk.com tab app and I'm using the php api sdk and for some reason when I try to get the user profile info I get this:

Incorrect signature: sid & secret authorization

the code is as fallows:

try {

$vkontakte = new VKontakte(array('testMode'   => true, 'fileUpload' => false));
$vkontakte->setApiId(XXXXXXX);
$vkontakte->setSecret('XXXXXXXXXX');

$viewerId = $vkontakte->getViewerId();

$profiles = $vkontakte->getProfiles(array(
    'uids'   => $viewerId,
    'fields' => 'nickname,sex,bdate,photo,photo_big,mobile_phone,has_mobile,home_phone,rate'
));
} catch (Exception $e) {
echo '<pre>';
echo $e->getMessage();
echo '</pre>';
}

Any idea what might be wrong here? or what should be done?

Margus
  • 1
  • 2

1 Answers1

1

I think about you using older api, try to use oauth api, see documentation:

http://vk.com/developers.php?oid=-1&p=%D0%90%D0%B2%D1%82%D0%BE%D1%80%D0%B8%D0%B7%D0%B0%D1%86%D0%B8%D1%8F_%D1%81%D0%B0%D0%B9%D1%82%D0%BE%D0%B2

You can use all methods, different only for getting access_token

getting access token:

http://vk.com/developers.php?oid=-1&p=%D0%90%D0%B2%D1%82%D0%BE%D1%80%D0%B8%D0%B7%D0%B0%D1%86%D0%B8%D1%8F_%D1%81%D0%B0%D0%B9%D1%82%D0%BE%D0%B2

For iframe apps you getting access_token in GET parameters, example: APP_URL/?...&api_settings=8194&viewer_id=XXXX&viewer_type=2&sid=YOURSID&secret=FFFFFFFFFF&access_token=ACCESS_TOCKEN&group_id=0&is_app_user=1&auth_key=6dfa5e5f8179066e6a7d01281a238ed4&language=0&parent_language=0&ad_info=zz==&is_secure=0&ads_app_id=1111

razielsd
  • 125
  • 6
  • While these links may answer the question, it is better to include the essential parts of the answer here and provide the links for reference. Link-only answers can become invalid if the linked page changes. For more details see [here](http://meta.stackexchange.com/questions/8231/are-answers-that-just-contain-links-elsewhere-really-good-answers) – Andrea Jan 28 '14 at 09:41
  • This seems to be only for standalone apps not for iframe ones. – Margus Jan 29 '14 at 11:23
  • Answer edited, you can use all methods, i'm using :) – razielsd Feb 03 '14 at 05:51